Search Results

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

Page 28/783 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • Collaborative Whiteboard using WebSocket in GlassFish 4 - Text/JSON and Binary/ArrayBuffer Data Transfer (TOTD #189)

    - by arungupta
    This blog has published a few blogs on using JSR 356 Reference Implementation (Tyrus) as its integrated in GlassFish 4 promoted builds. TOTD #183: Getting Started with WebSocket in GlassFish TOTD #184: Logging WebSocket Frames using Chrome Developer Tools, Net-internals and Wireshark TOTD #185: Processing Text and Binary (Blob, ArrayBuffer, ArrayBufferView) Payload in WebSocket TOTD #186: Custom Text and Binary Payloads using WebSocket One of the typical usecase for WebSocket is online collaborative games. This Tip Of The Day (TOTD) explains a sample that can be used to build such games easily. The application is a collaborative whiteboard where different shapes can be drawn in multiple colors. The shapes drawn on one browser are automatically drawn on all other peer browsers that are connected to the same endpoint. The shape, color, and coordinates of the image are transfered using a JSON structure. A browser may opt-out of sharing the figures. Alternatively any browser can send a snapshot of their existing whiteboard to all other browsers. Take a look at this video to understand how the application work and the underlying code. The complete sample code can be downloaded here. The code behind the application is also explained below. The web page (index.jsp) has a HTML5 Canvas as shown: <canvas id="myCanvas" width="150" height="150" style="border:1px solid #000000;"></canvas> And some radio buttons to choose the color and shape. By default, the shape, color, and coordinates of any figure drawn on the canvas are put in a JSON structure and sent as a message to the WebSocket endpoint. The JSON structure looks like: { "shape": "square", "color": "#FF0000", "coords": { "x": 31.59999942779541, "y": 49.91999053955078 }} The endpoint definition looks like: @WebSocketEndpoint(value = "websocket",encoders = {FigureDecoderEncoder.class},decoders = {FigureDecoderEncoder.class})public class Whiteboard { As you can see, the endpoint has decoder and encoder registered that decodes JSON to a Figure (a POJO class) and vice versa respectively. The decode method looks like: public Figure decode(String string) throws DecodeException { try { JSONObject jsonObject = new JSONObject(string); return new Figure(jsonObject); } catch (JSONException ex) { throw new DecodeException("Error parsing JSON", ex.getMessage(), ex.fillInStackTrace()); }} And the encode method looks like: public String encode(Figure figure) throws EncodeException { return figure.getJson().toString();} FigureDecoderEncoder implements both decoder and encoder functionality but thats purely for convenience. But the recommended design pattern is to keep them in separate classes. In certain cases, you may even need only one of them. On the client-side, the Canvas is initialized as: var canvas = document.getElementById("myCanvas");var context = canvas.getContext("2d");canvas.addEventListener("click", defineImage, false); The defineImage method constructs the JSON structure as shown above and sends it to the endpoint using websocket.send(). An instant snapshot of the canvas is sent using binary transfer with WebSocket. The WebSocket is initialized as: var wsUri = "ws://localhost:8080/whiteboard/websocket";var websocket = new WebSocket(wsUri);websocket.binaryType = "arraybuffer"; The important part is to set the binaryType property of WebSocket to arraybuffer. This ensures that any binary transfers using WebSocket are done using ArrayBuffer as the default type seem to be blob. The actual binary data transfer is done using the following: var image = context.getImageData(0, 0, canvas.width, canvas.height);var buffer = new ArrayBuffer(image.data.length);var bytes = new Uint8Array(buffer);for (var i=0; i<bytes.length; i++) { bytes[i] = image.data[i];}websocket.send(bytes); This comprehensive sample shows the following features of JSR 356 API: Annotation-driven endpoints Send/receive text and binary payload in WebSocket Encoders/decoders for custom text payload In addition, it also shows how images can be captured and drawn using HTML5 Canvas in a JSP. How could this be turned in to an online game ? Imagine drawing a Tic-tac-toe board on the canvas with two players playing and others watching. Then you can build access rights and controls within the application itself. Instead of sending a snapshot of the canvas on demand, a new peer joining the game could be automatically transferred the current state as well. Do you want to build this game ? I built a similar game a few years ago. Do somebody want to rewrite the game using WebSocket APIs ? :-) Many thanks to Jitu and Akshay for helping through the WebSocket internals! Here are some references for you: JSR 356: Java API for WebSocket - Specification (Early Draft) and Implementation (already integrated in GlassFish 4 promoted builds) Subsequent blogs will discuss the following topics (not necessary in that order) ... Error handling Interface-driven WebSocket endpoint Java client API Client and Server configuration Security Subprotocols Extensions Other topics from the API

    Read the article

  • Sharepoint Search crawl not working

    - by Satish
    Search Crawling is error out on my MOSS 2007 installation. I get the following error for all the web apps I have following error in Crawl logs. http://mysites.devserver URL could not be resolved. The host may be unavailable, or the proxy settings are not configured correctly on the index server. The Application Event log also has the following corresponding error The start address http://mysites.devserver cannot be crawled. Context: Application 'SSPMain', Catalog 'Portal_Content' Details: The URL of the item could not be resolved. The repository might be unavailable, or the crawler proxy settings are not configured. To configure the crawler proxy settings, use the Proxy and Timeout page in search administration. (0x80041221) I'm using Windows 2008 server. I tried accessing the site using the above mentioned url and its available. I did the registry setting for loop back issue found here http://support.microsoft.com/kb/896861 still not luck. Any Ideas?

    Read the article

  • Sharepoint Search crawl not working

    - by Satish
    Search Crawling is error out on my MOSS 2007 installation. I get the following error for all the web apps I have following error in Crawl logs. http://mysites.devserver URL could not be resolved. The host may be unavailable, or the proxy settings are not configured correctly on the index server. The Application Event log also has the following corresponding error The start address http://mysites.devserver cannot be crawled. Context: Application 'SSPMain', Catalog 'Portal_Content' Details: The URL of the item could not be resolved. The repository might be unavailable, or the crawler proxy settings are not configured. To configure the crawler proxy settings, use the Proxy and Timeout page in search administration. (0x80041221) I'm using Windows 2008 server. I tried accessing the site using the above mentioned url and its available. I did the registry setting for loop back issue found here http://support.microsoft.com/kb/896861 still not luck. Any Ideas?

    Read the article

  • Removing bing from my google search bar when I open a new tab

    - by user329869
    Bing has rudely planted its self on my "open new tab" so above bing my regular google is there but below is the irritating bing search bar! I have tried everything I know of to get rid of it and it will not go! I can not find it listed under my settings, control panel and/or uninstall! This is the second time bing has made its unwelcome tush comfy in my google area! How frustrating! I miss my mac book pro! Removing bing from my google search bar when I open a new tab.

    Read the article

  • Search all files containing text

    - by enthdegree
    With Busybox, how do you search for an expression within a bunch of files recursively through a bunch of directories, but only look through text files? We don't know what the file's suffix is going to be; it could be .sh, it could be nothing, it could be something else. I was considering somehow basing the search on encoding although I am not quite sure what the encoding would be either. I've tried busybox grep -r but it searches through binary files too, which wastes a lot of time.

    Read the article

  • NHibernate.Search - async mode

    - by Atul
    Hi, I am using NHibernate Lucene search in my project. Lucene.Net.dll - v - 2.3.1.3 NHibernate.dll - v - 2.1.0.4000 At this point I am trying to use async option for indexing and used following options config.SetProperty(NHibernate.Search.Environment.WorkerExecution, "async"); config.SetProperty(NHibernate.Search.Environment.WorkerThreadPoolSize, "1"); config.SetProperty(NHibernate.Search.Environment.WorkerWorkQueueSize, "5000"); Questions 1) My initial index was not build with this option, when used these settings first time, I had error saying NHibernate.Search.dll not found. When I deleted existing index and then started working, it went fine. Do we need to rebuild indexes whenever we change config settings like above ? 2) How size of index should be interpreted; i.e. initially my index was about 400MB (build over the last few months), which I deleted. Later when I reindexed, the size of index went down to 5MB ! Search appear to be alright after limited testing, but such a change appeared bit scary. Should we delete/rebuild indexes once in a while & is it normal to change this drastically ? 3) Is my above setting is OK ? When I had WorkerThreadPoolSize=5, I once got Dr Watson kind of error. Please advise on best practices of using async configuration for search. Regards, Atul

    Read the article

  • Search multiple search engines with a single keyword at the same time in Chrome?

    - by cptloop
    I want to search multiple websites at once by using a keyword trigger in Google Chrome. I am trying to achieve this with Javascript as described in this topic over at mozillazine. This is the code that supposedly works in Firefox: javascript:void(window.open('http://www.google.com/search?q=%s'));void(window.open('http://www.altavista.com/web/results?q=%s')) I have tried to insert this code into the "URL with %s in place of query" but nothing happens when I invoke it. Is it possible to get this to work this way or another in Chrome?

    Read the article

  • Fuzzy Search on Material Descriptions including numerical sizes & general descriptions of material t

    - by Kyle
    We're looking to provide a fuzzy search on an electrical materials database (i.e. conduit, cable, etc.). The problem is that, because of a lack of consistency across all material types, we could not split sizes into separate fields from the text description because some materials are rated by things other than size. I've attempted a combination of a full text search & a SQL CLR implementation of the Levenshtein search algorithm (for assistance in ranking), but my results are a little funky (i.e. they are not sorting correctly due to improper ranking). For example, if the search term is "3/4" ABCD Conduit", I'll might get back several irrelevant results in the following order: 1/2" Conduit 1/4" X 3/4" Cable 1/4" Cable Ties 3/4" DFC Conduit Tees 3/4" ABCD Conduit 3/4" Conduit I believe I've nailed the problem down to the fact that these two search algorithms do not factor in the relevance of punctuation & numeric. That is, in such a search, I'd expect the size to take precedence over any fuzzy match on the rest of the description, but my results don't reflect that. My question is: Can anyone recommend better search algorithms or different approaches that may be better suited for searching a combination of alphanumerics & punctuation characters?

    Read the article

  • Modify database for the SharePoint 2010 Enterprise Search administration web site

    - by Mark Hall
    Does anyone know how to modify the database settings for the Enterprise Search administration web site? When you configure the service application via Central Administration, SharePoint just decides to use the default database server and gives a name like Enterprise_Search_DB_Identifier. I want to modify this to atleast give a name that makes scense like SharePoint_Search_AdministrationWebContent, and it might be nice to move it to the database server that is hosting the crawl and property database. I figured out how to move the Central Administration web content database, but this database is not listed as a content database. It is listed as a Microsoft.Office.Server.Search.Administration.SearchAdminDatabase. I have not tested to see if the same process would work but because you are doing a RemoveContentDatabase and NewContentDatabase, I would assume not. Any help would be appreciated.

    Read the article

  • Search and replace global modifier

    - by mrucci
    Is there any reason why non-global/first-occurrence substitution is the default in many text editing programs (vim, sed, perl, etc.)? I am talking about the /g flag of search and replace commands like: :s/pan/focaccia/g # in vim sed 's/sfortuna/fortuna/g' # with sed that will substitute every occurrence of the search pattern with the replacement string. After (not too) many years of vim and sed usage I still did not find any use case for non-global substitutions. Is there some valid historical reason? Or it is because it is? Thanks.

    Read the article

  • [BST] Deletion procedure

    - by Metz
    Hi all. Consider the deletion procedure on a BST, when the node to delete has two children. Let's say i always replace it with the node holding the minimum key in its right subtree. The question is: is this procedure commutative? That is, deleting x and then y has the same result than deleting first y and then x? I think the answer is no, but i can't find a counterexample, nor figure out any valid reasoning. Thank you. EDIT: Maybe i've got to be clearer. Consider the transplant(node x, node y) procedure: it replace x with y (and its subtree). So, if i want to delete a node (say x) which has two children i replace it with the node holding the minimum key in its right subtree: y = minimum(x.right) transplant(y, y.right) // extracts the minimum (it doesn't have left child) y.right = x.right y.left = x.left transplant(x,y) The question was how to prove the procedure above is not commutative.

    Read the article

  • vim: highlighting a search term without moving the cursor

    - by ajwood
    Using Vim, I sometimes find myself staring at a section of source code for a while and suddenly want some variable on the screen to pop out. That's easy: /<var> which highlights them all. My issue is that it more often than not the search shifts my window so I'm not looking at the source code from the same place. Even if it's only shifted a few lines, it's still throws me off since I need to take a few seconds to figure out where things have moved to. Is it possible to highlight a search term without moving the cursor to the next match?

    Read the article

  • Change google search location beyond current country

    - by Abel
    I often work remotely and prefer using en-us locale settings for my searches. One of our computers is located in Germany, and whenever I try to change the location in Google Search Settings, I get an answer to "Pleas enter a valid Deutschland city or zip code". I checked this post, but it doesn't apply, as my language settings en-us and the Google search language is also set to English. It clearly uses the IP address of the computer. I couldn't find an answer in the Google help pages, anyone any idea how to change it London, New-York or Amsterdam?

    Read the article

  • backup, sync and search files over internet and intranet

    - by Cawas
    There are many online backup options out there. Dropbox, Sugarsync, Mozy, Carbonite, Jungledisk and my favorite so far, Crashplan. Some of them allow searching, all of them sync with their online servers, none of those (or many many others I didn't listed here) have what I want. I'm _not_ looking for an online backup service in here. Sure, some people might say "use rsync", "linux" and/or "set up apache" and so on... But that's just too much for maintenance, if it's even viable of building up. It needs to be simple. So, anyone knows of a really good solution out there? Picture mostly Google Desktop Search (or quick search) awesome searching, mixed with Crashplan Desktop, which is able to do everything by itself, and something like Dropbox's file versioning, along with dropbox the ability to seamless sync over intranet and internet like crashplan, switching between them when needed. I bet there's nothing like this yet, but well, I'm not sure. It would be great!

    Read the article

  • Add Control Panel items to Windows 8.1 Search

    - by Alec
    Windows 8.1 claims to search in all indexed locations. However when I tried to open "Mail" (i.e. Mlcfg32.cpl) by typing "Mail" in Search, magic didn't happen. Instead I had to scramble all the way through Control Panel. Is it possible to add Control Panel items to those indexed locations? Or is it just the thing Microsoft forgot about? (e.g. forgot on intention, so users would make use of their new "Settings" applet).

    Read the article

  • "Press Tab to search <site>" in Chrome not working

    - by YatharthROCK
    The problem After partially entering a URL like meta.st, Chrome adds in the rest of the URL slected in blue and says "Press Tab to search Meta Stack Overflow". But on pressing, it just moves the cursor to the next item like in a normal text-field. Other info I'm on Windows 7 Home Basic. My Chrome version number is 22.0.1229.52 beta-m (beta channel). This was working before. What I've tried I've reported it in Chrome (by going to Options Tools Report an issue...). I've also tried deleting all my custom search engines (they might've been interfering) and also tried creating a new profile. I also googled, but to no avail. How do I fix this? Thanks.

    Read the article

  • SharePoint 3.0 Search Stuck Starting

    - by Skaughty
    I have a single server running SharePoint 3.0 on WS2003 Sp2 not on a domain. My search service stopped working so I just went in to central admin and hit stop, then hit start. I soon found out this is not the way to do this process. I now can not get the search service to start again. I have tried everything I can think of, and nothing works it changes status to Starting but never gets to started. I have to go in with "stsadm -o spsearch -action stop" from the command prompt to stop it. I am using the Local service account for the service and the content accounts. Can anyone help me?

    Read the article

  • Command-line tool to search for file names on offline backup drives

    - by halloleo
    I am looking for an open-source (command-line) tool to register and search all my (backup) drives on a file name level. I want to search for file and folder names preferably written as regular expressions or file glob patterns. The external drives contain just normal HFS and NTFS filesystems. The backups are done via direct file copy. Requirement is that the tool compiles on OS X and works without each of the drives attached, but rather pointing me to the drive in case a drive contains a file with the pattern I searched for. At the moment I use a hand-knit script solution with locate databases, one for each external backup drive, but this is rather cumbersome, because locate itself can accesses only one database at a time and does not contain any management system for all the indices/databases. Are there any other tools out there for this?

    Read the article

  • Is there an algorithm for finding an item that matches certain properties, like a 20 questions game?

    - by lala
    A question about 20 questions games was asked here: However, if I'm understanding it correctly, the answers seem to assume that each question will go down a hierarchal branching tree. A binary tree should work if the game went like this: Is it an animal? Yes. Is it a mammal? Yes. Is it a feline? Yes. Because feline is an example of a mammal and mammal is an example of an animal. But what if the questions go like this? Is it a mammal? Yes. Is it a predator? Yes. Does it have a long nose? No. You can't branch down a tree with those kinds of questions, because there are plenty of predators that aren't mammals. So you can't have your program just narrow it down to mammal and have predators be a subset of mammals. So is there a way to use a binary search tree that I'm not understanding or is there a different algorithm for this problem?

    Read the article

  • How can I force Windows 7 to REindex a folder?

    - by Claudiu
    I asked Windows 7 to index my entire "Media" folder. After it was done it'd find anything in there, no problem. Then I reorganized it a bit and moved some folders around, and now it doesn't find things inside those folders anymore. For example, I'm looking at a folder with the files: 01. Ferry Corsten - Shelter Me.mp3 02. Ferry Corsten - Black Velvet.mp3 ... 05. Ferry Corsten - Made Of Love.mp3 ... I type in "Love" in the search box for the current folder, and it doesn't find anything. I checked in "Indexing Options", and this very folder is checked off in there. It seems I just messed up its indexing feature. Any ideas how fix?

    Read the article

  • Simple Interactive Search with jQuery and ASP.Net MVC

    - by Doug Lampe
    Google now has a feature where the search updates as you type in the search box.  You can implement the same feature in your MVC site with a little jQuery and MVC Ajax.  Here's how: Create a javascript global variable to hold the previous value of your search box. Use setTimeout to check to see if the search box has changed after some interval.  (Note: Don't use setInterval since we don't want to have to turn the timer off while Ajax is processing.) Submit the form if the value is changed. Set the update target to display your results. Set the on success callback to "start" the timer again.  This, along with step 2 above will make sure that you don't sent multipe requests until the initial request has finished processing. Here is the code: <script type="text/javascript"> var searchValue = $('#Search').val(); $(function () {     setTimeout(checkSearchChanged, 0.1); }); function checkSearchChanged() {     var currentValue = $('#Search').val();     if ((currentValue) && currentValue != searchValue && currentValue != '') {         searchValue = $('#Search').val();         $('#submit').click();     }     else {         setTimeout(checkSearchChanged, 0.1);     } } </script> <h2>Search</h2> <% using (Ajax.BeginForm("SearchResults", new AjaxOptions { UpdateTargetId = "searchResults", OnSuccess = "checkSearchChanged" })) { %>     Search: <%   = Html.TextBox("Search", null, new { @class = "wide" })%><input id="submit" type="submit" value="Search" /> <% } %> <div id="searchResults"></div> That's it!

    Read the article

  • Eclipse Search Menus disabled randomly

    - by MetroidFan2002
    I use Eclipse 3.3 in my daily work, and have also used Eclipse 3.2 extensively as well. In both versions, sometimes the Search options (Java Search, File Search, etc) in the menu get disabled, seemingly at random times. However, with CTRL + H, I am able to access the search functionality. Does anyone know why this happens? Has it been fixed in Eclipse 3.4?

    Read the article

  • Search Display Controller Crashes When Returning Results

    - by Convolution
    I have a tableview with a search display controller. It has been working fine in the past, but recently has started crashing for certain search results. Here my code searches a Golfer based on their Name, Age and Handicap. The data is correctly loaded into the table, I can access and drill down to receive further information. However when I type in a search query for either Name or Age, the app crashes, while the Golfers Handicap is returned fine. Note: dataSouceArray is the data source for the tableview, dataSourceArrayCopy is the mutable copy of the data used to add and remove objects in the search filter. - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { /* Update the filtered array based on the search text and scope. */ [self.dataSourceArrayCopy removeAllObjects]; // First clear the filtered array. /* Search the main list for products whose type matches the scope (if selected) and whose name matches searchText; add items that match to the filtered array. */ for (Golfer *golfer in dataSourceArray) { if ([scope isEqualToString:@"Name"] || [golfer.golferName isEqualToString:scope]) { NSComparisonResult result = [golfer.golferName compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.customerListCopy addObject:golfer]; } } if ([scope isEqualToString:@"Age"] || [golfer.golferAge isEqualToString:scope]) { NSComparisonResult result = [golfer.golferAge compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.dataSourceArrayCopy addObject:golfer]; } } if ([scope isEqualToString:@"Handicap"] || [golfer.golferHandicap isEqualToString:scope]) { NSComparisonResult result = [golfer.golferHandicap compare:searchText options:(NSCaseInsensitiveSearch|NSDiacriticInsensitiveSearch) range:NSMakeRange(0, [searchText length])]; if (result == NSOrderedSame) { [self.dataSourceArrayCopy addObject:golfer]; } } } } - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString { [self filterContentForSearchText:searchString scope: [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]]; // Return YES to cause the search result table view to be reloaded. return YES; } - (BOOL)searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchScope:(NSInteger)searchOption { [self filterContentForSearchText:[self.searchDisplayController.searchBar text] scope: [[self.searchDisplayController.searchBar scopeButtonTitles] objectAtIndex:searchOption]]; // Return YES to cause the search result table view to be reloaded. return YES; } Any help would be appreciated, thank you for taking the time to read this.

    Read the article

< Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >