Search Results

Search found 19563 results on 783 pages for 'binary search'.

Page 41/783 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Realtime MySQL search results on an advanced search page

    - by Andrew Heath
    I'm a hobbyist, and started learning PHP last September solely to build a hobby website that I had always wished and dreamed another more competent person might make. I enjoy programming, but I have little free time and enjoy a wide range of other interests and activities. I feel learning PHP alone can probably allow me to create 98% of the desired features for my site, but that last 2% is awfully appealing: The most powerful tool of the site is an advanced search page that picks through a 1000+ record game scenario database. Users can data-mine to tremendous depths - this advanced page has upwards of 50 different potential variables. It's designed to allow the hardcore user to search on almost any possible combination of data in our database and it works well. Those who aren't interested in wading through the sea of options may use the Basic Search, which is comprised of the most popular parts of the Advanced search. Because the advanced search is so comprehensive, and because the database is rather small (less than 1,200 potential hits maximum), with each variable you choose to include the likelihood of getting any qualifying results at all drops dramatically. In my fantasy land where I can wield AJAX as if it were Excalibur, my users would have a realtime Total Results counter in the corner of their screen as they used this page, which would automatically update its query structure and report how many results will be displayed with the addition of each variable. In this way it would be effortless to know just how many variables are enough, and when you've gone and added one that zeroes out the results set. A somewhat similar implementation, at least visually, would be the Subtotal sidebar when building a new custom computer on IBuyPower.com For those of you actually still reading this, my question is really rather simple: Given the time & ability constraints outlined above, would I be able to learn just enough AJAX (or whatever) needed to pull this one feature off without too much trouble? would I be able to more or less drop-in a pre-written code snippet and tweak to fit? or should I consider opening my code up to a trusted & capable individual in the future for this implementation? (assuming I can find one...) Thank you.

    Read the article

  • Assistance with building an inverted-index

    - by tipu
    It's part of an information retrieval thing I'm doing for school. The plan is to create a hashmap of words using the the first two letters of the word as a key and any words with the two letters saved as a string value. So, hashmap["ba"] = "bad barley base" Once I'm done tokenizing a line I take that hashmap, serialize it, and append it to the text file named after the key. The idea is that if I take my data and spread it over hundreds of files I'll lessen the time it takes to fulfill a search by lessening the density of each file. The problem I am running into is when I'm making 100+ files in each run it happens to choke on creating a few files for whatever reason and so those entries are empty. Is there any way to make this more efficient? Is it worth continuing this, or should I abandon it? I'd like to mention I'm using PHP. The two languages I know relatively intimately are PHP and Java. I chose PHP because the front end will be very simple to do and I will be able to add features like autocompletion/suggested search without a problem. I also see no benefit in using Java. Any help is appreciated, thanks.

    Read the article

  • jQuery Autocomplete Json Ajax cross browser issue with Google Search Appliance

    - by skyfoot
    I am implementing a jquery autocomplete on a search form and am getting the suggestions from the Google Search Appliance Autocomple suggestions service which returns a result set in json. What I am trying to do is go off to the GSA to get suggestions when the user types something in the search box. The url to get the json suggestions is as follows: http://gsaurl/suggest?q=<query>&max=10&site=default_site&client=default_frontend&access=p&format=rich The json which is returned is as follows: { "query":"re", "results": [ {"name":"red", "type":"suggest"}, {"name":"read", "type":"suggest"}] } The jQuery autocomplete code is as follows: $(#q).autocomplete(searchUrl, { width: 320, dataType: 'json', highlight: false, scroll: true, scrollHeight: 300, parse: function(data) { var array = new Array(); for(var i=0;i<data.results.length;i++) { array[i] = { data: data.results[i], value: data.results[i].name, result: data.results[i].name }; } return array; }, formatItem: function(row) { return row.name; } }); This works in IE but fails in firefox as the data returned in the parse function is null. Any ideas why this would be the case? Workaround I created an aspx page to call the GSA suggest service and to return the json from the suggest service. Using this page as a proxy and setting it as the url in the jQuery autocomplete worked in both IE and FireFox.

    Read the article

  • Getting Google results in Java? Need help!

    - by Cris Carter
    Hello. Right now, I'm trying to get the results from Google in Java, by searching for a term. I'm using a desktop program, not an applet. That in itself isn't complicated. but then Google gave me a 403 error. Anyways, I added referrer and User Agent and then it worked. Now, my problem is that I don't get the results page from Google. Instead, I get their script which gets the results page. My code right now simply uses a GET request on "http://www.google.com/search?q=" + Dork; Then it outputs each line. Here is what I get when I run my program: <.!doctype html<.head<.titledork - Google Search<./title<.scriptwindow.google={kEI:"9myaS-Date).getTime()}}};try{}catch(u){}window.google.jsrt_kill=1; align:center}#logo{display:block;overflow:hidden;position:relative;width:103px;height:37px; <./ script<./div Lots of stuff like that. I shortened it (A LOT) and put in dots to fit it here. So my big question is: How do I turn this whole mess into the nice results page I get when searching Google with a browser? Any help would be seriously appreciated, and I really need the answer fast. Also, please keep in mind that I do NOT want to use Google's API for this. Thanks in advance!

    Read the article

  • what data structure should I use for hash lookup as well as binary search?

    - by zebraman
    I am working on a school homework. I have a list of names. I want to be able to perform binary search on these names (find all names between a lower and upper bound) for first name as well as last name, and perform keyword searches as well (this will be accomplished using hashing. For example, if I have the names Garfield Cat Snoopy Dog Captain Crunch Fat Cat then a binary search of first names (C,H) will return Captain Crunch, Fat Cat, and Garfield Cat. A binary search of last names (Cr,D) will return Captain Crunch. A keyword search of 'cat' will return Fat Cat and Garfield Cat. I understand binary search will only work on a sorted list, but since I am planning on searching two different criteria, I will have to sort the list by last name or first name depending on what I'm searching for. I feel like it will be too inefficient to have to resort the list each time I want to perform a new binary search. Would it just be better for me to set up and maintain two sorted lists (one for sorted by first name, one for sorted by last name)? Also, for hashing, will I have to set up a different table of names for that as well? I understand each keyword will hash to some value determined by a hash function, and this value (or key) is a table address where the corresponding names are stored. So I just want to know what would be the best way to solve this problem? Maintaining separate structures, or is there a way to efficiently do everything I want with just one data structure?

    Read the article

  • Mysql - Help me alter this search query to get desired results

    - by sandeepan-nath
    Following is a dump of the tables and data needed to answer understand the system:- The system consists of tutors and classes. The data in the table All_Tag_Relations stores tag relations for each tutor registered and each class created by a tutor. The tag relations are used for searching classes. CREATE TABLE IF NOT EXISTS `Tags` ( `id_tag` int(10) unsigned NOT NULL auto_increment, `tag` varchar(255) default NULL, PRIMARY KEY (`id_tag`), UNIQUE KEY `tag` (`tag`), KEY `id_tag` (`id_tag`), KEY `tag_2` (`tag`), KEY `tag_3` (`tag`), KEY `tag_4` (`tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `Tags` (`id_tag`, `tag`) VALUES (1, 'Sandeepan'), (2, 'Nath'), (3, 'first'), (4, 'class'), (5, 'new'), (6, 'Bob'), (7, 'Cratchit'); CREATE TABLE IF NOT EXISTS `All_Tag_Relations` ( `id_tag` int(10) unsigned NOT NULL default '0', `id_tutor` int(10) default NULL, `id_wc` int(10) unsigned default NULL, KEY `All_Tag_Relations_FKIndex1` (`id_tag`), KEY `id_wc` (`id_wc`), KEY `id_tag` (`id_tag`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `All_Tag_Relations` (`id_tag`, `id_tutor`, `id_wc`) VALUES (1, 1, NULL), (2, 1, NULL), (3, 1, 1), (4, 1, 1), (6, 2, NULL), (7, 2, NULL), (5, 2, 2), (4, 2, 2); Following is my query:- This query searches for "first class" (tag for first = 3 and for class = 4, in Tags table) and returns all those classes such that both the terms first and class are present in the class name. SELECT wtagrels.id_wc,SUM(DISTINCT( wtagrels.id_tag =3)) AS key_1_total_matches, SUM(DISTINCT( wtagrels.id_tag =4)) AS key_2_total_matches FROM all_tag_relations AS wtagrels WHERE ( wtagrels.id_tag =3 OR wtagrels.id_tag =4 ) GROUP BY wtagrels.id_wc HAVING key_1_total_matches = 1 AND key_2_total_matches = 1 LIMIT 0, 20 And it returns the class with id_wc = 1. But, I want the search to show all those classes such that all the search terms are present in the class name or its tutor name So that searching "Sandeepan class" (wtagrels.id_tag = 1,4) or "Sandeepan Nath" also returns the class with id_wc=1. And Searching. Searching "Bob First" should not return any classes. Please modify the above query or suggest a new query, if possible using MyIsam - fulltext search, but somehow help me get the result.

    Read the article

  • Search and highlight html - ignoring and maintaining tags

    - by Sleepwalker
    I am looking for a good way to highlight key words in a block of html with stripping the html tags. I can regex to search for key words within html tags, but I haven't found a great way to search across tags. For example, if the key word phrase is "not bound" I want to be able to make this <p>I am not<strong>bound to please thee</strong> with my answers.</p> become wrapped in highlight tags, without breaking the "strong" tag (and making the html invalid) and become: <p>I am <span class="highlight">not</span><strong><span class="highlight">bound</span> to please thee</strong> with my answers.</p> The main issue is maintaining the html as it is AND wrapping blocks of text with highlight tags. I need to maintain the original html. Otherwise I would strip the tags. The best solution to this that I can think of right now would entail making a copy of the html and placing counter tokens where each space occurs, then stripping all tags and search for matching phrases, then looking back to the original and the tokenized strings and figuring out where to start building the highlight tags, then start walking forward, starting and ending highlight spans as needed from the beginning of the match until the end. This seems like overkill. I would like to something more elegant if possible. The solution would be written in C# or perhaps javascript, depending.

    Read the article

  • Hibernate Search + Spring

    - by Zane
    I'm trying to integrate Hibernate Search with Spring, but I can't seem to index anything. I was able to get Hibernate Search to work without Spring, but I'm having a problem integrating it with Spring. Any help would be much appreciated. Below is my springmvc-servlet.xml: <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"> <property name="entityManagerFactory" ref="entityManagerFactory" /> </bean> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"> <property name="persistenceUnitName" value="enewsclipsPersistenceUnit" /> </bean> And here is my DAO class: @Repository public class SearchDaoImpl implements SearchDao { JpaTemplate jpaTemplate; @Autowired public SearchDaoImpl(EntityManagerFactory entityManagerFactory) { this.jpaTemplate = new JpaTemplate(entityManagerFactory); } @SuppressWarnings("unchecked") public void updateSearchIndex() { /* Implement the callback method */ jpaTemplate.execute(new JpaCallback() { public Object doInJpa(EntityManager em) throws PersistenceException { List<Article> articles = em.createQuery("select a from Article a").getResultList(); FullTextEntityManager ftEm = Search.getFullTextEntityManager(em); ftEm.getTransaction().begin(); for(Article article : articles) { System.out.println("Indexing Item " + article.getTitle()); ftEm.index(article); } ftEm.getTransaction().commit(); return null; } }); } } I think that it may have to do with the transactions but I'm not exactly sure. If you could just point me in the right direction, that would be helpful too! Thank you.

    Read the article

  • Jquery Ajax Search on pressing return key in Internet Explorer

    - by haribo83
    Hi I have found the following code to create a search on my site - this works really well the only problem is in Internet Explorer the search doesn't work when you press the return key. Does anybody have any ideas? The search code is below - if anything else is needed please let me know. $(function() { $(".search_button").click(function() { var search_word = $("#search_box").val(); var dataString = 'search_word='+ search_word; if(search_word=='') { } else { $.ajax({ type: "GET", url: "searchdata.php", data: dataString, cache: false, beforeSend: function(html) { document.getElementById("insert_search").innerHTML = ''; $("#flash").show(); $("#searchword").show(); $(".searchword").html(search_word); $("#flash").html('<img src="ajax-loader.gif" /> Loading Results...'); }, success: function(html){ $("#insert_search").show(); $("#insert_search").append(html); $("#flash").hide(); } }); } return false; }); });

    Read the article

  • Extending / changing how Zend_Search_Lucene searches

    - by Grant Collins
    Hi, I am currently using Zend_Search_Lucene to index and search a number of documents currently at around a 1000 or so. What I would like to do is change how the engine scores hits on a document, from the current default. Zend_Search_Lucene scores on the frequency of number of hits within a document, so a document that has 10 matches of the word PHP will score higher than a document with only 3 matches of PHP. What I am trying to do is pass a number of key words and score depending on the hits of those keywords. e.g. I pass 5 key words say,PHP, MySQL, Javascript, HTML and CSS that I search against the index. One document has 3 matches to those key words and one document has all 4 matches, the 4 matches scores the highest. The number of instances of those words in the document do not concern me. Now I've had a quick look at Zend_Search_Lucene_Search_Similarity however I have to confess that I am not sure (or that bright) to know how to use this to achieve what I am after. Is what I want to do possible using Lucene or is there a better solution out there?

    Read the article

  • Balanced Search Tree Query, Asymtotic Analysis..

    - by AGeek
    Hi, The situation is as follows:- We have n number and we have print them in sorted order. We have access to balanced dictionary data structure, which supports the operations serach, insert, delete, minimum, maximum each in O(log n) time. We want to retrieve the numbers in sorted order in O(n log n) time using only the insert and in-order traversal. The answer to this is:- Sort() initialize(t) while(not EOF) read(x) insert(x,t); Traverse(t); Now the query is if we read the elements in time "n" and then traverse the elements in "log n"(in-order traversal) time,, then the total time for this algorithm (n+logn)time, according to me.. Please explain the follow up of this algorithm for the time calculation.. How it will sort the list in O(nlogn) time?? Thanks.

    Read the article

  • Lucene raise document score if sibling entity matches query

    - by Pitagoras
    I have the following design situation. I use hibernate search (lucene in the back). Tha application manages ITEMs which have title, description and tags. These are full text indexed. On the other hand, we have COLLECTION of ITEMs. The user can create a COLLECTION and add as many ITEMs as she wants. ITEMs can also belong to many COLLECTIONs. I have a boosted query so that search terms that appear in the tags are more important than in the title, and lastly in the description. But I need an additional matching criteria: for a given ITEM, it whould rank better if other documents in some COLLECTION where the ITEM belongs, also match the query. This is like to say: the title/tags/description of "fellow" items (i.e. items in some shared collection) make the item rank better. I was thinking that adding an ITEM to a COLLECTION would add something like "extra tags" to every other ITEM in the collection, being these extra tags the elements to match in the added ITEM. I feel a more clever solution lucene-wise should exists. Any ideas/pointers are welcome. Thanks.

    Read the article

  • sudo apt-get update problem

    - by Jeon
    I have a problem with sudo apt-get update that I can't seem to fix and It's causing problems with alot of installations I want to do. I run Ubuntu 12.04. Ign http://ftp.availo.se precise InRelease Ign http://ftp.availo.se precise-updates InRelease Ign http://ftp.availo.se precise-backports InRelease Ign http://ftp.availo.se precise-security InRelease Get:1 http://repository.spotify.com stable InRelease [2,979 B] Ign http://ppa.launchpad.net precise InRelease Ign http://extras.ubuntu.com precise InRelease Ign http://archive.canonical.com precise InRelease Ign http://ppa.launchpad.net precise InRelease Ign http://ppa.launchpad.net precise InRelease Ign http://repository.spotify.com stable InRelease Ign http://ftp.availo.se precise Release.gpg Ign http://ftp.availo.se precise-updates Release.gpg Ign http://ftp.availo.se precise-backports Release.gpg Ign http://repository.spotify.com stable/non-free amd64 Packages/DiffIndex Hit http://ppa.launchpad.net precise Release.gpg Hit http://ppa.launchpad.net precise Release.gpg Hit http://archive.canonical.com precise Release.gpg Hit http://extras.ubuntu.com precise Release.gpg Ign http://ftp.availo.se precise-security Release.gpg Ign http://repository.spotify.com stable/non-free i386 Packages/DiffIndex Ign http://repository.spotify.com stable/non-free TranslationIndex Hit http://ppa.launchpad.net precise Release.gpg Hit http://archive.canonical.com precise Release Hit http://extras.ubuntu.com precise Release Ign http://ftp.availo.se precise Release Ign http://ftp.availo.se precise-updates Release Hit http://ppa.launchpad.net precise Release Hit http://archive.canonical.com precise/partner amd64 Packages Hit http://extras.ubuntu.com precise/main Sources Ign http://ftp.availo.se precise-backports Release Ign http://ftp.availo.se precise-security Release Hit http://ppa.launchpad.net precise Release Hit http://archive.canonical.com precise/partner i386 Packages Ign http://archive.canonical.com precise/partner TranslationIndex Hit http://ppa.launchpad.net precise Release Hit http://extras.ubuntu.com precise/main amd64 Packages Hit http://extras.ubuntu.com precise/main i386 Packages Ign http://ftp.availo.se precise/main TranslationIndex Ign http://ftp.availo.se precise/multiverse TranslationIndex Ign http://ftp.availo.se precise/restricted TranslationIndex Hit http://ppa.launchpad.net precise/main Sources Hit http://ppa.launchpad.net precise/main amd64 Packages Hit http://ppa.launchpad.net precise/main i386 Packages Ign http://ppa.launchpad.net precise/main TranslationIndex Ign http://extras.ubuntu.com precise/main TranslationIndex Ign http://ftp.availo.se precise/universe TranslationIndex Hit http://ppa.launchpad.net precise/main Sources Hit http://ppa.launchpad.net precise/main amd64 Packages Hit http://ppa.launchpad.net precise/main i386 Packages Ign http://ppa.launchpad.net precise/main TranslationIndex Hit http://ppa.launchpad.net precise/main Sources Hit http://ppa.launchpad.net precise/main amd64 Packages Hit http://ppa.launchpad.net precise/main i386 Packages Ign http://ppa.launchpad.net precise/main TranslationIndex Ign http://ftp.availo.se precise-updates/main TranslationIndex Ign http://ftp.availo.se precise-updates/multiverse TranslationIndex Ign http://ftp.availo.se precise-updates/restricted TranslationIndex Ign http://ftp.availo.se precise-updates/universe TranslationIndex Hit http://repository.spotify.com stable/non-free amd64 Packages Ign http://ftp.availo.se precise-backports/main TranslationIndex Ign http://ftp.availo.se precise-backports/multiverse TranslationIndex Ign http://ftp.availo.se precise-backports/restricted TranslationIndex Ign http://ftp.availo.se precise-backports/universe TranslationIndex Hit http://repository.spotify.com stable/non-free i386 Packages Ign http://archive.canonical.com precise/partner Translation-en_US Ign http://ftp.availo.se precise-security/main TranslationIndex Ign http://ftp.availo.se precise-security/multiverse TranslationIndex Ign http://ftp.availo.se precise-security/restricted TranslationIndex Ign http://ftp.availo.se precise-security/universe TranslationIndex Ign http://repository.spotify.com stable/non-free Translation-en_US Ign http://archive.canonical.com precise/partner Translation-en Ign http://repository.spotify.com stable/non-free Translation-en Ign http://extras.ubuntu.com precise/main Translation-en_US Ign http://extras.ubuntu.com precise/main Translation-en Ign http://ppa.launchpad.net precise/main Translation-en_US Ign http://ppa.launchpad.net precise/main Translation-en Ign http://ppa.launchpad.net precise/main Translation-en_US Ign http://ppa.launchpad.net precise/main Translation-en Ign http://ppa.launchpad.net precise/main Translation-en_US Ign http://ppa.launchpad.net precise/main Translation-en Err http://ftp.availo.se precise/main Sources 404 Not Found Err http://ftp.availo.se precise/restricted Sources 404 Not Found Err http://ftp.availo.se precise/universe Sources 404 Not Found Err http://ftp.availo.se precise/multiverse Sources 404 Not Found Err http://ftp.availo.se precise/main amd64 Packages 404 Not Found Err http://ftp.availo.se precise/restricted amd64 Packages 404 Not Found Err http://ftp.availo.se precise/universe amd64 Packages 404 Not Found Err http://ftp.availo.se precise/multiverse amd64 Packages 404 Not Found Err http://ftp.availo.se precise/main i386 Packages 404 Not Found Err http://ftp.availo.se precise/restricted i386 Packages 404 Not Found Err http://ftp.availo.se precise/universe i386 Packages 404 Not Found Err http://ftp.availo.se precise/multiverse i386 Packages 404 Not Found Err http://ftp.availo.se precise-updates/main Sources 404 Not Found Err http://ftp.availo.se precise-updates/restricted Sources 404 Not Found Err http://ftp.availo.se precise-updates/universe Sources 404 Not Found Err http://ftp.availo.se precise-updates/multiverse Sources 404 Not Found Err http://ftp.availo.se precise-updates/main amd64 Packages 404 Not Found Err http://ftp.availo.se precise-updates/restricted amd64 Packages 404 Not Found Err http://ftp.availo.se precise-updates/universe amd64 Packages 404 Not Found Err http://ftp.availo.se precise-updates/multiverse amd64 Packages 404 Not Found Err http://ftp.availo.se precise-updates/main i386 Packages 404 Not Found Err http://ftp.availo.se precise-updates/restricted i386 Packages 404 Not Found Err http://ftp.availo.se precise-updates/universe i386 Packages 404 Not Found Err http://ftp.availo.se precise-updates/multiverse i386 Packages 404 Not Found Err http://ftp.availo.se precise-backports/main Sources 404 Not Found Err http://ftp.availo.se precise-backports/restricted Sources 404 Not Found Err http://ftp.availo.se precise-backports/universe Sources 404 Not Found Err http://ftp.availo.se precise-backports/multiverse Sources 404 Not Found Err http://ftp.availo.se precise-backports/main amd64 Packages 404 Not Found Err http://ftp.availo.se precise-backports/restricted amd64 Packages 404 Not Found Err http://ftp.availo.se precise-backports/universe amd64 Packages 404 Not Found Err http://ftp.availo.se precise-backports/multiverse amd64 Packages 404 Not Found Err http://ftp.availo.se precise-backports/main i386 Packages 404 Not Found Err http://ftp.availo.se precise-backports/restricted i386 Packages 404 Not Found Err http://ftp.availo.se precise-backports/universe i386 Packages 404 Not Found Err http://ftp.availo.se precise-backports/multiverse i386 Packages 404 Not Found Err http://ftp.availo.se precise-security/main Sources 404 Not Found Err http://ftp.availo.se precise-security/restricted Sources 404 Not Found Err http://ftp.availo.se precise-security/universe Sources 404 Not Found Err http://ftp.availo.se precise-security/multiverse Sources 404 Not Found Err http://ftp.availo.se precise-security/main amd64 Packages 404 Not Found Err http://ftp.availo.se precise-security/restricted amd64 Packages 404 Not Found Err http://ftp.availo.se precise-security/universe amd64 Packages 404 Not Found Err http://ftp.availo.se precise-security/multiverse amd64 Packages 404 Not Found Err http://ftp.availo.se precise-security/main i386 Packages 404 Not Found Err http://ftp.availo.se precise-security/restricted i386 Packages 404 Not Found Err http://ftp.availo.se precise-security/universe i386 Packages 404 Not Found Err http://ftp.availo.se precise-security/multiverse i386 Packages 404 Not Found Ign http://ftp.availo.se precise/main Translation-en_US Ign http://ftp.availo.se precise/main Translation-en Ign http://ftp.availo.se precise/multiverse Translation-en_US Ign http://ftp.availo.se precise/multiverse Translation-en Ign http://ftp.availo.se precise/restricted Translation-en_US Ign http://ftp.availo.se precise/restricted Translation-en Ign http://ftp.availo.se precise/universe Translation-en_US Ign http://ftp.availo.se precise/universe Translation-en Ign http://ftp.availo.se precise-updates/main Translation-en_US Ign http://ftp.availo.se precise-updates/main Translation-en Ign http://ftp.availo.se precise-updates/multiverse Translation-en_US Ign http://ftp.availo.se precise-updates/multiverse Translation-en Ign http://ftp.availo.se precise-updates/restricted Translation-en_US Ign http://ftp.availo.se precise-updates/restricted Translation-en Ign http://ftp.availo.se precise-updates/universe Translation-en_US Ign http://ftp.availo.se precise-updates/universe Translation-en Ign http://ftp.availo.se precise-backports/main Translation-en_US Ign http://ftp.availo.se precise-backports/main Translation-en Ign http://ftp.availo.se precise-backports/multiverse Translation-en_US Ign http://ftp.availo.se precise-backports/multiverse Translation-en Ign http://ftp.availo.se precise-backports/restricted Translation-en_US Ign http://ftp.availo.se precise-backports/restricted Translation-en Ign http://ftp.availo.se precise-backports/universe Translation-en_US Ign http://ftp.availo.se precise-backports/universe Translation-en Ign http://ftp.availo.se precise-security/main Translation-en_US Ign http://ftp.availo.se precise-security/main Translation-en Ign http://ftp.availo.se precise-security/multiverse Translation-en_US Ign http://ftp.availo.se precise-security/multiverse Translation-en Ign http://ftp.availo.se precise-security/restricted Translation-en_US Ign http://ftp.availo.se precise-security/restricted Translation-en Ign http://ftp.availo.se precise-security/universe Translation-en_US Ign http://ftp.availo.se precise-security/universe Translation-en Fetched 2,979 B in 9s (328 B/s) W: GPG error: http://repository.spotify.com stable InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 082CCEDF94558F59 W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/main/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/restricted/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/universe/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/multiverse/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/main/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/restricted/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/universe/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/multiverse/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/main/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/restricted/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/universe/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise/multiverse/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/main/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/restricted/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/universe/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/multiverse/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/main/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/restricted/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/universe/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/multiverse/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/main/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/restricted/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/universe/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-updates/multiverse/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/main/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/restricted/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/universe/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/multiverse/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/main/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/restricted/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/universe/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/multiverse/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/main/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/restricted/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/universe/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-backports/multiverse/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/main/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/restricted/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/universe/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/multiverse/source/Sources 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/main/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/restricted/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/universe/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/multiverse/binary-amd64/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/main/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/restricted/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/universe/binary-i386/Packages 404 Not Found W: Failed to fetch http://ftp.availo.se/ubuntu/dists/precise-security/multiverse/binary-i386/Packages 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead. I would appreciate a fix to this. Thank you for the help.

    Read the article

  • From Binary to Data Structures

    - by Cédric Menzi
    Table of Contents Introduction PE file format and COFF header COFF file header BaseCoffReader Byte4ByteCoffReader UnsafeCoffReader ManagedCoffReader Conclusion History This article is also available on CodeProject Introduction Sometimes, you want to parse well-formed binary data and bring it into your objects to do some dirty stuff with it. In the Windows world most data structures are stored in special binary format. Either we call a WinApi function or we want to read from special files like images, spool files, executables or may be the previously announced Outlook Personal Folders File. Most specifications for these files can be found on the MSDN Libarary: Open Specification In my example, we are going to get the COFF (Common Object File Format) file header from a PE (Portable Executable). The exact specification can be found here: PECOFF PE file format and COFF header Before we start we need to know how this file is formatted. The following figure shows an overview of the Microsoft PE executable format. Source: Microsoft Our goal is to get the PE header. As we can see, the image starts with a MS-DOS 2.0 header with is not important for us. From the documentation we can read "...After the MS DOS stub, at the file offset specified at offset 0x3c, is a 4-byte...". With this information we know our reader has to jump to location 0x3c and read the offset to the signature. The signature is always 4 bytes that ensures that the image is a PE file. The signature is: PE\0\0. To prove this we first seek to the offset 0x3c, read if the file consist the signature. So we need to declare some constants, because we do not want magic numbers.   private const int PeSignatureOffsetLocation = 0x3c; private const int PeSignatureSize = 4; private const string PeSignatureContent = "PE";   Then a method for moving the reader to the correct location to read the offset of signature. With this method we always move the underlining Stream of the BinaryReader to the start location of the PE signature.   private void SeekToPeSignature(BinaryReader br) { // seek to the offset for the PE signagure br.BaseStream.Seek(PeSignatureOffsetLocation, SeekOrigin.Begin); // read the offset int offsetToPeSig = br.ReadInt32(); // seek to the start of the PE signature br.BaseStream.Seek(offsetToPeSig, SeekOrigin.Begin); }   Now, we can check if it is a valid PE image by reading of the next 4 byte contains the content PE.   private bool IsValidPeSignature(BinaryReader br) { // read 4 bytes to get the PE signature byte[] peSigBytes = br.ReadBytes(PeSignatureSize); // convert it to a string and trim \0 at the end of the content string peContent = Encoding.Default.GetString(peSigBytes).TrimEnd('\0'); // check if PE is in the content return peContent.Equals(PeSignatureContent); }   With this basic functionality we have a good base reader class to try the different methods of parsing the COFF file header. COFF file header The COFF header has the following structure: Offset Size Field 0 2 Machine 2 2 NumberOfSections 4 4 TimeDateStamp 8 4 PointerToSymbolTable 12 4 NumberOfSymbols 16 2 SizeOfOptionalHeader 18 2 Characteristics If we translate this table to code, we get something like this:   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct CoffHeader { public MachineType Machine; public ushort NumberOfSections; public uint TimeDateStamp; public uint PointerToSymbolTable; public uint NumberOfSymbols; public ushort SizeOfOptionalHeader; public Characteristic Characteristics; } BaseCoffReader All readers do the same thing, so we go to the patterns library in our head and see that Strategy pattern or Template method pattern is sticked out in the bookshelf. I have decided to take the template method pattern in this case, because the Parse() should handle the IO for all implementations and the concrete parsing should done in its derived classes.   public CoffHeader Parse() { using (var br = new BinaryReader(File.Open(_fileName, FileMode.Open, FileAccess.Read, FileShare.Read))) { SeekToPeSignature(br); if (!IsValidPeSignature(br)) { throw new BadImageFormatException(); } return ParseInternal(br); } } protected abstract CoffHeader ParseInternal(BinaryReader br);   First we open the BinaryReader, seek to the PE signature then we check if it contains a valid PE signature and rest is done by the derived implementations. Byte4ByteCoffReader The first solution is using the BinaryReader. It is the general way to get the data. We only need to know which order, which data-type and its size. If we read byte for byte we could comment out the first line in the CoffHeader structure, because we have control about the order of the member assignment.   protected override CoffHeader ParseInternal(BinaryReader br) { CoffHeader coff = new CoffHeader(); coff.Machine = (MachineType)br.ReadInt16(); coff.NumberOfSections = (ushort)br.ReadInt16(); coff.TimeDateStamp = br.ReadUInt32(); coff.PointerToSymbolTable = br.ReadUInt32(); coff.NumberOfSymbols = br.ReadUInt32(); coff.SizeOfOptionalHeader = (ushort)br.ReadInt16(); coff.Characteristics = (Characteristic)br.ReadInt16(); return coff; }   If the structure is as short as the COFF header here and the specification will never changed, there is probably no reason to change the strategy. But if a data-type will be changed, a new member will be added or ordering of member will be changed the maintenance costs of this method are very high. UnsafeCoffReader Another way to bring the data into this structure is using a "magically" unsafe trick. As above, we know the layout and order of the data structure. Now, we need the StructLayout attribute, because we have to ensure that the .NET Runtime allocates the structure in the same order as it is specified in the source code. We also need to enable "Allow unsafe code (/unsafe)" in the project's build properties. Then we need to add the following constructor to the CoffHeader structure.   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct CoffHeader { public CoffHeader(byte[] data) { unsafe { fixed (byte* packet = &data[0]) { this = *(CoffHeader*)packet; } } } }   The "magic" trick is in the statement: this = *(CoffHeader*)packet;. What happens here? We have a fixed size of data somewhere in the memory and because a struct in C# is a value-type, the assignment operator = copies the whole data of the structure and not only the reference. To fill the structure with data, we need to pass the data as bytes into the CoffHeader structure. This can be achieved by reading the exact size of the structure from the PE file.   protected override CoffHeader ParseInternal(BinaryReader br) { return new CoffHeader(br.ReadBytes(Marshal.SizeOf(typeof(CoffHeader)))); }   This solution is the fastest way to parse the data and bring it into the structure, but it is unsafe and it could introduce some security and stability risks. ManagedCoffReader In this solution we are using the same approach of the structure assignment as above. But we need to replace the unsafe part in the constructor with the following managed part:   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)] public struct CoffHeader { public CoffHeader(byte[] data) { IntPtr coffPtr = IntPtr.Zero; try { int size = Marshal.SizeOf(typeof(CoffHeader)); coffPtr = Marshal.AllocHGlobal(size); Marshal.Copy(data, 0, coffPtr, size); this = (CoffHeader)Marshal.PtrToStructure(coffPtr, typeof(CoffHeader)); } finally { Marshal.FreeHGlobal(coffPtr); } } }     Conclusion We saw that we can parse well-formed binary data to our data structures using different approaches. The first is probably the clearest way, because we know each member and its size and ordering and we have control about the reading the data for each member. But if add member or the structure is going change by some reason, we need to change the reader. The two other solutions use the approach of the structure assignment. In the unsafe implementation we need to compile the project with the /unsafe option. We increase the performance, but we get some security risks.

    Read the article

  • Your Content Can Get Visibility Through Search Engines - Part 1

    Search engine marketing aims at getting higher search engine rankings for your website but for that you need to get yourself into the search engine Index first. Your content designed for your SEO activity should be accessible to millions of internet users and if your content is not found through the search engines, then all your search engine optimization efforts will go waste.

    Read the article

  • unstripped binary or object creating debian package

    - by Jaime
    I'm new to package creation and I'm trying to create a .deb package and keep getting 'unstripped-binary-or-object' on all my libraries and executables. I have everything setup in the directory tree where I want them to end up (and a DEBIAN folder with the control file) and then do fakeroot dpkg-deb --build ./mypackage when I lint with lintian mypackage.deb I get that error. Any ideas or suggestions? Thanks

    Read the article

  • Website not coming in Search engine results because of a term

    - by curiosity
    We have this site which is named Vialogues (Video+Discussion web based application). https://vialogues.com It has been around for sometime on the internet and we have also submitted sitemap.xml to search engines. However when we search on google or bing or yahoo using the keyword Vialogues, We are given results of the keyword dialogues and this message “showing results for dialogues, search instead for vialogues”. I am wondering if it's possible to list the site without the search engine suggesting “showing results for dialogues, search instead for vialogues”?

    Read the article

  • 5 Common Mistakes Made by Search Engine Optimization Companies

    Search engine optimization process or SEO is used for making the website search-friendly. The websites are made friendly not only for the search-engines, but also for those who search for products and services with the help of search-engines. There are 5 common mistakes which people make while optimizing the site. You should be aware that these mistakes can affect your ranking in the SE.

    Read the article

  • How Can a Website Benefit From Search Engine Optimization

    Search Engine Optimization, also plainly referred to as SEO is tuning the potentials of a website with the aim of getting high rankings in search engines like Google, Yahoo and Bing. Businesses battle for this high ranking because when web users search for particular services or products online, they only use specific keywords in the search engines then perform a web search.

    Read the article

  • Search Engine Optimisation For Online Businesses

    Most Internet users make use of search engines to get apt results for their search and this is the reason that a website with good search engine ranking is preferred much by the visitors. Landing on top search engine results not only helps to draw quality traffic on the website, but also helps the website to become a brand in the market. The more visitors navigate the web page, more publicity for the site shall boost up and this is made possible with Search engine optimization.

    Read the article

  • SEO - Search Engine Optimization Working For You

    SEO (search engine optimization), sometimes referred to as natural or organic search optimization, website SEO, or just plain old SEO, is the process of ensuring that the ranking of your website with search engines i.e. Google, Yahoo etc puts your web site near the top of searches. Natural or Organic search results are "free" i.e., you do not pay for a listing in the search results pages for your keywords. This means you need to do all the work.

    Read the article

  • Basic SEO Strategies - How to Get Your Website at the Top of the Search Results

    Search Engine Optimisation means making changes on your website so that it can be crawled more easily by search engines and found in search listings. By making changes on your website you can increase targeted visitors to your site. Search Engines use robots to crawl websites and the robots are only able to read content that is text. Your website results are displayed based on how relevant the content is in relation to the keyword that is being searched for in the search engine.

    Read the article

  • Where can I safetly search domain whois without worrying about the search engine parking on the domain immediately after the search?

    - by Evan Plaice
    There are a lot of companies that provide domain whois but I've heard of a lot of people who had bad experiences where the domain was bought soon after the whois search and the price was increased dramatically. Where can I gain access to a domain whois where I don't have to worry about that happening? Update: Apparently, the official name for this practice is called Domain Front Running and some sites go as far as to create explicit policies stating that they don't do it. This is where a domain registrar or an intermediary (like a domain lookup site) mines the searches for possibly attractive domains and then either sells the data to a third-party, or goes ahead and registers the name themselves ahead of you. In one case a registrar took advantage of what's known as the "grace period" and registered every single domain users looked up through them and held on to them for 5 days before releasing them back into the pool at no cost to themselves. Source: domainwarning.com And apparently, after ICANN was notified of the practice, they wrote it off as a coincidence of random 'domain tasting'. Source: See for yourself

    Read the article

  • Python - Using "Google AJAX Search" API's Local Search Objects

    - by user330739
    Hi! I've just started using Google's search API to find addresses and the distances between those addresses. I used geopy for this, but, I often had the problem of not getting the correct addresses for my queries. I decided to experiment, therefore, with Google's "Local Search" (http://code.google.com/apis/ajaxsearch/local.html). Anyway, I wanted to ask if I could use the "Local Search" objects provided by the API within python. Something tells me that I can't and that I have to use json. Does anyone know if there is a work around? PS: Im trying to make something like this: http://www.google.com/uds/samples/random/lead.html ... except a matrix type deal where the insides will be filled with distances between the addresses. Thanks for reading!

    Read the article

< Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >