Search Results

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

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

  • 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

  • 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

  • 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

  • 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

  • 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

  • How to create an entity with a composite primary key containing a generated value.

    - by David
    Using Hibernate + annotations, I'm trying to do the following: Two entities, Entity1 and Entity2. Entity1 contains a simple generated value primary key. Entity2 primary key is composed by a simple generated value + the id of entity one (with a many to one relationship) Unfortunately, I can't make it work. Here is an excerpt of the code: @Entity public class Entity1 { @Id @GeneratedValue private Long id; private String name; ... } @Entity public class Entity2 { @EmbeddedId private Entity2PK pk = new Entity2PK(); private String miscData; ... } @Embeddable public class Entity2PK implements Serializable { @GeneratedValue private Long id; @ManyToOne private Entity1 entity; } void test() { Entity1 e1 = new Entity1(); e1.setName("nameE1"); Entity2 e2 = new Entity2(); e2.setEntity1(e1); e2.setMiscData("test"); Transaction transaction = session.getTransaction(); try { transaction.begin(); session.save(e1); session.save(e2); transaction.commit(); } catch (Exception e) { transaction.rollback(); } finally { session.close(); } } When I run the test method I get the following errors: Hibernate: insert into Entity1 (id, name) values (null, ?) Hibernate: call identity() Hibernate: insert into Entity2 (miscData, entity_id, id) values (?, ?, ?) 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions WARNING: SQL Error: 0, SQLState: null 07-Jun-2010 10:51:11 org.hibernate.util.JDBCExceptionReporter logExceptions SEVERE: failed batch 07-Jun-2010 10:51:11 org.hibernate.event.def.AbstractFlushingEventListener performExecutions SEVERE: Could not synchronize database state with session org.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:254) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1001) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:339) at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106) at test.App.main(App.java:32) Caused by: java.sql.BatchUpdateException: failed batch at org.hsqldb.jdbc.jdbcStatement.executeBatch(Unknown Source) at org.hsqldb.jdbc.jdbcPreparedStatement.executeBatch(Unknown Source) at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:247) ... 8 more Note that I use HSQLDB. Any ideas about what is wrong ?

    Read the article

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