Search Results

Search found 1515 results on 61 pages for 'translate'.

Page 6/61 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • how to translate this hpricot code to nokogiri ?

    - by wefwgeweg
    Hpricot(html).inner_text.gsub("\r"," ").gsub("\n"," ").split(" ").join(" ") hpricot = Hpricot(html) hpricot.search("script").remove hpricot.search("link").remove hpricot.search("meta").remove hpricot.search("style").remove found it on http://www.savedmyday.com/2008/04/25/how-to-extract-text-from-html-using-rubyhpricot/

    Read the article

  • Best way to translate from IDictionary to a generic IDictionary

    - by George Mauer
    I've got an IDictionary field that I would like to expose via a property of type IDictionary<string, dynamic> the conversion is surprisingly difficult since I have no idea what I can .Cast<>() the IDictionary to. Best I've got: IDictionary properties; protected virtual IDictionary<string, dynamic> Properties { get { return _properties.Keys.Cast<string>() .ToDictionary(name=>name, name=> _properties[name] as dynamic); } }

    Read the article

  • where to find Ubercart translation files

    - by ernie
    I am trying to update language specific text files ("po files") for Ubercart, but it is unclear who/where these files are maintained. There are several places sited but I am not sure which is maintained? http://ftp.drupal.org/files/translations/6.x/ubercart/ http://l10n.privnet.biz/translation_group/ Also a description of how to do this in Drupal. In Drupal (link: admin/build/translate/import) there are several text groups to select. Do I have to repeat update for each group?

    Read the article

  • Java2d: Translate the axes

    - by Algorist
    Hi, I am developing an application using Java2d. The weird thing I noticed is, the original is at the top left corner and x and y axis increases from there. Is there a way to move the origin bottom left? Thank you.

    Read the article

  • Git: Help an SVN novice translate trunk/branch concepts to Git

    - by Jasconius
    So I am not much of a source control expert, I've used SVN for projects in the past. I have to use Git for a particular project (client supplied Git repo). My workflow is as such that I will be working on the files from two different computers, and often I need to check in changes that are unstable when I move from place to place so I can continue my work. What then occurs is when, say, the client goes to get the latest version, they will also download the unstable code. In SVN, you can address this by creating a trunk and use working branches, or use the trunk as the working version and create stable branches. What is the equivalent concept in Git, and is there a simple way to do this via Github?

    Read the article

  • Google Translate translates Javascript Code

    - by Matt
    Hi, I have some PHP code that sends a section of html code including some inline Javascript code by curl to google. When i get it back from Google translated into the language that i chose, the Javascript code has been translated too. Any ideas as to how i can stop Google translating my inline JavaScript code? Thanks, M

    Read the article

  • How can I translate my programmatic WCF configuration into app.config

    - by ofer
    Hi, I have an self hosted WCF server with hard coded configurations. the server worked fine until I tried to implement some new functionality. the new setting did not work (urrr.... ) and I find it hard to locate where are the problems in my code. instead of digging inside the code, I thought about different approach: Is there any way to dump those hard coded WCF configuration (the entire ) into app.config like text file after all configurations are loaded? this will enable me to have a easy global view of the entire settings .. mmm .. .by the way, does anyone know a way that will do the translation to the opposite direction? config to code. Any advice will be welcomed! ofer

    Read the article

  • help translate this week query from Oracle PL/SQL to SQL Server 2008

    - by Sarah Vessels
    I have the following query that runs in my Oracle database and I want to have the equivalent for a SQL Server 2008 database: SELECT TRUNC( /* Midnight Sunday */ NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL) ) AS week_start, TRUNC( /* 23:59:59 Saturday */ NEXT_DAY(NEXT_DAY(SYSDATE, 'SUN') - (7*LEVEL), 'SAT') + 1 ) - (1/(60*24)) + (59/(60*60*24)) AS week_end FROM DUAL CONNECT BY LEVEL <= 4 /* Get the past 4 weeks */ What the query does is get the start of the week and the end of the week for the last 4 weeks. It generates data like the following: WEEK_START WEEK_END 2010-03-07 00:00:00 2010-03-13 23:59:59 2010-02-28 00:00:00 2010-03-06 23:59:59 ...

    Read the article

  • How to translate product name and info in Magento

    - by Calua
    Hi everybody, Magento provide translation feature, a nice one for e-commerce platform. But it seems to me that the translation is only for the predefined magento keyword, like 'add to cart', 'add to wishlist' etc and not for the product name, info, and description that the user input to the store. Does anybody know how to implement this?? Any help would be much appreciated Thanks! :)

    Read the article

  • Google Translate translates inline Javascript Code

    - by Matt
    Hi, I have some PHP code that sends a section of html code including some inline Javascript code by curl to google. When i get it back from Google translated into the language that i chose, the Javascript code has been translated too. Any ideas as to how i can stop Google translating my inline JavaScript code? Thanks, M

    Read the article

  • How to translate,use JSON in GWT?

    - by graybow
    I'm new in gwt. and need to know how to use JSON in gwt so i try this simple data loader but i'm still confuse. I create a project named 'tesdb3' in eclipse. I create the PHP side to access the database, and made the output as JSON.. I create the userdata.php in folder war. then I compile tesdb3 project. Folder tesdb3 and the userdata.php in war moved in local server(I use WAMP). I put the PHP in folder tesdb3. This is the result from my localhost/phpmyadmin/tesdb3/userdata.php [{"kode":"002","nama":"bambang gentolet"}{"kode":"012","nama":"Algiz"}] From that result I think the PHP side was working good.Then I create UserData.java as JSNI overlay like this: package com.tesdb3.client; import com.google.gwt.core.client.JavaScriptObject; class UserData extends JavaScriptObject{ protected UserData() {} public final native String getKode() /*-{ return this.kode; }-*/; public final native String getNama() /*-{ return this.nama; }-*/; public final String getFullData() { return getKode() + ":" + getNama(); } } Then Finally in the tesdb3.java: public class Tesdb3 implements EntryPoint { String url= "http://localhost/phpmyadmin/tesdb3/datauser.php"; private native JsArray<UserData> getuserdata(String Json) /*-{ return eval(json); }-*/; public void LoadData() throws RequestException{ RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, URL.encode(url)); builder.sendRequest(null, new RequestCallback(){ @Override public void onError(Request request, Throwable exception) { Window.alert("error " + exception); } public void onResponseReceived(Request request, Response response) { getuserdata(response.getText()); //this is how i use the userdata json(is this already translated?) UserData UD = null; String LKode =UD.getKode(); String LName =UD.getNama(); Label L = new Label(LKode+""+LName); RootPanel.get().add(L); } }); } public void onModuleLoad() { try { LoadData(); } catch (RequestException e) { e.printStackTrace(); } } } The result is blank(i use development mode). and there was an eror like this:(I show it just some part) 10:46:29.984 [ERROR] [tesdb3] Uncaught exception escaped com.google.gwt.core.client.JavaScriptException: (ReferenceError): json is not defined fileName: http://localhost:1092 lineNumber: 2 stack: ("")@http://localhost:1092:2 My question is: How I use the translated Json in right way?? Is there any wrong use from my code? Is that necessary to move the compiled project to local server folder?(i do it following a tutorial from google). Sorry too many ask. but i'm really really confused.

    Read the article

  • Please help me translate C# code to Ruby

    - by Valentin Vasilyev
    Here is the code: using System; using System.Collections.Generic; using System.Linq; namespace cs2 { class Program { static void Main(string[] args) { var i=Fibs.TakeWhile(x=>x < 1000).Where(x=>x % 2==0).Sum(); } static IEnumerable<long> Fibs() { long a = 0, b = 1; while (true) { yield return b; b += a; a = b - a; } } } }

    Read the article

  • How to translate a config.ini file into C#.NET objects

    - by JACK IN THE CRACK
    config.ini: [globalloads] plugin.SWPlugin = 1 plugin.SWPlugin.params.1 = true plugin.SWPlugin.params.2 = 10 [testz : globballoads] plugin.SWPlugin.params.2 = 20 Simple enough? // load testz config and programmatically create this equivalent code: SWPluginAbstract p = new SWPlugin(true, 20); If a different config.ini setup is needed to do that, it's not a problem...

    Read the article

  • PDF Translation

    - by Nimbuz
    I really like google translator, but the output strips background images and all other content from the PDF. Is there any translation that converts PDF as-is or atleast close to the original without stripping images etc..? Thanks

    Read the article

  • how to translate Haskell into Scalaz?

    - by TOB
    One of my high school students and I are going to try to do a port of Haskell's Parsec parser combinator library into Scala. (It has the advantage over Scala's built-in parsing library that you can pass state around fairly easily because all the parsers are monads.) The first hitch I've come across is trying to figure out how Functor works in scalaz. Can someone explain how to convert this Haskell code: data Reply s u a = Ok a !(State s u) ParseError | Error ParseError instance Functor (Reply s u) where fmap f (Ok x s e) = Ok (f x) s e fmap _ (Error e) = Error e -- XXX into Scala (using Scalaz, I assume). I got as far as sealed abstract class Reply[S, U, A] case class Ok[S, U, A](a: A, state: State[S, U], error: ParseError) extends Reply[S, U, A] case class Error[S, U, A](error: ParseError) extends Reply[S, U, A] and know that I should make Reply extend the scalaz.Functor trait, but I can't figure out how to do that. (Mostly I'm having trouble figuring out what the F[_] parameter does.) Any help appreciated! Thanks, Todd

    Read the article

  • Translate from Java to C#: simple code to re-encode a string

    - by Dr. Zim
    We were sent this formula to encrypt a string written in Java: String myInput = "test1234"; MessageDigest md = MessageDigest.getInstance("SHA"); byte[] myD = md.digest(myInput.getBytes()); BASE64Encoder en64 = new BASE64Encoder(); String myOutput = new String ( Java.net.URLEncoder.encode( en64.encode(myD))); // myOutput becomes "F009U%2Bx99bVTGwS3cQdHf%2BJcpCo%3D" Our attempt at writing this in C# is: System.Security.Cryptography.SHA1 sha1 = new System.Security.Cryptography.SHA1CryptoServiceProvider(); string myOutput = HttpUtility.UrlEncode( Convert.ToBase64String( sha1.ComputeHash( ASCIIEncoding.Default.GetBytes(myInput)))); However the output is no where near the same. It doesn't even have percent signs in it. Any chance anyone would know where we are going wrong?

    Read the article

  • Apache gettext windows does not work/translate

    - by Prashant Kandathil
    I am new to gettext. Here is my setup: /Apache 2.2 PHP 5.3.6 Windows 7/ I have following code in the Apache/htdocs/test/index.php <?php $language = 'de_DE'; $translatefile = 'messages'; setlocale(LC_ALL, $language); putenv("LANG=".$language); bindtextdomain($translatefile, 'C:/locale'); textdomain($translatefile); echo gettext("Hello World!"); ?> I used PoEdit to generate the necessary translations under locale/de_DE/LC_MESSAGES/messsages.po & messages.mo The charset I used was UTF-8 When I visit http://localhost/test, the result is Hello World! when it should be Hall Welt! As a test, I opened command prompt and navigated to the test folder. Then I typed in php index.php The result that appeared in the console was Hall Welt! I am not sure why it is not working with Apache.

    Read the article

  • Translate GPS coordinates to location on PDF Map

    - by christo16
    Hi everyone, I'd like to know (from a high level view) what would be required to take a pdf floor plan of a building and determine where exactly you are on that floor plan using GPS coordinates? In addition to location, the user would be presented with a "turn by turn" directions to another point on the map, navigating down hallways, between cubicles, etc. Use case: an iPhone app that determined a user's location and guided them to a conference room or person's office in the building. I realize that this is by no means trivial, but any help is appreciated. Thanks!

    Read the article

  • Rails: translate ActiveRecord error template headers for a single model

    - by Chris
    Hi, I'm trying to rename the authlogic error messages in a Rails 3 app. The general format I found out working in Rails 3: de: errors: template: header: one: "Konnte {{model}} nicht speichern: ein Fehler." other: "Konnte {{model}} nicht speichern: {{count}} Fehler." body: "Bitte überprüfen Sie die folgenden Felder: But I want to change this for the authlogic user session model (and only for this one) because when the Login fails, the message "Could not save user session" does not make very much sense. How can I do that?

    Read the article

  • How do i translate this to "simpler" JavaScript?

    - by Julian Weimer
    Since i'm working with Titanium i realzed that its current JavaScript Interpreter doesn't accept specific coding-styles. So for for-loops and if-statements i have to have braces, even though i only want to span one line. Furthermore there is more i have to change if i want to use a Javascript Library like underscore.js. This is what Titanium doesn't want to see: if (!(result = result && iterator.call(context, value, index, list))) {_.breakLoop();} if (nativeSome && obj.some === nativeSome) {return obj.some(iterator, context);} var computed = iterator ? iterator.call(context, value, index, list) : value; computed >= result.computed && (result = {value : value, computed : computed}); Can i use a simpler syntax to describe the logic behind those lines of code?

    Read the article

  • Translate parse_git_branch function to zsh from bash (for prompt)

    - by yar
    I am using this function in Bash function parse_git_branch { git_status="$(git status 2> /dev/null)" pattern="^# On branch ([^${IFS}]*)" if [[ ! ${git_status}} =~ "working directory clean" ]]; then state="*" fi # add an else if or two here if you want to get more specific if [[ ${git_status} =~ ${pattern} ]]; then branch=${BASH_REMATCH[1]} echo "(${branch}${state})" fi } but I'm determined to use zsh. While I can use this perfectly as a shell script (even without a shebang) in my .zshrc the error is a parse error on this line if [[ ! ${git_status}}... What do I need to do to get it ready for zshell? Edit: The "actual error" I'm getting is " parse error near } and it refers to the line with the strange double }}, which works on Bash. Edit: Here's the final code, just for fun: parse_git_branch() { git_status="$(git status 2> /dev/null)" pattern="^# On branch ([^[:space:]]*)" if [[ ! ${git_status} =~ "working directory clean" ]]; then state="*" fi if [[ ${git_status} =~ ${pattern} ]]; then branch=${match[1]} echo "(${branch}${state})" fi } setopt PROMPT_SUBST PROMPT='$PR_GREEN%n@$PR_GREEN%m%u$PR_NO_COLOR:$PR_BLUE%2c$PR_NO_COLOR%(!.#.$)' RPROMPT='$PR_GREEN$(parse_git_branch)$PR_NO_COLOR' Thanks to everybody for your patience and help. Edit: The best answer has schooled us all: git status is porcelain (UI). Good scripting goes against GIT plumbing. Here's the final function: parse_git_branch() { in_wd="$(git rev-parse --is-inside-work-tree 2>/dev/null)" || return test "$in_wd" = true || return state='' git diff-index HEAD --quiet 2>/dev/null || state='*' branch="$(git symbolic-ref HEAD 2>/dev/null)" test -z "$branch" && branch='<detached-HEAD>' echo "(${branch#refs/heads/}${state})" } PROMPT='$PR_GREEN%n@$PR_GREEN%m%u$PR_NO_COLOR:$PR_BLUE%2c$PR_NO_COLOR%(!.#.$)' RPROMPT='$PR_GREEN$(parse_git_branch)$PR_NO_COLOR' Note that only the prompt is zsh-specific. In Bash it would be your prompt plus "\$(parse_git_branch)". This might be slower (more calls to GIT, but that's an empirical question) but it won't be broken by changes in GIT (they don't change the plumbing). And that is very important for a good script moving forward. Days Later: Ugh, it turns out that diff-index HEAD is NOT the same as checking status against working directory clean. So will this mean another plumbing call? I surely don't have time/expertise to write my own porcelain....

    Read the article

  • How to translate such AS3 class into C#?

    - by Ole Jak
    So I try to create opensource C# project for slicing FLVs I began with translating of existing project called flvslicer Can any one please help me with translating one of their classes package org.bytearray.video.events { import flash.events.Event; import flash.utils.ByteArray; public final class MergedEvent extends Event { public var time:Number; public var stream:ByteArray; public static const COMPLETE:String = "mergeComplete"; public function MergedEvent(type:String, stream:ByteArray, duration:Number) { super(type, false, false); // base this.stream = stream; this.time = duration; } } }

    Read the article

  • iOS: Text translation from English to different language and visa-versa

    - by AppleDeveloper
    I want to translate English texts to different languages from my iPad App. These texts are generated dynamically from the front end website so I can use static mapping between English and other language. Basically I will receive line of text in English from the server and I want to convert it to iPad's Locale language settings and display it. Is there anyone I can achieve this? Can I use Google translator? Thanks.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >