w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Why won't CloudFormation execute my command?
Your commands block should be nested inside the config block, at the moment it is at the same level in the hierarchy. "AWS::CloudFormation::Init" : { "config" : { "files" : { "c:\Packages\WebDeploy_amd64_en-US.msi" : { "source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi" } }, "commands" : { "1-installwebdeploy" : { "command" : "msiexec.exe /i c:\Packages\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart" } } }, }

Categories : Amazon

Why won't my CloudFormation script download a file?
Jonathon, I tried your template and the file downloaded successfully for me. You can check the cfn logs on the instance. They are in c:cfnlog. My cfn-init.log shows: 2013-07-19 21:30:18,269 [DEBUG] Parent directory c: est does not exist, creating 2013-07-19 21:30:18,269 [DEBUG] Writing content to c: estgoogle-logo.png 2013-07-19 21:30:18,269 [DEBUG] Retrieving contents from http://www.google.com/images/srpr/logo4w.png 2013-07-19 21:30:18,316 [DEBUG] No mode specified for c: estgoogle-logo.png 2013-07-19 21:30:18,316 [WARNING] Unsupported OS for setting owner/group: nt And my cfn-wire.log shows: 2013-07-19 21:30:18,269 [DEBUG] Request: GET http://www.google.com/images/srpr/logo4w.png [headers: {'Accept-Encoding': 'identity, deflate, compress, gzip', 'Accept': '*/*', 'User-Agent': 'pyth

Categories : Amazon

AWS - Automatic deployment (.NET) to CloudFormation stack
cloud-init is used with windows too. See the documentation for bootstrapping Windows stacks.

Categories : Amazon

Is it possible to create a SNS subscription with CloudFormation without creating a topic?
As you already discovered, AWS CloudFormation doesn't provide the expected AWS::SNS::Subscription resource (yet) and I'm not aware of this being possible by any other means, unfortunately - guess the rationale is that both are either managed within a template or externally, but your use case is sound and I can see no fundamental reason why this shouldn't be available (maybe they'll add it at some point, AWS is usually expanding their APIs over time to address such inconsistencies/missings).

Categories : Amazon

Installing Windows applications/extensions with Amazon CloudFormation
For your example of WebDeploy, you could add this: "C:\Webdeploy\WebDeploy_amd64_en-US.msi" : { "source" : "http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi" } as a element of this section of the template "WindowsServer": { "Type" : "AWS::EC2::Instance", "Metadata" : { "AWS::CloudFormation::Init" : { "config" : { "files" : { You could then add this command: "1-installwebdeploy" : { "command" : "msiexec.exe /i C:\Webdeploy\WebDeploy_amd64_en-US.msi ADDLOCAL=ALL /qn /norestart" } to the list of commands.

Categories : Amazon

Generating subnet CIDR blocks programmatically in CloudFormation templates (or adding integers together)
My solution for these kinds of issues was to use a legitimate programming language to compile a template into a CloudFormation JSON document. I used PHP 5.4, Twig and Symfony Console, but YMMV. Essentially, you do the math ahead of time in the programming language, then use that data as you write-out your JSON document.

Categories : Amazon

Wait on thread that creates an instance that creates a thread
One solution could be to use Task class instead of explicitly creating the Thread //here instead of creating a Thread, create a Task and return it to the caller objClientThread = new Thread(start) { IsBackground = true }; objClientThread.Start(); Then you can do Task task = objClientBase.Connect(); task.Wait();

Categories : C#

how to construct a string of physical subnet ids to create db subnet group on the fly in a cloudformation script?
I run into the same issue, after working with AWS support I understood that List of String does not mean what we initially thought. Also, if you want to place the DB inside a VPC you must not use AWS::RDS::DBSecurityGroup objects. Here is a full sample, it took me a while to get it working: "dbSubnetGroup" : { "Type" : "AWS::RDS::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : "Availability Zones for RDS DB", "SubnetIds" : [ { "Ref" : "subnetPrivate1" }, { "Ref" : "subnetPrivate2" } ] } }, "dbInstance" : { "Type" : "AWS::RDS::DBInstance", "Properties" : { "DBInstanceIdentifier" : { "Fn::Join" : [ "", [ { "Ref" : "AWS::St

Categories : Amazon

Thinking sphinx search with or condition didnt find both condition data
To be honest, I'm not entirely sure why this is happening - it's a Sphinx issue though, not Thinking Sphinx (so I've added the Sphinx tag). A work-around is to wrap both search options in double-quotes: fields << %q{(@description "#{params[:oiloiliness]}" | "#{params[:oiloiliness].gsub(/[^0-9A-Za-z]/, '')}" )} Also: you may want to consider adding hyphen to your list of ignore_chars via config/thinking_sphinx.yml.

Categories : Ruby On Rails

unable to set variable in OR condition when the first condition fails inside a batch file
example (prints 0 if found, otherwise 1): set /a path_check=0 echo %PATH% | findstr /i "C:\Windows\System32;" 2>NUL || set /a path_check=1 echo %path_check%

Categories : Windows

Suppress a duplicate row in SQL Server 2005 based on condition and list remaining rows that don't meet the condition
If Hazard is blank or 'Y' then you can use MAX() and GROUP BY to get your desired output: SELECT SHPMNT_NO, TOT_WEIGHT, MAX(HAZARD) 'HAZARD' FROM YourTable GROUP BY SHPMNT_NO, TOT_WEIGHT This will also work if Hazard is 'Y' or 'N'.

Categories : SQL

Passing Condition as string to another function's if condition-java
You can create a method, and place it in CellColorChanger class: private boolean checkCondition(){ return /* whatever condition like: */ (row == 2 && column == 2) || (row == 6 && column == 1) || (row == 1 && column == 2) || (row == 4 && column == 1); } Call this function on passed CellColorChanger object, whenever you want the condition to be re-evaluated.

Categories : Java

Chaining Parallel Tasks to an End Condition or Error Condition
You would need to add a continuation to all of the tasks, 1-4, with the error handling case to allow an error in any of them to call that function. For convenience you could create a method to add the same continuation to a collection of tasks. Here's one (feel free to add others for the other overloads of ContinueWith as needed): public static IEnumerable<Task> ContinueWith(this IEnumerable<Task> tasks , Action<Task> continuation, TaskContinuationOptions options) { return tasks.Select(task => task.ContinueWith(continuation, options)) .ToList();//important for this ToList to be here; //we want the continuations to be added now, not when the result is iterated } This allows you to write: var errorTasks = new[]{task, task2, task3, task4} .C

Categories : C#

Sqlite query using where condition having more than one condition to satisfy
May this help you: Replace your query with these lines.. public Cursor query(int id){ return myDataBase.query("question", null,"_id = "+id+ " AND " + "chek ="+number,null, null, null, null); keep space between the double quotes in And :" And " otherwise the string will be Example: _id=3And check =9

Categories : Android

cakephp condition can't list out the condition with upline value
'conditions' => 'id < '.$upline['User']['group_id'] should be 'conditions' => array( 'id < '.$upline['User']['group_id'] ) Also 'conditions' => 'id > '.$upline['User']['tgame_master_id'] should be 'conditions' => array( 'id > '.$upline['User']['tgame_master_id'] )

Categories : PHP

including a condition dynamically based on another condition
Should be pretty straightforward : select -------- from table left outer join.... where (Condition A IS NULL) OR (condition A AND condition B) UPDATED: For your conditions: where (a.column is null) or (a.column='123' and c.column='456') It will include a a row if it's a.column is null or if bot a.column and c.column have valid values.

Categories : SQL

Verify this condition with regular condition
A regex is not a good tool to use for this. You can do all you need by splitting and parsing the string: (see it run) class Main { public static void main (String[] args) throws java.lang.Exception { String inputString = "1,4,6,22,88,105:22"; int min = 1; int max = 105; String[] splitString = inputString.split("[,:]"); for (String part : splitString) { int parsedInt = Integer.parseInt(part); if (parsedInt < min || parsedInt > max) throw new Exception("Invalid"); } System.out.println("Yay it's ok!"); } }

Categories : Java

Throwing exception in if condition causes if condition to be ignored
bool isRightType = true; if(isRightType == false) { const string msg = "Für diesen Control-Typ wird die falsche Basisklasse verwendet!"; throw new Exception(msg); } You're hardcoding isRightType to true, then immediately testing for false. There's no execution path for the if statement to be true and execute.

Categories : C#

rspec expect condition OR condition
I don't think it is possible. I do think you are mistaken when you say that you would be testing implementation, instead of intent in your example. When you write a test, you test whether what comes out matches your expectation. Creating a user is something completely different than returning error messages. In my opinion it would be strange to say: when I do this, I expect this, or that, or that, or that to happen. In my opinion you should write one test, that tests whether a user is created when you send the correct parameters, and another test that deals with what happens when a user tries to send illegal parameters.

Categories : Ruby On Rails

tal:condition not performing condition check
If your result.sum_adt_out attribute is a string, your test will fail. Also note that <> has been deprecated in Python, use != instead to test inequality. Your template, simplified and with calling float() on the value first to ensure that it is numeric, then becomes: <td style="text-align: right;" tal:define="sum_adt_out python:float(result.sum_adt_out)"> <span tal:condition="sum_adt_out" tal:content="python:'%.1f' % (float(result.sum_cenmn)/sum_adt_out,)">currentindex</span> <span tal:condition="not:sum_adt_out">0.0</span> </td>

Categories : Python

Hudson Job creates .svn files
.svn files are internal files of Subversion. All subversion meta data is in this directories. In case of Hudson Job, they are irrelevant as you do not want to commit anything. You cannot avoid crating them. You can remove them but you will find them helpful when you will start using update instead of checkout on Hudson to speed up build.

Categories : Svn

wp_insert_post(), creates two pages?
I got a similar error before, when i am running a custom php script to insert posts into the Wordpress database, using the wp_insert_post statement. Weirdly it created 2 records in wp_posts table for every post. Not sure what is the issue, but i realized that when i ran the php code in the same browser where i am logged in as administrator, i got this duplicate posts issue. I resolved it by running my custom php code in a separate browser. So make sure that you are running your custom php code with SQL query in a browser, that has no Wordpress login in it. Hope it helps someone.

Categories : Wordpress

Model creates new row instead of being edited
The reason Backbone.js is firing a POST request instead of PUT is because your model does not have a unique identifier id associated with it.If there is not id attribute associated with your model, Backbone.js will always fire a POST request to save a new entry to db. From backbone's website : save model.save([attributes], [options]) ... If the model isNew, the save will be a "create" (HTTP POST), if the model already exists on the server, the save will be an "update" (HTTP PUT). Read this SO question for more information.

Categories : Javascript

How to recognize (what tag creates) this image?
The parent div #title has the image as a background image. <style type="text/css"> #title { background: url(http://colleenbriggs.files.wordpress.com/2012/12/cropped-fragments-of-light-low-res.jpg) no-repeat; height: 180px; } </style>

Categories : HTML

Changing an Entity creates a new one as well
i think this is entity framework issue,you may use "Context.context.Projekt.Find(id)" in your "izmjeniProjekt" instead of your function "getProjektByID",maybe passing and getting types with the functions is the problem, by the way your naming is awesome ! the problem is obvious, entity framework recognizes your "Projekt" as a new entry, so the problem is the Key of your database table, you probably used code first migrations to creating your database and you didn't specify the key, but by the way, you have the id, in my opinion its not necessary to get the "Projekt" from data context, just use it! maybe what i'm trying to say is not clear so watch this video ( you will see your problem there ) to have a better understanding of entity framework. Julie Lerman Speaks

Categories : C#

File creates but cannot write in it
Try this: using(FileStream stream = File.Create(path)) { TextWriter tw = new StreamWriter(stream); tw.WriteLine("Manual Numbers="); tw.WriteLine(""); tw.WriteLine("Installation Technical Manual: "); tw.WriteLine("Performance Manual: "); tw.WriteLine("Planned Maintenance Technical Manual: "); tw.WriteLine("Service Calibration Manual: "); tw.WriteLine("System Information Manual: "); tw.WriteLine(""); } The using ensures that the filestream is closed(disposed) even when an exception occurs within writing.

Categories : C#

Hibernate creates a SQL query
The need for quoting database identifiers derives from the database used, some do, some don't; it is not SQL per se that "wants" this. So you need to set the correct database dialect then Hibernate will do this automatically if needed. In fact it is one of the benefits of Hibernate that you don't need to care for this differences.

Categories : SQL

How does tag creates a bean?
Jsp:Use bean tag is used to initialize the class and bean is nothing but it is attribute so you should need to define here because it should know from which class it will get desired field then why we will call it Use bean> see below may be it help you <jsp:useBean id="p1" class="com.envious.Person" scope="session"/> First Name: <jsp:setProperty property="firstname" name="p1" value="abc"/><br> <jsp:getProperty name="p1" property="firstname"/><br> Last Name: <jsp:setProperty property="lastname" name="p1" value="xyz"/> <jsp:getProperty property="lastname" name="p1"/>

Categories : Java

Jasper creates empty PDF
The detail band of your report will be repeated for every row in the datasource. However your filling the report with an empty data source, this is why the band is not showing. Try moving your textfield in the title band to see it.

Categories : Java

Decorator that creates classes
Not possible. Making 3 classes is easy. Assigning the results to 3 variables, though? That violates Python's scope rules. @mc_me class Test: name = "Test" is equivalent to class Test: name = "Test" Test = mc_me(Test) There's no way for the decorator to say that it wants to create some more variables and assign to those too. Even if you somehow managed to get it to work (probably only at module or class scope with inspect craziness), Python would have no way to know that references to TestSuper or TestExtra should refer to the variables created by the decorator when compiling the bytecode.

Categories : Python

SQL inner join creates duplicates
Use proper join syntax consistently. You are mixing old-style joins (, with condition in the where clause) with proper ANSI join syntax. You mean something like this: SELECT s.SNAME, d.QTY FROM Suppliers s join Deliveries d d.SupplierId = s.SupplierId join Products p ON d.P = Products.Penter; I'm making up the join field between Suppliers and Deliveries. And, I'm only guessing that those are the tables that need to be connected (perhaps it is Suppiers and Products).

Categories : SQL

C# compiler creates ref class
Your ´Position´ class is a ´reference type´ When you equal pos2 to pos1 it points to the same memory location. Changing the property of one object will thus change the other one also as it is the same object

Categories : C#

Can't do multitask, creates errors?
You are swallowing your exception, so to speak, by just showing an arbitrary message. Instead, make use of the Exception instance provided in the catch: catch (Exception ex) { MessageBox.Show(ex.Message); } Although, I wouldn't necessarily condone throwing up dialogs, you can use the debugger to break in the catch block, interrogate stuff and things, and correct the problem.

Categories : C#

Script that creates files on AWS
It is impossible to know where your code outputs the file. Do you have a hardcoded directory in your code that happens to be the same as the one your script is in? What have you tried as far as running your code on AWS? Could you share the relevant code with us? To run the scripts in AWS you do what you would do to run the script on any machine. Copy over the .py file(s) and make sure python is installed. Then from the command line call "python .py".

Categories : Python

PHP creates new instance when pushing element
By default, PHP is copying values when assigning them. If you want a reference, you can use the & operator: $a = array(); $b = &$a; $b[] = "Hello!"; echo count($a); // prints 1 echo count($b); // prints 1

Categories : PHP

adding one DIV creates many white space
The white space is caused by .welcome-container, which has a huge margin-top. Demo Change is: .welcome_container { margin: 0px auto 55px auto; // was margin: 413px auto 55px auto; text-align: center; width: 760px; }

Categories : HTML

EF creates a new UserProfile every time I reference one?
I think the problem is that the UserProfile object on the Password is not attached the the DbContext that you're using to Insert. This makes EF think that it's a new object. Try: using (MediaProfitsDb db = new MediaProfitsDb()) { db.UserProfiles.Attach(pw.UserProfile); db.ProtectedPasswords.Add(pw); db.SaveChanges(); return true; }

Categories : C#

IsAntiAlias creates border around graph
i dug around the zedgraph source; couldn't find any easy cause/fix. so, i just turned off antialiasing for the whole graph (in the designer) and then turned it on for the individual components: myPane.XAxis.Title.FontSpec.IsAntiAlias = true; LineItem curve_x = new LineItem("x", x_values, sensor_x, Color.Red, SymbolType.None, 2.5F); LineItem curve_y = new LineItem("y", x_values, sensor_y, Color.Blue, SymbolType.None, 2.5F); LineItem curve_z = new LineItem("z", x_values, sensor_z, Color.Green, SymbolType.None, 2.5F); curve_x.Line.IsAntiAlias = true; curve_y.Line.IsAntiAlias = true; curve_z.Line.IsAntiAlias = true; myPane.XAxis.Scale.FontSpec.IsAntiAlias = true; myPane.YAxis.Scale.FontSpec.IsAntiAlias = true; that

Categories : C#

JSP still creates jsessionID with session=false
The directive <@page session="false"> will eliminate the automatic creation of an HTTP session when you access to a JSP page. See for the details: http://docs.oracle.com/cd/A97688_16/generic.903/bp/j2ee.htm#1008677 Clarification: if you access other pages (or resources) that create an HTTP session and then you access the page with the directive <@page session="false"> the session will not be destroyed.

Categories : Jsp

Android App Creates Incomplete Images
try this code public Bitmap PutoverBmp(Bitmap all, Bitmap scaledBorder) { Paint paint = new Paint(); final int width = bmp.getWidth(); // bmp is your main Bitmap final int height = bmp.getHeight(); patt = Bitmap.createScaledBitmap(bmp, width, height, true); Bitmap mutableBitmap = patt.copy(Bitmap.Config.ARGB_8888, true); Canvas canvas = new Canvas(mutableBitmap); scaledBorder = Bitmap.createScaledBitmap(border, width, height, true); paint.setAlpha(100); canvas.drawBitmap(scaledBorder, 0, 0, paint); return mutableBitmap; } simply call this Bitmap combine = (bmp , yourOtherBitmap);

Categories : Android



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.