w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

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

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

Portable programming - Linking fails fails with Win32 but links with linux
Microsoft is using a lot of defines in their header for unicode support. In your case the name OpenFile seems also to be defined to be eiter OpenFileA or if you switch to unicode it would be OpenFileW. To get rid of this problem add this after including the headers from microsoft. #undef CopyFile You can of course pack it into a #ifdef to limit it to the microsoft platform.

Categories : C++

Http Request fails from ASP.NET code on Test server (also fails from IE... but not firefox!?)
I finally found a relevant error in the server's windows event log: An TLS 1.0 connection request was received from a remote client application, but none of the cipher suites supported by the client application are supported by the server. The SSL connection request has failed. I created a new question, an actually answerable one, Here: How to add to the cipher suites available to ASP.NET HttpRequest client?

Categories : C#

If fails or copy function fails?
At the prompt, run the following commands: $ set -- FILENAME # FILENAME is the value you think $1 is supposed to have $ [ ! -f "/Folder1/$1.jpg" ] && [ -f "/BU_Folder2/$1_BU.jpg" ] && echo success If the last command does not print "success", then your script probably does not have the value for $1 that you think it does. Add echo $1 to the top of your script to confirm. If it does print "success", and your script has no error output from cp, I'm not sure what to suggest.

Categories : Bash

My MapReduce job become Fails
Most probably the input file you are reading has a row that doesn't have 4 columns. So when you split the row into an Array, String[] bookdata = st.split("";""); And you want to access the 4th element output.collect(new Text(bookdata[3]), one); It fails.

Categories : Hadoop

assertNotEmpty("0") fails. Why is it?
From http://php.net/manual/en/function.empty.php The following things are considered to be empty: "" (an empty string) 0 (0 as an integer) 0.0 (0 as a float) "0" (0 as a string) NULL FALSE array() (an empty array) $var; (a variable declared, but without a value)

Categories : PHP

SSH Connections one after another, second one fails
According to the documentation, exec doesn't block. Trying using exec! instead. Net::SSH.start(self.to_creds['host'], self.to_creds['user'], :password => self.to_creds['password']) do |ssh1| # Do some other stuff here tmp_path = "#{self.to_creds['filepath']}/tmp/#{Time.now.to_i}" ssh1.exec! "mkdir -p #{tmp_path}" ssh1.exec! "cd #{self.to_creds['filepath']}/#{new_client_id}" end Alternatively, Net::SSH.start(self.to_creds['host'], self.to_creds['user'], :password => self.to_creds['password']) do |ssh1| # Do some other stuff here tmp_path = "#{self.to_creds['filepath']}/tmp/#{Time.now.to_i}" ssh1.exec "mkdir -p #{tmp_path}" ssh1.exec "cd #{self.to_creds['filepath']}/#{new_client_id}" ssh1.loop end

Categories : Ruby

Fails to get ini file value
You're not specifically saying where TIniFile.Create should look for the config.ini file, so it's looking in the Windows directory by default and not finding it, and returning the default value you said it should return. You need to specify the location of the config.ini file. If it's in the same folder as your application, you can get the path from either ParamStr(0) or Application.ExeName using ExtractFilePath like this (I've added a try..finally to guard against exceptions, and moved the WriteLn so that it's only called if the ReadString succeeds): procedure testManejoIniFile(); var iniFile: TIniFile; user: String; Path: string; begin {Abro el archivo ini} Path := ExtractFilePath(ParamStr(0)); // Or Application.ExeName iniFile := TIniFile.Create(Path + 'config.ini'); try

Categories : Delphi

CreateFile() always fails
Print out filename before you try to use it. Nine times out of ten, a simple debug output like that will show you the exact problem. And print it out with delimiters so that you can see if you have a newline in there: printf ("[%s] ", filename); (or equivalent means, such as using wprintf). If there's a newline, you'll see: [myfile.txt ] instead of: [myfile.txt] If you get a string where you want the newline stripped, you can use something like: int slen = strlen (filename); if ((slen > 0) && (filename[slen-1] == ' ')) filename[slen-1] = ''; (again, or equivalent, such as using wcslen). And on another matter, you shouldn't need to replace with \ if the input is coming from the user. The escaping is only required in the C source code itself. And, one last thi

Categories : C

ANT compilation fails
It would appear module1 is not compiling because the jar created by module2 is not being built. You're calling the subant task, without specifying target: <subant target="buildJar"> <fileset dir="../module2/" includes="build.xml" /> </subant> The module1 build file does not have a default target specified: <?xml version="1.0" encoding="UTF-8"?> <project name="module2"> .. .. My recommended solution is to specify a default target as follows: <project name="module2" default="buildJar"> Aside Multi-module build support and dependency management are features baked into more modern Java build tools. If you're trying to structure a large project in ANT, consider learning how the ivy plugin works.

Categories : Java

Python trying fails
why arent you using the except keyword try: newbutton['roundcornerradius'] = buttondata['roundcornerradius'] buttons.append(newbutton) except: pass this will try the first part and if an error is thrown it will do the except part you can also add the disered error you want to except a certain error like this except AttributeError: you can also get the excepted error by doing this: except Exception,e: print str(e)

Categories : Python

RegularExpressionAttribute always fails
You can simplify your implementation by using the Validator. See here for more details. This should do the trick. public static IEnumerable<string> ValidateObject(this object model) { var context = new ValidationContext(model); var results = new List<ValidationResult>(); Validator.TryValidateObject(model, context, results, true); return results.Select(r => r.ErrorMessage); } Update I originally forgot the additional true (validateAllProperties) at the end of the call to TryValidateObject. The true specifies the validator to check every property and every ValidationAttribute. I tested this against you use case Lot = "a12345" which works (does not return an error message) v.s. Lot = "a1234$" which does return an error message. Hope this helps.

Categories : C#

Self-Hosted WCF SSL on Win XP Fails
Ok, so to understand what was causing this problem I had to first turn on schannel error logging (http://support.microsoft.com/kb/260729). Under: HKEY_LOCAL_MACHINESystemCurrentControlSetControlSecurityProvidersSCHANNEL, I added a new reg DWORD: EventLogging with value 7. Then restart the machine. Then looking at the logs, I saw error: Event Type: Error Event Source: Schannel Event Category: None Event ID: 36870 Date: 8/29/2013 Time: 8:03:07 PM User: N/A Computer: DEVELOPMENT Description: A fatal error occurred when attempting to access the SSL server credential private key. The error code returned from the cryptographic module is 0x80090016. For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp. This error led me to t

Categories : Wcf

Why PHP output fails?
PHP has a timeout setting, which is typically set by default to around 30 seconds. If the program takes longer than that to run, it will throw a timeout error and stop running. It does not matter whether you have been sending output to the browser or not; if the timeout limit is reached, the program will stop. This 30 seconds value can be adjusted in a number of ways. You can set it in the php.ini file, or adjust it directly in your program while the program is running. Please note that some web hosts may prevent you from changing the timeout. If you have trouble changing it, you may need to talk to your hosting company.

Categories : PHP

Why .on('click') fails
you can try this $("html").on('click', '.mybutton', function(event) { // do all sorts of stuff }); Here is the working example http://jsfiddle.net/UhFsB/

Categories : Jquery

jQuery fly out div fails
Change < a href="#" id="show2" class="morelinkwhite">Find Out More< /a> to < span id="show2" class="morelinkwhite">Find Out More< /span> when you click link with # it refreshes the page and jumps to the top. Do it to all "Find Out More" buttons. Hope it helps.

Categories : Jquery

Why Serialize fails to do its job?
Basically, JavaScriptSerializer doesn't support that pattern of conditional serialization. So: use one that does - fortunately, Json.NET does support this, and works fine: string jsonData = JsonConvert.SerializeObject(pageModelInstance); (no other changes needed, although you can safely remove the [Serializable] - that isn't needed)

Categories : C#

Why does iterating through a map fails in C++?
You set your loop to end when you reach the container.end, but because you increment the iterator twice you reach the end, then with that second it++ you try to go further (error). Example: let's say you have 3 elements. it = container.begin() ++it // ok ++it //ok it != container.end() //true ++it // ok BUT AT THIS MOMENT it = container.end ! ++it // CRASH

Categories : C++

STAssertEquals fails even though a1 = a2
Consider the following setup: double a = 4.45; double b = 7.34; double result = a - b; double testVal = -2.89; At this point, if you look at the actual values in memory of result vs. testVal you'll see the following: (lldb) p/x *(uint64_t*)&testVal (uint64_t) $1 = 0xc0071eb851eb851f (lldb) p/x *(uint64_t*)&result (uint64_t) $2 = 0xc0071eb851eb851e So you can see that indeed there is a difference, likely due to rounding in the subtraction operation, in the very last bit of the significand of result vs. the literal we put in testVal. This difference may not be apparent when the formatting code converts the native binary representation to decimal, as these conversions are not always exact, but it still affects the literal equality of these two values. Practically speaking, you

Categories : Objective C

Why "kill -15" fails sometimes?
It's not duplicate, but the answer is the same. Attach strace or gdb and see what it's doing when it's hung. However there are only two explanations: either you (or some library code you're using) blocked SIGTERM with sigprocmask, or the process is stuck in uninterruptable sleep in the kernel, which is usually a result of attempting to access a failing storage device like a dying hard drive or scratched optical disc. Could you elaborate on what OS, kernel version, libraries, etc. you're using?

Categories : C

Function Fails after a while
if (res != NULL) { row = mysql_fetch_row(res); if ((row!=NULL) && (row[0] != NULL) && (row[1] != NULL)) { strcpy(ip,row[0]); *port = atoi(row[1]); mysql_free_result(res); mysql_close(&mysql); mysql_close(conn); mysql_library_end(); return true; } mysql_free_result(res); mysql_close(&mysql); mysql_close(conn); mysql_library_end(); } if res is NULL you do not cleanup!

Categories : Mysql

Android AsyncTask fails
You forgot to open database ...!! Just add following code before you entered query for getting data Database_Object.getWritableDatabase(); Hope it helps you

Categories : Android

Twitter authentication fails
OK. I resolved the problem. Apparently, the issue was that my R version was 3.0.0, but the twitteR package has been updated for version 3.0.1. An update of the version fixed the error. Thanks, Valentin

Categories : R

Assign new value to variable fails
In POSIX shells such as Bash, $ is not part of the variable-name, it's just the notation for expanding the variable (to obtain its value); so, for example, echo "$_TYPE" prints the value of the variable _TYPE. You don't use the $ when you're assigning to the variable. So you just need: if [[ "$_TYPE" = 1 || "$_TYPE" = 2 ]] ; then _TYPE=Outbound fi

Categories : Shell

Cython c++ example fails to recognize c++, why?
Following the example exactly, on a very similar system to yours, everything works fine for me. But, along with a few other differences (an IndentationError, naming the file rectangle.pyx instead of rect.pyx, …) which turned out not to be relevant to this problem, you also left off this at the top of your Cython file: # distutils: language = c++ # distutils: sources = Rectangle.cpp And if I leave that off, I get the same error.

Categories : C++

Per https Authentication fails
I speculate that in your use of the 4 parameter form of the credentials method, the netloc and user are wrong. When the URL is https://www.example.com/foo/bar?quux;baz=42#fnord, the netloc is www.example.com:443. The user is a string of the NTLM domain, a single backslash, and the NTLM username, e.g. internalernd. Mind that if you hardcode that value as a string literal as you did in the example, you need to escape the backslash with a backslash. Check for these possible errors.

Categories : Perl

Use of POS.NET in .NET 4.0 WinForms application fails
I did figure out this my self adding: <runtime> <NetFx40_LegacySecurityPolicy enabled="true"/> </runtime> to my app.config did the trick!

Categories : C#

mkdir fails in the /tmp directory
Don't do that. Use PHP's awesomely called function, tmpfile(). From the docs: $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fseek($temp, 0); echo fread($temp, 1024); fclose($temp); // this removes the file

Categories : PHP

HttpWebRequest fails when called via WCF
The error indicates that the calling party (your service in this case) does not trust the certificate used by the server. There is a different trust store for interactive users and system users. So if your service runs on IIS you are using a different user than in your unit tests and that user uses the system trust store. Depending on your needs either apply the workaround in the link you sent or add the correct certificate to the store.

Categories : C#

jQuery $.getJSON() Fails
Your return looks like this : mycallback({ "test": "variable", "test2": "variable2" }) while a valid json would be: { "test": "variable", "test2": "variable2" } A valid json can only start with an array sign [ or an object sign { you can validate any json string on http://jsonlint.com

Categories : Jquery

cron job fails in gae python
I,m pretty sure this error was due to DeadlineExceededError, which I did not run into locally. My scrape() script now does its thing on fewer companies and articles, and does not run into the exceeded deadline.

Categories : Python

MediaPlayer+SurfaceView app fails
I found out what was my mistake. The log indicates the line 128: 07-20 17:54:07.236: E/AndroidRuntime(5713): java.lang.NullPointerException 07-20 17:54:07.236: E/AndroidRuntime(5713): at com.example.mediaplayer_video.Mediaplayer_video.surfaceCreated(Mediaplayer_video.java:128) At line 128 Mediaplayer_video.java this: public void surfaceCreated(SurfaceHolder holder) { Log.d(TAG, "surfaceCreated called"); playVideo(extras.getInt(MEDIA)); PlayVideo() method defined as playVideo(Integer Media), and Media = null. Fixed the playVideo(Integer Media) and playVideo(extras.getInt(MEDIA)) on playVideo() and everything earned.

Categories : Misc

For Loop Fails on HTML -- PHP
The cells that are returned will be empty, so echoing the table will not work. Try to give the cells a test value. When you leave the < and >, the var value is not recognized as HTML and will be echoed like text.

Categories : PHP



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