Search Results

Search found 6376 results on 256 pages for 'launch condition'.

Page 44/256 | < Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >

  • "// ..." comments at end of code block after } - good or bad?

    - by gablin
    I've often seen such comments be used: function foo() { ... } // foo while (...) { ... } // while if (...) { ... } // if and sometimes even as far as if (condition) { ... } // if (condition) I've never understood this practice and thus never applied it. If your code is so long that you need to know what this ending } is then perhaps you should consider splitting it up into separate functions. Also, most developers tools are able to jump to the matching bracket. And finally the last is, for me, a clear violation to the DRY principle; if you change the condition you would have to remember to change the comment as well (or else it could get messy for the maintainer, or even for you). So why do people use this? Should we use it, or is it bad practice?

    Read the article

  • "// ..." comments at end of code block after } - good or bad?

    - by gablin
    I've often seen such comments be used: function foo() { ... } // foo while (...) { ... } // while if (...) { ... } // if and sometimes even as far as if (condition) { ... } // if (condition) I've never understood this practice and thus never applied it. If your code is so long that you need to know what this ending } is then perhaps you should consider splitting it up into separate functions. Also, most developers tools are able to jump to the matching bracket. And finally the last is, for me, a clear violation to the DRY principle; if you change the condition you would have to remember to change the comment as well (or else it could get messy for the maintainer, or even for you). So why do people use this? Should we use it, or is it bad practice?

    Read the article

  • How to rename an existing Grails application

    - by Johan Pelgrim
    Hi there, Does anybody know how to (easily) "rename" an existing grails application? I'm running into this because my PaaS provider does not allow me to delete a subscription... So I want to deploy my application under a different name. Of course, I can do this manually, but I think it might be a useful 'top-level' script (i.e. "grails rename-app newappname") Manual hints: When I do a "grails create-app myappname" I can see the myappname exists in the following files (and filenames)... Of course this is done by the create-app script, which replaces @...@ tokens in the template. I guess once they are replaced, it's not trivial to do a rename. ./.project: <name>myappname</name> ./application.properties:app.name=myappname ./build.xml:<project xmlns:ivy="antlib:org.apache.ivy.ant" name="myappname" default="test"> ./ivy.xml: <info organisation="org.example" module="myappname"/> ./myappname-test.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/> ./myappname.launch:<listEntry value="/myappname"/> ./myappname.launch:<listEntry value="<?xml version="1.0" encoding="UTF-8"?> <runtimeClasspathEntry containerPath="org.eclipse.jdt.launching.JRE_CONTAINER" javaProject="myappname" path="1" type="4"/> "/> ./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="myappname"/> ./myappname.launch:<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dbase.dir="${project_loc:myappname}" -Dserver.port=8080 -Dgrails.env=development"/> ./myappname.tmproj: <string>myappname.launch</string> And of course... the top-level directory name is "myappname" Any hints, or information about ongoing initiatives in this area are welcome Greetz, Johan

    Read the article

  • Visual Studio: How to attach a debugger dynamically to a specific process

    - by Jeff Cyr
    I am building an internal dev tool to manage different processes commonly used in our development environment. The tool show the list the monitored processes, indicate their running state and allow to start or stop each process. I'd like to add the functionality of attaching a debugger to a monitored process from my tool instead of going in 'Debug-Attach to process' in visual studio and finding the process. My goal is to have something like Debugger.Launch() that would show a list of the available visual studio. I can't use Debugger.Launch() because it lauches the debugger on the process that make the call. I would need something like Debugger.Launch(processId). Does anyone know how to acheive this functionality? A solution could be to implement a command in each monitored process to call Debugger.Launch() when the command is received from the monitoring tool, but I would prefer something that does not require to modify the code of the monitored processes. Side question: When using Debugger.Launch(), instances of Visual Studio that already have a debugger attached are not listed. Visual Studio is not limited to one attached debugger, you can attach on multiple process when using 'Debug - Attach to process'. Anyone know how to bypass this limitation when using Debugger.Launch() or an alternative?

    Read the article

  • Japan Welcomes Oracle Enterprise Manager 12c

    - by Anand Akela
    Following Oracle’s grand unveiling of Oracle Enterprise Manager 12c at Oracle OpenWorld 2011 in San Francisco, Oracle Japan just completed their launch for the product. Leng Tan, Oracle VP of Products, delivered the keynote with collaboration from a number of key partners in the region. From left to right: Leng Tan, VP of Products, Oracle; Shinyashiki-san, Assistant General Manager, NEC; Fuketa-san, General Manager, HITACHI; Fujii-san, General Manager, Fujitsu; Misawa-san, VP of Alliances, Oracle Japan NEC, Hitachi and Fujitsu have been among Oracle’s most active partners in the Japan region. They have received key awards from Oracle Japan for their efforts. NEC received the partner of the year award for 2010 and 2011. Hitachi received the partner of the year award for Oracle Enterprise Manager in 2011. Fujitsu received awards in the areas of Database and Oracle Exadata in 2011. All three partners were active participants in Oracle Enterprise Manager 12c beta program. According to Hirai-san, the technical lead at the event, there were over 200 attendees. “The event was so well-attended; there was no room to stand.” Said Hirai-san. Hirai-san demonstrating Oracle Enterprise Manager 12c at the Oracle Japan launch Here’s the highlight of the presentations made by the Oracle partners during this launch. NEC has developed an Oracle Enterprise Manager Plug-in for iStorage (NEC SAN Storage product). Additionally, NEC’s WebSAM Invariant Analyzer management tool is now capable of integrating with Oracle Enterprise Manager HITACHI demonstrated monitoring capabilities for Oracle Exadata through Oracle Enterprise Manager in their JP1 system management tool Fujitsu’s Oracle Enterprise Manager 10g adapter for their SystemWalker tool has now been enhanced to work with Oracle Enterprise Manager 12c. Following a very successful launch in Japan, Oracle’s Total Cloud Control road show and additional Oracle Enterprise Manager 12c launches continue in the EMEA and Asia Pacific regions. This week Sushil Kumar, VP of Product Strategy and Business Development is scheduled to deliver the keynotes at several cities in India. Also this week, Richard Sarwal, SVP of Products, is scheduled to deliver a keynote at the DOAG conference in Nuremburg, Germany. Richard is also delivering the Oracle Enterprise Manger 12c launch event keynote in Paris on November 18th. Check out our event schedule for Oracle Enterprise Manager 12c events across the globe! For more information, please go to Oracle Enterprise Manager  web page or  follow us at :  Twitter   Facebook YouTube Linkedin

    Read the article

  • Alpha plugin in GStreamer not working

    - by Miguel Escriva
    Hi! I'm trying to compose two videos, and I'm using the alpha plug-in to make the white color transparent. To test the alpha plug-in I'm creating the pipeline with gst-launch. The first test I done was: gst-launch videotestsrc pattern=smpte75 \ ! alpha method=custom target-r=255 target-g=255 target-b=255 angle=10 \ ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink \ videotestsrc pattern=snow ! mixer. and it works great! Then I created two videos with those lines: gst-launch videotestsrc pattern=snow ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=snow.ogv gst-launch videotestsrc pattern=smpte75 ! ffmpegcolorspace ! theoraenc ! oggmux ! filesink location=bars75.ogv And changed the videotestsrc to a filesrc and it continues working gst-launch filesrc location=bars75.ogv ! decodebin2 \ ! alpha method=custom target-r=255 target-g=255 target-b=255 angle=10 \ ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink \ filesrc location=snow.ogv ! decodebin2 ! alpha ! mixer. But, when I use the ideo I want to compose, I'm not able to make the white color transparent gst-launch filesrc location=video.ogv ! decodebin2 \ ! alpha method=custom target-r=255 target-g=255 target-b=255 angle=10 \ ! videomixer name=mixer ! ffmpegcolorspace ! autovideosink \ filesrc location=snow.ogv ! decodebin2 ! alpha ! mixer. Can you help me? Any idea what is happening? I'm using GStreamer 0.10.28 You can download the test videos from here: http://polimedia.upv.es/pub/gst/gst.zip Thanks in advance, Miguel Escriva

    Read the article

  • Using foreach loop.

    - by Harikrishna
    I break the code of the for loop without using break like I have for loop given below.And when i is 1 or 2 or 3 or any else but if condition is true then loop will be terminated because i will be 5 if the condition is true.And so NO need of break is needed there.Beacause I do not want to use break.I have done like this here.It works. bool myCondition=false; for(int i=0;i<5;i++) { if(myCondition) { i=5; } } But now I want to use foreach loop and in this loop when some condition is true then I want to break the foreach loop code.So what should I do here for breaking the foreach loop code without using break ? Like in the above for loop I have initialize i to 5 when condition is true.In the foreach loop anything like that to do to avoid break.

    Read the article

  • MySQL REGEXP: matching blank entries

    - by Erwin Paglinawan
    Hi, I have this SQL condition that is supposed to retrieve all rows that satisfy the given regexp condition: country REGEXP ('^(USA|Italy|France)$') However, I need to add a pattern for retrieving all blank country values. Currently I am using this condition country REGEXP ('^(USA|Italy|France)$') OR country = "" How can achieve the same effect without having to include the OR clause? Thanks, Erwin

    Read the article

  • An INSERT conditioned on COUNT

    - by Anders Feder
    How can I construct a MySQL INSERT query that only executes if the number of rows satisfying some condition already in the table is less than 20, and fails otherwise? That is, if the table has 18 rows satisfying the condition, then the INSERT should proceed. If the table has 23 rows satisfying the condition, then the INSERT should fail. For atomicity, I need to express this in a single query, so two requests can not INSERT at the same time, each in the 'belief' that only 19 rows satisfy the condition. Thank you.

    Read the article

  • How do I improve the efficiency of the queries executed by this generic Linq-to-SQL data access clas

    - by Lee D
    Hi all, I have a class which provides generic access to LINQ to SQL entities, for example: class LinqProvider<T> //where T is a L2S entity class { DataContext context; public virtual IEnumerable<T> GetAll() { return context.GetTable<T>(); } public virtual T Single(Func<T, bool> condition) { return context.GetTable<T>().SingleOrDefault(condition); } } From the front end, both of these methods appear to work as you would expect. However, when I run a trace in SQL profiler, the Single method is executing what amounts to a SELECT * FROM [Table], and then returning the single entity that meets the given condition. Obviously this is inefficient, and is being caused by GetTable() returning all rows. My question is, how do I get the query executed by the Single() method to take the form SELECT * FROM [Table] WHERE [condition], rather than selecting all rows then filtering out all but one? Is it possible in this context? Any help appreciated, Lee

    Read the article

  • Managing Strategy objects with Hibernate & Spring

    - by Francois
    This is a design question better explained with a Stack Overflow analogy: Users can earn Badges. Users, Badges and Earned Badges are stored in the database. A Badge’s logic is run by a Badge Condition Strategy. I would prefer not to have to store Badge Condition Strategies in the database, because they are complex tree structure objects. How do I associate a Badge stored in the database with its Badge Condition Strategy? I can only think of workaround solutions. For example: create 1 class per badge and use a SINGLE_TABLE inheritance strategy. Or get the badge from the database, and then programmatically lookup and inject the correct Badge Condition Strategy. Thanks for suggesting a better design.

    Read the article

  • Visual Studio - "{ }" settings

    - by Xorty
    Seriously, I don't know what to google. Here's the thing, I like this java-like code writting: if (condition == true) { doSomeStuff(); } But VisualStudio "helps" me with his own "style", which I don't like and I am unable to change (after rather big time of desperate checking all settings :/) if (condition == true) { DoStuff(); } I obviously want the "{" char to be in same line where condition is ... I am using MS Visual Studio 2010 professional Any help appreciated!

    Read the article

  • The great Vanishing Act of INetMgr.exe on my Windows 7 x64 system

    - by marc_s
    I'm facing an odd issue with the IIS Manager on Windows 7 (x64). At home, I have Win7 Professional, and when I check my IIS manager icon in the start menu, I see it links to %windir%\system32\inetsrv\InetMgr.exe When I launch this from the command line, it works like a charm. At work, however, I have Windows 7 Enterprise (x64), and when I check my link in the start menu, the entry is exactly the same. If I click on it - it works like a charm. Now if I'd like to launch it from the command line (cmd.exe or TakeCommand), however - the file just isn't there - a DIR %windir%\system32\inetsrv\*.exe shows a number of files, including a "inetmgr6.exe" - but no "inetmgr.exe" - and of course, I can't launch it either :-( Strangely enough, when I look at the directory %windir%\system32\INetSrv in Windows Explorer or Windows Powershell, I SEE the INetMgr.exe file and I can launch it - no problem. What the **** is going on here? How can I find the INetMgr.exe from my classic command line and launch it from there?? UPDATE: ok, some updates. On my work laptop, the INetMgr.exe file appears to really be located in a directory called c:\windows\syswow64\inetsrv (I'm recalling from memory, so don't quote me on the directory name - something like that). I can see this if I search for it in e.g. Powershell or Windows 7 Explorer. However, from a "classic" command line like cmd.exe, it appears to be in c:\windows\system32\inetsrv ..... hmmm.... trouble is - even though I now know where the file really is, I cannot access that directory from my classic command line - not even if I'm running cmd.exe as admin with elevated privileges....... so I know where the file is, but that still doesn't solve my problem :-(

    Read the article

  • Am I right in thinking there is no way to put an if statement and an else statement on line in Python?

    - by Louise
    Am I right in thinking I can't put an if-statement and the corresponding else-statement on one line in Python? NB: variable = value1 if condition else value2 is NOT two statements. It's one statement which can take the value of one of two expressions. I want to do something like if condition a=value else b=value Am I right in thinking this requires a full if-else in Python? Like if condition: a=value else: b=value Thanks, Louise

    Read the article

  • #include in C# (conditional compilation)

    - by HeavyWave
    Is it possible in C# to set such a condition that if the condition is true - compile one file;If condition is false - compile another file? Sort of like #ifdef DEBUG #include Class1.cs #else #include Class2.cs #endif Or possibly set it up in project properties.

    Read the article

  • Ubuntu12.04 - launched applications, not staying in same desktop

    - by Anders Metnik
    My question is why a launched application, if it has loading time like netbeans, eclipse jdeveloper etc. If i go to desktop3 and launch an application and then go to desktop 2 while I wait, then when it has loaded the application will launch in desktop2. Is there anyway to change this? I find it highly annoying since i on startup would like to launch 3-4 big applications, leave my computer while loadingf, and then return. But i cant leave since i have to launch them sequential instead of simultaneous... Help please :-)

    Read the article

  • Sorting and Pagination does not work after I build a custom keyword search that is build using relat

    - by Roland
    I recently started to build a custom keyword search using Yii 1.1.x The search works 100%. But as soon as I sort the columns and use pagination in the admin view the search gets lost and all results are shown. So with otherwords it's not filtering so that only the search results show. Somehow it resets it. In my controller my code looks as follows $builder=Messages::model()->getCommandBuilder(); //Table1 Columns $columns1=array('0'=>'id','1'=>'to','2'=>'from','3'=>'message','4'=>'error_code','5'=>'date_send'); //Table 2 Columns $columns2=array('0'=>'username'); //building the Keywords $keywords = explode(' ',$_REQUEST['search']); $count=0; foreach($keywords as $key){ $kw[$count]=$key; ++$count; } $keywords=$kw; $condition1=$builder->createSearchCondition(Messages::model()->tableName(),$columns1,$keywords,$prefix='t.'); $condition2=$builder->createSearchCondition(Users::model()->tableName(),$columns2,$keywords); $condition = substr($condition1,0,-1) . " OR ".substr($condition2,1); $condition = str_replace('AND','OR',$condition); $dataProvider=new CActiveDataProvider('Messages', array( 'pagination'=>array( 'pageSize'=>self::PAGE_SIZE, ), 'criteria'=>array( 'with'=>'users', 'together'=>true, 'joinType'=>'LEFT JOIN', 'condition'=>$condition, ), 'sort'=>$sort, )); $this->render('admin',array( 'dataProvider'=>$dataProvider,'keywords'=>implode(' ',$keywords),'sort'=>$sort )); and my view looks like this $this->widget('zii.widgets.grid.CGridView', array( 'dataProvider'=>$dataProvider, 'columns'=>array( 'id', array( 'name'=>'user_id', 'value'=>'CHtml::encode(Users::model()->getReseller($data->user_id))', 'visible'=>Yii::app()->user->checkAccess('poweradministrator') ), 'to', 'from', 'message', /* 'date_send', */ array( 'name'=>'error_code', 'value'=>'CHtml::encode($data->status($data->error_code))', ), array( 'class'=>'CButtonColumn', 'template'=>'{view} {delete}', ), ), )); I really do not know what do do anymore since I'm terribly lost, any help will be hihsly appreciated

    Read the article

  • Java ternary operator and boxing Integer/int?

    - by Markus
    I tripped across a really strange NullPointerException the other day caused by an unexpected type-cast in the ternary operator. Given this (useless exemplary) function: Integer getNumber() { return null; } I was expecting the following two code segments to be exactly identical after compilation: Integer number; if (condition) { number = getNumber(); } else { number = 0; } vs. Integer number = (condition) ? getNumber() : 0; . Turns out, if condition is true, the if-statement works fine, while the ternary opration in the second code segment throws a NullPointerException. It seems as though the ternary operation has decided to type-cast both choices to int before auto-boxing the result back into an Integer!?! In fact, if I explicitly cast the 0 to Integer, the exception goes away. In other words: Integer number = (condition) ? getNumber() : 0; is not the same as: Integer number = (condition) ? getNumber() : (Integer) 0; . So, it seems that there is a byte-code difference between the ternary operator and an equivalent if-else-statement (something I didn't expect). Which raises three questions: Why is there a difference? Is this a bug in the ternary implementation or is there a reason for the type cast? Given there is a difference, is the ternary operation more or less performant than an equivalent if-statement (I know, the difference can't be huge, but still)?

    Read the article

  • No Firefox UI if launched during boot-up

    - by kpax
    At work I'm using Windows XP SP2. What I've noticed is if I launch Firefox while Windows hasn't finished booting up, it launches the firefox.exe process but fails to launch the associated UI i.e. there's no Firefox window at the end of it. The only way to resolve this is to kill the firefox.exe process and re-launch Firefox. Has anyone else experienced this kind of behavior? Update: I'm using Firefox 3.6

    Read the article

  • Force applications to open in the foreground when launched from iexplore

    - by Earls
    I have a slight problem with my project I've working on... I have replaced explorer with iexplore in kiosk mode. iexplore loads a speeddial type of webpage for a set of windows programs. I launch those programs with PHP's system(). The problem is, when the programs launch, they launch BEHIND iexplore instead of in front of it. How can I force the programs being launched to ALWAYS load in the foreground?

    Read the article

  • Parameterise Service start option in WiX installer

    - by Jamiec
    I have a ServiceInstall component in a WiX installer where I have a requirement to either start auto or demand depending on parameters passed into the MSI. So the Xml element in question is <ServiceInstall Vital="yes" Name="My Windows Service" Type="ownProcess" Account="[SERVICEUSERDOMAIN]\[SERVICEUSERNAME]" DisplayName="My Service" Password="[SERVICEUSERPASSWORD]" Start="demand" Interactive="no" Description="Something interesting here" Id="Service" ErrorControl="ignore"></ServiceInstall> WiX will not allow using a PArameter for the Start attribute, so Im stuck with completely suplicating the component with a condition, eg/ <Component Id="ServiceDemand" Guid="{E204A71D-B0EB-4af0-96DB-9823605050C7}" > <Condition>SERVICESTART="demand"</Condition> ... and completely duplicating the whole component, with a different setting for Start and a different Condition. Anyone know of a more elegant solution? One where I don;t have to maintain 2 COmponents whjich do exactly the same thing except the Attribute for Start?

    Read the article

  • Can't start program by PsExec on windows server 2003 64-bit

    - by Stan
    I ran PsExec on a windows server 2003 32-bit machine to remotely launch a program on a windows server 2003 64-bit machine. The program is a win32 program with dependency to msvcr80.dll, msvcp80.dll, msjava.dll, PocoFoundation.dll, PocoNet.dll. The process will freeze and looks like fail to start the user interface. However, the program was running fine if I log on that 64-bit machine and double click on it. What could be wrong with using PsExec to launch it? I use process explorer but couldn't find anything. Thanks. EDIT: An update, this issue is actually happening to every program that launch by psexec on that host. For example, if try to use psexec to launch notepad.exe, I can see the process name (notepad.exe) in task manager, and notepad tab on taskbar. But when click on notepad tab, the window won't show up. It looks like the application stuck in the middle of launching process.

    Read the article

  • MSI install sequence - run DB scripts before services start

    - by marc_s
    Folks, we're running into some sequencing troubles with our MSI install. As part of our app, we install a bunch of services and allow the user to pick whether to start them right away or later. When they start right away, they seem to start too early in the install sequence - before our database manager had a chance to update the database. Right now, our custom action to run the database updater looks like this - it's being run after "InstallFinalize" - very late in the process. <InstallExecuteSequence> <RemoveExistingProducts After='InstallInitialize' /> <Custom Action='RunDbUpdateManagerAction' After='InstallFinalize'> DbUpdateManager=3</Custom> </InstallExecuteSequence> What would be the more appropriate step to run after or before, to make sure the DB scripts are executed before any of the installed services start up? Is there a "BeforeServiceStart" step? EDIT: Just defining the "Before='StartServices'" attribute on the tag didn't solve my problem. I am assuming the issue is this: the custom action has an "inner text", which represents a condition, and this condition is: "&DbUpdateManager=3". From what I can deduce from trial & error, this probably means "the DbUpdateManager feature must be published". Now, trouble is: "PublishFeature" comes way at the end in the install sequence, just before "InstallFinalize", and definitely AFTER InstallServices / StartServices. So when I specify the "Before=StartServices" requirement, the condition "DbUpdateManager feature must be published" isn't true yet, so the DbUpdateManager doesn't get executed :-( I tried removing the condition - in that case, my DbUpdateManager sometimes doesn't execute at all, sometimes more than once - no real clear pattern as to what happens when..... Any more ideas?? Is there a way I could check for a condition "the DbUpdateManager feature is installed" which would be true after the "InstallFiles" step?? Marc

    Read the article

< Previous Page | 40 41 42 43 44 45 46 47 48 49 50 51  | Next Page >