Search Results

Search found 4676 results on 188 pages for 'john nash'.

Page 127/188 | < Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >

  • Android Camera exit rotate

    - by John
    I am first time to write a camera app. At program, I am using setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE) and android:screenOrientation="landscape" in Manifest to set the landscape screen. My problem is when use System.exit() or Intent. The screen will change to portrait automatically. But in my program, it haven't set any screen orientation again. How can I prevent this problem? Thanks!!

    Read the article

  • Core Data Errors vs Exceptions Part 3

    - by John Gallagher
    My question is similar to this one. Background I'm creating a large number of objects in a core data store using NSOperations to speed things up. I've followed all the Core Data multithreading rules - I've got a single persistent store coordinator and a managed object context per thread that on save is merging back to the main managed object context. The Problem When the number of threads running at once is more than 1, I get the exception logged on save of my core data store: NSExceptionHandler has recorded the following exception: NSInternalInconsistencyException -- optimistic locking failure What I've Tried My code that creates new entities is quite complex - it makes entities that have relationships with other entities that could be being created in a separate thread. If I replace my object creation routine with some very simple code just making non-related entries, everything works perfectly. Initially, as well as the exceptions, I was getting a save error saying core data couldn't save due to the merge failing. I read the docs and realised I needed a merge policy on the Managed Object Context I was saving to. I set this up and as this question states, the save error goes away, but the exception remains. My Question Do I need to worry about these exceptions? If I do need to get rid of the exceptions, any ideas on how I do it?

    Read the article

  • Rails 3 MySQL 2 reports an error in what looks to be valid SQL syntax

    - by John Judd
    I am trying to use the following bit of code to help in seeding my database. I need to add data continually over development and do not want to have to completely reseed data every time I add something new to the seeds.rb file. So I added the following function to insert the data if it doesn't already exist. def AddSetting(group, name, value, desc) Admin::Setting.create({group: group, name: name, value: value, description: desc}) unless Admin::Setting.find_by_sql("SELECT * FROM admin_settings WHERE group = '#{group}' AND name = '#{name}';").exists? end AddSetting('google', 'analytics_id', '', 'The ID of your Google Analytics account.') AddSetting('general', 'page_title', '', '') AddSetting('general', 'tag_line', '', '') This function is included in the db/seeds.rb file. Is this the right way to do this? However I am getting the following error when I try to run it through rake. rake aborted! Mysql2::Error: 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 'group = 'google' AND name = 'analytics_id'' at line 1: SELECT * FROM admin_settings WHERE group = 'google' AND name = 'analytics_id'; Tasks: TOP => db:seed (See full trace by running task with --trace) Process finished with exit code 1 What is confusing me is that I am generating correct SQL as far as I can tell. In fact my code generates the SQL and I pass that to the find_by_sql function for the model, Rails itself can't be changing the SQL, or is it? SELECT * FROM admin_settings WHERE group = 'google' AND name = 'analytics_id'; I've written a lot of SQL over the years and I've looked through similar questions here. Maybe I've missed something, but I cannot see it.

    Read the article

  • Getting level values from PCM raw data using Core Audio

    - by John
    I am trying to extract level data from a PCM audio file using core audio. I have gotten as far as (I believe) getting the raw data into a byte array (UInt8) but it is 16 bit PCM data and I am having trouble reading the data out. The input is from the iPhone microphone, which I have set as: [recordSetting setValue:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt:1] forKey:AVNumberOfChannelsKey]; [recordSetting setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey]; [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey]; [recordSetting setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey]; which is obviously 16 bits. I am then trying to just print out a few values to see if they look reasonable for debug purposes below, and they do not look reasonable (many 0's). ExtAudioFileRef inputFile = NULL; ExtAudioFileOpenURL(track.location, &inputFile); AudioStreamBasicDescription inputFileFormat; UInt32 dataSize = (UInt32)sizeof(inputFileFormat); ExtAudioFileGetProperty(inputFile, kExtAudioFileProperty_FileDataFormat, &dataSize, &inputFileFormat); UInt8 *buffer = malloc(BUFFER_SIZE); AudioBufferList bufferList; bufferList.mNumberBuffers = 1; bufferList.mBuffers[0].mNumberChannels = 1; bufferList.mBuffers[0].mData = buffer; //pointer to buffer of audio data bufferList.mBuffers[0].mDataByteSize = BUFFER_SIZE; //number of bytes in the buffer while(true) { UInt32 frameCount = (bufferList.mBuffers[0].mDataByteSize / inputFileFormat.mBytesPerFrame); // Read a chunk of input OSStatus status = ExtAudioFileRead(inputFile, &frameCount, &bufferList); // If no frames were returned, conversion is finished if(0 == frameCount) break; NSLog(@"---"); int16_t *bufferl = &buffer; for(int i=0;i<100;i++){ //const int16_t *bufferl = bufferl[i]; NSLog(@"%d",bufferl[i]); } } Not sure what I am doing wrong, I think it has to do with reading the byte array. Sorry for the long code post...

    Read the article

  • visual studio qt5 plugins not working on release

    - by John Smith
    I'm got this project where i'm showing images with a qt5 interface, i'm simply setting the Pixmap of a label with the qimage pixmap The thing is, it's working on a debug build, but not on a release build and i dont understand why. I already got a folder in my .Exe folder named "plugins" and a subfolder in it named "imageformats", and in this folder the file named "qjpeg.dll" So i coming here to see if someone has an idea on why it doesn't work ? Thanks in advance !

    Read the article

  • Confusion over manual/automatic sizing of Flash Sprite Objects

    - by John
    If I have a custom class subclassing Sprite and it draws some simple objects, how does this work with respect to the Sprite.width & Sprite.height properties? It seems I can draw (for example) a rectangle of any size, bigger than the Sprite size. Similarly if I set the width/height properties, what happens to the content already drawn? As a use-case, I might have a stick-man which is drawn as a set of lines, I want to set the man's height and the rendering is scaled to this. Are there any issues with width/height being auto-calculated or am I misunderstanding what these properties actually mean?

    Read the article

  • Customer wants some data to appear after you later delete rows. System giant / not my creation. Fast

    - by John Sullivan
    This is a fairly common problem, it probably has a name, I just don't know what it is. A.) User sees obscure piece of information in Row B of L_OBSCURE_INFO displayed on some screen at a certain point. It is in table L_Obscure_info. B.) Under certain circumstances we want to correctly delete data in L_OBSCURE_INFO. Unfortunately, nobody accounted for the fact that the user might want to backtrack and see some random piece of information that was most recently in L_OBSCURE_INFO. C.) The system is enormous and L_OBSCURE_INFO is used all the time. You have no idea what the ramifications are of implementing some kind of hack and whatever you do, you don't want to introduce more bugs. I think the best approach would be to create an L_OBSCURE_INFO_HISTORY table and record a record in there every time you change data. But god help your ensuring it's accurate in this system where L_OBSCURE_INFO is being touched everywhere and you don't have time to implement L_OBSCURE_INFO_HISTORY. Is there a particularly easy, clever design solution for this kind of problem -- basically an elegant database hack? If not, is this kind of design problem under a particular class of problems or have a name?

    Read the article

  • What are you supposed to do with old SVN branches?

    - by John
    We had a SVN branch recently that had been merged back to trunk, and some more work on that feature/functional area was needed. I suggested using the same branch but was told you shouldn't re-use a branch once it has been integrated into trunk (a reference in SVN docs was given, I can't find it now). That suggests a branch is fairly useless once you merge back to trunk, so my question is once a branch is no longer needed, should it simply be deleted or kept?

    Read the article

  • Best javascript i18n techniques / AJAX - dates, times, numbers, currency

    - by John Vasileff
    For server side generated content, i18n support is usually pretty easy, for example, Java provides extensive i18n support. But, these rich server side libraries are not available within the browser, which causes a problem when trying to format data client side (AJAX style.) What javascript libraries and techniques are recommended for performing client side formatting and time-zone calculations? Also - beyond simple client side formatting, how can consistency be achieved when performing both server side and client side formatting?

    Read the article

  • How to display only selected data in combo box at run time from database?

    - by Joy1979
    I am new to .Net and I am working on one task. Below is my scenario. I have 2 tables: Table 1: Students StudentID StudentDetail 1 StudentName 2 StudentGrade Table 2: Student_data StudentDetail StudentRecords StudentName John (Default) StudentName Jacob StudentName Smith StudentGrade A (default) StudentGrade B StudentGrade C Question: When window form loads (run time) I need to display StudentRecords in combo box with StudentName = "John" and StudentGrade = "A" as default followed by other values. StudentName and StudentRecords are in Labels and values are in a ComboBox. I am using VB.Net and VS 2010 with SQL 2008r2. I would appreciate any step by step help. Apologies If my request is simple.

    Read the article

  • jquery loop hover button

    - by john morris
    ok i have 6 buttons, im trying to have a jquery listener for when you hover over one of the 6 buttons, it changes class. im using a for loop to do this, heres my code: $(document).ready(function() { for($i=1;$i<7;$i++) { $('#button'+i).hover(function() { $(this).addClass('hovering'); }, function() { $(this).removeClass('normal'); }); } }); each button has an id of "buttonx" ( the x being a number ) help?

    Read the article

  • Load Empty Database table

    - by john White
    I am using SQLexpress and VS2008. I have a DB with a table named "A", which has an IdentitySpecification column named ID. The ID is auto-incremented. Even if the row is deleted, the ID still increases. After several data manipulation, the current ID has reached 15, for example. When I run the application if there's at least 1 row: if I add a new row, the new ID is 16. Everything is fine. If the table is empty (no row): if I add a new row, the new ID is 0, which is an error (I think). And further data manipulation (eg. delete or update) will result in an unhandled exception. Has anyone encountered this? PS. In my table definition, the ID has been selected as follow: Identity Increment = 1; Identity Seed =1; The DB load code is: dataSet = gcnew DataSet(); dataAdapter->Fill(dataSet,"A"); dataTable=dataSet->Tables["A"]; dbConnection->Open(); The Update button method dataAdapter->Update(dataSet,"tblInFlow"); dataSet->AcceptChanges(); dataTable=dataSet->Tables["tblInFlow"]; dataGrid->DataSource=dataTable; If I press Update: if there's at least a row: the datagrid view updates and shows the table correctly. if there's nothing in the table (no data row), the Add method will add a new row, but from ID 0. If I close the program and restart it again: the ID would be 16, which is correct. This is the add method row=dataTable->NewRow(); row["column1"]="something"; dataTable->Rows->Add(row); dataAdapter->Update(dataSet,"A"); dataSet->AcceptChanges(); dataTable=dataSet->Tables["A"];

    Read the article

  • Hudson's FindBugs plugin reports line number "-1" for bugs. Ideas?

    - by John B.
    Greetings, I have a simple test project set up in Hudson and the project's build process (a batch file) generates a findbugs.xml file. This is processed by Hudson's FindBugs plugin but it shows the line number of the bugs as "-1" instead of their actual line number. A coworker suggested I enable debug info for the compiler. I used the -g "Generate all debugging info" option for javac but nothing seemed to change. My build command is: javac -g -classpath C:\testWebApp1\src -d C:\testWebApp1\build C:\testWebApp1\src\*.java The only other thing in the build.bat file is a call to the FindBug tool (text UI). Here is what the FindBugs Plugin says about the first bug: File: GenerateHellos.java, Line: -1, Type: UUF_UNUSED_FIELD, Priority: Normal, Category: PERFORMANCE Any ideas? Thanks a ton!

    Read the article

  • I can't find a DirectX installer to run from my installer.

    - by John
    I tried this one. But it's the annoying one which asks you where to extract temp files, my users won't know what this means. I also tried the web installer, but you're not strictly allowed to use this. I don't really follow the windows setup stuff, but is there a single .EXE I am allowed to distribute and run, which just works (for DX 9.0C) with some command-line args? Or some other way, which can can described in idiot-proof steps and and called in one command-line argument from an installer script like Inno?

    Read the article

  • WINDOWS: Your computer hangs. You can windows + R (run dialog) but performance is so halted taskMGR

    - by John Sullivan
    The question is, what process are available to try to recover from total system instability before pulling the plug when we can do nothing but programs or batches in the path from the run dialog (windows + r key), and performance is so dead that taskMGR / procEXP / other programs with visual guis are not usable? I am not a windows expert, but ideally someone out there has written a program that does more or less stuff like this: Immediately set (or perhaps I can set from the run prompt) its priority to extremely high, evaluate performance bottlenecks. E.g. is CPU 100%? If so identify offending program(s) or problems. Attempt / log fixes, then provide crude feedback asking the user if his performance has stabilized enough to abort, wait a few seconds, if no feedback continue, etc. etc. Eventually try to do any "system cleanup" if the program decides it cannot recover and perhaps finally provide a series of beeps to the user, or what have you, to say "OK, I give up, time to pull the plug". Ideally create a log, when able. These kinds of horrible hangs are a situation where surely trying something, anything, is better than nothing -- as long as that something is intelligent -- when the alternative is ripping out the power coord. Again, I am not a windows expert, so perhaps there is a much more elegant "hands on" approach I am not aware of.

    Read the article

  • get foreign key objects in a single query - Django

    - by John
    Hi I have 2 models in my django code: class ModelA(models.Model): name = models.CharField(max_length=255) description = models.CharField(max_length=255) created_by = models.ForeignKey(User) class ModelB(models.Model): category = models.CharField(max_length=255) modela_link = models.ForeignKey(ModelA, 'modelb_link') functions = models.CharField(max_length=255) created_by = models.ForeignKey(User) Say ModelA has 100 records, all of which may or may not have links to ModelB Now say I want to get a list of every ModelA record along with the data from ModelB I would do: list_a = ModelA.objects.all() Then to get the data for ModelB I would have to do for i in list_a: i.additional_data = i.modelb_link.all() However this runs a query on every instance of i. Thus making 101 queries to run. Is there any way of running this all in just 1 query. Or at least less than the 101 queries. I've tried putting in ModelA.objects.select_related().all() but this didn't seem to have any effect. Thanks

    Read the article

  • Is is possible to stringstream this way? to convert from string to int?

    - by John
    Is it possible to stringstream like this? I am trying to read with ifstream and convert it. string things = "10 11 12 -10"; int i1; int i2; int i3; int i4; stringstream into; into << things; into >> i1; into >> i2; into >> i3; into >> i4; I expect it to be : i1 = 10 i2 = 11 i3 = 12 i4 = -10 is that correct? Can the same stringstream variable be used multiple times? When I tried, the first time was ok but everything else later on is just 0.

    Read the article

  • Jquery conditionals, window locations, and viewdata. Oh my!

    - by John Stuart
    I have one last thing left on a project and its a doozy. Not only is this my first web application, but its the first app i used Jquery, CSS and MVC. I have no idea on how to proceed with this. What i am trying to do is: In my controller, a waste item is validated, and based on the results one of these things can happen. The validation is completed, nothing bad happens, which sets ViewData["FailedWasteId"] to -9999. Its a new waste item and the validation did not pass, which sets ViewData["FailedWasteId"] to 0. Its an existing waste item and the validation did not pass, which sets ViewData["FailedWasteId"] to the id of the waste item. This ViewData["FailedWasteId"] is set on page load using <%=Html.Hidden("wFailId", int.Parse(ViewData["WasteFailID"].ToString()))%> When the validations do not pass, then the page zooms (by window.location) to an invisible div, opens the invisible div etc. Hopefully my intentions are clear with this poor attempt at jquery. The new waste div is and the existing item divs are dynamically generated (this i know works) " So my question here is... Help? I cant even get the data to parse correctly, nor can i even get the conditionals to work. And since this happens after post, i cant get firebug to help my step through the debugger, as the script isnt loaded yet. $(document).ready(function () { var wasteId = parseInt($('#wFailId').text()); if (wasteId == -9999) { //No Issue } else if (wasteId < 0) { //Waste not saved to database } else if (wasteId == 0) { //New Waste window.location = '#0'; $('.editPanel').hide(); $('#GeneratedWasteGrid:first').before(newRow); $('.editPanel').appendTo('#edit-panel-row').slideDown('slow'); } else if (wasteId > 0) { //Waste saved to database } });

    Read the article

  • call_user_function_array() and __construct

    - by John
    I'm working on a simple framework, and I'm having a slight problem. I'd like to use call_user_function_array() to pass parameters to a function. That's fine, except the function I want to pass it to is __construct. I can't create an instance of an object with cufa(), and by instantiating an object, and then using cufa to call that instance's __construct(), I run into problems with a broken class because I'm calling the constructor twice (and one time it's called wrong.)

    Read the article

  • What's the advantage of an Adobe AIR app over a traditional desktop app?

    - by John
    I'm pretty familiar with using Adobe Flex & AS3, and compared with writing apps in JS/HTML I think it's very cool. However, since AIR is essentially a non-browser version of Flex with benefits like local storage, it seems to be competing as a cross-platform desktop application platform... and in that space it's much less mature than more established desktop technologies. So what's the advantage of creating a desktop application using AIR compared to something like Java (or C++ using a cross-platform GUI library like wxWidgets)? Java's equally capable of communicating with the server for instance, I'm not quite sure what AIR adds when competing head-to-head in the desktop development world?

    Read the article

  • Easy way to determine what content is not delivered using a secure HTTPS connection?

    - by John
    I have some pages that are sent via HTTPS. Internet Explorer sometimes complains about "This webpage contains content that will not be delivered using a secure HTTPS". I looked in the html source to confirm all content calls (href, src, etc...) are sent via https. My CSS files use relative paths. But I'm still getting these warnings. Is there an easy way to track down which items are not sent via HTTPS?

    Read the article

< Previous Page | 123 124 125 126 127 128 129 130 131 132 133 134  | Next Page >