Search Results

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

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

  • Translate SQL to LINQ query - group/join/filter

    - by Paddy
    I have the following query: SELECT S.[FlowOrder], S.[DESCRIPTION], COUNT(I.ID) FROM WorkFlowStatus AS S INNER JOIN Item AS I ON S.ID = I.StatusID WHERE I.Installation = '1' GROUP BY S.[Description], S.[FlowOrder] ORDER BY S.[FlowOrder] Which gives me the count of an item, grouped by a foreign key to workflow, outputting the descriptive name from my FK table. I've go this far with the LINQ query (using LINQ-to-SQL) in the background: var items = from s in _entities.WorkflowStatus join i in _entities.Items on s.ID equals i.StatusId into Statuses orderby s.FlowOrder select new {s.Description, ItemCount = Statuses.Count() }; How do I get the where clause in the SQL into this LINQ query?

    Read the article

  • php to translate GET request to POST request

    - by DennyHalim
    i have a hosted script somewhere that only accept POST request. example, some.hosted/script.php how can i setup another simple php that can accept GET request and then POST it to the hosted script. so that i can put up a link like this: other.site/post2hostedscript.php?postthis=data and then it POST postthis=data to the hosted script. tnx

    Read the article

  • Translate This git_parse_function to zsh?

    - 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? Note: I realize the answer could be "go learn zsh syntax," but I was hoping for a quick hand with this if it's not too difficult.

    Read the article

  • Translate Prototype code into Jquery version

    - by user1055495
    I everybody, I'm working on a SaaS application and I need to use Jquery instead of Prototype due to some extra plugins integration. My code that was wotking a charm with Prototype is not running anymore with Jquery and I'm not used to write in this framework... Is there someone to help me in "translating" this one: Thanks a lot for your help. var rates = new Array(); <% for tva_rate in @tva_rates -%> rates.push(new Array(<%= tva_rate.id %>, '<%=h tva_rate.taux %>', '<%=h tva_rate.compte_id %>' )); <% end -%> function tvaSelected() { tva_id = $('journal_tva_id').getValue(); show = 1; if (tva_id > 0){ rates.each(function(rate) { if (rate[0] == tva_id) { $('journal_taux').setValue(rate[1]); $('journal_compte_tva').setValue(rate[2]); show = 2; } }); } if (show == 1) { $('tva_taux_field').hide(); } else { $('tva_taux_field').show(); } } document.observe('dom:loaded', function() { tvaSelected(); $('journal_tva_id').observe('change', tvaSelected); });

    Read the article

  • Translate from C# to VB

    - by Congero
    How do you convert the following c# code to vb.net? private static readonly ICollection<string> _skipHeaders = new[] { "Connection", "Keep-Alive", "Accept", "Host", "User-Agent", "Content-Length", "Content-Type", "Accept-Encoding", "Authorization", "Referer", ProxyMethodHeader, ProxyAuthorizationHeader, ProxyAcceptHeader, ProxyAgentHeader, ProxyQueryHeader };

    Read the article

  • Translate sequence in macro parameters to separate macros

    - by Alex Tiger
    How to acces each element in macro if the definition is like MACRO(name, seq) and the code is like: MACRO("TheName", (Elem1) (Elem2) (Elem3) ) I want to generate the next code: MACRO("TheName", ELEMMACRO(Elem1) ELEMMACRO(Elem2) ELEMMACRO(Elem3) ) Or something like that. In other words, I want to process every parameter separately (I don't care of definition, even if it will be something like MACRO("TheName", Elem1, Elem2, Elem3 ) There could be more elements, there could be less. I have tried V_ARGS (I need it only for gcc), but I can only copy all the elements by that, not to process them separately. What can I do? P.S. Because of some reasons, I can't use Boost.

    Read the article

  • Cannot translate date formats from rails form to mysql db

    - by Steve
    I have a simple search form in rails 3 that has two date fields. I'm having a problem getting these dates into my mysql db. I've tried using the american_date gem, specifying date formats in my initializers, in the config/locales/en.yml file, and directly on the date on the date fields themselves. Currently, I'm setting the rails-approved date format in the view - <%= f.text_field :depart_date, :value=> Date.today.strftime('%Y-%m-%d') %> The dateformat in my DB is also YYYY-mm-dd, so things should be going smoothly. The console tells me that the two date fields are both class = "Date" I think I've found the disconnect. From the logs - Started POST "/searches" for 127.0.0.1 at 2013-10-30 17:43:26 -0400 Processing by SearchesController#create as HTML Parameters: {"utf8"=>"v","search"=>{"depart_date"=>"2013-10-30", "return_date"=>"2013-11-09"} ?[1m?[35m (0.0ms)?[0m BEGIN ?[1m?[36mSQL (0.0ms)?[0m ?[1mINSERT INTO `searches` (`depart_date`,`return_date`) VALUES ('2013-30-10','2013-09-11')?[0m ?[1m?[35m (2.0ms)?[0m COMMIT Note that the month and day values are switched in the insert statement. How can I prevent this from happenening?

    Read the article

  • Please help translate this in linq to ef

    - by user3487644
    StringBuilder sb = new StringBuilder(); sb.AppendLine("SELECT"); sb.AppendLine(String.Format(" (SELECT TOP 1 CAST(ProspectID AS VARCHAR(5)) FROM Lead_Import_Fail Where ProspectID < {0} AND ProspectFullName = '{1}')", Convert.ToInt64(lead.LeadID), lead.Name)); sb.AppendLine(String.Format(", (SELECT TOP 1 CAST(ProspectID AS VARCHAR(5)) FROM Lead_Import_Fail Where ProspectID < {0} AND ProspectNRICPassport = '{1}')", Convert.ToInt64(lead.LeadID), lead.NRIC)); Thanks in advance.

    Read the article

  • Mysql adapter for Zend_Translate

    - by Peter
    Hi everybody, I'm currently in the planning phase of a rather large project that I'll develop in the Zend Framework. One of the problems I'm facing is that the customers will want to translate not only the content but also the interface. I'm currently using gettext and poedit to manage my language files but this is not an option for the customer as they, for one, want have FTP access to the site. Hence, I'm thinking of a mysql back end with an interface in the front end for the customer to manage his own translations of the interface. There is however still no mysql adapater for Zend_Translate. So, does anybody now of an adapter script for Zend_Translate so it can work with a mysql table? Or any arguments against using mysql and possible other solutions for this problem?

    Read the article

  • Need help converting apache .htaccess code to lighttpd url_rewrite code

    - by miCRoSCoPiC_eaRthLinG
    Hi All, I have this custom written CMS built on XAMPP. I'm trying to test the same on lighttpd to benchmark the so-called performance gains... but am stuck at the rewrite rules. I use the default rewrite rules of WordPress in my .htaccess which hands all url parsing over to my script as long as there aren't any files or directories same as the URL structure. Here's the code: RewriteBase /somedir/ # Let the Script handle all pretty URLs RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule .* index.php [L] Can anyone please help me translate the same to the lighttpd format? I could only (partially) figure out the last line myself going through the lighty docs ... i.e. url.rewrite-once = ( ".*" => "index.php" ) But that of course won't suffice... All my CMS is doing is giving me 404's. Thanks, miCRoSCoPiC^eaRthLinG

    Read the article

  • quartz2d translating the origin

    - by qwertyp96
    My understanding of quartz2d is that the code CGContextTranslateCTM(context, x, y); translates the coordinate system. I have a quartz2d view with lots of shapes on it, and the user needs to be able to pan around and zoom it. However, when using the CGContextScaleCTM(context, scaleX, scaleY); code, everything scales around the origin, not the center of the viewpoint the user is viewing. My solution to this was to use the following code: CGContextRef context = UIGraphicsGetCurrentContext(); CGContextTranslateCTM(context, 512.0+offset.x, 384.0+offset.y); //(512, 384) is the center of the iPad screen CGContextScaleCTM(context, scale, scale); You can translate around fine, but things still scale into the corner. What's wrong? EDIT: Oh. Wow. Duh. If you move the origin, the shapes move too, so you can't move it relative to the shapes. Now I know what's wrong, but how do I do that?(move the origin independently of the shapes)

    Read the article

  • Creating a voxel chunk with a VBO - How to translate the coordinates of each block and add it to the VBO chunk?

    - by sunsunsunsunsun
    Im trying to make a voxel engine similar to minecraft as a little learning experience and a way to learn some opengl. I have created a chunk class and I want to put all of the vertices for the whole chunk into a single VBO. I was previously only putting each block into a vbo and making a call to render each block. Anyways, I am a bit confused about how I can translate the coordinates of each block in the chunk when I'm putting all vertices into one vbo. This is what I have at the moment. public void putVertices(float tx, float ty, float tz) { float l_length = 1.0f; float l_height = 1.0f; float l_width = 1.0f; vertexPositionData.put(new float[]{ xOffset + l_length + tx, l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, l_height + ty, zOffset + l_width + tz, xOffset + l_length + tx, l_height + ty, zOffset + l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + l_width + tz, xOffset + -l_length + tx, -l_height + ty, zOffset + l_width + tz, xOffset + -l_length + tx, -l_height + ty, zOffset + -l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + -l_width + tz, xOffset + l_length + tx, l_height + ty, zOffset + l_width + tz, xOffset + -l_length + tx, l_height + ty,zOffset + l_width + tz, xOffset + -l_length + tx, -l_height + ty,zOffset + l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, -l_height + ty,zOffset + -l_width + tz, xOffset + -l_length + tx, l_height + ty, zOffset + -l_width + tz, xOffset + l_length + tx, l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, l_height + ty, zOffset + l_width + tz, xOffset + -l_length + tx, l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, -l_height + ty, zOffset + -l_width + tz, xOffset + -l_length + tx, -l_height + ty,zOffset + l_width + tz, xOffset + l_length + tx, l_height + ty,zOffset + -l_width + tz, xOffset + l_length + tx, l_height + ty, zOffset + l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + l_width + tz, xOffset + l_length + tx, -l_height + ty, zOffset + -l_width + tz }); } public void createChunk() { vertexPositionData = BufferUtils.createFloatBuffer((24*3)*activateBlocks); Random random = new Random(); for (int x = 0; x < CHUNK_SIZE; x++) { for (int y = 0; y < CHUNK_SIZE; y++) { for (int z = 0; z < CHUNK_SIZE; z++) { if(blocks[x][y][z].getActive()) { putVertices(x*2.0f, y*2.0f, z*2.0f); } } } } Whats any easy way to translate the vertices of each block into its correct position? I was previously using glTranslatef with each call to render block but this wont work now. What I am doing now also does not work, the blocks all render in stacks on top of each other and it looks like this: http://i.imgur.com/NyFtBTI.png Thanks

    Read the article

  • Translating EventAggregators usage of SynchronizationContext to VB.Net

    - by Phil Sayers
    Working with a fairly large VB.Net back office winforms application. 1 million+ LOC. Big ball of mud, 90% of all code is in Forms & other UI controls. Slowly introducing better architecture as time & recources allows, We've been using ideas from the EventAggrgator by Jeremy Miller. http://codebetter.com/blogs/jeremy.miller/archive/2008/01/11/build-your-own-cab-extensible-pub-sub-event-aggregator-with-generics.aspx Initially I stripped out the usage of SynchronizationContext. Now I'm trying to introduce it back, and I'm struggling with the translation of the lamda stuff from c# to vb.net. Specifically this line of c# _context.Send(delegate { receiver.Handle(subject); }, null); This is the vb.net I have so far: _context.Send(New SendOrPostCallback(AddressOf listener.Handle(message)), Nothing) The error I'm getting is listener.Handle(message) <-- AddressOf operand must be the name of a method. I'm sure I'm missing something simple, but after staring at this for 2 days, I'm lost.

    Read the article

  • OpenCV: Shift/Align face image relative to reference Image (Image Registration)

    - by Abhischek
    I am new to OpenCV2 and working on a project in emotion recognition and would like to align a facial image in relation to a reference facial image. I would like to get the image translation working before moving to rotation. Current idea is to run a search within a limited range on both x and y coordinates and use the sum of squared differences as error metric to select the optimal x/y parameters to align the image. I'm using the OpenCV face_cascade function to detect the face images, all images are resized to a fixed (128x128). Question: Which parameters of the Mat image do I need to modify to shift the image in a positive/negative direction on both x and y axis? I believe setImageROI is no longer supported by Mat datatypes? I have the ROIs for both faces available however I am unsure how to use them. void alignImage(vector<Rect> faceROIstore, vector<Mat> faceIMGstore) { Mat refimg = faceIMGstore[1]; //reference image Mat dispimg = faceIMGstore[52]; // "displaced" version of reference image //Rect refROI = faceROIstore[1]; //Bounding box for face in reference image //Rect dispROI = faceROIstore[52]; //Bounding box for face in displaced image Mat aligned; matchTemplate(dispimg, refimg, aligned, CV_TM_SQDIFF_NORMED); imshow("Aligned image", aligned); } The idea for this approach is based on Image Alignment Tutorial by Richard Szeliski Working on Windows with OpenCV 2.4. Any suggestions are much appreciated.

    Read the article

  • Scaled live iPhone Camera view in center, "CGAffineTransformTranslate" not working

    - by Gavin
    Hi, I have a little problem which I could not solve. I really hope someone can help me with that. I wanted to resize the live camera view and place it in the center, using the following code below: picker.cameraViewTransform = CGAffineTransformScale(picker.cameraViewTransform, 0.5, 0.56206); picker.cameraViewTransform = CGAffineTransformTranslate(picker.cameraViewTransform, 80, 120); But all I got was a scaled 1/2 sized view on the top left of the screen. It seems as though "CGAffineTransformTranslate" does nothing at all. The translation didn't work even when I used: picker.cameraViewTransform = CGAffineTransformMake(1, 0, 0, 1, 80, 120); The translation portion seems to have no effect on the live camera view. Hope someone can enlighten me. Thanks.

    Read the article

  • Deserialize jSON Google AJAX Translation API

    - by Chris Porter
    I've got the JSON coming back like this: {"responseData": [{"responseData":{"translatedText":"elefante"},"responseDetails":null,"responseStatus":200},{"responseData":{"translatedText":"Burro"},"responseDetails":null,"responseStatus":200}], "responseDetails": null, "responseStatus": 200} And I need to parse it into a ResponseData object I have set-up: public class ResponseData { public string translatedText = string.Empty; public object responseDetails = null; public HttpStatusCode responseStatus = HttpStatusCode.OK; public List<ResponseData> responseData { get; set; } } I Deserialize it like this: JavaScriptSerializer serializer = new JavaScriptSerializer(); ResponseData translation = serializer.Deserialize<ResponseData>(responseJson); But no matter what the translated text is always empty.

    Read the article

  • Cakephp, i18n, Retrieve translation records for associated models

    - by ion
    Quoting from the cakephp Book (ver 1.3): Note that only fields of the model you are directly doing find on will be translated. Models attached via associations won't be translated because triggering callbacks on associated models is currently not supported. Has anyone come up with a solution for this??? If not could you give me some pointers concerning the following simple scenario. I have 2 models: Project, Category. Project HABTM Category I have properly set up i18n table and I have a few entries in the db, all translated. When I retrieve a project it does retrieve the translation but not the translated category because as it says in the cakephp book models attached via associations won't be translated. Any help would be appreciated

    Read the article

  • Free or open source dictionaries

    - by jack
    I'm working on a multi-lingual search engine. I need to map keywords in English to corresponding words in following languages: Bulgarian Catalan Chinese Crotian Czech Danish Dutch Finish French German Greek Hungarian Italian Japanese Korean Lithuanian Litvian Norwegian Polish Portuguese Romanian Russian Slovak Slovenian Spanish Swedish Thai Ukrainian Vietnamese I already known eudict and stardict. Could you recommend some other free or open source dictionaries cover one or more above languages?

    Read the article

  • What is the best way to translate a big amount of text data?

    - by sashaeve
    I have a lot of text data and want to translate it to different languages. Possible ways I know: Google Translate API Bing Translate API The problem is that all these services have limitations on text length, number of calls etc. which makes them inconveniente in use. What services / ways you could advice to use in this case?

    Read the article

  • Zend framework - duplication in translated url

    - by tomasr
    I have these URLs cz/kontroler/akce en/controller/action Is used transatable route and works it like charm. But problem is, that when you will write cz/controller/akce it works as well. In generally when you have cz/something-in-czech en/something-in-english which route to someController, will be works still cz/some en/some because it is really name of controller. How solve this duplicity content issue?

    Read the article

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