w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Title case for a paragraph
Strings are immutable, in Python. You can assign the new string again to tha same variable, or convert it into list, mutate the list, and ''.join() it again. >>> sentence = list("hello. who are you?") >>> for l in range(0, len(sentence)-1): ... if l == 0: ... sentence[l] = sentence[l].upper() ... elif sentence[l] == ".": ... sentence[l+2] = sentence[l+2].upper() ... >>> ''.join(sentence) 'Hello. Who are you?'

Categories : Python

slidify layouts: title-only, title-and-body, title-and-two-cols, title caption, and blank
Slide layouts are mustache templates that can make use of objects returned by the parser. You can find a list of objects returned by the parser here. Coming to the question raised, here is how one would go about building the layouts for the slides. Title Only <slide class="segue nobackground {{ slide.class }}" id="{{ slide.id }}"> <hgroup> {{{ slide.header }}} </hgroup> </slide> The two column layout inherits from the parent layout, and the column widths are configurable. Two Columns --- layout: slide replace: slide.content --- {{{ slide.content }}} <div class='left' style='float:left;width:{{{ slide.left.w }}}'> {{{ slide.left.html }}} </div> <div class='right' style='float:right;width:{{{ slide.right.w }}}'> {{{ slide.right

Categories : R

Alternate title case in jQuery
$(window).load(function() { var z; var title = $('.post__title').text().split(""); for (i = 0; i < title.length; ++i) { z = Math.floor(Math.random() * (1 - 0 + 1)) + 0; if (z==1) { title[i].toUpperCase(); } else { title[i].toLowerCase(); } $.map(title, function(val,index) { var str = index + ":" + val; return str; }).join(", "); $(".post__title").text(str); }); You were using title[i].this.value.toUpperCase();. that is incorrect since title[i]already has the reference to the letter. Just call toUpperCase() or toLowerCase() on title[i].

Categories : Jquery

Using dataannotations displayFormat to change to title case in ASP.Net MVC
If you want to change the display name of a particualr field, just add the [DisplayName("DisplayedName")] data annotation to a property in your model. For example, if your model has the property "FirstName", you may want to display it with a space and a colon as in "First Name:" as seen here: public string FirstName { get; set; } [DisplayName("First Name:")]

Categories : Asp Net Mvc

How to select only non title-case words within brackets?
Try a Normal Map like: :noremap tc /{<CR>v%:s/v%V<(w)(w*)>%V/=toupper( submatch(1) ) . tolower( submatch(2) )/g<CR>/}<CR> How does it work? /{<CR> :: Searches an opening curly brace. v% :: Visual select the content from current position (opening curly brace) until the closing one. :s/.../g<CR> :: Substitute command that inside visual selection(%V) title-case words doing two groups, the first letter and the rest. /}<CR> :: After substitution command, if cursor comes from a different line its position is set at the beginning of line, so to avoid repeat the map against same text, set its position after closing curly brace to find next pair in following execution. I did a test with following text: Topic One ========= This is some text

Categories : Regex

Do we need restclient in case if we have to support multiple plateform
WADL (https://wadl.java.net/) is the WSDL-equivalent for RESTful services, however, it is not very widely used by now. Edit: A reason why it might be not popular can be found in this article: http://bitworking.org/news/193/Do-we-need-WADL

Categories : Java

Converting All CapsText on a SSRS report to Title Case Text
This will display GEORGIA(GA) as Georgia(GA): =StrConv(Left(Fields!Title.Value, InStr(Fields!Title.Value, "(") - 1), 3) & Right(Fields!Title.Value, InStr(StrReverse(Fields!Title.Value), "(")) Basically it's splitting the string in two based on (, applying StrConv to the left side then concatenating the two strings back together. Maybe not the most concise code ever but does the job with native SSRS functions.

Categories : Reporting Services

Regex function to make a word title case (including hyphens)
You can use the word boundary assertion  to more easily find words: /[w']+/g This will find the starting word boundary, all "word" characters and apostrophes, followed by another word boundary. Since dashes should count as word boundaries, this should catch your problem text.

Categories : Javascript

Why doesn't String switch statement support a null case?
As damryfbfnetsi points out in the comments, JLS §14.11 has the following note: The prohibition against using null as a switch label prevents one from writing code that can never be executed. If the switch expression is of a reference type, that is, String or a boxed primitive type or an enum type, then a run-time error will occur if the expression evaluates to null at run time. In the judgment of the designers of the Java programming language, this is a better outcome than silently skipping the entire switch statement or choosing to execute the statements (if any) after the default label (if any). (emphasis mine) While the last sentence skips over the possibility of using case null:, it seems reasonable and offers a view into the language designers' intentions. If we rather look

Categories : Java

Switch case, case was not found, but similar to the other case, give suggestion
I can point you in the right direction: http://php.net/manual/en/function.levenshtein.php Is a php function that can be used for your cause, there is a nice example on that page as well. A related stack overflow question has more info on when your strings are longer than 255 characters: String similarity in PHP: levenshtein like function for long strings

Categories : PHP

vb.net how to check case of label.text i.e lower case, upper case
isUpper and isLower apply to single characters within a string. I think a better solution is to create a temporary string that is formatted the way you want it and return the comparison. As an example (for ProperCase) If String.Format(yourString, vbStrConv.ProperCase) = yourString then 'your code for proper case End If With this, you should be able to get most of your comparisons going. As for toggle case, you are going to have to write an algorithm that does the string conversion for you. See http://www.codeproject.com/Tips/162540/Letter-Case-Conversion-Algorithms-Title-Case-Toggl for a fairly useful algorithm.

Categories : Vb.Net

French characters in php
You've got a UTF-8 encoded string, which would decode to Jeudi, 26 Août 2010 13:26 Make sure your page also indicates it uses UTF-8 - see <meta charset='utf-8'> vs <meta http-equiv='Content-Type'> for some techniques. Alternatively, you can decode to ISO-8859-1 with utf8_decode(), but really, you should get comfortable with using UTF-8 these days :)

Categories : PHP

Tokenizing in french using nltk
Take at the section "3.3 Text Processing with Unicode" in Chapter 3 of NTLK. Make sure that your string is prepended with a u and you should be ok. Also note from that chapter that, as @tripleee suggested: There are many factors determining what glyphs are rendered on your screen. If you are sure that you have the correct encoding, but your Python code is still failing to produce the glyphs you expected, you should also check that you have the necessary fonts installed on your system.

Categories : Python

Parse french date in php
You could use strftime. If there's only one language and you use shared hosting where french isn't supported, you could build an array with the months, and replace them with the english version.

Categories : PHP

error while updating french data
I solved this by throwing the queries into a notepad , I save it as UTF-8 then I copied it into pl/sql and compiled it. IT seems for U-TF8 database, especially for the special characteres, they should be saved as UTF-8 in the notepad , if they were saved as ANSI, this will cause problem to the database.

Categories : Oracle

French Server and HTTP Requests
I just read what "AsynkTasks" is, and I assumed you're working on android, which I know nothing about. I don't know if (or how) this might help you, but if your app can somehow send a request to somewhere that can run this PHP: http://chir.ag/projects/geoiploc/ It returns the geographical location by requester IP. Hope this helps.

Categories : Http

cant write features in French in Behat
Look at the configuration details in: [project root]/vendor/behat/gherkin/tests/Behat/Gherkin/Fixtures/i18n.yml You can also look in: [project root]/vendor/behat/gherkin/i18n.php Make sure you are using the correct syntax for it. Have you tried using the following just to see if it will work when specifying the language from the command prompt? $ behat --story-syntax --lang YOUR_LANG From: http://docs.behat.org/quick_intro.html#more-about-features Also please provide us with examples of what you are doing. It is kinda hard to troubleshoot something you can't see or analyze.

Categories : PHP

Special (French) characters in an ASP.NET MVC View
Have you tried $("#idTxWhat").val(unescape('@ViewBag.myValue')); SECOND TRY: How about this then var t = '@ViewBag.myValue'; t = decodeURIComponent(escape(t)); $("#idTxWhat").val(t);

Categories : Jquery

How can I encode French characters in objective-c?
&#39; is an html or xml entity. The data you are receiving has probably been xml encoded. You need to parse the response using a proper XML parser if this is the case. I'm guessing you are manually parsing out the data you want.

Categories : Objective C

French names using wday in lubridate
Not without writing your own method. The days of the week are hardcoded in English in lubridate:::wday.numeric labels <- c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday") You could tweak the code from my answer here and replace the English names with names in the language of your choice. # assuming x is your Date c("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")[as.POSIXlt(x)$wday + 1] Edit: Here is a version that more closely matches lubridate labels <- c("dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi") ordered(as.POSIXlt(x)$wday + 1, levels=1:7, labels=labels)

Categories : R

Android How to display french letters (like- é,à etc.) using UTF-8 or else?
You code is fine, but you need to make sure, your input is UTF-8 encoded. There are a lot of methods how to do it. Each of them is specific to your environment like your operating system. A good summary is given here: Best way to convert text files between character sets? On Linux (I guess on OSX it's the same) you do: iconv -f ISO-8859-15 -t UTF-8 in.txt > out.txt Most good text editors have options for how to save files. You might want to check that too. In modern operating systems UTF-8 should be the default.

Categories : Android

phpstorm french characters formating issue
What kind of file is that -- HTML? In any case: you do have light green background between the tags. This suggests that you have another language injected between those tags (Language Injection functionality), which may use completely different formatting rules (not HTML -- e.g. JavaScript or whatever you may have injected there). Possible solution: Place cursor somewhere between such tags, Alt+Enter (or click on light bulb icon) and use "Uninject Language" option. Alternatively: Settings | Language Injections -- find and disable (or even delete) offending entry there (will be "global" or "project" type in last column).

Categories : HTML

Sorting using tablesorter issue for french language
You should sort using a "latinised" version of the text to perform the sort. This might help, not only for french diacritics : latinise.

Categories : Javascript

Solving UTF8 & french accents incompatibility
mysql_set_charset('utf8', $db_handle) tells the database that the data you're going to send it will be encoded in UTF-8. If the result is messed up, that means you did not in fact send UTF-8 encoded text. Double check the encoding of what you're sending. I thought UTF8 does support characters like the french accents, but obviously it doesn't! I does just fine. See What Every Programmer Absolutely, Positively Needs To Know About Encodings And Character Sets To Work With Text and Handling Unicode Front To Back In A Web App.

Categories : PHP

How to allow only numbers in a texbox but also allow entry with French keyboard
Would this work? $("input").bind("propertychange input textInput", function() { this.value = this.value.replace(/[^d.]/g, ""); }); Of course, this trims the value after the input event, so I'm not sure if that's what you want

Categories : Javascript

Mysterious error by parsing French dates on OSX
I don't really have an explanation, but I do have a solution. Having had similar problems with German numbers using "," instead of "." for decimals and some different ways of writing dates too. Here's what I usually do to my data that is not in the correct format: a<-"30 juillet 2012" b<-gsub(pattern="juillet", a, replacement="july") as.Date(b, format="%d %B %Y") [1] "2012-07-30" Hope this helps you out. If "july" doesn't work on your system, you could always replace it with a 7. Like so a<-"30 juillet 2012" b<-gsub(pattern="juillet", a, replacement="/ 7 /") b<-gsub(pattern="|| ", b, replacement="") as.Date(b, format= "%d/%m/%Y") Greetings, Ben

Categories : R

Switch case with case 2 equal to case 1 plus case 0
why not something like this: function case0() { print '<tr>'; print '<td align="right">'; print "Sup:"; print '</td>'; print '<td>'; print $sup; print '</td>'; print '</tr>'; } function case1() { print '<tr>'; print '<td align="right">'; print "Inf:"; print '</td>'; print '<td>'; print $inf; print '</td>'; print '</tr>'; } switch($value) { case 0: case0(); break; case 1: case1(); break; case 2: case0(); case1(); break; }

Categories : PHP

Using a special French character in a view with razor application
One solution, which is not very good but works is using the code &eacute; <strong style="color: blue">La description de la s&eacute;quence</strong> <h2 style="color: red; margin-left: 40%;">Ajouter une s&eacute;quence</h2>. A smarter solution would be to declare UTF-8 encoding in the head tag like so: <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head>

Categories : HTML

spell correction for foreign languages like French, Russian
Hunspell is likely the most famous spell checker around: http://hunspell.sourceforge.net/ There are multiple versions of hunspell, but Aspell is an alternative: http://aspell.net/

Categories : PHP

dynamically apply title of html document into the title fields of images
var title = document.title; $('.sth').attr('title',title); Edit, but I don't really see the point of doing this. The title of the site has little to do with the images, if it's added to all of them, what is the point anyways?

Categories : PHP

Javascript Slider title replace html for title just working on 1st item
I found a couple of issues with your script, but first you have invalid markup in your page since you have multiple <div> elements with the same ids of tbtit and tbdescp. Id attributes should be unique in a HTML page so should change those to classes instead. Now in your script you need to change the part where you retrieve the values of the title and the description of the image that is hovered to reference the sibling elements: //THIS var tbtit = $("#tbtit").html(); var tbdesc = $("#tbdescp").html(); //SHOULD NOW BE THIS var tbtit = $(this).siblings('.tbtit').text(); var tbdesc = $(this).siblings('.tbdescp').text(); Finally when you update the text for your main image you want to set the content for your <h4> and <p> tags and not replace them completely, so use .t

Categories : Javascript

(javascript / google scripts) How to get the title of a page encoded with iso-8859-1 so that the title will display correctly in my utf-8 website?
Where are you displaying the content is more important. If you are writing it to a spreadsheet, then you have to change the settings of the spreadsheet to the correct language (French). In addition, you can use the advanced parameters to specify what charset the original content is in. For example, var result = UrlFetchApp.fetch( url , {contentType : 'text/html; charset=utf-8'}); var wholePage = result.getContentText(); var scrap = wholePage.match( /<title>(.*?)</title>/ ); var title = scrap[1];

Categories : Javascript

Responsive menu with title: have a resizing title that takes up all available space
Unfortunately, this is not possible with CSS only — not if you want to work with IE8. You have to calculate the available space to fill the divs within, and the calc()'s function just work on modern browsers. I created two topics to search a responsive solution to percentage containers, and the results are here and here. The JavaScript's final solution is this: /** Centralize the main container **/ function calculateMainContainerWidth() { $realWidth = $(".main-container").width() - $(".right").outerWidth(), $containerContent = $(".left"); $containerContent.css("width", $realWidth); }; $(window).on("resize", function() { calculateMainContainerWidth(); }); calculateMainContainerWidth(); Also available in FiddleJS. I hope it helps.

Categories : Jquery

View Pager Title Strip to show one title Only
get pagerTitleStripe (pagerTitleStripe=(PagerTitleStrip) findViewById(R.id.pager_title_strip);) set alpha to 0 in secondary views (pagerTitleStripe.setNonPrimaryAlpha(0);) y listo!

Categories : Android

How do I prevent French accent character truncation with Ruby 1.9, Rails 3.2, and MySQL?
Well you are using utf8 but if you use utf8_unicode_ci it could be better there is another encoding utf8_general_ci which is of better performance but could have problems with German if that's a problem use the utf8_unicode_ci, that's for the database, for more information on MySQL character set check out MySQL's charset-unicode-sets. On the side of Rails and Ruby you should check this questions out French accents in ruby. And also Rails messages in french. As a last resource you could html encode the data before inserting it in the database. This can mess up searches but if you encode the search data also before searching the database everything should be fine for more information check French characters in rails page. I hope this helps if you keep getting errors please tell me so I can c

Categories : Ruby On Rails

Difference between window.title and document.title
The window object doesn't have a title property. http://www.w3schools.com/jsref/obj_window.asp Hope this helps! Cheers, LC

Categories : Javascript

Page Title and Site Title Configuration DNN 7
The default behavior is automatic if you leave the "Page Title" setting blank within the settings for the individual page. To accomplish what you desire you will need to customize the settings on a page-by-page basis.

Categories : Asp Net

jQuery.support.ajax returns true even if XMLHTTP support is disabled
According to this Microsoft page, the IE8 setting only disables the W3C standard XMLHttpRequest object. It leaves the ActiveX Microsoft.XMLHTTP control enabled. There is a separate setting to disable (all) ActiveX controls. The jQuery support.ajax test works for both methods, so disabling the former but leaving the latter enabled will return true.

Categories : Javascript

support lib android.support.v7.widget.GridLayout causes InflateException / ClassNotFoundException with app widgets
When making widgets, you are constrained to the Views that implement the RemoteViews mechanism. The way that mechanism works is that the remote, "host" process is the one doing the actual inflating. Therefore, if that remote process (the launcher that hosts the widget) does not have the GridLayout class in its classpath, there is absolutely no way you can do this short of drawing the View in your own process and setting it as a Bitmap on an ImageView. I wouldn't do that, though. In general, when making widgets, constrain yourself to the Views that come with the framework.

Categories : Android

OpenCV: No GPU support (The library is compiled without CUDA support)
You seem to have a mix of two different versions of OpenCV on your system (2.4.6.1 and 2.4.2). The older version (2.4.2) appears to be built without GPU support. You might try removing any older versions of OpenCV completely and start your build process for 2.4.6.1 over again.

Categories : C++



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