Daily Archives

Articles indexed Tuesday September 25 2012

Page 7/18 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Get Specific depth values in Kinect (XNA)

    - by N0xus
    I'm currently trying to make a hand / finger tracking with a kinect in XNA. For this, I need to be able to specify the depth range I want my program to render. I've looked about, and I cannot see how this is done. As far as I can tell, kinect's depth values only work with pre-set ranged found in the depthStream. What I would like to do is make it modular so that I can change the depth range my kinect renders. I know this has been down before but I can't find anything online that can show me how to do this. Could someone please help me out? I have made it possible to render the standard depth view with the kinect, and the method that I have made for converting the depth frame is as follows (I've a feeling its something in here I need to set) private byte[] ConvertDepthFrame(short[] depthFrame, DepthImageStream depthStream, int depthFrame32Length) { int tooNearDepth = depthStream.TooNearDepth; int tooFarDepth = depthStream.TooFarDepth; int unknownDepth = depthStream.UnknownDepth; byte[] depthFrame32 = new byte[depthFrame32Length]; for (int i16 = 0, i32 = 0; i16 < depthFrame.Length && i32 < depthFrame32.Length; i16++, i32 += 4) { int player = depthFrame[i16] & DepthImageFrame.PlayerIndexBitmask; int realDepth = depthFrame[i16] >> DepthImageFrame.PlayerIndexBitmaskWidth; // transform 13-bit depth information into an 8-bit intensity appropriate // for display (we disregard information in most significant bit) byte intensity = (byte)(~(realDepth >> 8)); if (player == 0 && realDepth == 00) { // white depthFrame32[i32 + RedIndex] = 255; depthFrame32[i32 + GreenIndex] = 255; depthFrame32[i32 + BlueIndex] = 255; } // omitted other if statements. Simple changed the color of the pixels if they went out of the pre=set depth values else { // tint the intensity by dividing by per-player values depthFrame32[i32 + RedIndex] = (byte)(intensity >> IntensityShiftByPlayerR[player]); depthFrame32[i32 + GreenIndex] = (byte)(intensity >> IntensityShiftByPlayerG[player]); depthFrame32[i32 + BlueIndex] = (byte)(intensity >> IntensityShiftByPlayerB[player]); } } return depthFrame32; } I have a strong hunch it's something I need to change in the int player and int realDepth values, but i can't be sure.

    Read the article

  • Dynamic libraries are not allowed on iOS but what about this?

    - by tapirath
    I'm currently using LuaJIT and its FFI interface to call C functions from LUA scripts. What FFI does is to look at dynamic libraries' exported symbols and let the developer use it directly form LUA. Kind of like Python ctypes. Obviously using dynamic libraries is not permitted in iOS for security reasons. So in order to come up with a solution I found the following snippet. /* (c) 2012 +++ Filip Stoklas, aka FipS, http://www.4FipS.com +++ THIS CODE IS FREE - LICENSED UNDER THE MIT LICENSE ARTICLE URL: http://forums.4fips.com/viewtopic.php?f=3&t=589 */ extern "C" { #include <lua.h> #include <lualib.h> #include <lauxlib.h> } // extern "C" #include <cassert> // Please note that despite the fact that we build this code as a regular // executable (exe), we still use __declspec(dllexport) to export // symbols. Without doing that FFI wouldn't be able to locate them! extern "C" __declspec(dllexport) void __cdecl hello_from_lua(const char *msg) { printf("A message from LUA: %s\n", msg); } const char *lua_code = "local ffi = require('ffi') \n" "ffi.cdef[[ \n" "const char * hello_from_lua(const char *); \n" // matches the C prototype "]] \n" "ffi.C.hello_from_lua('Hello from LUA!') \n" // do actual C call ; int main() { lua_State *lua = luaL_newstate(); assert(lua); luaL_openlibs(lua); const int status = luaL_dostring(lua, lua_code); if(status) printf("Couldn't execute LUA code: %s\n", lua_tostring(lua, -1)); lua_close(lua); return 0; } // output: // A message from LUA: Hello from LUA! Basically, instead of using a dynamic library, the symbols are exported directly inside the executable file. The question is: is this permitted by Apple? Thanks.

    Read the article

  • How can you put all images from a game to 1 file?

    - by ThePlan
    I've just finished a basic RPG game written in C++ SFML, I've put a lot of effort into the game and I'd want to distribute it, however I've ran into a small issue. Problem is, I have well over 200 images and map files (they're .txt files which hold map codes) all in the same folder as the executable, when I look in the folder, it makes me want to cry a little bit seeing so many resources, I've never seen a game which shows you all the resources directly, instead I believe they pack the resources in a certain file. Well, that's what I'm trying to achieve: I'm hoping to pack all the images in 1 file (Maybe the .txt files as well) then being able to read from that file or easily add to it.

    Read the article

  • Is there any online programmer's community, focusing on core game development?

    - by kasperov
    I am looking for a stricktly/mostly programming oriented game community, focusing on core graphics, middleware, and research. Any suggestions? Edit: I am specifically looking for people/community/group, having expertise in core game engine design/programming, directx/opengl reservoir.(And specifically targetting the programming part only).(The platforms can be anything from PC to xbox360/ps3/wii and even 3ds.)

    Read the article

  • What is this type of sound effect called?

    - by Fibericon
    There is a sound typically associated with a bright flash of light, which starts with a lower whirring noise, then breaks into a higher pitched sound. What is that type of sound called? I'm not sure how to begin searching for that, so a typical name for it would be very helpful. It's something similar to what occurs at 0:41 in this youtube video (here's a link to a few seconds beforehand), where Naruto 6 tails transforms into Kyuubei in Naruto Generations.

    Read the article

  • Only the last run in a for loop in Javascript works

    - by Mengfei Murphy
    Here is a for loop written by Javascript. It is trying to apply queries for websql. for (var i = 0; i < 10; i++){ db.transaction(function (tx){ tx.executeSql('INSERT INTO ProjSetsT (ProjID) VALUES (?);', [i]); }); } The attempt is obvious, I tried to add values "0, 1, 2, ... 9" into column ProjID in table ProjSetsT. It does not work. I only got the last element, i.e. "9" inserted, but not the first eight numbers. Is there any syntax mistakes?

    Read the article

  • Three.js: texture to datatexture

    - by Alessandro Pezzato
    I'm trying to implement a delayed webcam viewer in javascript, using Three.js for WebGL capabilities. I need to store frames grabbed from webcam, so they can be shown after some time (some milliseconds to some seconds). I'm able to do this without Three.js, using canvas and getImageData(). You can find an example on jsfidle. I'm trying to find a way to do this without canvas, but using Three.js Texture or DataTexture object. Here an example of what I'm trying. The problem is that I cannot find how to copy the image from a Texture (image is of type HTMLVideoElement) to another. In rotateFrames() function the older frame should be lost and newer should replace, like in a FIFO. But the line frames[i].image = frames[i + 1].image; is just copying the reference, not the texture data. I guess DataTexture should do this, but I'm not able to get a DataTexture out of a Texture or HTMLVideoElement. Any idea?

    Read the article

  • how to put result in the end using jquery

    - by Martty Rox
    my code is : html with the js in section please ch3eck it out i need to prodeuce the result of the form of five questions and display it in the last section of the page where am i going wrong am using innerhtml js thing to produce the result in the last section <div id="section1"> <script type="text/javascript"> function changeText2(){ alert("working"); var count1=0; var a=document.forms["myForm"]["drop1"].value; var b=document.forms["myForm"]["drop2"].value; alert(document.forms["myForm"]["drop2"].value); var c=document.forms["myForm"]["drop3"].value; var d=document.forms["myForm"]["drop4"].value; var e=document.forms["myForm"]["drop5"].value; var f=document.forms["myForm"]["drop6"].value; if(a===2) { count1++; alert(count1); } else { alert("lit"); } if(b===2) { count1++; } else { alert("lit"); } if(c===2) { count1++; } else { alert("lit"); } if(d===2) { count1++; } else { alert("lit"); } if(e===2) { count1++; } else alert("lit"); } alert(count1); document.getElementById('boldStuff2').innerHTML = count1; </script> <form name="myForm"> <p>1)&#x00A0;&#x00A0;Who won the 1993 &#x201C;King of the Ring&#x201D;?</p> <div> <select id="f1" name="drop1"> <option value="0" selected="selected">-- Select -- </option> <option value="1">Owen Hart </option> <option value="2">Bret Hart </option> <option value="3">Edge </option> <option value="4">Mabel </option> </select> </div> <!--que1--> <p>2)&#x00A0;&#x00A0;What NHL goaltender has the most career wins?</p> <div> <select id="f2" name="drop2"> <option value="0" selected="selected">-- Select -- </option> <option value="1">Grant Fuhr </option> <option value="2">Patrick Roy </option> <option value="3">Chris Osgood </option> <option value="4">Mike Vernon</option> </select> </div> <!--que2--> <p>3)&#x00A0;&#x00A0;What Major League Baseball player holds the record for all-time career high batting average?</p> <div> <select id="f3" name="drop3"> <option value="0" selected="selected">-- Select -- </option> <option value="1">Ty Cobb </option> <option value="2">Larry Walker </option> <option value="3">Jeff Bagwell </option> <option value="4">Frank Thomas</option> </select> </div> <!--que3--> <p>4)&#x00A0;&#x00A0;Who among the following is NOT associated with billiards in India?</p> <div> <select id="f4" name="drop4" > <option value="0" selected="selected">-- Select -- </option> <option value="1">Subash Agrawal </option> <option value="2">Ashok Shandilya </option> <option value="3">Manoj Kothari </option> <option value="4">Mihir Sen</option> </select> </div> <!--que4--> <p>5)&#x00A0;&#x00A0;Which cricketer died on the field in Bangladesh while playing for Abahani Club?</p> <div> <select id="f5" name="drop5" > <option value="0" selected="selected">-- Select -- </option> <option value="1">Subhash Gupte</option> <option value="2">M.L.Jaisimha</option> <option value="3">Lala Amarnath</option> <option value="4">Raman Lamba</option> </select> </div> <!--que5--> <a href="#services" class="page_nav_btn next"><input type='button' onclick='changeText2()' value='NEXT'/></a> </form> </div> <div id="section2"> </div> ... <div id="results"> <b id='boldStuff2'>fff ggg</b> </div> need to display the results of each section at the last div as shown in script... js for first section not working plz some help me where am i going wrong....

    Read the article

  • How to integrate an dynamically generated JSON Object into an other object?

    - by Marco Ciarfaglia
    How can I put this JSON Object in the function or object below? // this function generates an JSON Object dynamically $(".n_ListTitle").each(function(i, v) { var node = $(this); var nodeParent = node.parent(); var nodeText = node.text(); var nodePrice = node.siblings('.n_ListPrice'); var prodPrice = $(nodePrice).text(); var prodId = nodeParent.attr('id').replace('ric', ''); var prodTitle = nodeText; var json = { id : prodId, price : prodPrice, currency : "CHF", name : prodTitle }; return json; }); TDConf.Config = { products : [ // here should be inserted the JSON Object {id: "[product-id1]", price:"[price1]", currency:"[currency1]", name:"[product-name1]"}, {id: "[product-id2]", price:"[price2]", currency:"[currency2]", name:"[product-name2]"}, ... })], containerTagId :"..." }; If it is not understandable please ask :) Thanks in advance for helping me to figure out!

    Read the article

  • Checking data of all same class elements

    - by Tiffani
    I need the code to check the data-name value of all instances of .account-select. Right now it just checks the first .account-select element and not any subsequent ones. The function right now is on click of an element such as John Smith, it checks the data-name of the .account-select lis. If the data-names are the same, it does not create a new li with the John Smith data. If no data-names are equal to John Smith, then it adds an li with John Smith. This is the JS-Fiddle I made for it so you can see what I am referring to: http://jsfiddle.net/rsxavior/vDCNy/22/ Any help would be greatly appreciated. This is the Jquery Code I am using right now. $('.account').click(function () { var acc = $(this).data("name"); var sel = $('.account-select').data("name"); if (acc === sel) { } else { $('.account-hidden-li').append('<li class="account-select" data-name="'+ $(this).data("name") +'">' + $(this).data("name") + '<a class="close bcn-close" data-dismiss="alert" href="#">&times;</a></li>'); } }); And the HTML: <ul> <li><a class="account" data-name="All" href="#">All</a></li> <li><a class="account" data-name="John Smith" href="#">John Smith</a></li> </ul> <ul class="account-hidden-li"> <ul>

    Read the article

  • Need JavaScript var in anchor

    - by Helto
    I'm sure this is really simple, but I need some help. I'm trying to insert a variable into an anchor in the following snippet var tablerows = '' $.each( data, function(index,row){ id = row.shift() tablerows += '<tr><td><a href="getuserimage.php?id=" target="_blank">' + row.shift() + '</a></td>' tablerows += '<td>' + row.join('</td><td>') + '</td></tr>' }) $("#users-table > tbody").html(tablerows) I'm just not sure how to get the id in there

    Read the article

  • the difference of String.valueOf(char) and +

    - by Will Yu
    to show the default value of char ,I wrote code like this: public class TestChar { static char a; public static void main(String[] args) { System.out.println("."+String.valueOf(a)+"."); System.out.println("the default char is "+a); } } but the console output is confused.the first is ". ." ,however the second is "the default char is [](like this ,I don't know how to describe it.)" why?thanks for help

    Read the article

  • Python: Trying to get index of an intersection

    - by user1620716
    I have the following line of code: for i in [i for i,x in enumerate(catdate) if x == set(NNSRCfile['datetimenew']).intersection(catdate)]: print i I am trying to find the index of the intersection for the two components above. Both are lengthy lists that have several commonalities. The intersection part works perfectly; however, the for loop seems to output nothing. (ie: there is nothing that is printed). Python outputs no error, and when I run the code in IPython, I notice that i is equivalent to to the very last element in the list "catdate", instead of listing the indices of "catdate" that are equivalent to the intersection values. Any help is greatly appreciated!

    Read the article

  • How to refresh site if $_SESSION variable has changed

    - by 4ndro1d
    I'm writing in my $_SESSION variable from a database, when i clicked a link. public function getProjectById($id){ $query="SELECT * FROM projects WHERE id=\"$id\""; $result=mysql_query($query); $num=mysql_numrows($result); while ($row = mysql_fetch_object($result)) { $_SESSION['projectid'] = $row->id; $_SESSION['projecttitle'] = $row->title; $_SESSION['projectinfo'] = $row->info; $_SESSION['projecttext'] = $row->text; $_SESSION['projectcategory'] = $row->category; } } Now my variable is overwritten and I want to show these variables in my index.php like this: <div id="textContent"> <?php if(isset($_SESSION['projecttext']) && !empty($_SESSION['projecttext'])) { echo $_SESSION['projecttext']; }else { echo 'No text'; } ?></div> But of course, my page will not refresh automatically. How can I do that?

    Read the article

  • get return value from 2 threads in C

    - by polslinux
    #include <stdio.h> #include <stdlib.h> #include <pthread.h> #include <stdint.h> #include <inttypes.h> typedef struct tmp_num{ int tmp_1; int tmp_2; }t_num; t_num t_nums; void *num_mezzo_1(void *num_orig); void *num_mezzo_2(void *num_orig); int main(int argc, char *argv[]){ pthread_t thread1, thread2; int tmp=0,rc1,rc2,num; num=atoi(argv[1]); if(num <= 3){ printf("Questo è un numero primo: %d\n", num); exit(0); } if( (rc1=pthread_create( &thread1, NULL, &num_mezzo_1, (void *)&num)) ){ printf("Creazione del thread fallita: %d\n", rc1); exit(1); } if( (rc2=pthread_create( &thread2, NULL, &num_mezzo_2, (void *)&num)) ){ printf("Creazione del thread fallita: %d\n", rc2); exit(1); } t_nums.tmp_1 = 0; t_nums.tmp_2 = 0; pthread_join(thread1, (void **)(&t_nums.tmp_1)); pthread_join(thread2, (void **)(&t_nums.tmp_2)); tmp=t_nums.tmp_1+t_nums.tmp_2; printf("%d %d %d\n", tmp, t_nums.tmp_1, t_nums.tmp_2); if(tmp>2){ printf("Questo NON è un numero primo: %d\n", num); } else{ printf("Questo è un numero primo: %d\n", num); } exit(0); } void *num_mezzo_1(void *num_orig){ int cont_1; int *n_orig=(int *)num_orig; t_nums.tmp_1 = 0; for(cont_1=1; cont_1<=(*n_orig/2); cont_1++){ if((*n_orig % cont_1) == 0){ (t_nums.tmp_1)++; } } pthread_exit((void *)(&t_nums.tmp_1)); return NULL; } void *num_mezzo_2(void *num_orig){ int cont_2; int *n_orig=(int *)num_orig; t_nums.tmp_2 = 0; for(cont_2=((*n_orig/2)+1); cont_2<=*n_orig; cont_2++){ if((*n_orig % cont_2) == 0){ (t_nums.tmp_2)++; } } pthread_exit((void *)(&t_nums.tmp_2)); return NULL; } How this program works: i have to input a number and this program will calculate if it is a prime number or not (i know that it is a bad algorithm but i only need to learn pthread). The problem is that the returned values are too much big.For example if i write "12" the value of tmp tmp_1 tmp_2 into the main are 12590412 6295204 6295208.Why i got those numbers??

    Read the article

  • C++ Returning Multiple Items

    - by Travis Parks
    I am designing a class in C++ that extracts URLs from an HTML page. I am using Boost's Regex library to do the heavy lifting for me. I started designing a class and realized that I didn't want to tie down how the URLs are stored. One option would be to accept a std::vector<Url> by reference and just call push_back on it. I'd like to avoid forcing consumers of my class to use std::vector. So, I created a member template that took a destination iterator. It looks like this: template <typename TForwardIterator, typename TOutputIterator> TOutputIterator UrlExtractor::get_urls( TForwardIterator begin, TForwardIterator end, TOutputIterator dest); I feel like I am overcomplicating things. I like to write fairly generic code in C++, and I struggle to lock down my interfaces. But then I get into these predicaments where I am trying to templatize everything. At this point, someone reading the code doesn't realize that TForwardIterator is iterating over a std::string. In my particular situation, I am wondering if being this generic is a good thing. At what point do you start making code more explicit? Is there a standard approach to getting values out of a function generically?

    Read the article

  • FoxPro to C#: What best method between ODBC, OLE DB or another?

    - by Martin Labelle
    We need to read data from FoxPro 8 with C#. I'm gonna do some operations, and will push some of thoses data to an SQL Server database. We are not sure what's best method to read those data. I saw OLE DB and ODBC; what's best? REQUIRMENTS: The export program will run each night, but my company runs 24h a day. The DBF could sometimes be huge. We DON'T need to modify data. Our system, wich use FoxPro, is quite unstable: I need to find a way that ABSOLUTELY do not corrupt data, and, ideally, do not lock DBF files while reading. Speed is a minor requirement: it must be quick, but requirement #4 is most important.

    Read the article

  • SQL finding members who are not friends of another member

    - by thedirktastik
    I'm struggling to find a query which will return members who aren't friends of a certain member. Here is the layout of my tables: member_login: MemberID, email, password member_info: memberID, first_name, last_name member_friends: friendID, req_member, req_date, app_member, app_date, date_deactivated I tried to use NOT IN to run a query that would return the opposite of friends but nothing I try seems to be working. Here's what I thought would work: SELECT Mi.First_Name, Mi.Last_Name FROM Member_Info Mi WHERE Mi.Memberid NOT IN( SELECT Mi.Memberid, Mi.First_Name, Mi.Last_Name FROM Member_Info Mi, Member_Login Ml, Member_Friends Mf WHERE Mi.Memberid = Ml.Memberid AND (Mi.Memberid = Mf.Req_Member AND Mf.App_Member = 1 OR Mi.Memberid = Mf.App_Member AND Mf.Req_Member =1) AND Ml.Date_Deactivated <= 0 AND Mf.App_Date > 0 ); Any ideas?

    Read the article

  • missing plot title in ggplot2

    - by Ben Mazzotta
    How can I create a plot title in ggplot2? Am I making a silly syntax error? The ggplot2 docs indicate that labs(title = 'foo') should work, but I can only get the arguments x='foo' and y='foo' to work with labs(). Neither ggtitle() nor title() worked either. Here is an example. x <- rnorm(10,10,1) y <- rnorm(10,20,2) xy.df <- data.frame(x,y) qplot(x,y, data=xy.df, geom='point', color=x*y) + labs(title = "New Plot Title", x='Some Data', y='Some Other Data')

    Read the article

  • PHP sessions dying in a few seconds

    - by beauchette
    I have a problem with my server : my sessions are dying on their own after a few seconds. here are two page examples : page1.php : <? session_start(); $_SESSION['x'] = 'moo'; ?> page2.php : <? session_start(); echo $_SESSION['x']; ?> php's settings are debian's untouched : no auto start, 1440 seconds maxlifetime, etc so, if I visit page1.php et then page2.php I'm supposed to see 'moo' for 24 minutes, in my case, you have 'moo' for about 5 seconds. Then I observed that the actual session file, was 44 bytes long, and then 0 a few seconds later, without any other intervention than a few 'ls' to observe the phenomenon, I really have no clue as to what happens and any help would be appreciated. EDIT: after some fiddling (mainly not doing much besides restarting my server 3 or 4 times) I was able to have my quick example working. and then I noticed that sessions in my session.save_path directory are all 44 bytes except for some that are 0 bytes, so it's like it's working but not always. which is even more frustrating.

    Read the article

  • How to maintain tabs when pasting in Vim

    - by Ant Wilson
    I use the tab key to indent my python code in Vim, but whenever I copy and paste a block Vim replaces every tab with 4 spaces, which raises an IndentationError I tried setting :set paste as suggested in related questions but it makes no difference Other sites suggest pasting 'tabless' code and using the visual editor to re-indent, but this is asking for trouble when it comes to large blocks Are there any settings I can apply to vim to maintain tabs on copy/paste? Thanks for any help with this :) edit: I am copying and pasting within vim using the standard gnome-terminal techniques (ctrl+shift+c / mouse etc.) my .vimrc is: syntax on set ts=4 if has("terminfo") let &t_Co=8 let &t_Sf="\e[3%p1%dm" let &t_Sb="\e[4%p1%dm" else let &t_Co=8 let &t_Sf="\e[3%dm" let &t_Sb="\e[4%dm" endif I looked up that ts - Sets tab stops to n for text input, but don't know what value would maintain a tab character

    Read the article

  • JRI Fatal Error on Ubuntu

    - by Peter Jackson
    I have successfully installed JRI and rJava on Windows 7. I am now trying to get it to work on Ubuntu with 64bit OS. I can make rJava calls from within R but getting JRI to work is more difficult. I am running NetBeans 7.1.2 and I have followed various tricks in setting R_HOME and java.library.path to enable all the classes to be loaded. That is, I am past the error messages such as "jri library not found" and "R_HOME not set". From my java code,I can see that R_HOME = /usr/lib64/R. The error message I get now is Fatal error: you must specify '--save', '--no-save' or '--vanilla' This happens when Rengine is first called: Rengine r = new Rengine(args,false,null); This appears to be an error message from R; it seems to be expecting a command line argument. I haven't seen any posting with this error message. Any ideas? Thanks, Peter

    Read the article

  • Azure SDK + Django + Visual Studio 2012 - Publish to Azure succeeds, but I get 500 error

    - by hume
    I followed the instructions here: https://www.windowsazure.com/en-us/develop/python/tutorials/django-with-visual-studio/ However, whenever I try to open the url to my web app in the cloud I get a 500 error. The tutorial doesn't mention setting up the TEMPLATE_DIRS setting in the django application or doing any work on the cloud service machine to install python/django. Could these be the problem?

    Read the article

  • How to match multiple substrings in jQuery combobox autocomplete

    - by John R
    I found more than a couple examples of this with a plain jquery autocomplete but not in a way that will work with the autocomplete included in the combobox code from the demo because the structure of the code is structured so differently. I want to match every item that has all of the search tokens anywhere in any word. I don't need to match the start of any word, any part of it is fine. I don't care if the search strings are highlighted in the autocomplete list if that makes things too complicated. Desired search/result combos: (please excuse the spacing) "fi th" "fi rst second th ird" "rs on" "fi rs t sec on d third" "ec rd" "first s ec ond thi rd" but not limited to any max/min length or number of tokens. EDIT I figured part of it out using the code structure from the other autocorrect I had working. source: function( requestObj, responseFunc ) { var matchArry = $("select > option").map(function(){return this.innerHTML;}).get(); var srchTerms = $.trim(requestObj.term).split(/\s+/); // For each search term, remove non-matches $.each (srchTerms, function (J, term) { var regX = new RegExp (term, "i"); matchArry = $.map (matchArry, function (item) { if( regX.test(item) ){ return{ label: item, value: item, option: HTMLOptionElement } ? item :null; } } ); }); // Return the match results responseFunc (matchArry); }, and select: function( event, ui ) { ui.item.option.selected = true; self._trigger( "selected", event, { item: ui.item.option }); $("destination").val(ui.item.value); // I added this line }, but I can't get both multiple words AND being able to click to select working at the same time. If I remove the } ? item :null; on the return in the map function I can click to select an item. If I leave it I can type multiple words, but I can't click any of the items... Is that the problem or the option: this? I've tried replacing it with HTMLOptionElement and null and I'm stuck. I am able to set the value of another field with ui.item.value within the select label but that doesn't put the value in the search box or close the dropdown menu. Fiddle of current code: http://jsfiddle.net/eY3hM/

    Read the article

  • Dequeue from messageQueue in the PeekCompleted Method

    - by Fraga
    i'm reading messages from MessageQueue using PeekCompleted, i do my process here and if everything go right, I need to remove it from the Queue! currenty i am using MyMessageQueue.Receive() and it works, but is this a reliable way of making sure each message will be processed right? MessageQueue MyMessageQueue; public Form1() { InitializeComponent(); MyMessageQueue = new MessageQueue(@".\private$\Dms"); MyMessageQueue.PeekCompleted += new PeekCompletedEventHandler(MessageQueue_PeekCompleted); MyMessageQueue.Formatter = new XmlMessageFormatter(new Type[] { typeof(string) }); MyMessageQueue.BeginPeek(); } void MessageQueue_PeekCompleted(object sender, PeekCompletedEventArgs e) { try { Debug.WriteLine("ToProcess:" + e.Message.Body); //Long process that maybe fail MyMessageQueue.Receive(); } finally { MyMessageQueue.BeginPeek(); } }

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >