Search Results

Search found 2312 results on 93 pages for 'whats your favourite'.

Page 75/93 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Emulator restarts after snapshot load

    - by reox
    I've set up a android emulator with a snapshot of a specific state i need to go back every time. the snapshot is created and is listed and i can also start directly with this snapshot with emulator -avd MyAVD -snapshot mystate -no-snapshot-save the problem is now that the emulator restart itselfs after i load the snapshot after i did my changes in the emulator. So if i use echo -e "avd snapshot load mystate\nexit" | nc localhost 5554 the snapshot is loaded correctly but then after some seconds i see the bootloader screen. Whats happening there? this phenomen is repeatable with different emulators and different snapshots. is it possible that i just misuse a feature here? edit: it seems this problem is only occuring when i load a snapshot multiple times. after starting the emulator, everything is working quite well. now i load my snapshot, also everything is working well. but when i now load the same snapshot again, it will correctly load it but then the emulator will restart. so is there any possibility to load a snapshot multiple times? otherwise i always need to restart my emulator, which takes a long time...

    Read the article

  • sqlite3 delete does not delete everything?

    - by Skand
    Whats going on here? I would expect the following delete to delete everything from the table. Is there a fundamental mis-understanding of how sqlite3 behaves on my part? sqlite .schema CREATE TABLE ip_domain_table (ip_domain TEXT, answer TEXT, ttl INTEGER, PRIMARY KEY(ip_domain, answer, ttl)); sqlite select count(*) from ip_domain_table where ttl < 9999999999 ; 1605343 sqlite pragma cache_size=100000; delete from ip_domain_table where ttl < 9999999999; sqlite select count(*) from ip_domain_table where ttl < 9999999999 ; 258 Q: Why does the count show "258"? Shouldn't it be 0 instead? If I do this instead, it deletes all the entries as expected. sqlite select count(*) from ip_domain_table; 1605343 sqlite pragma cache_size=100000; delete from ip_domain_table; sqlite select count(*) from ip_domain_table; 0

    Read the article

  • UISlider how to set the initial value

    - by slim
    I'm pretty new at this iphone dev stuff and i'm working on some existing code at a company. The uislider i'm trying to set the initial value on is actually in a UITableViewCell and is a custom control. I was thinking in the cell init cell = (QuantitiesCell *)[self loadCellWithNibName:@"QuantitiesCell" forTableView:ltableView withStyle:UITableViewCellStyleDefault]; i could just call something like ((QuantitiesCell *)cell).value = 5; The actual QuantitiesCell class has the member value and the following functions -(void)initCell;{ if (listOfValues == nil) { [self initListOfValues]; } quantitiesSLider.maximumValue = [listOfValues count]-1; quantitiesSLider.minimumValue = 0; quantitiesSLider.value = self.value; } -(void)initListOfValues;{ listOfValues = [[NSMutableArray alloc] initWithCapacity:10]; int j =0; for (float i = minValue; i <= maxValue+increment; i=i+increment) { [listOfValues addObject:[NSNumber numberWithFloat: i]]; if (i == value) { quantitiesSLider.value = j; } j++; } } like i said, i'm pretty new at this so if i need to post more of the code to show whats going to get help, let me know, This slider always is defaulting to 1, the slider ranges usually from 1-10, and i want to set it to a specific value of the item i'm trying to edit.

    Read the article

  • How can I extract a string between matching braces in Perl?

    - by Srilesh
    My input file is as below : HEADER {ABC|*|DEF {GHI 0 1 0} {{Points {}}}} {ABC|*|DEF {GHI 0 2 0} {{Points {}}}} {ABC|*|XYZ:abc:def {GHI 0 22 0} {{Points {{F1 1.1} {F2 1.2} {F3 1.3} {F4 1.4}}}}} {ABC|*|XYZ:ghi:jkl {JKL 0 372 0} {{Points {}}}} {ABC|*|XYZ:mno:pqr {GHI 0 34 0} {{Points {}}}} { ABC|*|XYZ:abc:pqr {GHI 0 68 0} {{Points {{F1 11.11} {F2 12.10} {F3 14.11} {F4 16.23}}}} } TRAILER I want to extract the file into an array as below : $array[0] = "{ABC|*|DEF {GHI 0 1 0} {{Points {}}}}" $array[1] = "{ABC|*|DEF {GHI 0 2 0} {{Points {}}}}" $array[2] = "{ABC|*|XYZ:abc:def {GHI 0 22 0} {{Points {{F1 1.1} {F2 1.2} {F3 1.3} {F4 1.4}}}}}" .. .. $array[5] = "{ ABC|*|XYZ:abc:pqr {GHI 0 68 0} {{Points {{F1 11.11} {F2 12.10} {F3 14.11} {F4 16.23}}}} }" Which means, I need to match the first opening curly brace with its closing curly brace and extract the string in between. I have checked the below link, but this doesnt apply to my question. http://stackoverflow.com/questions/413071/regex-to-get-string-between-curly-braces-i-want-whats-between-the-curly-braces I am trying but would really help if someone can assist me with their expertise ... Thanks Sri ...

    Read the article

  • How do I efficiently write a "toggle database value" function in AJAX?

    - by AmbroseChapel
    Say I have a website which shows the user ten images and asks them to categorise each image by clicking on buttons. A button for "funny", a button for "scary", a button for "pretty" and so on. These buttons aren't exclusive. A picture can be both funny and scary. The user clicks the "funny" button. An AJAX request is sent off to the database to mark that image as funny. The "funny" button lights up, by assigning a class in the DOM to mark it as "on". But the user made a mistake. They meant to hit the next button over. They should click "funny" again to turn it off, right? At this point I'm not sure whats the most efficient way to proceed. The database knows that the "funny" flag is set, but it's inefficient to query the database every time a button is clicked to say, is this flag set or not, then go on with a second database call to toggle it. Should I infer the state of the database flag from the DOM, i.e. if that button has the class "on" then the flag must be set, and branch at that point? Or would it be better to have a data structure in Javascript in the page which duplicates the state of each image in the database, so that every time I set the database flag to true, I also set the value in the Javascript data to true and so on?

    Read the article

  • Silverlight Async Design Pattern Issue

    - by Mike Mengell
    I'm in the middle of a Silverlight application and I have a function which needs to call a webservice and using the result complete the rest of the function. My issue is that I would have normally done a synchronous web service call got the result and using that carried on with the function. As Silverlight doesn't support synchronous web service calls without additional custom classes to mimic it, I figure it would be best to go with the flow of async rather than fight it. So my question relates around whats the best design pattern for working with async calls in program flow. In the following example I want to use the myFunction TypeId parameter depending on the return value of the web service call. But I don't want to call the web service until this function is called. How can I alter my code design to allow for the async call? string _myPath; bool myFunction(Guid TypeId) { WS_WebService1.WS_WebService1SoapClient proxy = new WS_WebService1.WS_WebService1SoapClient(); proxy.GetPathByTypeIdCompleted += new System.EventHandler<WS_WebService1.GetPathByTypeIdCompleted>(proxy_GetPathByTypeIdCompleted); proxy.GetPathByTypeIdAsync(TypeId); // Get return value if (myPath == "\\Server1") { //Use the TypeId parameter in here } } void proxy_GetPathByTypeIdCompleted(object sender, WS_WebService1.GetPathByTypeIdCompletedEventArgs e) { string server = e.Result.Server; myPath = '\\' + server; } Thanks in advance, Mike

    Read the article

  • Malware - Technical anlaysis

    - by nullptr
    Note: Please do not mod down or close. Im not a stupid PC user asking to fix my pc problem. I am intrigued and am having a deep technical look at whats going on. I have come across a Windows XP machine that is sending unwanted p2p traffic. I have done a 'netstat -b' command and explorer.exe is sending out the traffic. When I kill this process the traffic stops and obviously Windows Explorer dies. Here is the header of the stream from the Wireshark dump (x.x.x.x) is the machines IP. GNUTELLA CONNECT/0.6 Listen-IP: x.x.x.x:8059 Remote-IP: 76.164.224.103 User-Agent: LimeWire/5.3.6 X-Requeries: false X-Ultrapeer: True X-Degree: 32 X-Query-Routing: 0.1 X-Ultrapeer-Query-Routing: 0.1 X-Max-TTL: 3 X-Dynamic-Querying: 0.1 X-Locale-Pref: en GGEP: 0.5 Bye-Packet: 0.1 GNUTELLA/0.6 200 OK Pong-Caching: 0.1 X-Ultrapeer-Needed: false Accept-Encoding: deflate X-Requeries: false X-Locale-Pref: en X-Guess: 0.1 X-Max-TTL: 3 Vendor-Message: 0.2 X-Ultrapeer-Query-Routing: 0.1 X-Query-Routing: 0.1 Listen-IP: 76.164.224.103:15649 X-Ext-Probes: 0.1 Remote-IP: x.x.x.x GGEP: 0.5 X-Dynamic-Querying: 0.1 X-Degree: 32 User-Agent: LimeWire/4.18.7 X-Ultrapeer: True X-Try-Ultrapeers: 121.54.32.36:3279,173.19.233.80:3714,65.182.97.15:5807,115.147.231.81:9751,72.134.30.181:15810,71.59.97.180:24295,74.76.84.250:25497,96.234.62.221:32344,69.44.246.38:42254,98.199.75.23:51230 GNUTELLA/0.6 200 OK So it seems that the malware has hooked into explorer.exe and hidden its self quite well as a Norton Scan doesn't pick anything up. I have looked in Windows firewall and it shouldn't be letting this traffic through. I have had a look into the messages explorer.exe is sending in Spy++ and the only related ones I can see are socket connections etc... My question is what can I do to look into this deeper? What does malware achieve by sending p2p traffic? I know to fix the problem the easiest way is to reinstall Windows but I want to get to the bottom of it first, just out of interest.

    Read the article

  • How to restrict text search to a certain subset of the database ?

    - by Nikhil Garg
    I have a large central database of around 1 million heavy records. In my app, for every user I would have a subset of rows from central table, which would be very small (probably 100 records each).When a particular user has logged in , I would want to search on this data set only. Example: Say I have a central database of all cars in the world. I have a user profile for General Motors(GM) , Ferrari etc. When GM is logged in I just want to search(a full text search and not fire a sql query) for those cars which are manufactured by GM. Also GM may launch/withdraw a model in which case central db would be updated & so would be rowset associated with GM. In case of acquisitions, db of certain profiles may change without launch/removal of new car. So central db wont change then , but rowsets may. Whats the best way to implement such a design ? These smaller row sets would need to be dynamic depending on user activities. We are on Rails 2.3.5 and use thinking_sphinx as the connector and Sphinx/MySQL for search and relational associations.

    Read the article

  • Exclude specific value from a Min/Max agregate funcion using ICriteria.

    - by sparks
    I have a schedule (Voyages) table like this: ID Arrival Departure OrderIndex 1 01/01/1753 02/10/2009 0 1 02/11/2009 02/15/2009 1 1 02/16/2009 02/19/2009 2 1 02/21/2009 01/01/1753 3 2 01/01/1753 03/01/2009 0 2 03/04/2009 03/07/2009 1 2 03/09/2009 01/01/1753 2 By design i save '01/01/1753' as a default value if the user doesn't fill a the field on the capture screen and for the very first Arrival and the very last Departure which are never provided. Im using Nhibernate and Criteria, and im wondering whats the best way to query this data if i want to know the First departure and last arrival for each voyage in the table. My first thought was a groupby (ID) and then do some Min and Max with the arrival and departure but the `'01/01/1753' VALUE is messing aronud. ... .SetProjection(Projections.ProjectionList() .Add(Projections.GroupProperty("ID"), "ID") .Add(Projections.Min("DepartureDate"), "DepartureDate") .Add(Projections.Max("ArrivalDate"), "ArrivalDate") ) ... So is there a way to skip this value in the Min function comparison (without losing the whole row of data), or there is a better way to do this, maybe utilizing the OrderIndex that always indicate the correct order of the elements, maybe ordering ASC taking the 1st and then Order DESC and taking the 1 st again, but im not quite sure how to do that with criteria syntax.

    Read the article

  • How can I SETF an element in a tree by an accessor?

    - by Willi Ballenthin
    We've been using Lisp in my AI course. The assignments I've received have involved searching and generating tree-like structures. For each assignment, I've ended up writing something like: (defun initial-state () (list 0 ; score nil ; children 0 ; value 0)) ; something else and building my functions around these "states", which are really just nested lists with some loosely defined structure. To make the structure more rigid, I've tried to write accessors, such as: (defun state-score ( state ) (nth 2 state)) This works for reading the value (which should be all I need to do in a nicely functional world. However, as time crunches, and I start to madly hack, sometimes I want a mutable structure). I don't seem to be able to SETF the returned ...thing (place? value? pointer?). I get an error with something like: (setf (state-score *state*) 10) Sometimes I seem to have a little more luck writing the accessor/mutator as a macro: (defmacro state-score ( state ) `(nth 2 ,state)) However I don't know why this should be a macro, so I certainly shouldn't write it as a macro (except that sometimes it works. Programming by coincidence is bad). What is an appropriate strategy to build up such structures? More importantly, where can I learn about whats going on here (what operations affect the memory in what way)?

    Read the article

  • Processing XML form input in ASP

    - by Omar Kooheji
    I'm maintaining a legacy application which consists of some ASP.Net pages with c# code behinds and some asp pages. I need to change the way the application accepts it's input from reading a set of parameters from some form fields to reading in one form field which contains contains some XML and parsing to get the parameters out. I've written a C# class that takes an The NameValueCollection from the C# HttpRequest's Form Element. Like so NameValueCollection form = Request.Form; Dictionary<string, string> fieldDictionary = RequestDataExtractor.BuildFieldDictionary(form); The code in the class looks for a particular parameter and if it's there processes the XML and outputs a Dictionary, if its not there it just cycles through the Form parameters and puts them all into the dictionary (Allowing the old method to still work) How would I do this in ASP? Can I use my same class, or a modified version of it? or do I have to write some new code to get this working? If I have to write ASP code Whats the best way to process the XML in ASP? Sorry if this seems like a stupid question but I know next to nothing about ASP and VB.

    Read the article

  • Best and simple way to handle JSON in Django

    - by primal
    Hi, As part of the application we are developing (with android client and Django server) a json object which contains user name and pass word is sent to server from android client as follows HttpPost post = new HttpPost(URL); /*Adding key value pairs */ json.put("username", un); json.put("password", pwd); StringEntity se = new StringEntity(json.toString()); post.setEntity(se); response = client.execute(post); The response is parsed like this result = responsetoString(response.getEntity().getContent()); //Converts response to String jObject = new JSONObject(result); JSONObject post = jObject.getJSONObject("post"); username = post.getString("username"); message = post.getString("message"); Hope upto this everything is fine. The problem comes when parsing or sending JSON responses in Django server. Whats the best way to do this? We tried using SimpleJSON and it turned out not to be so simple as we didn't find any good tutorials or sample code for the same? Are there any python functions similiar to get,put and opt in java for JSON? Any help would be much appreciated..

    Read the article

  • First site going live real soon. Last minute questions

    - by user156814
    I am really close to finishing up on a project that I've been working on. I have done websites before, but never on my own and never a site that involved user generated data. I have been reading up on things that should be considered before you go live and I have some questions. 1) Staging... (Deploying updates without affecting users). I'm not really sure what this would entail, since I'm sure that any type of update would affect users in some way. Does this mean some type of temporary downtime for every update? can somebody please explain this and a solution to this as well. 2) Limits... I'm using the Kohana framework and I'm using the Auth module for logging users in. I was wondering if this already has some type of limit (on login attempts) built in, and if not, what would be the best way to implement this. (save attempts in database, cookie, etc.). If this is not whats meant by limits, can somebody elaborate. 3) Caching... Like I said, this is my first site built around user content. Considering that, should I cache it? 4) Back Ups... How often should I backup my (MySQL) database, and how should I back it up (MySQL export?). The site is currently up, yet not finished, if anybody wants to look at it and see if something pops out to you that should be looked at/fixed. Clashing Thoughts. If there is anything else I overlooked, thats not already in the list linked to above, please let me know. Thanks.

    Read the article

  • can the python wave module accept StringIO object

    - by user368005
    i'm trying to use the wave module to read wav files in python. whats not typical of my applications is that I'm NOT using a file or a filename to read the wav file, but instead i have the wav file in a buffer. And here's what i'm doing import StringIO buffer = StringIO.StringIO() buffer.output(wav_buffer) file = wave.open(buffer, 'r') but i'm getting a EOFError when i run it... File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 493, in open return Wave_read(f) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 163, in __init__ self.initfp(f) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/wave.py", line 128, in initfp self._file = Chunk(file, bigendian = 0) File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/chunk.py", line 63, in __init__ raise EOFError i know the StringIO stuff works for creation of wav file and i tried the following and it works import StringIO buffer = StringIO.StringIO() audio_out = wave.open(buffer, 'w') audio_out.setframerate(m.getRate()) audio_out.setsampwidth(2) audio_out.setcomptype('NONE', 'not compressed') audio_out.setnchannels(1) audio_out.writeframes(raw_audio) audio_out.close() buffer.flush() # these lines do not work... # buffer.output(wav_buffer) # file = wave.open(buffer, 'r') # this file plays out fine in VLC file = open(FILE_NAME + ".wav", 'w') file.write(buffer.getvalue()) file.close() buffer.close()

    Read the article

  • Any info about book "Unix Internals: The New Frontiers" by Uresh Vahalia 2nd edition (Jan 2010)

    - by claws
    This summer I'm getting into UNIX (mostly *BSD) development. I've graduate level knowledge about operating systems. I can also understand the code & read from here and there but the thing is I want to make most of my time. Reading books are best for this. From my search I found that these two books The Design and Implementation of the 4.4 BSD Operating System "Unix Internals: The New Frontiers" by Uresh Vahalia are like established books on UNIX OS internals. But the thing is these books are pretty much outdated. yay!! Lucky me. "Unix Internals: The New Frontiers" by Uresh Vahalia 2 edition (Jan 2010) is released. I've been search for information on this book. Sadly, Amazon says "Out of Print--Limited Availability" & I couldn't find any info regarding this book. This is the information I'm looking for: Table of Contents Whats new in this edition? Where the hell can I buy soft-copy of this book? I really cannot afford buying a hardcopy. How can I contact the author? I've lot of hopes & expectations on this book. I've been waiting for its release for a long time. I've sent random mails to & & requesting to have a proper website for this book. I even contacted publisher for any further information but no replies from any one. If you have any other books that you think will help me. I again repeat, I want to get max possible out of these 2.5 months summer.

    Read the article

  • Powerpoint displays a "can't start the application" error when an Excel Chart object is embedded in

    - by A9S6
    This is a very common problem when Excel Worksheet or Chart is embedded into Word or Powerpoint. I am seeing this problem in both Word and Powerpoint and the reason it seems is the COM addin attached to Excel. The COM addin is written in C# (.NET). See the attached images for error dialogs. I debugged the addin and found a very strange behavior. The OnConnection(...), OnDisConnection(...) etc methods in the COM addin works fine until I add an event handler to the code. i.e. handle the Worksheet_SheetChange, SelectionChange or any similar event available in Excel. As soon as I add even a single event handler (though my code has several), Word and Powerpoint start complaining and do not Activate the embedded object. On some of the posts on the internet, people have been asked to remove the anti-virus addins for office (none in my case) so this makes me believe that the problem is somewhat related to COM addins which are loaded when the host app activates the object. Does anyone have any idea of whats happening here?

    Read the article

  • Mac CoreLocation Services does not ask for permissions

    - by Ryan Nichols
    I'm writing a Mac App that needs to use CoreLocation services. The code and location works fine, as long as I manually authenticate the service inside the security preference pane. However the framework is not automatically popping up with a permission dialog. The documentation states: Important The user has the option of denying an application’s access to the location service data. During its initial uses by an application, the Core Location framework prompts the user to confirm that using the location service is acceptable. If the user denies the request, the CLLocationManager object reports an appropriate error to its delegate during future requests. I do get an error to my delegate, and the value of +locationServicesEnabled is correct on CLLocationManager. The only part missing is the prompt to the user about permissions. This occurs on my development MPB and a friends MBP. Neither of us can figure out whats wrong. Has anyone run into this? Relevant code: _locationManager = [CLLocationManager new]; [_locationManager setDelegate:self]; [_locationManager setDesiredAccuracy:kCLLocationAccuracyKilometer]; ... [_locationManager startUpdatingLocation]; UPDATE: Answer It seems there is a problem with Sandboxing in which the CoreLocation framework is not allowed to talk to com.apple.CoreLocation.agent. I suspect this agent is responsible for prompting the user for permissions. If you add the Location Services Entitlement (com.apple.security.personal-information.location) it only gives your app the ability to use the CL framework. However you also need access to the CoreLocation agent to ask the user for permissions. You can give your app access by adding the entitlement 'com.apple.security.temporary-exception.mach-lookup.global-name' with a value of 'com.apple.CoreLocation.agent'. Users will be prompted for access automatically like you would expect. I've filed a bug to apple on this already.

    Read the article

  • Why are Managed Beans not loaded in Tomcat?

    - by c0d3x
    Hi, I created a JSF 2 web application with facelets. The libs for JSF where stored at tomcat/lib, to share it between several applications. I thought maybe it would be better to store the libs inside the WEB-INF/lib folder of the application, to get the application more independent from server configurations. Now when I start tomcat via eclipse, the managed beans are loaded and working. But when I start tomcat directly / standalone the managed beans are not loaded automatically. I used @ManagedBean @SessionScoped / @RequestScoped annotations to declare classes as managed beans. Why is this? What can I do to fix it? I don't use any faces-config.xml file yet. Thanks in advance. edited: Maybe this helps to see whats going on: javax.el.PropertyNotFoundException: /Artikel.xhtml @12,108 value="#{artikelBackingBean.nameFilterPattern}": Target Unreachable, identifier 'artikelBackingBean' resolved to null at com.sun.faces.facelets.el.TagValueExpression.getType(TagValueExpression.java:93) at com.sun.faces.renderkit.html_basic.HtmlBasicInputRenderer.getConvertedValue(HtmlBasicInputRenderer.java:95) at javax.faces.component.UIInput.getConvertedValue(UIInput.java:1008) at javax.faces.component.UIInput.validate(UIInput.java:934) at javax.faces.component.UIInput.executeValidate(UIInput.java:1189) at javax.faces.component.UIInput.processValidators(UIInput.java:691) at javax.faces.component.UIForm.processValidators(UIForm.java:243) at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1080) at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:1180) at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(ProcessValidationsPhase.java:76) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:312) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:849) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:454) at java.lang.Thread.run(Thread.java:619)

    Read the article

  • Testing Broadcasting and receiving messages

    - by Avik
    Guys am having some difficulty figuring this out: I am trying to test whether the code(in c#) to broadcast a message and receiving the message works: The code to send the datagram(in this case its the hostname) is: public partial class Form1 : Form { String hostName; byte[] hostBuffer = new byte[1024]; public Form1() { InitializeComponent(); StartNotification(); } public void StartNotification() { IPEndPoint notifyIP = new IPEndPoint(IPAddress.Broadcast, 6000); hostName = Dns.GetHostName(); hostBuffer = Encoding.ASCII.GetBytes(hostName); UdpClient newUdpClient = new UdpClient(); newUdpClient.Send(hostBuffer, hostBuffer.Length, notifyIP); } } And the code to receive the datagram is: public partial class Form1 : Form { byte[] receivedNotification = new byte[1024]; String notificationReceived; StringBuilder listBox; UdpClient udpServer; IPEndPoint remoteEndPoint; public Form1() { InitializeComponent(); udpServer = new UdpClient(new IPEndPoint(IPAddress.Any, 1234)); remoteEndPoint=null; startUdpListener1(); } public void startUdpListener1() { receivedNotification = udpServer.Receive(ref remoteEndPoint); notificationReceived = Encoding.ASCII.GetString(receivedNotification); listBox = new StringBuilder(this.listBox1.Text); listBox.AppendLine(notificationReceived); this.listBox1.Items.Add(listBox.ToString()); } } For the reception of the code I have a form that has only a listbox(listBox1). The problem here is that when i execute the code to receive, the program runs but the form isnt visible. However when I comment the function call( startUdpListener1() ), the purpose isnt served but the form is visible. Whats going wrong?

    Read the article

  • php fuel 42000 error

    - by ryanc1256
    I don't get whats wrong. So this is the full error I get... Fuel\Core\Database_Exception [ 42000 ]: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'to, from, message, checked) VALUES ('1', 'freddy', 'bob', 'message', '1')' at line 1 with query: "INSERT INTO chatmes (id, to, from, message, checked) VALUES ('1', 'freddy', 'bob', 'message', '1')" and this my php code which is supposably giving me the error <?php define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR); define('APPPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/app/').DIRECTORY_SEPARATOR); define('PKGPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/packages/').DIRECTORY_SEPARATOR); define('COREPATH', realpath('/var/www/vhosts/grubber.co.nz/httpdocs/fuel/core/').DIRECTORY_SEPARATOR); require APPPATH.'bootstrap.php'; error_reporting(-1); ini_set('display_errors', 1); $to = $_GET['to']; $from = $_GET['from']; $message = $_GET['message']; $dquotes = '"'; $squotes = "'"; $message = str_replace($dquotes, "&quot", $message); $message = str_replace($squotes, "&#039", $message); DB::insert('chatmes')->set(array('id' => '1', 'to' => 'freddy', 'from' => 'bob', 'message' => 'message', 'checked' => '1'))->execute(); ?> I dont know what I am doing wrong?? Also the connection im using is PDO At the moment the only line thats giving me a error is, the db update query

    Read the article

  • Linq to sql Repository pattern , Some doubts

    - by MindlessProgrammer
    I am using repository pattern with linq to sql, I am using a repository class per table. I want to know , am i doing at good/standard way, ContactRepository Contact GetByID() Contact GetAll() COntactTagRepository List<ContactTag> Get(long contactID) List<ContactTag> GetAll() List<ContactTagDetail> GetAllDetails() class ContactTagDetail { public Contact Contact {get;set;} public ContactTag COntactTag {get;set;} } When i need a contact i call method in contactrepository, same for contacttag but when i need contact and tags together i call GetDetais() in ContactTag repository its not returning the COntactTag entity generated by the orm insted its returning ContactTagDetail entity conatining both COntact and COntactTag generated by the orm, i know i can simple call GetAll in COntactTag repository and can access Contact.ContactTag but as its linq to sql it will there is no option to Deferred Load in query level, so whenever i need a entity with a related entity i create a projection class Another doubt is where i really need to right the method i can do it in both contact & ContactTag repostitory like In contact repository GetALlWithTags() or something but i am doing it in in COntactTag repository Whats your suggestions ?

    Read the article

  • Resolve php "deadlock"

    - by Matt
    Hey all, I'm currently running into a situation that I guess would be called deadlock. I'm implementing a message service that calls various object methods.. it's quite similar to observer pattern.. Here's whats going on: Dispatcher.php Dispatcher.php <? class Dispatcher { ... public function message($name, $method) { // Find the object based on the name $object = $this->findObjectByName($name); // Slight psuedocode.. for ease of example if($this->not_initialized($object)) $object = new $object(); // This is where it locks up. } return $object->$method(); ... } class A { function __construct() { $Dispatcher->message("B", "getName"); } public function getName() { return "Class A"; } } class B { function __construct() { // Assume $Dispatcher is the classes $Dispatcher->message("A", "getName"); } public function getName() { return "Class B"; } } ?> It locks up when neither object is initialized. It just goes back and forth from message each other and no one can be initialized. Any help would be immensely helpful.. Thanks! Matt Mueller

    Read the article

  • Cannot access Class methods from previous windows form - C#

    - by George
    I am writing an app, still, where I need to test some devices every minute for 30 minutes. It made sense to use a timer set to kick off every 60 secs and do whats required in the event handler. However, I need the app to wait for the 30 mins until I have finished with the timer since the following code alters the state of the devices I am trying to monitor. I obviously don't want to use any form of loop to do this. I thought of using another windows form, since I also display the progress, which will simply kick off the timer and wait until its complete. The problem I am having with this is that I use a device Class and cant seem to get access to the methods in the device class from the 2nd (3rd actually - see below) windows form. I have an initial windows form where I get input from the user, then call the 2nd windows form where it work out which tests need to be done and which device classes need to be used, and then I want to call the 3rd windows form to handle the timer. I will have up to 6-7 device classes and so wanted to only instantiate them when actually requiring them, from the 2nd form. Should I have put this logic into the 1st windows form (program class ??) ? Would I not still have the problem of not being able to access device class methods from there too ? Anyway, perhaps someone knows of a better way to do the checks every minute without the rest of the code executing (and changing the status of the devices) or how I should be accessing the methods in the app ?? Well that's the problem, I cant get that part of it to work correctly. Here is the definition for the calling form including the device class - namespace NdtStart { public partial class fclsNDTCalib : Form { NDTClass NDT = new NDTClass(); public fclsNDTCalib() (new fclsNDTTicker(NDT)).ShowDialog(); Here is the class def for the called form - namespace NdtStart { public partial class fclsNDTTicker : Form { public fclsNDTTicker() I tried lots but couldn't get the arguments to work.

    Read the article

  • PhoneGap/Cordova. childBrowser plugin giving starnge URL (iOS)

    - by MeltingDog
    I am having a great deal of difficulty getting the childBrowser plugin to work Currently when I click my link it does nothing on my iOS simulator and when I click it using a browser I get a Web Page Not Found error with the web address looking something like: file://myapp/www/%C3%A2%E2%82%AC%C2%9D#??????? I am really stuck for ideas on whats going on and what is causing this, any advice would be greatly appreciated. My code is: <script type="text/javascript" charset="utf-8" src="js/ChildBrowser.js"></script> <script> function onDeviceReady() { childbrowser = ChildBrowser.install(); var root = this; cb = window.plugins.childBrowser; if(cb != null) { cb.onLocationChange = function(loc){ root.locChanged(loc); }; cb.onClose = function(){root.onCloseBrowser(); }; cb.onOpenExternal = function(){root.onOpenExternal(); }; //cb.showWebPage(“http://google.com”); } } function onCloseBrowser() { console.log(“onCloseBrowser!”); } function locChanged(loc) { console.log(“locChanged!”); } function onOpenExternal() { alert(“onOpenExternal!”); } <body onLoad=”onBodyLoad()”> <a href=”#” onclick=’cb.showWebPage(“http://www.google.com”);’>Click Me</a>

    Read the article

  • what does this attempted trojan horse code do?

    - by bstullkid
    It looks like this just sends a ping, but whats the point of that when you can just use ping? /* WARNING: this is someone's attempt at writing a malware trojan. Do not compile and *definitely* don't install. I added an exit as the first line to avoid mishaps - msw */ int main (int argc, char *argv[]) { exit(1); unsigned int pid = 0; char buffer[2]; char *args[] = { "/bin/ping", "-c", "5", NULL, NULL }; if (argc != 2) return 0; args[3] = strdup(argv[1]); for (;;) { gets(buffer); /* FTW */ if (buffer[0] == 0x6e) break; switch (pid = fork()) { case -1: printf("Error Forking\n"); exit(255); case 0: execvp(args[0], args); exit(1); default: break; } } return 255; }

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >