Daily Archives

Articles indexed Thursday June 17 2010

Page 2/121 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • iPhone 4.0 SDK UIWebView crashes with DOMHTMLElement error..

    - by hytgbn
    My app have an UIWebView and I open a twitter oauth page with it. when I open oauth page , it works well. after I sign-in, it redirects to another page which have PIN code. and It crashes down with logs below. Is it a bug in 4.0 SDK? 2010-06-14 22:55:11.159 AllFx[1435:2003] -[DOMHTMLElement setHref:]: unrecognized selector sent to instance 0x74e4040 2010-06-14 22:55:11.162 AllFx[1435:2003] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[DOMHTMLElement setHref:]: unrecognized selector sent to instance 0x74e4040' *** Call stack at first throw: ( 0 CoreFoundation 0x02b6c919 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x02cba5de objc_exception_throw + 47 2 CoreFoundation 0x02b6e42b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x02ade116 ___forwarding___ + 966 4 CoreFoundation 0x02addcd2 _CF_forwarding_prep_0 + 50 5 DataDetectorsUI 0x0bde8ac4 -[WebTextIterator(DDExtensions) dd_doUrlificationForQuery:forResults:document:DOMWasModified:URLificationBlock:] + 1731 6 DataDetectorsUI 0x0bde2f09 -[DDOperation _doURLificationOnDocument] + 341 7 DataDetectorsUI 0x0bddff9c -[DDDetectionController _doURLificationOnWebThreadAndRelease:] + 563 8 CoreFoundation 0x02add42d __invoking___ + 29 9 CoreFoundation 0x02add301 -[NSInvocation invoke] + 145 10 WebCore 0x039fa2b3 _ZL15HandleAPISourcePv + 147 11 CoreFoundation 0x02b4dd7f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15 12 CoreFoundation 0x02aac2cb __CFRunLoopDoSources0 + 571 13 CoreFoundation 0x02aab7c6 __CFRunLoopRun + 470 14 CoreFoundation 0x02aab280 CFRunLoopRunSpecific + 208 15 CoreFoundation 0x02aab1a1 CFRunLoopRunInMode + 97 16 WebCore 0x039943c3 _ZL12RunWebThreadPv + 483 17 libSystem.B.dylib 0x98552a19 _pthread_start + 345 18 libSystem.B.dylib 0x9855289e thread_start + 34 ) terminate called after throwing an instance of 'NSException'

    Read the article

  • Setting the default stack size on Linux globally for the program

    - by wowus
    So I've noticed that the default stack size for threads on linux is 8MB (if I'm wrong, PLEASE correct me), and, incidentally, 1MB on Windows. This is quite bad for my application, as on a 4-core processor that means 64 MB is space is used JUST for threads! The worst part is, I'm never using more than 100kb of stack per thread (I abuse the heap a LOT ;)). My solution right now is to limit the stack size of threads. However, I have no idea how to do this portably. Just for context, I'm using Boost.Thread for my threading needs. I'm okay with a little bit of #ifdef hell, but I'd like to know how to do it easily first. Basically, I want something like this (where windows_* is linked on windows builds, and posix_* is linked under linux builds) // windows_stack_limiter.c int limit_stack_size() { // Windows impl. return 0; } // posix_stack_limiter.c int limit_stack_size() { // Linux impl. return 0; } // stack_limiter.cpp int limit_stack_size(); static volatile int placeholder = limit_stack_size(); How do I flesh out those functions? Or, alternatively, am I just doing this entirely wrong? Remember I have no control over the actual thread creation (no new params to CreateThread on Windows), as I'm using Boost.Thread.

    Read the article

  • Yes, another thread question...

    - by Michael
    I can't understand why I am loosing control of my GUI even though I am implementing a thread to play a .wav file. Can someone pin point what is incorrect? #!/usr/bin/env python import wx, pyaudio, wave, easygui, thread, time, os, sys, traceback, threading import wx.lib.delayedresult as inbg isPaused = False isStopped = False class Frame(wx.Frame): def __init__(self): print 'Frame' wx.Frame.__init__(self, parent=None, id=-1, title="Jasmine", size=(720, 300)) #initialize panel panel = wx.Panel(self, -1) #initialize grid bag sizer = wx.GridBagSizer(hgap=20, vgap=20) #initialize buttons exitButton = wx.Button(panel, wx.ID_ANY, "Exit") pauseButton = wx.Button(panel, wx.ID_ANY, 'Pause') prevButton = wx.Button(panel, wx.ID_ANY, 'Prev') nextButton = wx.Button(panel, wx.ID_ANY, 'Next') stopButton = wx.Button(panel, wx.ID_ANY, 'Stop') #add widgets to sizer sizer.Add(pauseButton, pos=(1,10)) sizer.Add(prevButton, pos=(1,11)) sizer.Add(nextButton, pos=(1,12)) sizer.Add(stopButton, pos=(1,13)) sizer.Add(exitButton, pos=(5,13)) #initialize song time gauge #timeGauge = wx.Gauge(panel, 20) #sizer.Add(timeGauge, pos=(3,10), span=(0, 0)) #initialize menuFile widget menuFile = wx.Menu() menuFile.Append(0, "L&oad") menuFile.Append(1, "E&xit") menuBar = wx.MenuBar() menuBar.Append(menuFile, "&File") menuAbout = wx.Menu() menuAbout.Append(2, "A&bout...") menuAbout.AppendSeparator() menuBar.Append(menuAbout, "Help") self.SetMenuBar(menuBar) self.CreateStatusBar() self.SetStatusText("Welcome to Jasime!") #place sizer on panel panel.SetSizer(sizer) #initialize icon self.cd_image = wx.Image('cd_icon.png', wx.BITMAP_TYPE_PNG) self.temp = self.cd_image.ConvertToBitmap() self.size = self.temp.GetWidth(), self.temp.GetHeight() wx.StaticBitmap(parent=panel, bitmap=self.temp) #set binding self.Bind(wx.EVT_BUTTON, self.OnQuit, id=exitButton.GetId()) self.Bind(wx.EVT_BUTTON, self.pause, id=pauseButton.GetId()) self.Bind(wx.EVT_BUTTON, self.stop, id=stopButton.GetId()) self.Bind(wx.EVT_MENU, self.loadFile, id=0) self.Bind(wx.EVT_MENU, self.OnQuit, id=1) self.Bind(wx.EVT_MENU, self.OnAbout, id=2) #Load file usiing FileDialog, and create a thread for user control while running the file def loadFile(self, event): foo = wx.FileDialog(self, message="Open a .wav file...", defaultDir=os.getcwd(), defaultFile="", style=wx.FD_MULTIPLE) foo.ShowModal() self.queue = foo.GetPaths() self.threadID = 1 while len(self.queue) != 0: self.song = myThread(self.threadID, self.queue[0]) self.song.start() while self.song.isAlive(): time.sleep(2) self.queue.pop(0) self.threadID += 1 def OnQuit(self, event): self.Close() def OnAbout(self, event): wx.MessageBox("This is a great cup of tea.", "About Jasmine", wx.OK | wx.ICON_INFORMATION, self) def pause(self, event): global isPaused isPaused = not isPaused def stop(self, event): global isStopped isStopped = not isStopped class myThread (threading.Thread): def __init__(self, threadID, wf): self.threadID = threadID self.wf = wf threading.Thread.__init__(self) def run(self): global isPaused global isStopped self.waveFile = wave.open(self.wf, 'rb') #initialize stream self.p = pyaudio.PyAudio() self.stream = self.p.open(format = self.p.get_format_from_width(self.waveFile.getsampwidth()), channels = self.waveFile.getnchannels(), rate = self.waveFile.getframerate(), output = True) self.data = self.waveFile.readframes(1024) isPaused = False isStopped = False #main play loop, with pause event checking while self.data != '': # while isPaused != True: # if isStopped == False: self.stream.write(self.data) self.data = self.waveFile.readframes(1024) # elif isStopped == True: # self.stream.close() # self.p.terminate() self.stream.close() self.p.terminate() class App(wx.App): def OnInit(self): self.frame = Frame() self.frame.Show() self.SetTopWindow(self.frame) return True def main(): app = App() app.MainLoop() if __name__=='__main__': main()

    Read the article

  • strtotime fails for valid date

    - by Funky Dude
    i am doing a project where i need to output date of orders. and i do the following inside a for loop <?php echo date('M d, Y g:i A',strtotime($order['Order']['created']));?> for some strange reason, sttotime returns false. (Dec 31, 1969 7:00 PM appears instead.) i made sure $order['Order']['created'] is not empty and is valid. even stranger, that exact same piece of code works fine on the other page, only different is that, that one is not in a loop. but that cant be the reason right? i set timezone to America/New_York and $order['Order']['created'] is mysql timestamp. var_dump on said variable string(27) "2010-06-16 20:12:51"

    Read the article

  • findManyToManyRowset with Zend_Db_Table_Select

    - by Typeoneerror
    Hello. I'm trying to use a select object to filter the results of a many to many rowset. This call works great: $articles = $this->model->findArticlesViaArticlesUsers(); This however does not: $articles = new Default_Model_Articles(); $articleSelect = $articles->select(); $articleSelect->where("status = 'published'") ->order("date_published DESC") ->limit(1); $articles = $this->model->findArticlesViaArticlesUsers($articleSelect); That throws the following error: exception 'Zend_Db_Select_Exception' with message 'You cannot define a correlation name 'i' more than once' I can't figure out how to successfully get "articles that have the status of 'published'" using the magic many-to-many relationship (nor findManyToManyRowset). I'm at the end of my rope and thinking of just writing the sql manually. Any ideas?

    Read the article

  • Store form values for later submission

    - by kim griggs
    I have a Rails app that lets users create tutorials and quizzes. There are many users taking the quizzes and many quizzes in a tutorial. My client wants the quiz results to persist when a student navigates away from the quiz. So the use case would be: User starts to take quiz User answers some of the questions User navigates away from quiz to check a fact in the tutorial User goes back to quiz and their answers are still there User finishes quiz and submits Now this would be pretty easy to do if I enforced a "Save" submit so that the answers could be stored in a session or whatever, but the client (and I agree) thinks people will not remember to save before navigating away. Looking for advice on how to approach this. I'm thinking an observer and cookies.

    Read the article

  • Javascript onbeforeunload Issue

    - by Nik
    Alright, I have an issue with the following code. What happens is when a user closes their browser, it should prompt them to either click OK or click CANCEL to leave the page. Clicking OK would trigger a window.location to redirect to another page for user tracking (and yes, to avoid flame wars, there is a secondary system in place to assure accurate tracking, in the event of the user killing the browser from the task manager (as mentioned in similar questions)). CANCEL would remain on the page, the issue being that no matter what button you hit, you get redirected as if you wanted to leave the page. The relevant code is below. window.onbeforeunload = confirmExit; function confirmExit() { var where_to = confirm("Click OK to exit, Click CANCEL to stay."); if (where_to == true) { window.location="logout.php"; } if (where_to == false){ alert("Returning..."); } }

    Read the article

  • PDCurses TUI C++ Win32 console app - Access violation reading location

    - by Bach
    I have downloaded pdcurses source and was able to successfully include curses.h in my project, linked the pre-compiled library and all good. After few hours of trying out the library, I saw the tuidemo.c in the demos folder, compiled it into an executable and brilliant! exactly what I needed for my project. Now the problem is that it's a C code, and I am working on a C++ project in VS c++ 2008. The files I need are tui.c and tui.h How can I include that C file in my C++ code? I saw few suggestions here but the compiler was not too happy with 100's of warnings and errors. How can I go on including/using that TUI pdcurses includes!? Thanks EDIT: I added extern "C" statement, so my test looks like this now, but I'm getting some other type of error #include <stdio.h> #include <stdlib.h> using namespace std; extern "C" { #include <tui.h> } void sub0(void) { //do nothing } void sub1(void) { //do nothing } int main (int argc, char * const argv[]) { menu MainMenu[] = { { "Asub", sub0, "Go inside first submenu" }, { "Bsub", sub1, "Go inside second submenu" }, { "", (FUNC)0, "" } /* always add this as the last item! */ }; startmenu(MainMenu, "TUI - 'textual user interface' demonstration program"); return 0; } Although it is compiling successfully, it is throwing an Error at runtime, which suggests a bad pointer: 0xC0000005: Access violation reading location 0x021c52f9 at line startmenu(MainMenu, "TUI - 'textual user interface' demonstration program"); Not sure where to go from here. thanks again.

    Read the article

  • c# How to Verify Signature, Loading PUBLIC KEY From PEM file?

    - by bbirtle
    I'm posting this in the hope it saves somebody else the hours I lost on this really stupid problem involving converting formats of public keys. If anybody sees a simpler solution or a problem, please let me know! The eCommerce system I'm using sends me some data along with a signature. They also give me their public key in .pem format. The .pem file looks like this: -----BEGIN PUBLIC KEY----- MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDe+hkicNP7ROHUssGNtHwiT2Ew HFrSk/qwrcq8v5metRtTTFPE/nmzSkRnTs3GMpi57rBdxBBJW5W9cpNyGUh0jNXc VrOSClpD5Ri2hER/GcNrxVRP7RlWOqB1C03q4QYmwjHZ+zlM4OUhCCAtSWflB4wC Ka1g88CjFwRw/PB9kwIDAQAB -----END PUBLIC KEY----- Here's the magic code to turn the above into an "RSACryptoServiceProvider" which is capable of verifying the signature. Uses the BouncyCastle library, since .NET apparently (and appallingly cannot do it without some major headaches involving certificate files): RSACryptoServiceProvider thingee; using (var reader = File.OpenText(@"c:\pemfile.pem")) { var x = new PemReader(reader); var y = (RsaKeyParameters)x.ReadObject(); thingee = (RSACryptoServiceProvider)RSACryptoServiceProvider.Create(); var pa = new RSAParameters(); pa.Modulus = y.Modulus.ToByteArray(); pa.Exponent = y.Exponent.ToByteArray(); thingee.ImportParameters(pa); } And then the code to actually verify the signature: var signature = ... //reads from the packet sent by the eCommerce system var data = ... //reads from the packet sent by the eCommerce system var sha = new SHA1CryptoServiceProvider(); byte[] hash = sha.ComputeHash(Encoding.ASCII.GetBytes(data)); byte[] bSignature = Convert.FromBase64String(signature); ///Verify signature, FINALLY: var hasValidSig = thingee.VerifyHash(hash, CryptoConfig.MapNameToOID("SHA1"), bSignature);

    Read the article

  • jQuery server ping slowly but surely filling memory?

    - by danspants
    I use the following piece of code to test if our server is running whilst the user is in a page. I've also started adding other functions that grab small amounts of data that are constantly changing and are to be relayed to the user (Files waiting for download, messages, reports etc). I've noticed recently that if I leave any page open (all pages contain the same function), the browser takes up more and more system memory which I can only attribute to this regular task (overnight it reached 1.6 gb). Is there some way of clearing out the data that is being accumulated? Is this normal behaviour? As far as i can tell, every time I call the function it should overwrite the previously retrieved data? function testServer(){ jQuery.ajax({ type:"HEAD", url:"/media/d_arrow_blue.png", error: function(msg) { jQuery.jGrowl("Server Disconnected"); } }); //retrieves count of files awaiting download - move to seperate function jQuery.get("/get_files/",{"type":"count"},function(data) { jQuery("#downloadList").children("div").text(data); }); }; jQuery().doTimeout(6000,function() { testServer(); return true; });

    Read the article

  • autosave options in ruby on rails

    - by fregas
    is there a way to turn OFF autosave in rails? I dont' want modifications to an association to automatically save to the database UNTIL i call save on the parent object. some_parent.some_children << child #should not save, just adds to the association! some_parent.save #now parent and children are saved! It this possible or am i barking up the wrong tree?

    Read the article

  • jQuery selectors - parental problems

    - by aressidi
    Hi there, I have an emote selector that opens up when a user clicks an entry in a diary. The way I've worked it is that the emote selector panel lives hidden at the top of the page. When a user clicks on the 'emote control' associated with an entry, I use JavaScript to grab the HTML of the emote selector panel from the top of the page and insert it next to the entry. Using Firebug, here's what the finished product would look like in the page (snippet from element inspect). I'm trying to get the ID for the class 'emote-control-container' which contains the entry id: <td> <div id="1467002" class="emote-select emote-default">&nbsp;</div> <div class="emote-control-container" id="emote-controls-1467002"> <div id="emote-control-selector"> <div id="emote-control-selector-body"> <ul> <li id="emote-1"><img src="/images/default_emote.gif?1276134900" class="emote-image" alt="Default_emote"></li> <li id="emote-2"><img src="/images/default_emote.gif?1276134900" class="emote-image" alt="Default_emote"></li> <li id="emote-3"><img src="/images/default_emote.gif?1276134900" class="emote-image" alt="Default_emote"></li> <li id="emote-4"><img src="/images/default_emote.gif?1276134900" class="emote-image" alt="Default_emote"></li> </ul> </div> <div id="emote-control-selector-footer"> &nbsp; </div> </div> </div> </td> I need the entry ID along with the emote ID to make a post via AJAX when a user selects an emote from the selector panel by clicking on it. I'm able to get the emote ID just fine with this, which I'm using to alert-out the selected emote ID: jQuery('li').live('click', function(e) { e.preventDefault; var emoteId = this.id; alert(emoteId); }); I'm having trouble traversing up DOM to get the element ID from '.emote-control-container. I've tried everything, but I'd expect this to work, but it doesn't: jQuery('li').live('click', function(e) { e.preventDefault; var entryId = jQuery(this.id).parent(".emote-control-container").attr("id"); alert(entryId); }); What am I doing wrong.? I can't target the ID of the .emote-control-container.

    Read the article

  • How do I reference members of a single object passed to the View?

    - by Juxtaposed
    I'm new to MVC2 in ASP.NET/C#, so please forgive me if I misunderstand something. I have code similar to this in my Controller: var singleInstance = new Person("John"); ViewData["myInstance"] = singleInstance; return View(); So in my view, Index.aspx, I want to be able to reference members in that object. For example, Person has a member called Name, which is set in the constructor. In the view I want to get Person.Name from what is stored in the ViewData object. Ex.: <%= ViewData["myInstance"].name %> That doesn't work. The only real workaround I've found is to do something like this: <% var thePerson = ViewData["myInstance"]; print (or whatever the method is) thePerson.Name; %> Any help would be much appreciated... This was so much easier in PHP/Zend Framework... sigh

    Read the article

  • UIWebView not evaluating javascript properly

    - by jammur
    I'm trying to run some javascript against a UIWebView but it's doesn't seem to be working. For example, here is a snippet of html I'm using to test: <html><body><h1>Hello World!</h1><p>It's me.</p></body></html> If I run the following javascript against it, the return value is 0, when it should be 1. var elements = document.getElementsByTagName("h1"); elements.length; Here's the objc code I'm using for the webview. 'parser' is a string containing the above javascript: [webView loadHTMLString:@"<html><body><h1>Hello World!</h1><p>It's me.</p></body></html>" baseURL:nil]; NSString *markupResult = [webView stringByEvaluatingJavaScriptFromString:parser];

    Read the article

  • Rearrange items in ListBox

    - by superexsl
    Hey, I have a ListBox with a number of ListBoxItem objects. What is the best way to allow users to rearrange the items by dragging and dropping? Do I have to use StackPanels instead? Thanks for any suggestions

    Read the article

  • Imagemagick mogrify stopped working on Cygwin

    - by Andrei
    I've been using Imagemagick's mogrify on Cygwin, but at some point it stopped working. I've tried uninstalling / reinstalling, but still no go. When I try to run mogrify it trows this error : /usr/bin/mogrify.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory Anyone have any hints on what's causing this ?

    Read the article

  • How do I set Environment Variables in Visual Studio 2010?

    - by xarzu
    How do I set Environment Variables in Visual Studio 2010? I found this web page: http://msdn.microsoft.com/en-us/library/ee479070.aspx Which says: From the Project menu, choose Properties. In the left pane, select Configuration Properties, and then select Environment. But when I select "Configuration Properties", there is no "Enviroment" option: http://i67.photobucket.com/albums/h292/Athono/microsoft/newstuff.jpg This is an example in VS 2008: http://i21.photobucket.com/albums/b279/GrunchCan/env.jpg But how is it done in VS 2010?

    Read the article

  • What are the steps for making domain-neutral assemblies?

    - by Mystagogue
    ...and can those steps also be applied to a 3rd party assembly (that might already be strong-named)? The context for my question should not be important, but I'll share anyway: I'm thinking of making a logger (or log-wrapper) that always knows what "log source" to target, regardless of whether the assemblies using it are in one appdomain, or spread across several appdomains. I think one way to achieve that, is to have a domain-neutral assembly with a static "LogSource" property. If that static property is set in a domain-neutral assembly, I think all appdomains will see it.

    Read the article

  • Named captured substring in pcre++

    - by VDVLeon
    Hello, I want to capture named substring with the pcre++ library. I know the pcre library has the functionality for this, but pcre++ has not implemented this. This is was I have now (just a simple example): pcrepp::Pcre regex("test (?P<groupName>bla)"); if (regex.search("test bla")) { // Get matched group by name int pos = pcre_get_stringnumber( regex.get_pcre(), "groupName" ); if (pos == PCRE_ERROR_NOSUBSTRING) return; // Get match std::string temp = regex[pos - 1]; std::cout << "temp: " << temp << "\n"; } If I debug, pos return 1, and that is right, (?Pbla) is the 1th submatch (0 is the whole match). It should be ok. But... regex.matches() return 0. Why is that :S ? Btw. I do regex[pos - 1] because pcre++ reindexes the result with 0 pointing to the first submatch, so 1. So 1 becomes 0, 2 becomes 1, 3 becomes 2, etc. Does anybody know how to fix this?

    Read the article

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