Search Results

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

Page 41/256 | < Previous Page | 37 38 39 40 41 42 43 44 45 46 47 48  | Next Page >

  • Why would you use the ternary operator without assigning a value for the "true" condition?

    - by RickNotFred
    In the Android open-source qemu code I ran across this line of code: machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */ It this just a confusing way of saying: if (machine->max_cpus) { ; //do nothing } else { machine->max_cpus = 1; } If so, wouldn't it be clearer as: if (machine->max_cpus == 0) machine->max_cpus = 1; Interestingly, this compiles and works fine with gcc, but doesn't compile on http://www.comeaucomputing.com/tryitout/ .

    Read the article

  • what's the condition for setting a cookie in safari?

    - by Woho87
    Hi! I got problem with safari on mac not sending cookies I'm setting. I can see that they are set in preferences - cookies. But they never sends back to my server. And I'm not setting the cookies in a http 302 status, which was a bug that I found here. There must be at lot of you out there having same issues as me. How did you get it work? And yes I have search countless times and found nothing on this issue

    Read the article

  • Emails sent using Flex app are delayed

    - by user363825
    I'm currently building an application in Flex that utilizes SMTP Mailer to automatically send out emails to the user when a particular condition is satisfied. The application checks this condition every 30 seconds. The condition is satisfied based on new records being returned from a database table. The problem is as follows: When the condition is first satisfied, the email is delivered to the user with no issues. The second time the condition is satisfied, the email is not delivered. In the smtp logs, the delivery attempt appears to get hung up on the following line: 354 Start mail input; end with <CRLF>.<CRLF> No error codes are present in the smtp logs, but I do trace the following event from the SMTP Mailer class: [Event type="mailError" bubbles=false cancelable=false eventPhase=2] When the condition is satisfied a third time, the email that was not delivered when the condition was satisfied the previous time is now delivered, along with the email for this instance. This pattern then repeats itself, with the next email not being sent followed by two emails being sent simulatneously when the condition is met again. The smtp server being used is Windows 2003, on an internal network. The email is being sent to an outlook account hosted on an exchange server that is also on this internal network. Here is the actionscript code that creates the SMTPMailer object: public var testMail:SMTPMailer = null; public function alertNotify() { Security.loadPolicyFile("crossdomain.xml"); this.testMail = new SMTPMailer("myserver.ec.local",25); this.testMail.addEventListener(SMTPEvent.MAIL_SENT, onEmailEvent); this.testMail.addEventListener(SMTPEvent.MAIL_ERROR, onEmailError); this.testMail.addEventListener(SMTPEvent.DISCONNECTED, onEmailConn); this.testMail.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onEmailError); } Here is the code that creates the email body and calls the method to send the email: public function alertUser(emailAC:ArrayCollection):void { trace ("In alertUser() before send, testMail.connected = " + testMail.connected.toString()); var testStr:String = " Key Location Event Type Comment Update Time "; for each (var event:rEntity in emailAC) { testStr = testStr + "" + event.key.toString() + "" + event.xml.address.toString() + " " + [email protected]() + "" + [email protected]() + "" + [email protected]() + "" + event.xml.attribute("update-time").toXMLString() + ""; } testStr = testStr + ""; testMail.flush(); testMail.sendHTMLMail("[email protected]","[email protected]","Event Notification",testStr); } Really not sure where the email that gets hung up is being stored until it is finally sent.... Any suggestions as to how to begin to remedy this issue would be much appreciated.

    Read the article

  • Doing sum's if certain conditions are true

    - by Gugu
    I am trying to build a query that does a sum if a certain parameter is set. For example: SELECT SUM(IF(<condition>,field,field)) AS total_value ...which is working correctly. But i have more than one condition in IF(), like: SELECT SUM(IF(<condition> <condition>,field,field)) AS total_value ..which is not working, could you have any idea what should be the right query for this.

    Read the article

  • SCORM 2004 Sequencing: What Am I doing wrong?

    - by Van
    This quiz is the last SCO in a grouping of 4 SCOs. SCO 1,2,3 have to be completed before this quiz becomes available. The problem is that when 1,2,3 are completed the menu skips right over this quiz and goes to the first page in the next module. This quiz stats grayed out the entire time. I think it has to do with the precondition logic or the objectives but I've tried everything I can think of and nothing works. <item identifier="quiz1_100" identifierref="res-quiz1" isvisible="true"> <title>Quiz 1</title> <imsss:sequencing> <imsss:controlMode choice="true" choiceExit="false" flow="true" forwardOnly="false" useCurrentAttemptObjectiveInfo="false" useCurrentAttemptProgressInfo="false" /> <imsss:sequencingRules> <imsss:preConditionRule> <imsss:ruleConditions conditionCombination="any"> <imsss:ruleCondition referencedObjective="obj_1000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="obj_2000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="obj_3000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="quiz_primary" operator="not" condition="objectiveStatusKnown" /> </imsss:ruleConditions> <imsss:ruleAction action="disabled" /> </imsss:preConditionRule> <imsss:preConditionRule> <imsss:ruleConditions conditionCombination="any"> <imsss:ruleCondition referencedObjective="obj_1000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="obj_2000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="obj_3000_VHKP_test" operator="not" condition="objectiveStatusKnown" /> <imsss:ruleCondition referencedObjective="quiz_primary" operator="not" condition="objectiveStatusKnown" /> </imsss:ruleConditions> <imsss:ruleAction action="skip" /> </imsss:preConditionRule> <imsss:preConditionRule> <imsss:ruleConditions conditionCombination="all"> <imsss:ruleCondition condition="completed" /> </imsss:ruleConditions> <imsss:ruleAction action="skip" /> </imsss:preConditionRule> </imsss:sequencingRules> <imsss:objectives> <imsss:primaryObjective objectiveID="quiz_primary" satisfiedByMeasure="true"> <imsss:minNormalizedMeasure>0.8</imsss:minNormalizedMeasure> <imsss:mapInfo targetObjectiveID="quiz_complete" writeNormalizedMeasure="true" writeSatisfiedStatus="true" /> </imsss:primaryObjective> <imsss:objective satisfiedByMeasure="false" objectiveID="obj_1000_VHKP_test"> <imsss:mapInfo targetObjectiveID="gObj_1000_VHKP" readSatisfiedStatus="true" readNormalizedMeasure="false" /> </imsss:objective> <imsss:objective satisfiedByMeasure="false" objectiveID="obj_2000_VHKP_test"> <imsss:mapInfo targetObjectiveID="gObj_2000_VHKP" readSatisfiedStatus="true" readNormalizedMeasure="false" /> </imsss:objective> <imsss:objective satisfiedByMeasure="false" objectiveID="obj_3000_VHKP_test"> <imsss:mapInfo targetObjectiveID="gObj_3000_VHKP" readSatisfiedStatus="true" readNormalizedMeasure="false" /> </imsss:objective> <!-- <imsss:objective satisfiedByMeasure="false" objectiveID="obj_quiz1"> <imsss:mapInfo targetObjectiveID="quiz_primary" readSatisfiedStatus="true" readNormalizedMeasure="false" /> </imsss:objective> --> <imsss:objective satisfiedByMeasure="false" objectiveID="course_complete"> <imsss:mapInfo targetObjectiveID="obj_EJBOWNADV_primary" readSatisfiedStatus="true" readNormalizedMeasure="false" /> </imsss:objective> </imsss:objectives> <imsss:deliveryControls tracked="true" completionSetByContent="true" objectiveSetByContent="false" /> </imsss:sequencing> </item>

    Read the article

  • AWS: setting up auto-scale for EC2 instances

    - by Elton Stoneman
    Originally posted on: http://geekswithblogs.net/EltonStoneman/archive/2013/10/16/aws-setting-up-auto-scale-for-ec2-instances.aspxWith Amazon Web Services, there’s no direct equivalent to Azure Worker Roles – no Elastic Beanstalk-style application for .NET background workers. But you can get the auto-scale part by configuring an auto-scaling group for your EC2 instance. This is a step-by-step guide, that shows you how to create the auto-scaling configuration, which for EC2 you need to do with the command line, and then link your scaling policies to CloudWatch alarms in the Web console. I’m using queue size as my metric for CloudWatch,  which is a good fit if your background workers are pulling messages from a queue and processing them.  If the queue is getting too big, the “high” alarm will fire and spin up a new instance to share the workload. If the queue is draining down, the “low” alarm will fire and shut down one of the instances. To start with, you need to manually set up your app in an EC2 VM, for a background worker that would mean hosting your code in a Windows Service (I always use Topshelf). If you’re dual-running Azure and AWS, then you can isolate your logic in one library, with a generic entry point that has Start() and Stop()  functions, so your Worker Role and Windows Service are essentially using the same code. When you have your instance set up with the Windows Service running automatically, and you’ve tested it starts up and works properly from a reboot, shut the machine down and take an image of the VM, using Create Image (EBS AMI) from the Web Console: When that completes, you’ll have your own AMI which you can use to spin up new instances, and you’re ready to create your auto-scaling group. You need to dip into the command-line tools for this, so follow this guide to set up the AWS autoscale command line tool. Now we’re ready to go. 1. Create a launch configuration This launch configuration tells AWS what to do when a new instance needs to be spun up. You create it with the as-create-launch-config command, which looks like this: as-create-launch-config sc-xyz-launcher # name of the launch config --image-id ami-7b9e9f12 # id of the AMI you extracted from your VM --region eu-west-1 # which region the new instance gets created in --instance-type t1.micro # size of the instance to create --group quicklaunch-1 #security group for the new instance 2. Create an auto-scaling group The auto-scaling group links to the launch config, and defines the overall configuration of the collection of instances: as-create-auto-scaling-group sc-xyz-asg # auto-scaling group name --region eu-west-1 # region to create in --launch-configuration sc-xyz-launcher # name of the launch config to invoke for new instances --min-size 1 # minimum number of nodes in the group --max-size 5 # maximum number of nodes in the group --default-cooldown 300 # period to wait (in seconds) after each scaling event, before checking if another scaling event is required --availability-zones eu-west-1a eu-west-1b eu-west-1c # which availability zones you want your instances to be allocated in – multiple entries means EC@ will use any of them 3. Create a scale-up policy The policy dictates what will happen in response to a scaling event being triggered from a “high” alarm being breached. It links to the auto-scaling group; this sample results in one additional node being spun up: as-put-scaling-policy scale-up-policy # policy name -g sc-psod-woker-asg # auto-scaling group the policy works with --adjustment 1 # size of the adjustment --region eu-west-1 # region --type ChangeInCapacity # type of adjustment, this specifies a fixed number of nodes, but you can use PercentChangeInCapacity to make an adjustment relative to the current number of nodes, e.g. increasing by 50% 4. Create a scale-down policy The policy dictates what will happen in response to a scaling event being triggered from a “low” alarm being breached. It links to the auto-scaling group; this sample results in one node from the group being taken offline: as-put-scaling-policy scale-down-policy -g sc-psod-woker-asg "--adjustment=-1" # in Windows, use double-quotes to surround a negative adjustment value –-type ChangeInCapacity --region eu-west-1 5. Create a “high” CloudWatch alarm We’re done with the command line now. In the Web Console, open up the CloudWatch view and create a new alarm. This alarm will monitor your metrics and invoke the scale-up policy from your auto-scaling group, when the group is working too hard. Configure your metric – this example will fire the alarm if there are more than 10 messages in my queue for over a minute: Then link the alarm to the scale-up policy in your group: 6. Create a “low” CloudWatch alarm The opposite of step 4, this alarm will trigger when the instances in your group don’t have enough work to do (e.g fewer than 2 messages in the queue for 1 minute), and will invoke the scale-down policy. And that’s it. You don’t need your original VM as the auto-scale group has a minimum number of nodes connected. You can test out the scaling by flexing your CloudWatch metric – in this example, filling up a queue from a  stub publisher – and watching AWS create new nodes as required, then stopping the publisher and watch AWS kill off the spare nodes.

    Read the article

  • Why does Xcode launch the iPhone simulator when the iPad simulator is selected?

    - by Dr Dork
    When I open an existing iPad project in Xcode and "Build and Run" it, it launches the iPhone simulator when I have the iPad Simulator set as the active executable? Inside the iPhone simulator is a shrunken version of the iPad. What is going on? How do I get it to run the iPad simulator? Note: When the iPhone Simulator is running, I double checked the Hardware-Device setting and it's set to iPad. This is what I want, of course, but I don't want it to run the iPhone simulator. I seem to recall it used to run an iPad simulator. Is there such a thing or am I tripping and there is only an iPhone simulator that can run iPad apps? Thanks in advance for your help!

    Read the article

  • C#, Linq, Dynamic Query: Code to filter a Dynamic query outside of the Repository

    - by Dr. Zim
    If you do something like this in your Repository: IQueryable<CarClass> GetCars(string condition, params object[] values) { return db.Cars.Where(condition, values); } And you set the condition and values outside of the repository: string condition = "CarMake == @Make"; object[] values = new string[] { Make = "Ford" }; var result = myRepo.GetCars( condition, values); How would you be able to sort the result outside of the repository with Dynamic Query? return View( "myView", result.OrderBy("Price")); Somehow I am losing the DynamicQuery nature when the data exits from the repository. And yes, I haven't worked out how to return the CarClass type where you would normally do a Select new Carclass { fieldName = m.fieldName, ... }

    Read the article

  • Android development in Unreal with an existing project

    - by user1238929
    I am currently using an Unreal 3 project that has been targeted for multiple devices. Originally, it was targeted for iOS and now I want to try and build it for Android. The project is capable of doing it and I am in the process of testing it. I think I have everything I need in order to build it and launch it for an android device that I have set up and connected to my PC and is recognized by the Android SDK ABD. I am currently trying to build and launch the game through the Unreal Frontend but when I try, I am getting stuck at getting the Unreal Frontend to find my Android device as a platform to debug, like it would with a PC, Xbox360, or PS3. Right now, I am just trying to launch the game to see if I can get it to simply run on an Android device, I'm going to worry about the packaging later. So I have two questions: Am I on the right track in looking at the Unreal Frontend to cook and launch the project on Android or should I look somewhere else? How do I get Unreal to recognize my Android device as a platform to launch on? I would even settle for recognizing an emulator, but that seems even harder.

    Read the article

  • System cant mount root

    - by Tony Parkes
    Im running ubuntu 12.10, i have installed NETKIT as i need it for my university work. It is installed fine and the NETKIT configuration is ok when checked but when i try to launch a virtual machine it appears on screen for about half a second and then vanishes. I did a verbose launch and im told that the system cant mount root, i can however launch an xterm...any help would be greatly appreciated. Tony

    Read the article

  • How to launch standard browser out of Java application?

    - by Peter
    Hi there how to I open a URL with the systems standard browser with Java? I currently use this code for opening a specific URL (locally stored html file), which works fine when I run the application with my IDE (Eclipse), but after bundling the software, it doesn't work any more. url = MainWindow.class.getResource("mySite.html"); helpMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { try { java.awt.Desktop.getDesktop().browse(url.toURI()); } catch (URISyntaxException e1) { e1.printStackTrace(); } catch (IOException e1) { e1.printStackTrace(); } } }); Any suggestsions? Thank you very much!

    Read the article

  • How to implement a countdown clock on a product launch web page?

    - by Daniel Earwicker
    I'm asking this on behalf of a certain corporation: http://www.microsoft.com/visualstudio/en-us/watch-it-live Things to bear in mind: It's 8:30 AM at different times depending on where you are in the world. For example, where I am, it is already 10 AM, whereas in Redmond it's still only 2 AM. That's probably the main thing, I guess. Can any SO users recommend ways to improve the existing countdown page so that it works correctly for users in any timezone? (Serious question - clearly this is a pit that is easy to fall into!)

    Read the article

  • Is it possible to remember the filename from a fileupload field and then later launch that file via

    - by Pieter Breed
    I have a HTML file upload field from which I'm reading the file name of the file that the user specifies. The actual contents of the file is never uploaded. At a later stage, is it possible to construct a link using this file name information so that if the user clicks on this link, the original file is launched into a new browser window? If not, what are the reason for disallowing this behaviour? The purpose of such a feature is to store links to documents that are available on a mapped local drive or a network share.

    Read the article

  • Is there a good AddIn for Visual Studio that will launch msbuild targets?

    - by Jon Lent
    One of the things I like about the Java IDEs out there is that they typically have the ability to allow a user to right-click on an Ant file and run one of the targets. I've got an msbuild file in my solution that is used for migrating the application database, and would kill to be able to right-click on it, select "update" or "rollback" and have it run. My searching has not turned up anything meant to run inside VS2008, just a shell extension for windows explorer. Has anybody seen such an animal out there? Cordially, Jon

    Read the article

  • How to launch a Windows service network process to listen to a port on a localhost socket that is vi

    - by rwired
    Here's the code (in a standard TService in Delphi): const ProcessExe = 'MyNetApp.exe'; function RunService: Boolean; var StartInfo : TStartupInfo; ProcInfo : TProcessInformation; CreateOK : Boolean; begin CreateOK := false; FillChar(StartInfo,SizeOf(TStartupInfo),#0); FillChar(ProcInfo,SizeOf(TProcessInformation),#0); StartInfo.cb := SizeOf(TStartupInfo); CreateOK := CreateProcess(nil, PChar(ProcessEXE),nil,nil,False, CREATE_NEW_PROCESS_GROUP+NORMAL_PRIORITY_CLASS, nil, PChar(InstallDir), StartInfo, ProcInfo); CloseHandle(ProcInfo.hProcess); CloseHandle(ProcInfo.hThread); Result := CreateOK; end; procedure TServicel.ServiceExecute(Sender: TService); const IntervalsBetweenRuns = 4; //no of IntTimes between checks IntTime = 250; //ms var Count: SmallInt; begin Count := IntervalsBetweenRuns; //first time run immediately while not Terminated do begin Inc(Count); if Count >= IntervalsBetweenRuns then begin Count := 0; //We check to see if the process is running, //if not we run it. That's all there is to it. //if ProcessEXE crashes, this service host will just rerun it if processExists(ProcessEXE)=0 then RunService; end; Sleep(IntTime); ServiceThread.ProcessRequests(False); end; end; MyNetApp.exe is a SOCKS5 proxy listening on port 9870. Users configure their browser to this proxy which acts as a secure-tunnel/anonymizer. All works perfectly fine on 2000/XP/2003, but on Vista/Win7 with UAC the service runs in Session0 under LocalSystem and port 9870 doesn't show up in netstat for the logged-in user or Administrator. Seems UAC is getting in my way. Is there something I can do with the SECURITY_ATTRIBUTES or CreateProcess, or is there something I can do with CreateProcessAsUser or impersonation to ensure that a network socket on a service is available to logged-in users on the system (note, this app is for mass deployment, I don't have access to user credentials, and require the user elevate their privileges to install a service on Vista/Win7)

    Read the article

  • Correct way to (re)launch a Java application with hardware-dependent VM parameters?

    - by LowLevelAbstraction
    EDIT I don't want to use Java Web Start I've got a Java application that I'd like to run with different VM parameters depending on the amount of memory the system it is launched on has. For example if the machine has 1 GB of memory or less I'd like to pass "-Xmx200m" and "-Xmx400m" if it has 2 GB and "-Xmx800m" if it has 8 GB (these are just examples). Is there a portable way to do this? I've tried having a first tiny Java app (hence portable) that determines the amount of memory available and then launches a new Java app but I don't think this is very clean. As of now I've written Bash shell scripts that invoke the Java app with the correct parameters depending on the config but it only works on Linux on OS X. What is the correct way to solve this? Would application packager package ;) help ?

    Read the article

  • Silverlight 4 launch a trusted application into the browser ?

    - by Niklaos
    Hi guys, I just lost 5 hours looking for a answer which i haven't been able to find :p First, I'd like to force a trusted application (i need to access the file system) to display into the browser. Based on what i found on google a trusted application must be installed and launched as a desktop application (also called out-of-browser application). So, i want to have an installed application on the client side but meanwhile, the user must also be able to start this same application into a browser window when he goes on my web site. Is this possible ? Second, I'd like to give to the user the possibility to start the application from the browser. To be clear be the application is installed on the client computer but i want a button on my web site which starts the desktop application. How can i do that ? Thanks

    Read the article

  • bumblebee does not work with metacity and KWin, but works with compiz

    - by cpu2
    If I try to launch something with optirun under compiz, it works. If I try to launch something with optirun under KDE or metacity, it gives me: [ 247.384077] [ERROR]Cannot access secondary GPU - error: [XORG] (EE) [ 247.384117] [ERROR]Aborting because fallback start is disabled. If it matters, I'm trying to launch Portal 2 with wine I have: Nvidia GeForce GT540M with optimus Acer Aspire Timeline X Intel core i5 and 3000 Integrated Graphics

    Read the article

  • checking if records exists in DB, in single step or 2 steps?

    - by Sinan
    Suppose you want to get a record from database which returns a large data and requires multiple joins. So my question would be is it better to use a single query to check if data exists and get the result if it exists. Or do a more simple query to check if data exists then id record exists, query once again to get the result knowing that it exists. Example: 3 tables a, b and ab(junction table) select * from from a, b, ab where condition and condition and condition and condition etc... or select id from a, b ab where condition then if exists do the query above. So I don't know if there is any reason to do the second. Any ideas how this affects DB performance or does it matter at all?

    Read the article

  • ClickOnce disallow publishing of Debug builds

    - by LnDCobra
    Is there anyway to disallow publishing Debug builds when publishing ClickOnce aplications using Visual Studio 2008? I know this was asked before, but i can't figure out how from the answer. THe Accepted answer for previous question was: One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build. The condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail. Could anyone elaborate on that answer or tell me where/or how I can add this condition. [Original Question][1] [1]: http://One thing you can do is add a condition to the .csproj or .vbproj file that MSBuild will check when doing a build. The condition would check if a publish is occurring and check if the build is a debug build, then do something like run an external tool or otherwise interrupt the build process or cause it to fail.

    Read the article

  • How can I launch a system command via Javascript in Google Chrome?

    - by kvsn
    I want to execute a local program on my computer via Javascript in Chrome. In Firefox, it can be done as follows (after setting 'signed.applets.codebase_principal_support' to true in about:config): function run_cmd(cmd, args) { netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); file.initWithPath(cmd); var process = Components.classes["@mozilla.org/process/util;1"] .createInstance(Components.interfaces.nsIProcess); process.init(file); process.run(false, args, args.length); } What's the equivalent code for Chrome?

    Read the article

  • hibernate not throwing stale state exception nor it is overwriting data

    - by Reddy
    Our application do the following. 1. Start the transaction. 2. Execute a query using prepared statement 3. Check a condition to see the number of rows updated are equal to the required number. 4. It commits on success of above condition otherwise it will roll back However the problem is that when two threads are simultaneously enter this code. Thread-1 is updating a row in step 2. It checked the condition and committed successfully since the condition is successful. Thread-2 started execution somewhere between steps 1 & 4, and it is failing on at condition checking at step 3 (as it is getting number of updated rows as 0). I expected second thread to throw an exception but it is not. What could be the problem?

    Read the article

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