Search Results

Search found 3177 results on 128 pages for 'david murrant'.

Page 93/128 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • Prove that the set of regular languages is a proper subset of the set of the context-free languages

    - by David Relihan
    I was brushing up (not homework)on some computation-theory and came accross this problem: How can you prove that the set of regular languages is a proper subset of the set of the context-free languages. Now I know a language is regular iff it is accepted by a finite automaton. And I know a language is context-free iff it is accepted by a pushdown automaton. But I'm not sure of what solution is.

    Read the article

  • Getting user data from Active Directory using PL/SQL

    - by David Neale
    I had a discussion today regarding an Oracle procedure I wrote some time ago. I wanted to get 7500 user email addresses from Active Directory using PL/SQL. AD will return a maximum of 1000 rows and the LDAP provider used by Oracle will not support paging. Therefore, my solution was to filter on the last two characters of the sAMAccountName (*00,*01,*02...etc.). This results in 126 queries (100 for account names ending in digits, 26 for those ending in a letter...this was sufficient for my AD setup). The person I was speaking to (it was a job interview by the way) said he could have done it a better way, but he would not tell me what that method was. Could anybody hazard a guess at what this method was?

    Read the article

  • Possible iphone animation timing/rendering bug?

    - by David
    Hi all, I have been working on an iphone apps for several weeks. Now I encounter an animation problem that I can't figure out how to resolve. Mayhbe you can help. Here is the details (a little long, bear with me): Basically the effect I want to achieve is, when user click a button, a loading view pops up, hiding the whole screen; and then the apps does a lot of heavy computation, which takes a few seconds. Once the computation is done, soem result views (something likes checkers on a checker board) are rendered under the loading view. Once all result views are rendered, I used animation animation to remove the loading view nand show the result views to the user. Here is what I do: when user click a button, run this code: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(loadingViewInserted:finished:context:)]; // use a really high index number so it will always on top [self.view insertSubview:loadingViewController.view atIndex:1000]; [UIView commitAnimations]; In the "loadingViewInserted" function, it calls another function doing the heavy computation work. Once the computation is done, a lot of result views (like checkers on a checker board) are rendered under the loading view. for(int colIndex = 1; colIndex <= result.columns; colIndex++) { for(int rowIndex = 1; rowIndex <= result.rows; rowIndex++) { ResultView *rv = [ResultView resultViewWithData:results[colIndex][rowIndex]]; [self.view addSubview:rv]; } } Once all result views are added, following animation is invoked to remove the loading view: [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.0]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; [loadingViewController.view removeFromSuperview]; [UIView commitAnimations]; By doing this, most of the time (maybe 90%) it does exactly what I want. However, sometime I see some weird result: the loading view shows up first as expected, then before it disappears, some result views, which suppose to be under the loading view, suddenly appears on top of the loading view; and some of them are partial rendered. And then the loading view curled up, and everything looks normal again. The weird situation only lasts for less than a second, but already bad enough to screw up the UI. I have tried all different kinds of thing to fix this (using another thread to remove the loading view, make the loading view non-transparent), but none of them works. The only thing that makes a little better is, I hide all the result views first; after the last animation finished, in its call back, unhide all result views. But this loses the nice effect that when curling up the loading view, the results are already there. At this point, I really think this is a bug in iphone (I compile it with OS 3.0) OS. Or maybe you can point out what I have done wrong (or could do differently). (thanks for finishing this long post, :-) )

    Read the article

  • How to get total cpu usage in Linux (c++)

    - by cz-david
    I am trying to get total cpu usage in %. First I should start by saying that "top" will simply not do, as there is a delay between cpu dumps, it requires 2 dumps and several seconds, which hangs my program (I do not want to give it its own thread) next thing what I tried is "ps" which is instant but always gives very high number in total (20+) and when I actually got my cpu to do something it stayed at about 20... Is there any other way that I could get total cpu usage? It does not matter if it is over one second or longer periods of time... Longer periods would be more useful, though.

    Read the article

  • How does one declare the type of an Android preference?

    - by David R.
    I have a preferences.xml that looks like this: <?xml version="1.0" encoding="utf-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <EditTextPreference android:name="Sample" android:enabled="true" android:persistent="true" android:summary="Sample" android:defaultValue="3.0" android:title="Sample" android:key="sample" /> </PreferenceScreen> When I do sp.getString("sample", "3.0"), it works fine and returns a string, but it shouldn't be a string, it should be a float. Running sp.getFloat("sample", 3.0f) throws a ClassCastException because it is a string. What should I put in the XML so that the preference is stored as a float?

    Read the article

  • preg_match_all image source

    - by David
    I have the following regex expression which is to extract the source of any img tag in HTML. /(<img).*(src\s*=\s*"([a-zA-Z0-9\.;:\/\?&=\-_|\r|\n]{1,})")/isxmU However, it doesn't appear to be matching the following: <IMG SRC='http://www.mysite.com/pix/lens/mtf/CAEF8512L.gif'> How can I build it to match this as well?

    Read the article

  • OpenLayers: Get resolution of map in a given projection (4326)

    - by David Pfeffer
    I'm using OpenLayers to display OpenStreetMap maps. (Though, I'd assume this should be general enough to work for any map product...) I'm displaying some very sophisticated vector overlays, and the amount and resolution of the features I'm returning from the server via GeoJSON to overlay has proven too much for many computers. What I'd like to do now instead is to only send data befitting the resolution of the current zoom. This should be relatively easy to do using the getResolution and calculateBounds methods on the Map object. calculateBounds returns a Bounds object that then can be transformed between the map projection and display projection. How do I transform the resolution into my desired projection (4326 in this case)?

    Read the article

  • Is there still a place for XML in the future?

    - by David Neale
    Now that many people seem to be moving towards JSON for web communication I am wondering about why XML should continue to be used. I appreciate that XML has many years on JSON, during which time it has been widely adopted. However, the fact that it is so well-adopted appears to be the one decisive reason why it should continue to be used. Is there a good reason why XML should not gradually be phased out in favour of JSON?

    Read the article

  • va_list has not been declared

    - by David Doria
    When compiling some working code on Fedora 11, I am getting this error: /usr/include/c++/4.4.1/cstdarg:56: error: ‘::va_list’ has not been declared I am using: [doriad@davedesktop VTK]$ g++ --version g++ (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2) Does anyone know what the problem could be? Thanks, Dave

    Read the article

  • C# 4.0 Named Parameters - should they always be used when calling non-Framework methods?

    - by David Neale
    I really this is a hugely subjective topic but here is my current take: When calling methods which do not form part of the .NET BCL named parameters should always be used as the method signatures may well change, especially during the development cycle of my own applications. Although they might appear more verbose they are also far clearer. Is the above a reasonable approach to calling methods or have I overlooked something fundamental?

    Read the article

  • iPhone Simulator - Restores Plist - Weird Issue

    - by David Schiefer
    Hi All, today I've come across a rather weird issue. After adding code to validate a key (i added it below), the Simulator refuses to let go of the old plist file. I deleted the simulator folder in the Application Support folder, then deleted the *build directory and restarted xcode & build & run my app...still the same issue. the old plist is still there and 100% identical. I then changed the identifier and the snippet's validation keys, the plist however stayed the same. basically, no matter what i do it won't go. the same thing happens on the iphone itself. I have checked through the code, i don't create the key anywhere, but it still returns YES for it at every restart. Here's the code I added: + (void)initialize{ ////////////////////////////SPECIFING THE PREDATA/////////////////// NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *appDefaults = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:@"protect"]; [defaults registerDefaults:appDefaults]; } if ([[NSUserDefaults standardUserDefaults] boolForKey:@"protect"] == NO) { [navigationController pushViewController:help animated:YES]; [help.navigationItem hidesBackButton]; } else { [window addSubview:passcode.view]; [self performSelector:@selector(responder) withObject:nil afterDelay:1]; } as a result, it will always go for the else option, which for some reason, doesn't get executed either. I assumed an error but the log is empty and there's no crash.

    Read the article

  • Name for method that takes a string value and returns DBNull.Value || string

    - by David Murdoch
    I got tired of writing the following code: /* Commenting out irrelevant parts public string MiddleName; public void Save(){ SqlCommand = new SqlCommand(); // blah blah...boring INSERT statement with params etc go here. */ if(MiddleName==null){ myCmd.Parameters.Add("@MiddleName", DBNull.Value); } else{ myCmd.Parameters.Add("@MiddleName", MiddleName); } /* // more boring code to save to DB. }*/ So, I wrote this: public static object DBNullValueorStringIfNotNull(string value) { object o; if (value == null) { o = DBNull.Value; } else { o = value; } return o; } // which would be called like: myCmd.Parameters.Add("@MiddleName", DBNullValueorStringIfNotNull(MiddleName)); If this is a good way to go about doing this then what would you suggest as the method name? DBNullValueorStringIfNotNull is a bit verbose and confusing. I'm also open to ways to alleviate this problem entirely. I'd LOVE to do this: myCmd.Parameters.Add("@MiddleName", MiddleName==null ? DBNull.Value : MiddleName); but that won't work. I've got C# 3.5 and SQL Server 2005 at my disposal if it matters.

    Read the article

  • C++ array initialization without assignment

    - by david
    This question is related to the post here. Is it possible to initialize an array without assigning it? For example, class foo's constructor wants an array of size 3, so I want to call foo( { 0, 0, 0 } ). I've tried this, and it does not work. I'd like to be able to initialize objects of type foo in other objects' constructor initialization lists. Is this possible?

    Read the article

  • Consolidating files in a single directory before you link them into the final executable

    - by David
    I am working on Solaris 10, Sun Studio 11. I am refactoring some old code, and trying to write unit tests for them. My make file looks like: my_model.o:my_model.cc CC -c my_model.cc -I/../../include -library=stlport4 -instances=extern unit_test: unit_test.o my_model.o symbol_dictionary.o CC -o unit_test unit_test.o my_model.o symbol_dictionary.o -I../../include \ -library=stlport4 -instances=extern unit_test.o: unit_test.cc CC -c unit_test.cc -I/../../include -library=stlport4 -instances=extern symbol_dictionary.o: cd ../../test-fixtures && ($MAKE) symbol_dictionary.o mv ../../test-fixtures/symbol_dictionary.o . In the ../../test-fixtures makefile, I have the following target: symbol_dictionary.o: CC -c symbol_dictionary.cc -I/../../include -library=stlport4 -instances=extern I do the instances=extern because I had linking problems before, and this was the recommended solution. The consequence is in each directory that is being compiled, a SunWS_Cache directory is created to store the template instances. This is the long way to get to this question. Is it a standard practice to consolidate object files in a single directory before you link them?

    Read the article

  • Aspect Oriented Programming vs List<IAction> To execute methods based on conditions

    - by David Robbins
    I'm new to AOP so bear with me. Consider the following scenario: A state machine is used in a workflow engine, and after the state of the application is changed, a series of commands are executed. Depending on the state, different types of commands should be executed. As I see it, one implementation is to create List<IAction> and have each individual action determine whether it should execute. Would a Aspect Oriented process work as well? That is, could you create an aspect that notifies a class when a property changes, and execute the appropriate processes from that class? Would this help centralize the state specific rules?

    Read the article

  • Indexes and multi column primary keys

    - by David Jenings
    Went searching and didn't find the answer to this specific noob question. My apologies if I missed it. In a MySQL database I have a table with the following primary key PRIMARY KEY id (invoice, item) In my application I will also frequently be selecting on "item" by itself and less frequently on only "invoice". I'm assuming I would benefit from indexes on these columns. MySQL does not complain when I define the following: INDEX (invoice), INDEX (item), PRIMARY KEY id (invoice, item) But I don't see any evidence (using DESCRIBE -- the only way I know how to look) that separate indexes have been established for these two columns. So the question is, are the columns that make up a primary key automatically indexed individually? Also, is there a better way than DESCRIBE to explore the structure of my table?

    Read the article

  • Exporting emails from outlook programtically with vba

    - by David
    I'm using this script to export email from outlook. My question is how do I export the body of the email without the html formatting ? Sub SaveItemsToExcel() On Error GoTo ErrorHandlerExit Dim oNameSpace As Outlook.NameSpace Dim oFolder As Outlook.MAPIFolder Dim objFS As Scripting.FileSystemObject Dim objOutputFile As Scripting.TextStream Set objFS = New Scripting.FileSystemObject Set objOutputFile = objFS.OpenTextFile("C:\Temp\Export.csv", ForWriting, True) Set oNameSpace = Application.GetNamespace("MAPI") Set oFolder = oNameSpace.PickFolder If oFolder Is Nothing Then GoTo ErrorHandlerExit End If If oFolder.DefaultItemType <> olMailItem Then MsgBox "Folder does not contain mail messages" GoTo ErrorHandlerExit End If objOutputFile.WriteLine "From,Subject,Recived, Body" ProcessFolderItems oFolder, objOutputFile objOutputFile.Close Set oFolder = Nothing Set oNameSpace = Nothing Set objOutputFile = Nothing Set objFS = Nothing ErrorHandlerExit: Exit Sub End Sub Sub ProcessFolderItems(oParentFolder As Outlook.MAPIFolder, ByRef objOutputFile As Scripting.TextStream) Dim oCount As Integer Dim oMail As Outlook.MailItem Dim oFolder As Outlook.MAPIFolder oCount = oParentFolder.Items.Count For Each oMail In oParentFolder.Items If oMail.Class = olMail Then objOutputFile.WriteLine oMail.SenderEmailAddress & "," & Replace(oMail.Subject, ",", "") & "," & oMail.ReceivedTime End If Next oMail Set oMail = Nothing If (oParentFolder.Folders.Count > 0) Then For Each oFolder In oParentFolder.Folders ProcessFolderItems oFolder, objOutputFile Next End If End Sub

    Read the article

  • GNU linker: alternative to --version-script to list exported symbols at the command line ?

    - by David Cournapeau
    On Linux with the GNU toolchain, I know how to control exported symbols from a shared library with a version script (gcc -Wl,--version-script=symbols.map), but I would like to list exported symbols on the command line instead. IOW, I would like the equivalent of link /EXPORT:foo from the MS toolchain. Is it possible ? EDIT: My question may not be very clearn: if I have a library libfoo.so, and I want to only export libraries foo1 and foo2, I can go create a version script foo.linux as follows libfoo.so { global: foo1; foo2; local: *; } And do gcc -shared foo.c -Wl,--version-script=foo.linux -o libfoo.so -soname libfoo.so I would like to be able to do something like this instead: gcc -shared foo.c -Wl,--export-symbol=foo1 -Wl,--export-symbol=foo2 -o libfoo.so -soname libfoo.so

    Read the article

  • Android: Defined array resource not found ?!

    - by David
    Hi, i have a strange (?) error in my android application. I have defined some arrays in values/arrays.xml the following way: <?xml version="1.0" encoding="utf-8"?> <resources> <array name="perimeter"> <item>10 miles</item> <item>20 miles</item> <item>30 miles</item> </array> <array name="regvalues"> <item>1</item> <item>2</item> <item>3</item> </array> </resources> Now I want to use them in a ListPreference for a PreferenceActivity (defined by an xml file). So i set android:entries="@array/perimeter" android:entryValues="@array/regvalues" for this ListPreference. When I try to use this on my device the app crashes. (NullPointer in Dialog.close()) If I try to use the regvalues-items as Entries for the ListPreference i get a NullPointer in ArrayAdapter.createViewFromResource(int, View, ViewGroup, int) line: 355 So there seems to be sth wrong with the regvalues array. But what ?!? Eclipse shows me no errors at compile time. So everything in the xml-file and java-code is written correctly and there are no typos. Where is the problem?!?

    Read the article

  • IE7 Problem with sIFR when <br> is inside an H3

    - by David Fox
    I have a problem I just discovered when viewing certain pages in IE7. If I have a very long header that wraps to a second line, or worse, if I put a BR in the middle, that throws off the spacing. One page to look at: broken example1 You'll notice that the margin at the top of the page gets offset as the headings are rendered, throwing everything off. I'm using code like this: <h3 style="margin:0"><a href="../books/msc1.html">Middle School Confidential™<br> Book 1: Be Confident in Who You Are</a></h3> but repeated many times to exaggerate the problem. I tried another test where I removed the BR and let the lines wrap naturally. This is an improvement in terms of the spacing, but it doesn't fix the problem. (Same URL but make it m1.html) In the third example, each heading takes up only one line (m2.html) One option would be to just split up the heading onto two lines, each with its on H tags. But since these are links, then it will appear that the first line might go to one place, and the second to another, since they wouldn't change color simultaneously as you roll over them. So, any solutions to this? I believe I have the current version of sIFR 3. I don't want to upgrade to IE8 until I know this is resolved. Thanks!

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >