w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Plomino multilingual site
At the moment there is no document content translation solution for Plomino. The mentioned solution can be used to translate pre-defined contents (like labels in forms, computed values, etc.) but obviously it is not applicable to content freely entered by users in documents. Nevertheless, Plomino is already used in multilingual contexts. A basic solution is to: create a field to store the document language, provide a Document ID formula which will use this lang field value (so we can guess the id of any translated version from the current doc id), implement the different actions you might need (like "Translate this doc", "Switch to language xx", etc.) as basic Plomino actions.

Categories : Misc

Rails gem for adding text/images to site which retain the language syntax
Ace Editor is good for syntax highlighting and an editor. is pretty good. It is what github uses for gists and things. For just syntax highlighting, you have many options such as pygments.rb, coderay, and rainbow just to list a few..

Categories : Ruby On Rails

Having different logo and app name depending on the Language (Android developer / multilingual App)
Take a look here: http://developer.android.com/guide/topics/resources/localization.html That is, use a string also for your app name referenced in the Manifest file, then create different folders: res/values/strings.xml res/values-fr/strings.xml res/values-ja/strings.xml Same applies to drawables: res/drawable/strings.xml res/drawable-fr/strings.xml res/drawable-ja/strings.xml And in general every resource located in res. Here you can find more informations about available localization codes.

Categories : Android

Is it possible to create a multilingual site JUST with HTML, CSS and jQuery?
I would suggest having /language/ at the start of your urls, e.g. /en/ for the english version, and /nl/ for the german (or whatever code you use). You will have to translate all the pages by hand. In the past, I have had some success with a customer who "didn't want a CMS" by setting everything up in a CMS (which I didn't tell them about), then saving all the rendered pages. They got what they asked for, how I did it isn't relevant to them. Make sure you file off the serial numbers.

Categories : Misc

Language selection with Umbraco and XSLT
I am not sure why you are using the GetRelatedNodesAsXml method. I think you are taking a difficult approach here. I am not sure if you want to display only the flag of the current language or both flags This will display the flag of the current language: <xsl:variable name="languageNode" select="$currentPage/ancestor::*[@level = '1']" /> <ul> <li> <a href="{umbraco.library:NiceUrl($languageNode/@id)}" class="{$languageNode/@nodeName}"> <xsl:value-of select='$languageNode/@nodeName' /></a> </li> </ul> If you want both flags, try this: <ul> <xsl:for-each select="/root/*[@nodeType = 'add the nodeTypeID of your language items']"> <li> <a href="{umbraco.library:NiceUrl(@id)}" class="{@nodeName}"> <x

Categories : Xslt

How to deal with navigation menu in a template for a multilingual site codeiginiter
You can do it with CodeIgniter's Language Library. For more read the answer here. This can help you! UPDATE: Also Check this library If you want to use template, when you can do it CodeIgniter Template

Categories : Codeigniter

Selected menu item not active in a Joomla 3 multilingual site
I found the answer myself. The menu being wrongly shown was the one from "ALL" language, once I unpublished the "ALL" menu, the real "English" menu got shown up correctly with the active one being marked with css class "current active".

Categories : Joomla

How to integrate my Umbraco site with Worldpay
The first thing you should be considering is how would you usually connect WorldPay to a .Net website. The fact that your site is Umbraco-based needn't complicate things. Find a couple of articles describing integration into a standard .Net website and see if those approaches will work with your website. The only complicating factor might be defining a "callback" page, but then at worst you could just use a hard-coded URL. Many questions like this assume that Umbraco complicates otherwise well-documented tasks. But generally an Umbraco site is still just user controls and masterpages or views and actions. If you want to make the Worldpay configuration editable within Umbraco, that is another question completely.

Categories : C#

Convert API request to text to use in site
You need to bind onto the onload listener instead of setting a value to xhr: var xhr = new XMLHttpRequest(); xhr.open("GET", "http://data.mtgox.com/api/2/BTCUSD/money/ticker_fast?pretty", false); xhr.onload = function() { document.getElementById("myDiv").innerHTML=this.responseText; }; xhr.send(); See the MDN docs on Using XMLHttpRequest.

Categories : Javascript

Connect azure web site to on-premise database over site-to-site vpn
Azure Web Sites do not support the Azure Virtual Network (as of 8/22/2013); http://www.windowsazure.com/en-us/manage/services/web-sites/choose-web-app-service/ You will need to create a cloud service deployment instead if you would like to use Virtual Network and access the on-premises database. Once that is done and your firewall is properly configured, it is like you say just a connection string.

Categories : Database

Drawing multilingual text using PIL (Part II)
I suspect that your problem is that you are drawing a 9 character string in a 76 point in a 400x400 pixel image starting at 50, 50 - so it is either wrapping or clipping and getting messed up - try changing your point size to 32 or your image to 800x800. (IIRC 76 points is approximately 100 pixel per character.)

Categories : Misc

Django Multilingual Text Field using JSON
Code looks good to me. The only thing that could impact performance is the frequent json encoding/decoding... yet, that shouldn't have a major impact unless you are facing thousands of users on a server with minimal resources. The previous question you linked to contains some comments noting that adding additional languages might be easier using other means. But in the end - that's a mixture between personal preferences and maintainability. If it fits your project goals, I can't see any reason not to do it the way you've coded it. Providing proof that your implementation is the best is near to impossible. That is, unless you prove it yourself by creating a different, non-json based implementation and benchmark both on your production server. You'll notice differences will be rather mini

Categories : Django

In Umbraco 6.1.1 MVC 4, how can I do a form post back to a surface controller using a model that inherits from Umbraco's RenderModel?
Ok, I've had no responses to this question but am now in a position to answer it myself. Maybe it was a fundamental oversight, but not that obvious imho, and information on the Umbraco forum etc about inheriting from RenderModel is fairly limited. Essentially the answer, as was my first instinct, is to solve the original exception "No parameterless constructor defined for this object" by providing a paramaterless constructor. The difficulty is working out what to put inside the parameterless constructor for my model, since it inherits from the Umbraco RenderModel which requires an IPublishedContent instance passed to it's constructor. Luckily while browsing around I happened across this post on the Umbraco forum: http://our.umbraco.org/forum/developers/api-questions/40754-Getting-Curre

Categories : Asp Net Mvc

How to implement Full-Text search in multilingual content in SQL Server
Certain content (document) types support language settings - e.g. Microsoft Office Documents, PDF, [X]HTML, or XML. If you change the type of your Name column to XML, you can determine the language of each value (i.e. per row). For instance: Instead of storing values as strings name 1 name 2 name 3 ...you could store them as XML documents with the appropriate language declarations: <content xml:lang="en-US">name 1</content> <content xml:lang="fr-FR">name 2</content> <content xml:lang="en-UK">name 3</content> During Full-text index population the correct word breaker/stemmer will be used, based on the language settings of each value (XML document): US English for name 1, French or name 2, and UK English for name 3. Of course, this would require a

Categories : SQL

Umbraco MVC Implementation - View does not depend on Umbraco implementations
No you can't. Simply because all requests pass through a single action. In order to retrieve a path to a CMS-managed page, you need to use the node/content traversal the @Model provides. See here for more details on this. Edit To clarify, the author of the article is suggesting that the Umbraco implementation should be more in line with a traditional MVC implementation with little or no logic in the views. Therefore, any querying of node data should happen prior to the view (e.g. in the Mappers). So this is where you would have to retrieve the links. Umbraco's default MVC implementation forces all requests to go via a single action on a single controller. The author's implementation allows the requests to be shared across one controller per document type - which is better IMO. But it st

Categories : Asp Net Mvc

Convert Text File To MySQL Database
If it would be me, I'd make a ruby script to convert that thing in a .sql with a list of INSERT statements. The only actual issue seems to be the asterisk, that should become an auto key... So, first of all, you have to create a table in your database. Let's say you do CREATE TABLE MyTable( ID INTEGER AUTO_INCREMENT PRIMARY KEY, Binary CHAR(whatever) Name VARCHAR(whatever), Description VARCHAR(whatever) ) Then, you can make a .sql with some scripting language. Maybe you can even do it with a .sh bash (sed -i -E 's/^*,([^,]+),([^,]+),(.+)$/INSERT INTO MyTable (Binary, Name, Description) VALUES ("1", "2", "3");/') Otherwise, i feel more comfortable with Ruby: require 'csv' CSV.foreach("your_file.txt") do |row| puts <<EOS INSERT INTO MyTable (Binary, Name, Description)

Categories : Mysql

Umbraco - error when using umbraco.library:NiceUrl(...)
Ok I found a solution: I added an extra check to this part: <!-- Return the url --> <xsl:if test="$i = $max"> <xsl:if test="$id != '' "> <xsl:value-of select="umbraco.library:NiceUrl($id)" /> </xsl:if> </xsl:if> this fixed my problem.

Categories : Xslt

Umbraco MediaService / Umbraco MediaItem not saving
To Save media, I found this method with MediaService. However, I think it's possible another method more refined [HttpPost] public JsonResult Upload(HttpPostedFileBase file) { IMedia mimage; // Create the media item mimage = _mediaService.CreateMedia(file.FileName, <parentId>, Constants.Conventions.MediaTypes.Image); mimage.SetValue(Constants.Conventions.Media.File, file); _mediaService.Save(mimage); return Json(new { success = true}); }

Categories : C#

How do I convert a table form a database into a text file?
Check this out : How to export table data from a mysql database into text file using java?

Categories : Mysql

(Umbraco) Can get text but not image from a subnode to homepage
here's an example: <xsl:variable name="mediaId" select="number($currentPage/mediaId)" /> <xsl:if test="$mediaId > 0"> <xsl:variable name="mediaNode" select="umbraco.library:GetMedia($mediaId, 0)" /> <xsl:if test="$mediaNode/umbracoFile"> <img src="{$mediaNode/umbracoFile}" alt="[image]" height="{umbracoHeight}" width="{umbracoWidth}" /> </xsl:if> </xsl:if> How to use umbraco.library GetMedia in XSLT

Categories : Xslt

How do I modify an existing database table (add/remove columns) with PetaPOCO (Umbraco 6, MVC)
If you are using PetaPoco, you could use the db.Execute("alter table ...") but then you would need to have sufficient access rights to execute a DDL statement like that. Also I would run this within a PetaPoco transaction too, as it's good practice. Finally, if you were running this at Application_Start (which is fine) you would need to perform a check to ensure that the column didn't already exist.

Categories : C#

Need to create web app for web site but not sure what programming language to use
Java / C# are SERVER technologies, HTML / JavaScript are CLIENT technologies. If the requirement is that the page be only a basic html publish (no server technology present) then JavaScript is your only choice. ASP.net or Java are basically programs on the server which decide what HTML to render dynamically, instead of an .html page which is static content. Once the HTML is downloaded, then JavaScript can be used to manipulate the Document Object Model (DOM) to change the HTML that is rendered from memory. To do calculations in an HTML/JavaScript application, the browser is doing the computation and replacing the information without ever communicating with a server, asking for a new page or for more information, etc. In contrast, a C# application would be running on the server, waitin

Categories : Web Services

PHP multilanguage site with language files
I believe php sprintf is a relevant function to mention here Take a look at their example. <?php $num = 5; $location = 'tree'; $format = 'There are %d monkeys in the %s'; echo sprintf($format, $num, $location); ?> You could solve your problem with a similar approach. A lot of php frameworks use sprintf in cases as yours.

Categories : PHP

Change the language of a site using a button
You need to send the required value to the server when the button is clicked, so your link would have to have the language string like ?lang=es. Then you can process it on the server side and store the language for the current visitor in for example a database (for logged-in users), a session or a cookie. Then you can use a header redirect to redirect the user to the site without the language string and check at the top if the db-entry / session / cookie is set and use that language.

Categories : PHP

PostgreSQL: Full text search multitenant site, plus only parts of site
The normal approach would be to create: one full text index: CREATE INDEX idx1 ON dw1_posts USING gin(to_tsvector('english', approved_text)); a simple index on the site_id: CREATE INDEX idx2 on dw1_posts(page_id); another simple index on the page_id: CREATE INDEX idx3 on dw1_posts(site_id); Then it's the SQL planner's business to decide which ones to use if any, and in what order depending on the queries and the distribution of values in the columns. There is no point in trying to outsmart the planner before you've actually witnessed slow queries.

Categories : Postgresql

How can I use the Disqus comments in my three-language site in all three languages different?
Referencing this doc, there are a couple of ways to have a multi-lingual site: Create as many Disqus shortnames as you need languages, and reference those shortnames in each language portion of your site where you load Disqus Use the following javascript override to load different languages per-page: var disqus_config = function () { this.language = "ru"; }; Use option #1 if you want to moderate or manage each language separately. Option #2 is good if those moderating can do so in either language.

Categories : Api

HTTP GET to return custom model with data from external database with Umbraco MVC Surface Controller
There are a lot of questions about this and the best place to look for an authoritative approach is the Umbraco MVC documentation. However, yes you will find, if you use Html.BeginUmbracoForm(...) you will be forced into a HttpPost action. With this kind of functionality (a search form), I usually build the form manually with a GET method and have it submit a querystring to a specific node URL. <form action="@Model.Content.Url"> ... </form> On that page I include an @Html.Action("SearchResults", "TyresSearch") which itself has a model that maps to the keys in the querystring: [ChildAction] public ActionResult(TyreSearchModel model){ // Find results TyreSearchResultModel results = new Wheels.BDL.TyreBDL().GetAllTyres(); // Filter results based on submitted mo

Categories : Asp Net Mvc

Could not locate Razor Host Factory type: umbraco.MacroEngines.RazorUmbracoFactory, umbraco.MacroEngines
If you are trying to host the blogengine site within a virtual directory of the Umbraco site, then you will have to amend the blogengine web.config to "remove" all the Umbraco-specific handlers and modules, as these will be inherited by the blogengine application, causing this exception because the application can't find the relevant DLLs in its bin folder. I recently had a similar problem and I have posted the web.config I used in the virtual directory below. Mine was a very simple web application, so obviously this will not work by itself in your blogengine app. You will need to add the relevant parts into your web.config file. Also, this was for a v6 Umbraco install in IIS7.5, so you may have to experiment a little. <?xml version="1.0"?> <configuration> <configSecti

Categories : Iis

How to C# text/language analysis for detecting address, phone numbers, events etc in a given text?
This would be a good reason to use a few different regular expressions. Using regular expressions would allow you to throw different address, phone number, and date patterns at a block of text and match up the content you're looking for. MSDN - RegEx http://msdn.microsoft.com/en-us/library/system.text.regularexpressions.regex.aspx C# Regular Expression Cheat Sheet http://www.mikesdotnetting.com/Article/46/CSharp-Regular-Expressions-Cheat-Sheet RegExLib http://regexlib.com/

Categories : C#

How to convert decimal value to character in c language
When you create your array you should use character literals: char bytes[4] = {'2', '0', '1', '3'}; These are stored in memory in the character encoding your compiler is using which converts the character to a number. If you want to get the decimal value represented by the character when read by a human (i.e. '2' -> 2) then you can do bytes[x] - '0' assuming the digit characters are adjacent in the character encoding (which is true of ASCII and UTFs at least).

Categories : C

C language: Convert Pointer to String, what am I getting back?
The address isn't backwards. Printf shoudl always print big endian. If you print the address locations, if you get 589796 when an int, if you print it as hex, then you'll get 0x8FFE4 = 589796. Everything is working as it should, since no matter hwo you print it, its going to be the correct memory address, just with a different representation.

Categories : C

Convert unicode characters to their respective language letter in ios
How are you parsing the XML? A proper XML parser should decode the numeric references. I'm guessing that you are attempting to hand parse an XML document instead of relying on NSXMLParser. If so, you really should use an XML parser. Bad Guess on my part, it's likely that the entities are being double encoded. To answer your question directly, Objective C HTML escape/unescape shows how to decode entities with a quick and dirty method.

Categories : IOS

Give a block of text, some keyshorts, and the target text, how to get the minimal key press to convert the text?
It's probably NP-hard. This paper gives a hardness proof for an editor where insertions, deletions, and substring moves all have constant cost. %0 Book Section %D 2002 %@ 978-3-540-43862-5 %B Combinatorial Pattern Matching %V 2373 %S Lecture Notes in Computer Science %E Apostolico, Alberto %E Takeda, Masayuki %R 10.1007/3-540-45452-7_9 %T Edit Distance with Move Operations %U http://dx.doi.org/10.1007/3-540-45452-7_9 %I Springer Berlin Heidelberg %8 2002-01-01 %A Shapira, Dana %A Storer, JamesA. %P 85-98 %G English

Categories : Algorithm

How to convert an "ArrayList" written in Java into a C++ program language?
The Java code looks a bit strange. If you really want to use recursion, then I recommend rewriting the methods as follows. public void getCale(ArrayList<Nod> lnoduri) { if (parent != null) { parent.getCale(lnoduri); } lnoduri.add(this); } public ArrayList<Nod> getCale() { ArrayList<Nod> result = new ArrayList(); getCale(result); return result; } In C++, I would use only one member function. std::vector<Nod*> getCale() { std::vector<Nod*> result; for (Nod* n = this; n; n = n->_parent) { result.push_back(n); } std::reverse(result.begin(), result.end()); return result; }

Categories : Java

Convert joomla 1.5 to 2.5 with whole site and also with virtuemart
Thre is a lot of documentation out there on how to convert Joomla 1.5 sites to Joomla 2.5. You need to use an extension such as JUpgrade to upgrade your site to 2.5. Please bare in mine that this will update your database tables and core extensions such as com_content, mod_login etc. This will not upgrade 3rd party extensions that you have found from the Joomla Extensions Directory. You will need to go back to whereever you downloaded these extensions from and see if there is a Joomla 2.5 compatible version of them, and install them, else you'll need to look for an alternative. Seeing as you have waited all the way till now, you might be best off upgrading again to Joomla 3.x. Even though this it eh short term release, it is the way forward, will save what could be another time consuming

Categories : Joomla

How to grab audio/voice from flash webcam and convert it to web based language
I think what you need is WebRTC (web Real time communication). Please have a look on these articles, it will definitely help you WebRTC This is working example & this is code link for it

Categories : PHP

jQuery convert URL to parameters across entire site
This kind of thing is generally determined by the server. For example if you are using apache to serve your files and you have a directory structure -web_root -CA -fairfield index.html index.html your request to mysite.com/CA/fairfield would fetch the index.html file in the fairfield folder on your server. If however you want one script for all your towns but still want separate urls then try something like serve with apache all paths under a domain through one script

Categories : Jquery

SQLite database with multi language iOS 6 app
(I assume its not same app with different binaries for different app stores). I saw somewhere but not able to recollect that there was an unofficial limit of three copies of the same app for localisation reasons.Since Apple released the App Store Review Guidelines, one of them is that developers should not "spam" the app store with multiple versions of the same app with minor changes. Why don't you merge all your apps(languages) into one and keep it in your server.So that the end-user can download any version(language) of the content they want,and even it will be easier for you to keep your database upto date.

Categories : Iphone

How to use multi-language output from database?
You must query the database first like this: mysql_query("SET NAMES 'utf8'"); // use mysqli_ ! After you've run this query you can run your regular "select" etc.. Also, make sure the collation of the fields is utf8_general_ci

Categories : PHP

How to install PL/CTL language into PostgreSQL database 8.1.22
Not sure where you found the information about current_query and pltcl. These are unrelated. The reason why you can't find pltcl is simply because you're using too old PostgreSQL. current_query() has been added to Pg in version 8.4. Is there any particular reason why you're using such old version? It is no longer supported, and it lacks almost 8 years of added features! If you have to use 8.1, you might want to define: create function current_query() returns text as ' select current_query from pg_stat_activity where procpid = pg_backend_pid(); ' language sql; But it is much better idea just to upgrade. As for edited and added second question - it's very likely that Pg 8.1 cannot use "row.*" construct. Find who wrote the original code with the "dance comments", and ask about it. Perha

Categories : Database



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