Search Results

Search found 4300 results on 172 pages for 'mark virtue'.

Page 61/172 | < Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >

  • How to terminate process using VBScript

    - by Mark
    Hi, I have this VBScript code to terminate one process Const strComputer = "." Dim objWMIService, colProcessList Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery("SELECT * FROM Win32_Process WHERE Name = 'Process.exe'") For Each objProcess in colProcessList objProcess.Terminate() Next it works fine with some processes, but when it comes to any process runs under SYSTEM, it can't stop it. Is there is anything I need to add to kill the process under SYSTEM? Thanks

    Read the article

  • Embedding mercurial revision information in Visual Studio c# projects automatically

    - by Mark Booth
    Original Problem In building our projects, I want the mercurial id of each repository to be embedded within the product(s) of that repository (the library, application or test application). I find it makes it so much easier to debug an application ebing run by custiomers 8 timezones away if you know precisely what went into building the particular version of the application they are using. As such, every project (application or library) in our systems implement a way of getting at the associated revision information. I also find it very useful to be able to see if an application has been compiled with clean (un-modified) changesets from the repository. 'Hg id' usefully appends a + to the changeset id when there are uncommitted changes in a repository, so this allows is to easily see if people are running a clean or a modified version of the code. My current solution is detailed below, and fulfills the basic requirements, but there are a number of problems with it. Current Solution At the moment, to each and every Visual Studio solution, I add the following "Pre-build event command line" commands: cd $(ProjectDir) HgID I also add an HgID.bat file to the Project directory: @echo off type HgId.pre > HgId.cs For /F "delims=" %%a in ('hg id') Do <nul >>HgID.cs set /p = @"%%a" echo ; >> HgId.cs echo } >> HgId.cs echo } >> HgId.cs along with an HgId.pre file, which is defined as: namespace My.Namespace { /// <summary> Auto generated Mercurial ID class. </summary> internal class HgID { /// <summary> Mercurial version ID [+ is modified] [Named branch]</summary> public const string Version = When I build my application, the pre-build event is triggered on all libraries, creating a new HgId.cs file (which is not kept under revision control) and causing the library to be re-compiled with with the new 'hg id' string in 'Version'. Problems with the current solution The main problem is that since the HgId.cs is re-created at each pre-build, every time we need to compile anything, all projects in the current solution are re-compiled. Since we want to be able to easily debug into our libraries, we usually keep many libraries referenced in our main application solution. This can result in build times which are significantly longer than I would like. Ideally I would like the libraries to compile only if the contents of the HgId.cs file has actually changed, as opposed to having been re-created with exactly the same contents. The second problem with this method is it's dependence on specific behaviour of the windows shell. I've already had to modify the batch file several times, since the original worked under XP but not Vista, the next version worked under Vista but not XP and finally I managed to make it work with both. Whether it will work with Windows 7 however is anyones guess and as time goes on, I see it more likely that contractors will expect to be able to build our apps on their Windows 7 boxen. Finally, I have an aesthetic problem with this solution, batch files and bodged together template files feel like the wrong way to do this. My actual questions How would you solve/how are you solving the problem I'm trying to solve? What better options are out there than what I'm currently doing? Rejected Solutions to these problems Before I implemented the current solution, I looked at Mercurials Keyword extension, since it seemed like the obvious solution. However the more I looked at it and read peoples opinions, the more that I came to the conclusion that it wasn't the right thing to do. I also remember the problems that keyword substitution has caused me in projects at previous companies (just the thought of ever having to use Source Safe again fills me with a feeling of dread *8'). Also, I don't particularly want to have to enable Mercurial extensions to get the build to complete. I want the solution to be self contained, so that it isn't easy for the application to be accidentally compiled without the embedded version information just because an extension isn't enabled or the right helper software hasn't been installed. I also thought of writing this in a better scripting language, one where I would only write HgId.cs file if the content had actually changed, but all of the options I could think of would require my co-workers, contractors and possibly customers to have to install software they might not otherwise want (for example cygwin). Any other options people can think of would be appreciated. Update Partial solution Having played around with it for a while, I've managed to get the HgId.bat file to only overwrite the HgId.cs file if it changes: @echo off type HgId.pre > HgId.cst For /F "delims=" %%a in ('hg id') Do <nul >>HgId.cst set /p = @"%%a" echo ; >> HgId.cst echo } >> HgId.cst echo } >> HgId.cst fc HgId.cs HgId.cst >NUL if %errorlevel%==0 goto :ok copy HgId.cst HgId.cs :ok del HgId.cst Problems with this solution Even though HgId.cs is no longer being re-created every time, Visual Studio still insists on compiling everything every time. I've tried looking for solutions and tried checking "Only build startup projects and dependencies on Run" in Tools|Options|Projects and Solutions|Build and Run but it makes no difference. The second problem also remains, and now I have no way to test if it will work with Vista, since that contractor is no longer with us. If anyone can test this batch file on a Windows 7 and/or Vista box, I would appreciate hearing how it went. Finally, my aesthetic problem with this solution, is even strnger than it was before, since the batch file is more complex and this there is now more to go wrong. If you can think of any better solution, I would love to hear about them.

    Read the article

  • Custom language - FOR loop in a clojure interpeter?

    - by Mark
    I have a basic interpreter in clojure. Now i need to implement for (initialisation; finish-test; loop-update) { statements } Implement a similar for-loop for the interpreted language. The pattern will be: (for variable-declarations end-test loop-update do statement) The variable-declarations will set up initial values for variables.The end-test returns a boolean, and the loop will end if end-test returns false. The statement is interpreted followed by the loop-update for each pass of the loop. Examples of use are: (run ’(for ((i 0)) (< i 10) (set i (+ 1 i)) do (println i))) (run ’(for ((i 0) (j 0)) (< i 10) (seq (set i (+ 1 i)) (set j (+ j (* 2 i)))) do (println j))) inside my interpreter. I will attach my interpreter code I got so far. Any help is appreciated. Interpreter (declare interpret make-env) ;; needed as language terms call out to 'interpret' (def do-trace false) ;; change to 'true' to show calls to 'interpret' ;; simple utilities (def third ; return third item in a list (fn [a-list] (second (rest a-list)))) (def fourth ; return fourth item in a list (fn [a-list] (third (rest a-list)))) (def run ; make it easy to test the interpreter (fn [e] (println "Processing: " e) (println "=> " (interpret e (make-env))))) ;; for the environment (def make-env (fn [] '())) (def add-var (fn [env var val] (cons (list var val) env))) (def lookup-var (fn [env var] (cond (empty? env) 'error (= (first (first env)) var) (second (first env)) :else (lookup-var (rest env) var)))) ;; for terms in language ;; -- define numbers (def is-number? (fn [expn] (number? expn))) (def interpret-number (fn [expn env] expn)) ;; -- define symbols (def is-symbol? (fn [expn] (symbol? expn))) (def interpret-symbol (fn [expn env] (lookup-var env expn))) ;; -- define boolean (def is-boolean? (fn [expn] (or (= expn 'true) (= expn 'false)))) (def interpret-boolean (fn [expn env] expn)) ;; -- define functions (def is-function? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'lambda (first expn))))) (def interpret-function ; keep function definitions as they are written (fn [expn env] expn)) ;; -- define addition (def is-plus? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '+ (first expn))))) (def interpret-plus (fn [expn env] (+ (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define subtraction (def is-minus? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '- (first expn))))) (def interpret-minus (fn [expn env] (- (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define multiplication (def is-times? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '* (first expn))))) (def interpret-times (fn [expn env] (* (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define division (def is-divides? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '/ (first expn))))) (def interpret-divides (fn [expn env] (/ (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define equals test (def is-equals? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '= (first expn))))) (def interpret-equals (fn [expn env] (= (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define greater-than test (def is-greater-than? (fn [expn] (and (list? expn) (= 3 (count expn)) (= '> (first expn))))) (def interpret-greater-than (fn [expn env] (> (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define not (def is-not? (fn [expn] (and (list? expn) (= 2 (count expn)) (= 'not (first expn))))) (def interpret-not (fn [expn env] (not (interpret (second expn) env)))) ;; -- define or (def is-or? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'or (first expn))))) (def interpret-or (fn [expn env] (or (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define and (def is-and? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'and (first expn))))) (def interpret-and (fn [expn env] (and (interpret (second expn) env) (interpret (third expn) env)))) ;; -- define print (def is-print? (fn [expn] (and (list? expn) (= 2 (count expn)) (= 'println (first expn))))) (def interpret-print (fn [expn env] (println (interpret (second expn) env)))) ;; -- define with (def is-with? (fn [expn] (and (list? expn) (= 3 (count expn)) (= 'with (first expn))))) (def interpret-with (fn [expn env] (interpret (third expn) (add-var env (first (second expn)) (interpret (second (second expn)) env))))) ;; -- define if (def is-if? (fn [expn] (and (list? expn) (= 4 (count expn)) (= 'if (first expn))))) (def interpret-if (fn [expn env] (cond (interpret (second expn) env) (interpret (third expn) env) :else (interpret (fourth expn) env)))) ;; -- define function-application (def is-function-application? (fn [expn env] (and (list? expn) (= 2 (count expn)) (is-function? (interpret (first expn) env))))) (def interpret-function-application (fn [expn env] (let [function (interpret (first expn) env)] (interpret (third function) (add-var env (first (second function)) (interpret (second expn) env)))))) ;; the interpreter itself (def interpret (fn [expn env] (cond do-trace (println "Interpret is processing: " expn)) (cond ; basic values (is-number? expn) (interpret-number expn env) (is-symbol? expn) (interpret-symbol expn env) (is-boolean? expn) (interpret-boolean expn env) (is-function? expn) (interpret-function expn env) ; built-in functions (is-plus? expn) (interpret-plus expn env) (is-minus? expn) (interpret-minus expn env) (is-times? expn) (interpret-times expn env) (is-divides? expn) (interpret-divides expn env) (is-equals? expn) (interpret-equals expn env) (is-greater-than? expn) (interpret-greater-than expn env) (is-not? expn) (interpret-not expn env) (is-or? expn) (interpret-or expn env) (is-and? expn) (interpret-and expn env) (is-print? expn) (interpret-print expn env) ; special syntax (is-with? expn) (interpret-with expn env) (is-if? expn) (interpret-if expn env) ; functions (is-function-application? expn env) (interpret-function-application expn env) :else 'error))) ;; tests of using environment (println "Environment tests:") (println (add-var (make-env) 'x 1)) (println (add-var (add-var (add-var (make-env) 'x 1) 'y 2) 'x 3)) (println (lookup-var '() 'x)) (println (lookup-var '((x 1)) 'x)) (println (lookup-var '((x 1) (y 2)) 'x)) (println (lookup-var '((x 1) (y 2)) 'y)) (println (lookup-var '((x 3) (y 2) (x 1)) 'x)) ;; examples of using interpreter (println "Interpreter examples:") (run '1) (run '2) (run '(+ 1 2)) (run '(/ (* (+ 4 5) (- 2 4)) 2)) (run '(with (x 1) x)) (run '(with (x 1) (with (y 2) (+ x y)))) (run '(with (x (+ 2 4)) x)) (run 'false) (run '(not false)) (run '(with (x true) (with (y false) (or x y)))) (run '(or (= 3 4) (> 4 3))) (run '(with (x 1) (if (= x 1) 2 3))) (run '(with (x 2) (if (= x 1) 2 3))) (run '((lambda (n) (* 2 n)) 4)) (run '(with (double (lambda (n) (* 2 n))) (double 4))) (run '(with (sum-to (lambda (n) (if (= n 0) 0 (+ n (sum-to (- n 1)))))) (sum-to 100))) (run '(with (x 1) (with (f (lambda (n) (+ n x))) (with (x 2) (println (f 3))))))

    Read the article

  • Visual Studio massive renaming of controls in WPF project

    - by Mark
    I have a scene in my WPF project with about 2000 different user controls: <local:MyControlType x:name="aaka4sn9f" /> <local:MyControlType x:name="aaks22nf_1" /> <local:MyControlType x:name="aa66s2f_2" /> and so on down the screen... Is there a way to rename all of these controls using Visual Studio (and possibly a regex) to be: <local:MyControlType x:name="myControl1" /> <local:MyControlType x:name="myControl2" /> <local:MyControlType x:name="myControl3" /> ?? Thanks a lot!

    Read the article

  • Left with extra UITableViewCell after re-ordering

    - by Mark F
    After going into Edit mode, moving a cell, and leaving edit mode, i am left with one extra cell sitting on top of its duplicate cell while still in edit mode. The problem has to be somewhere in here: - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath { NSMutableArray *array = [[fetchedResultsController fetchedObjects] mutableCopy]; id objectToMove = [[array objectAtIndex:sourceIndexPath.row] retain]; [array removeObjectAtIndex:sourceIndexPath.row]; [array insertObject:objectToMove atIndex:destinationIndexPath.row]; [objectToMove release]; for (int i=0; i<[array count]; i++) { [(NSManagedObject *)[array objectAtIndex:i] setValue:[NSNumber numberWithInt:i] forKey:@"userOrder"]; } [array release]; } Any guidance greatly appreciated!

    Read the article

  • Muliple Foreground Colors in Powershell in One Command.

    - by Mark Tomlin
    I want to output many different foreground colors with one statement. PS C:\> Write-Host "Red" -ForegroundColor Red Red This output is red. PS C:\> Write-Host "Blue" -ForegroundColor Blue Blue This output is blue. PS C:\> Write-Host "Red", "Blue" -ForegroundColor Red, Blue Red Blue This output is magenta, but I want the color to be Red for the word red, and blue for the word blue via the one command. How can I do that?

    Read the article

  • GWT now has spring roo support, what will this mean to GWT developers?

    - by Mark M
    I have been using GWT with App Engine for a while now. Recently there was an announcement that GWT will support Spring Roo and SpringSource Tool Suite (http://googlewebtoolkit.blogspot.com/2010/05/gwt-21-milestone-1-is-now-available.html). I am having trouble seeing the big picture from the Google announcement page. For those without much knowledge of Spring what does this mean for GWT developers used to building swing-like gui's?

    Read the article

  • SQLAlchemy - select for update example

    - by Mark
    I'm looking for a complete example of using select for update in SQLAlchemy, but haven't found one googling. I need to lock a single row and update a column, the following code doesn't work (blocks forever): s = table.select(table.c.user=="test",for_update=True) u = table.update().where(table.c.user=="test") u.execute(email="foo") Do I need a commit? How do I do that? As far as I know you need to: begin transaction select ... for update update commit

    Read the article

  • Storing year/make/model in a database?

    - by Mark
    Here's what I'm thinking (excuse the Django format): class VehicleMake(Model): name = CharField(max_length=50) class VehicleModel(Model): make = ForeignKey(VehicleMake) name = CharField(max_length=50) class VehicleYear(Model): model = ForeignKey(VehicleModel) year = PositiveIntegerField() This is going to be used in those contingent drop-down select boxes, which would visually be laid out like [- Year -][- Make -][- Model -]. So, to query the data I need I would first have to select all distinct years from the years table, sorted descending. Then I'd find all the vehicle makes that have produced a model in that year. And then all the models by that make in that year. Is this a good way to do it, or should I re-arrange the foreign keys somehow? Or use a many-to-many table for the years/models so that no year is repeated?

    Read the article

  • Netbeans 7.2 won't open on OS X

    - by Mark van Wyk
    I installed Netbeans on OSX Mountain Lion running JDK 7. Everything was working fine. Then my machine for no reason crashed. After this I could no longer open Netbeans anymore. If I try to start Netbeans from the commandline: /Applications/NetBeans/NetBeans 7.2.app/Contents/MacOS/netbeans Then it works fine. From there I can select Netbeans About and confirm that my userdir and cachedir is: User directory: /Users/<user>/Library/Application Support/NetBeans/7.2 Cache directory: /Users/<user>/Library/Caches/NetBeans/7.2 So, I deleted these directories and tried again, but alas, I can only start netbeans via the commandline. Ideas appreciated...

    Read the article

  • Smart Client Guidance = Prism? Vs 2010

    - by mark smith
    Hi there, I have found this link http://smartclient.codeplex.com/ which has some updates for vs 2010 .... I don't know but i always seem to get confused i.e. lack of documentation etc..... but is this the same as Prism?? If not can anyone tell me where the differences are... It appears to be a link for designing smartclient so i presume its composite Or am i wrong? If i am indeed wrong, where is the link to prism and the vs 2010 templates? Any help would be really appreciated

    Read the article

  • dealloc on Background Thread

    - by Mark Brackett
    Is it an error to call dealloc on a UIViewController from a background thread? It seems that UITextView (can?) eventually call _WebTryThreadLock which results in: bool _WebTryThreadLock(bool): Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Background: I have a subclassed NSOperation that takes a selector and a target object to notify. -(id)initWithTarget:(id)target { if (self = [super init]) { _target = [target retain]; } return self; } -(void)dealloc { [_target release]; [super dealloc]; } If the UIViewController has already been dismissed when the NSOperation gets around to running, then the call to release triggers it's dealloc on a background thread.

    Read the article

  • opening transaction validation in vb.net

    - by Mark
    Can anyone help me on how can I validate transaction example: transaction = mySqlConn.BeginTransaction(IsolationLevel.ReadCommitted) If there's still an opened transaction, then the code above will ignore.. How do I know if there was a transaction not yet committed before opening new transaction to avoid Nested Transaction?

    Read the article

  • Output Parameter Not Returned

    - by Mark Plumpton
    Why does this script return a pair of nulls? I'm using SQL Server 2008, script run in MSSMS. CREATE PROCEDURE proc_Test ( @Input int, @Out1 int OUTPUT, @Out2 varchar(10) OUTPUT ) AS BEGIN SET NOCOUNT OFF SET @Out1 = 100 + @Input SET @Out2 = 'result=' + CONVERT(varchar,@Out1) RETURN END GO DECLARE @Out1 int, @Out2 varchar(10) exec proc_Test @Input=1, @Out1=@Out1, @Out2=@Out2 select @Out1, @Out2

    Read the article

  • Embedded Windows Media Player background image

    - by Mark
    Hi all, I'm loading an external video stream in my embedded player. Since it takes a little while to connect and preload you see a black background for +- 7 secs untill video plays . I would like to know if its possible to have a background image saying 'Stand by loading video' with my logo on it before the video starts to play. Only thing i could find was bgcolor parameter but that's not what I want. I hope someone can help me thanks!!

    Read the article

  • Python - store output of subprocess() call in a string

    - by Mark
    Hey all, I'm trying to make a system call in Python and store the output to a string that I can manipulate in the Python program. #!/usr/bin/python import subprocess p = subprocess.Popen("pwd") # edit - actual command I want to store output of p2 = subprocess.Popen("ntpq -p") I've tried a few things including some of the suggestions here: http://stackoverflow.com/questions/1996518/retrieving-the-output-of-subprocess-call but without any luck. Many thanks!

    Read the article

  • Python: Get items at depth? (set library?)

    - by Mark
    I have a nested list something like this: PLACES = ( ('CA', 'Canada', ( ('AB', 'Alberta'), ('BC', 'British Columbia' ( ('van', 'Vancouver'), ), ... )), ('US', 'United States', ( ('AL', 'Alabama'), ('AK', 'Alaska'), ... I need to retrieve some data out of it. If depth is 0 I need to retrieve all the countries (and their codes), if depth == 1, I need to retrieve all the states/provinces, if depth == 2 I need to retrieve all the cities... and so forth. Is there some set library for doing stuff like this? Or can someone point me in the right direction? I started coding up a solution only to realize it wouldn't work for levels deeper than 1 because you have to go in and out of each list...

    Read the article

  • How do people handle working with Code Names for their projects?

    - by Mark
    Hi All, Recently we started using some code names for several different types of prototype applications all following a theme. This made things a little more fun and was a great idea. The problem is that Im not too sure how people deal with migrating a codebase from "codename" state into version 1.0 state which may have a proper name... not something that a client really shouldnt see :) We are using Visual Studio at the moment, and I can see that you can change the assembly name, but there are references to the namespaces, etc... that would really be a large change to make. Do people both changing things like namespaces before the v1.0 release?

    Read the article

  • EOF of excel in vb6

    - by Mark
    how do i write the code in vb6 in finding the EOF of excel file can anyone help me? i try to code this and it works.. --- Dim excelApp as Excel.Application Dim excelWB as Excel.Workbook Set excelApp = New Excel.Application Set excelWB = excelApp.Workbooks.Open("D:\Book1.xls") Dim xlsRow as Long Dim EOF as Boolean xlsRow = 1 Do While (EOF = False) If (excelWB.Sheets("Sheet1").Cells(xlsRow, 1).Value = "") Then EOF = True Else xlsRow = xlsRow + 1 End If Loop <--- this code is working, but the only problem is only the column 1 will be checked and the others is not. Can anyone help me on how to improve this code to check all rows and column of excel cells.

    Read the article

  • postgresql syntax while exists loop

    - by veilig
    I'm working at function from Joe Celkos book - Trees and Hierarchies in SQL for Smarties I'm trying to delete a subtree from an adjacency list but part my function is not working yet. WHILE EXISTS –– mark leaf nodes (SELECT * FROM OrgChart WHERE boss_emp_nbr = -99999 AND emp_nbr > -99999) LOOP –– get list of next level subordinates DELETE FROM WorkingTable; INSERT INTO WorkingTable SELECT emp_nbr FROM OrgChart WHERE boss_emp_nbr = -99999; –– mark next level of subordinates UPDATE OrgChart SET emp_nbr = -99999 WHERE boss_emp_nbr IN (SELECT emp_nbr FROM WorkingTable); END LOOP; my question: is the WHILE EXISTS correct for use w/ postgresql? I appear to be stumbling and getting caught in an infinite loop in this part. Perhaps there is a more correct syntax I am unaware of.

    Read the article

< Previous Page | 57 58 59 60 61 62 63 64 65 66 67 68  | Next Page >