w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Cassandra: what is the correct configuration for EC2 multi-region?
According to the docs: broadcast_address: (Default: listen_address) If your Cassandra cluster is deployed across multiple Amazon EC2 regions and you use the EC2MultiRegionSnitch, set the broadcast_address to public IP address of the node and the listen_address to the private IP. listen_address: (Default: localhost) The IP address or hostname that other Cassandra nodes use to connect to this node. If left unset, the hostname must resolve to the IP address of this node using/etc/hostname, /etc/hosts, or DNS. Do not specify rpc_address: (Default: localhost) The listen address for client connections (Thrift remote procedure calls). seed_provider: (Default: org.apache.cassandra.locator.SimpleSeedProvider) A list of comma-delimited hosts (IP addresses) to use as contact points when

Categories : Amazon

I am using ajax to show the output after entering some data on textfield ,it is not showing proper output?
The approach should be Write onchange event (onchange of textbox content call the process() function) for the text box. or To add a button to triggering the function. => user enters the dish and clicks on button. Approach one (Using jQuery) <!DOCTYPE> <html> <head> <script type="text/javascript" src="jquery-1.9.1.min.js"></script> <!--<script type="text/javascript" src="foodstore.js"></script>--> <script> $(document).on("keyup","#inputuser", function(){ var dish = $(this).val(); $.ajax({ type: "GET", url: 'foodstore.php', data : {food:dish}, success: function(data){alert(data); $('#usererror').html(data); } });

Categories : PHP

how to get notification when I changed the Region Format in Settings
Register for the NSCurrentLocaleDidChangeNotification notification. This will be called when the user returns to your app after the Region Format has changed. The UIApplicationSignificantTimeChangeNotification notification is for time changes, not locale changes.

Categories : IOS

Proper binding configuration for web service with plaintext password
Use ClearUsernameBinding in case there is no SSL. If there is SSL use this: <basicHttpBinding> <binding name="NewBinding0"> <security mode="TransportWithMessageCredential" /> </binding> </basicHttpBinding> and in either case turn on wcf log and trace on the server to see how your message differs from soapUI and what are the inner server exceptions.

Categories : Dotnet

Updating Date Time Format specified in the regional settings of the system(Region and Language)
CultureInfo data is cached first time it's requested, so it's required to call CultureInfo.ClearCachedData method to get updated format values. As a side note it's pretty strange that you assuming frequent settings changes during app runtime. If it's requred for app to have some sort of format changes it's better to make that an application option.

Categories : C#

Could not find tool aapt. Please provide proper Android SDK directory path as configuration parameter
If you are using android version 17, you might want to try this documented workaround (i.e. I did not find it myself). cd <android-sdk>/platform-tools ln -s ../build-tools/17.0.0/aapt aapt ln -s ../build-tools/17.0.0/lib lib

Categories : Android

Convert into proper XML format
Add a reference to System.Web and use the HttpServerUtility.UrlDecode Method (String): var decodedXml = System.Web.HttpUtility.UrlDecode(xml);

Categories : C#

DateTime is not in proper format
There's several ways to do this. Either: Change the regional settings for the user running your web application Use the correct CultureInfo object when formatting Set the default CultureInfo object on the current thread Escape the slashes To provide a CultureInfo object when formatting: @Html.DisplayFor(modelItem => item.EndDate.ToString("dd/MM/yyyy", CultureInfo.GetCulture("en-US"))) To set the default CultureInfo object: Thread.CurrentThread.CurrentCulture = CultureInfo.GetCulture("en-US"); To escape the slashes, use single quotes: [DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:dd'/'MM'/'yyyy}")] Note that all the code ends up in DateTime.ToString(string) or one of its overloads, so that's the place to look for clues to this.

Categories : C#

how to get proper dropdown format for dates
The POSTed information is the value of the option, not its text. If you want the text, you can: echo "<option value=".$month_array[$i]." name='Resolved_date2'>".$month_array[$i]."</option>"; To limit the number of days according to the chosen month, you'll have to do it on the client side, using javascript or preferably one of its frameworks like jQuery.

Categories : PHP

jsp not passing UTF-8 data in proper format
The character encoding specified in the page (or in the web.xml) is applied to the following phases of an HTTP communication: Preparing / sending the Request from the Client to the Server Receiving / reading the Request in the Server Preparing / sending the Response from the Server to the Client Receiving / reading the Response in the Client The Application Server is the only responsible for the phase 2. You need to look for your specific application server settings, to alter the default character encoding (that could easily be ISO-8859-1), and alter it to work in UTF-8. For example, in Tomcat you would need to edit the conf/server.xml file, by adding the URIEncoding="UTF-8" parameter to the <Connector>, for example from <Connector port="8090" /> to <Connector p

Categories : Java

What's the proper format for a union initializer list?
A union holds only one member at a time, so you initialize it with only one value. You may use Box iMyBoxA = { value }; to initialize the first-listed member of the union or Box iMyBoxA = { .name = value }; to initialize a particular member by name. Some notes: Your code is missing a semicolon after the union declaration; it should be: struct Box { union { AS128 intr; AS32 a, b, c, d; }; }; Since you have a union inside a struct, you ought to use two sets of braces for the initializers: Box iMyBoxA = { { value } }; The syntax with one set of braces is permitted but may elicit warnings from your compiler. Designated initializers (member names in initializers) are a C 1999 feature. This question is tagged with C and C++. A C++ compiler might or might not accept a designated initial

Categories : C++

Proper number format not coming for spanish
You have to set NSNumberFormatterCurrencyStyle instead of NSNumberFormatterDecimalStyle and CurrencySymbol to Empty to remove the symbol of Currency. Working Code : NSNumberFormatter *currencyFormatter = [[NSNumberFormatter alloc] init]; [currencyFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; [currencyFormatter setCurrencySymbol:@""]; [currencyFormatter setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"es_ES"]]; NSLog(@"Final Value :: %@", [currencyFormatter stringFromNumber:[NSNumber numberWithFloat:1000000]]); Output (As you want without Currency Symbol) : Final Value :: 1.000.000,00

Categories : Iphone

LocationManager region monitor is not what I expected. The region boundary looks bigger than my settings
My experience is that this is normal behavior. I've been using region monitoring for about 2.5 years now and since iOS 6, the -didExitRegion delegate takes much longer to trigger than the -didEnterRegion. I also had this behavior confirmed by an Apple Engineer during WWDC 2013. It doesn't sound as if they plan to improve the accuracy, rather delay, in the exit events. According to the engineer, the OS takes a lot longer to decipher that you've left because it has to completely get out of range of known Wifi networks and to new cell towers. It is much easier to determine you've arrived than it is to determine you've left. If it is only taking 300M or so to trigger your geofence (outside the 300M radius), I'd say you are probably within the operating limits of the geofence. If you need prec

Categories : IOS

How to disable a region when a child window pops up in another region in prism mef wpf
You can bind your viewModel's main content's attribute IsEnabled to a boolean property IsPopupGone. In the constructor of your toolbar subscribe EventAggregator to an event PopupWindowStateChanged and payload as a boolean. Then when your popup window(s) display, publish this event with True, and when closed publish as False. private bool isPopupGone = true; // default/original state assumed to be no childs showing public bool IsPopupGone { get { return isPopupGone; } set { isPopupGone = value; /* implement notifypropertychanged */ } } public ToolbarViewModel(IEventAggregator eventAggregator) { EventAggregator = eventAggregator; EventAggregator.GetEvent<PopupWindowStateChanged>().Subscribe(UpdateEnabledState); } public void UpdateEnabledState(bool isPopupShowing

Categories : Wpf

Changing the Export-CSV output output format
Your output format is not CSV, so Export-Csv is not a suitable tool for you. Try this instead: Get-Admins | group { $_.Computer } | % { '{0},{1}' -f @($_.Group.Computer)[0], ($_.Group.AdminGroupMembers -join ',') } | Out-File 'output.csv' For PowerShell v2 you'll need to manually expand the group properties: Get-Admins | group { $_.Computer } | % { $computer = @($_.Group | select -Expand Computer)[0] $admins = ($_.Group | select -Expand AdminGroupMembers) -join ',' '{0},{1}' -f $computer, $admins } | Out-File 'output.csv'

Categories : Powershell

proper output not given by SQL Count Statement
After executing mysql_query you need to fetch results from that. Read the documents here fetch-assoc BTW stop using mysql functions they are deprecated use either PDO or mysqli functions.

Categories : PHP

Unable to get proper output of if-else loop
You need to add an space in the 2nd condition: [["${arr[1]}" == "MySQL-client-5.6.5_m8-1.rhel5"]] ^ ^ / - here here - so it is [[ "${arr[1]}" == "MySQL-client-5.6.5_m8-1.rhel5" ]]

Categories : Shell

GD - Getting the proper output function from imagecreatefromstring()
You can use getimagesize() php function in order to see what type of image you are dealing with and accordingly use the proper method based on it. http://php.net/manual/en/function.getimagesize.php

Categories : PHP

Get proper format of the text file in HTML form
If I get it right, you should replace your new line characters with <br> or <p>. Try str = [str stringByReplacingOccurrencesOfString:@" " withString:@"<br>"]; How to detect new lines in Objective-C Solution of your next question might look like this: NSArray *words = [str componentsSeparatedByString:@" "]; NSString *line = @""; NSUInteger maxLineLength = 100; NSString *resultStr = @""; for (NSString *word in words) { if ([line length] + [word length] > maxLineLength) { resultStr = [resultStr stringByAppendingFormat:@"%@<br>", line]; line = word; } else { line = [line stringByAppendingFormat:@" %@", word]; } } resultStr = [resultStr stringByAppendingString:line];

Categories : HTML

C - What is the proper format to allow a function to show an error was encountered?
There is not really a standard practice for this kind of error handling in C. But a good handling in your specific case would be returning NaN, in other words 0.0/0.0. /* error else */ else { etc(); return 0.0/0.0; } Which would yield NaN. You can check if a value is not a number by comparing it with itself, as NaN is the only float/double value that will fail when comparing to itself. yvalue = getYValueAt(...) if (yvalue != yvalue) { treat_error_here(); } This is just an option, there are other ways of handling this kinds of error.

Categories : C

Laravel4: check if the inserted email is in a proper format
Just define a custom error message: $messages = array( 'email' => 'Address in mailbox given :attribute does not comply with RFC 2822, 3.6.2.', ); $validator = Validator::make($input, $rules, $messages);

Categories : Forms

how can i get array in proper format from this foreach and nested if condition in php?
Update to this one. From : array_push($color1,$color); $items = array($color1); To array_push($color1, $color); if(!empty($color1)) { $items[] = $color1; } And $items = array() before loop.

Categories : PHP

How to place content in proper table format in repeater?
Ignoring the fact that this piece of HTML is totally invalid (ul -> li -> div -> a -> table), try to set the cell vertical alignment to top (<td valign="top">). A good advice. Try to use CSS and rewrite this using just divs and make it valid. <ul> <li> <div class="product"> <a href="#" class="info"> <table class="holder"> <asp:Repeater ID="repContent" runat="server"> <ItemTemplate> <%# (Container.ItemIndex + 4) % 4 == 0 ? "<tr>" : string.Empty %> <td valign="top"> <img src='<%#"/productimages/main/" + Eval("PhotoName").ToString().Trim

Categories : Asp Net

Emacs: select a region and type to delete the region
I don't think it does it out of the box, it looks like you have to turn on delete-selection-mode as per this article on EmacsWiki. So, basically put the following line into your .emacs: (delete-selection-mode 1)

Categories : Emacs

HBase region over region servers load not balanced
Are you using sequential rowkeys, like timestamp?If that is the case you might end up with RegionServer Hotspotting, putting uneven load on the servers. Avoid using sequential keys, if you can. If it is not possible create pre-splitted tables.

Categories : Hadoop

Primefaces p:calendar and format user input into proper date
it's true that's too late but may be cold help someone else . you can't use Mask but you can do it with regex expression for exemple : <p:calendar value="#{MyBean.MyDate}" id="MyCalendar" effect="explode" > <f:validateRegex pattern="^(?:(?:31(/|-|.)(?:0?[13578]|1[02]))1|(?:(?:29|30)(/|-|.)(?:0?[1,3-9]|1[0-2])2))(?:(?:1[6-9]|[2-9]d)?d{2})$|^(?:29(/|-|.)0?23(?:(?:(?:1[6-9]|[2-9]d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1d|2[0-8])(/|-|.)(?:(?:0?[1-9])|(?:1[0-2]))4(?:(?:1[6-9]|[2-9]d)?d{2})$"> <p:ajax update="msgMyCalendar" event="keyup" /> </f:validateRegex> </p:calendar> <p:message for="MyCalendar" id="msgMyCalendar" display="icon"/>

Categories : Jquery

A proper way to output text immediately in Java Swing GUI
Read up on Concurrency. You should probably use a SwingWorker for the long running task, then you can publish results to the GUI as they become available.

Categories : Java

Problems with the foreach-Loop, to get proper Output as an XML-File
You've got two separate loops at the outermost level, first off. This doesn't seem useful. Secondly, you are looping over the myPackage.Packages collection, then each time through that loop you do nothing with the loop variable myPackages but simply launch into the inner loop which does the work. So you end up with one copy of each element for each subpackage in myPackage (and none if there are no subpackages). So clearly that has to go. Finally, setting up an XElement as a formatter and then successively copying the XML data into your own string is probably not the best solution. It's better to use XElement to construct the XML tree first and then dump the contents. So it should look something like this (not tested, not compiled): XElement xPkg = new XElement(myPackage.Name.ToString()

Categories : C#

SImple C program with array is not printing proper output
C arrays are 0 indexed - your program writes outside the boundaries of the new array, so it causes undefined behaviour. In this case, you probably are overwriting the i variable, so you end up with an infinite loop. You need to change your loops: for (i = 0; i < 10; i++) { new[i] = 0; } and: for (i = 0; i < 10; i++) { printf("%d", i); }

Categories : C

jQuery datepicker changing format dosent show proper month
If you only need to month and year (since thats what you are storing on the input) you can use this: $(function() { //set datepicker or month/year selection $('#a').datepicker( { changeMonth: true, changeYear: true, showButtonPanel: true, dateFormat: 'MM yy' }); $("#a").focus(function () { $(".ui-datepicker-calendar").hide(); //add event to perform on done button click $(".ui-datepicker-close").click(function(){ var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val(); var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val(); $("#a").datepicker('option', 'defaultDate', new Date(year, month, 1));

Categories : Javascript

How to get current date and time and save it into char* array in proper format?
You can use strftime function: http://www.gnu.org/software/libc/manual/html_node/Formatting-Calendar-Time.html strftime is described in C99 Standard in

Categories : C

Java SimpleDateFormat.format(date) configuration
Have you tried setting Locale in DateTime format object: private final SimpleDateFormat dformat = new SimpleDateFormat("EEEE dd-MMMMM-yyyy HH:mm:ss a",Locale.US); Not all languages are following US standard (Capitalized day and month names). Therefore what output value java DateTimeFormat is giving was expected. You could find this interesting discussion in the following questions How to control the capitalization of month and day names returned by DateFormat?

Categories : Java

SSL configuration in Jboss 7.1 - java.io.IOException: Invalid keystore format
According to the JBoss HTTPS connector documentation, the certificate-key-file attribute should be pointing to a keystore, not a key. So you will need to import that key into a JKS keystore. There are examples on how to do that in the JBoss SSL Configuration documentation.

Categories : Ssl

Azure Management Service API gives deployment configuration in some Encrypted format
This is the expected behavior. REST API returns the data in Base64 encoded format. Since Windows Azure PowerShell consumes the same REST API, they convert the data from Base64 format and present it in humanly readable format. This is what you would also need to do. So in your code you would do something like this: string clearText = System.Text.Encoding.UTF8.GetString( Convert.FromBase64String(reader.ReadToEnd()));

Categories : Azure

How can I get the country and region code using geolocation instead of full country and region names
You should use the short_name value for the country, which is the two-digit country code. These are ISO standard codes and should be the basis for your database lookup, not the localized country name.

Categories : Javascript

Format XML output without HTML tag using XSL
First thing to note is that is that currently you are doing this <xsl:value-of select="user:ShowFolderFileList('.')"/> When really you ought to be doing this to use your file path in your XML <xsl:value-of select="user:ShowFolderFileList(string(xml/folder/text()))" /> Note the use of "string()" here, because "text()" actually returns a text node, a not a datatype of string. Secondly, when you use javascript functions in XSLT in this way, I believe they can only return the simple data types of string and number. Your function is returning a string, not actual XML, when you use xsl:value-of on a string, any reserved symbols will be escaped. Now, you can be a bit naughty and do this <xsl:value-of select="user:ShowFolderFileList(string(xml/folder/text()))"

Categories : Javascript

Why am I not getting the output in the string format?
Encode the bytes in Base64 encoding (How do I convert a byte array to Base64 in Java?) Or Hex: Convert from byte array to hex string in java System.out.println( Hex.encodeHexString( bytes ) );

Categories : Java

Need Sql query output like this format
This should get you started: declare @Hours as Table ( EmpId Int, Monday Time, Tuesday Time, Wednesday Time, Thursday Time, Friday Time, Saturday Time, Sunday Time, StartDate Date, EndDate Date ); insert into @Hours ( EmpId, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, StartDate, EndDate ) values ( 1, '08:00', '08:12', '00:00', '04:00', '00:00', '03:00', '00:00', '20130510', '20130516' ); select * from @Hours; with Week as ( -- Build a table of all of the dates in the work week. select StartDate as WorkDate, EndDate from @Hours union all select DateAdd( day, 1, WorkDate ), EndDate from Week where WorkDate < EndDate ) -- Output the result. select EmpId, case DatePart( weekday, W.WorkDate ) when 1 then H.Monday when 2 th

Categories : SQL

How can I format the output of "grep"?
You need to do: grep -Hn -e PIPPO -e PLUTO -e TOPOLINO *.csv >> result.txt You can run the grep in a different directory if you want the full path: cd / grep -Hn -e PIPPO -e PLUTO -e TOPOLINO /your/path/*.csv >> result.txt If you want to only show the matching parts add the -o parameter to grep: grep -Hno -e PIPPO -e PLUTO -e TOPOLINO *.csv >> result.txt

Categories : Linux

How to format the output to the center in C?
Just add a field width in your format string, e.g. printf("+--------------+---------- " " Postal number| Tele " "----------+-----------------+--------------- " "%8u | %3u", number, tele);

Categories : C

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