Search Results

Search found 2008 results on 81 pages for 'greg smith'.

Page 39/81 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Piping a bash variable into awk and storing the output

    - by Andrew Smith
    Hello, To illustrate my problem, TEST="Hi my name is John" OUTP=`echo $TEST | awk '{print $3}'` echo $OUTP What I would expect this to do is pass the $TEST variable into awk and store the 3rd word into $OUTP. Instead I get "Hi: not found", as if it is expecting the input to be a file. If I pass just a string instead of a variable, however, there is no problem. What would be the best way to approach this? Thanks all!

    Read the article

  • BackgroundWorker vs background Thread

    - by freddy smith
    I have a stylistic question about the choice of background thread implementation I should use on a windows form app. Currently I have a BackgroundWorker on a form that has an infinite (while(true)) loop. In this loop I use WaitHandle.WaitAny to keep the thread snoozing until something of interest happens. One of the event handles I wait on is a "stopthread" event so that I can break out of the loop. This event is signaled when from my overridden Form.Dispose(). I read somewhere that BackgroundWorker is really intended for operations that you dont want to tie up the UI with and have an finite end - like downloading a file, or processing a sequence of items. In this case the "end" is unknown and only when the window is closed. Therefore would it be more appropriate for me to use a background Thread instead of BackgroundWorker for this purpose?

    Read the article

  • Throwing exception vs returning null value with switch statement

    - by Greg
    So I have function that formats a date to coerce to given enum DateType{CURRENT, START, END} what would be the best way to handling return value with cases that use switch statement public static String format(Date date, DateType datetype) { ..validation checks switch(datetype){ case CURRENT:{ return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss"); } ... default:throw new ("Something strange happend"); } } OR throw excpetion at the end public static String format(Date date, DateType datetype) { ..validation checks switch(datetype){ case CURRENT:{ return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss"); } ... } //It will never reach here, just to make compiler happy throw new IllegalArgumentException("Something strange happend"); } OR return null public static String format(Date date, DateType datetype) { ..validation checks switch(datetype){ case CURRENT:{ return getFormattedDate(date, "yyyy-MM-dd hh:mm:ss"); } ... } return null; } What would be the best practice here ? Also all the enum values will be handled in the case statement

    Read the article

  • Why is WPO(whole-program optimization) not doing any improvements in my program size? (FPC 2.4.0)

    - by Gregory Smith
    I use FPC 2.4.0 for WinXP(binary from the official page), also tryed with same version but compiled from source on my comp. I put something like this: I:\pascal\fpc-2.4.0.source\fpc-2.4.0\compiler\ppc386 -FWserver-1.wpo -OWsymbolliveness -CX -XX -Xs- -al -Os -oServer1.o Server I:\pascal\fpc-2.4.0.source\fpc-2.4.0\compiler\ppc386 -FWserver-2.wpo -OWsymbolliveness -Fwserver-1.wpo -Owsymbolliveness -CX -XX -Xs- -al -Os -oServer2.o Server ..(up to 100 times) but always same .wpo files, and same .o sizes(.s, assembly files change intermittently) I also not(through compiler messages), that not used variables are still alive. Also tryed -OWall -owall What am i doing wrong?

    Read the article

  • How to get the changes on a branch in git

    - by Greg Hewgill
    What is the best way to get a log of commits on a branch since the time it was branched from the current branch? My solution so far is: git log $(git merge-base HEAD branch)..branch The documentation for git-diff indicates that "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B". On the other hand, the documentation for git-rev-parse indicates that "r1...r2" is defined as "r1 r2 --not $(git merge-base --all r1 r2)". Why are these different? Note that "git diff HEAD...branch" gives me the diffs I want, but the corresponding git log command gives me more than what I want. In pictures, suppose this: x---y---z---branch / ---a---b---c---d---e---HEAD I would like to get a log containing commits x, y, z. "git diff HEAD...branch" gives these commits. However, "git log HEAD...branch" gives x, y, z, c, d, e.

    Read the article

  • How do i make my text wrap in a <div> with a large border radius

    - by Greg Guida
    in the following code <html> <body> <div style="height:400px; width:400px; -moz-border-radius:100px; -webkit-border-radius:100px; border:3px solid #500; background-color:#a00; overflow:hidden;"> Why is this getting cut at the beginning??? </div> </body> </html> Why isn't the browser wrapping the text around the rounded corners. In webkit browsers(i tested both chrome and safari) the overflow hidden cuts the text outside the border. Firefox just renders text outside the border. I also tried this without overflow:hidden; but again the text just rendered outside the border.

    Read the article

  • MVVM-Light: The target "RunCodeAnalysis" does not exist in the project when i do build??

    - by mark smith
    Hi there, Just built myself a mvvmlight app and if i press f5 TO COMPILE and run all works ok, it displays the wpf window but if i do a BUILD i get an error Error 1 The target "RunCodeAnalysis" does not exist in the project. I am using the visual studio 2010 professional version RTM The only thing i see strange is the target framework which is set to .NET framework 4 client profile Anybody know why this happens??

    Read the article

  • On Ubuntu, how do you install a newer version of python and keep the older python version?

    - by Trevor Boyd Smith
    Background: I am using Ubuntu The newer python version is not in the apt-get repository (or synaptic) I plan on keeping the old version as the default python when you call "python" from the command line I plan on calling the new python using pythonX.X (X.X is the new version). Given the background, how do you install a newer version of python and keep the older python version? I have downloaded from python.org the "install from source" *.tgz package. The readme is pretty simple and says "execute three commands: ./configure; make; make test; sudo make install;" If I do the above commands, will the installation overwrite the old version of python I have (I definitely need the old version)?

    Read the article

  • "Look" of page changes a bit after uploading it to IIS - looks good on computer same IE8

    - by J Smith
    No it's not a path issue...or else the site won't have a design. The website looks fine if I open it with IE8 in my computer. But after I upload it to IIS 6.0 two things change on positioning. I see a rendering problem. But if I open it with IE 8.0 on my machine it looks good, but opening it when uploaded to IIS , it changes a bit. Same exact files. Same browser, same computer. The only different thing is that it has been uploaded to IIS. IT has no programming in aspx whatsoever just .html .css and .js

    Read the article

  • .net 4.0 concurrent queue dictionary

    - by freddy smith
    I would like to use the new concurrent collections in .NET 4.0 to solve the following problem. The basic data structure I want to have is a producer consumer queue, there will be a single consumer and multiple producers. There are items of type A,B,C,D,E that will be added to this queue. Items of type A,B,C are added to the queue in the normal manner and processed in order. However items of type D or E can only exist in the queue zero or once. If one of these is to be added and there already exists another of the same type that has not yet been processed then this should update that other one in-place in the queue. The queue position would not change (i.e. would not go to the back of the queue) after the update. Which .NET 4.0 classes would be best for this?

    Read the article

  • Sync Framework: SqlSyncProvider ItemConflicting vs ApplyChangeFailed

    - by Paul Smith
    I'm trying to use design a syncronisation application that syncs changes between different SQL Server databases. I came up with a design based around receiving the ItemConflicting event, storing the knowledge associated with the conflict, and resolving all conflicts off-line. However, it seems that I can only get the ApplyChangeFailed event to fire. Is there some reason why SqlSyncProvider does not use the ItemConflicting event? Am I just hooking up to the event wrongly? The reason I care is that the ItemConlficting event allows me to simply log the conflict and continue with the rest of the synchronisation in a way that I can't seem to achieve with the ApplychangeFailed event.

    Read the article

  • Switching AM/PM in ASP.NET AJAX MaskedEdit localization

    - by Greg
    The sample page for the MaskedEdit says "Tip: Type 'A' or 'P' to switch AM/PM". Are these keys hardcoded? Does the control automatically change itself for cultures that use 12-hour designators that don't start with A or P? Or is just broken for those? example: Arabic (Saudi Arabia) - AM: ? Arabic (Saudi Arabia) - PM: ? Chinese (Taiwan) - AM: ?? Chinese (Taiwan) - PM: ?? Greek (Greece) - AM: pµ Greek (Greece) - PM: µµ Korean (Korea) - AM: ?? Korean (Korea) - PM: ?? Albanian (Albania) - AM: PD Albanian (Albania) - PM: MD Persian (Iran) - AM: ?.? Persian (Iran) - PM: ?.? Vietnamese (Vietnam) - AM: SA Vietnamese (Vietnam) - PM: CH Afrikaans (South Africa) - PM: nm Punjabi (India) - AM: ????? Punjabi (India) - PM: ??? Syriac (Syria) - AM: ?.? Syriac (Syria) - PM: ?.? If this control doesn't handle this situation, does anyone know of a control that does?

    Read the article

  • How to request device token on iphone

    - by Greg
    Hello, I am able to use the didRegisterForRemoteNotificationWithDeviceToken callback method to get the device token of my iphone when subscribing to push notifications. My question is how can I get this token again a later time? When a user subscribes to something in my application, I want to send the device token and the id of the item they are subscribing to...but I can't figure out where to get the device token from. I tried using the uniqueIdentifer from the UIDevice class but this value is different than what the original token was. I supposed I could call registerForRemoteNotificationTypes each time my app starts to produce the token. But if I do that, I'm not sure how I can access this value from a different class (my didRegisterForRemoteNotificationWithDeviceToken callback is located in the main application delegate). Thanks for any help for an objective C newbie!

    Read the article

  • Visual Studio Question: When doing a compile/debug is VS suppose to delete existing files in the bin

    - by Greg
    Hi, Q1 - When doing a compile/debug is VS suppose to delete existing files in the bin\debug area? (for VS2008) if no then can I ask please: Q2 - My winforms checks for existance of a sqlite.db3 file and creates it if it needs to (programmatically). If the behavior I wanted was that each Compile/Debug I do is for the target Debug area to be clear, so that the program would exercise the code that builds the database file, how would I organise this? thanks

    Read the article

  • .NET: Allow NULLS in DB fields?

    - by mark smith
    Hi there, I have the task of re-factoring an SQLServer DB.... A lot of the tables and columns "ALLOW NULLS", Is this good practice... I seem to remember the authour of CSLA.NET saying it was really bad practice to allow nulls in a DB... If this is the case, what are my alternatives? Remove all "ALLOW NULLS" from all columns.... and in numeric columns use a value of -1 for example?? I would really appreciate any input anyone has. I am currently using a Model (from entity framework) from my DB and the db columns that "ALLOW NULLS" are null ... and some of the stored procedures require that i have a default value... i.e. BOOLEAN require FALSE as default ... but it is null.. Well i don't want to stray from my original question, ALLOW NULLS are a bad thing from what i can gather .... so how do i fix this ? Any help really appreciated

    Read the article

  • How do I override generic activerecord error messages in ruby-on-rails?

    - by David Smith
    In my en.yml translation file, I have: activerecord: errors: template: header: one: "1 error prohibited this {{model}} from being saved" other: "{{count}} errors prohibited this {{model}} from being saved" When an activerecord/validation error occurs during logging into my application, the error message: "1 error prohibited this user session from being saved" is displayed (where user_session is the model being used). I'd rather have it say something like "An error has occured to prevent you from logging into your account". How do I override the generic error message with my specific one?

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >