Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 49/96 | < Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >

  • Workling not running tasks in background

    - by alex
    Hi, I followed the railscast that describes how to get workling running background tasks, but can't get it working. The task runs, but not in the background (it's taking 5 secs before I'm redirected to admin_path). Here is what my code looks like: class AdminWorker < Workling::Base   def test_workling(options)     sleep 5   end end class AdminController < ApplicationController   def test_workling     AdminWorker.async_test_workling     flash[:notice] = "Doing stuff in the background"     redirect_to admin_path   end end What am I doing wrong? How to debug? Thanks!

    Read the article

  • The question about the basics of LINQ to SQL

    - by Alex
    I just started learning LINQ to SQL, and so far I'm impressed with the easy of use and good performance. I used to think that when doing LINQ queries like from Customer in DB.Customers where Customer.Age > 30 select Customer LINQ gets all customers from the database ("SELECT * FROM Customers"), moves them to the Customers array and then makes a search in that Array using .NET methods. This is very inefficient, what if there are hundreds of thousands of customers in the database? Making such big SELECT queries would kill the web application. Now after experiencing how actually fast LINQ to SQL is, I start to suspect that when doing that query I just wrote, LINQ somehow converts it to a SQL Query string SELECT * FROM Customers WHERE Age > 30 And only when necessary it will run the query. So my question is: am I right? And when is the query actually run? The reason why I'm asking is not only because I want to understand how it works in order to build good optimized applications, but because I came across the following problem. I have 2 tables, one of them is Books, the other has information on how many books were sold on certain days. My goal is to select books that had at least 50 sales/day in past 10 days. It's done with this simple query: from Book in DB.Books where (from Sale in DB.Sales where Sale.SalesAmount >= 50 && Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID).Contains(Book.ID) select Book The point is, I have to use the checking part in several queries and I decided to create an array with IDs of all popular books: var popularBooksIDs = from Sale in DB.Sales where Sale.SalesAmount >= 50 && Sale.DateOfSale >= DateTime.Now.AddDays(-10) select Sale.BookID; BUT when I try to do the query now: from Book in DB.Books where popularBooksIDs.Contains(Book.ID) select Book It doesn't work! That's why I think that we can't use thins kinds of shortcuts in LINQ to SQL queries, like we can't use them in real SQL. We have to create straightforward queries, am I right?

    Read the article

  • Can someone help me with m Django localization?

    - by alex
    I have a template with has text in it. It's located in /templates under my project directory. I'm trying to do Japanese now. I create a directory called "locale" in my project directory. Then, I set up this in my settings: gettext = lambda s: s LANGUAGES = ( ('de', gettext('German')), ('en', gettext('English')), ('ja', gettext('Japanese')), ) After that, I run this command: django-admin.py makemessages -l ja The only problem is, this doesn't work! In my locale/ja/LC_MESSAGES/django.po: Isn't it supposed to scan my templates with .html extension and grab all the strings? # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-05-20 22:45+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <[email protected]>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: settings.py:101 msgid "German" msgstr "" #: settings.py:102 msgid "English" msgstr "" #: settings.py:103 msgid "Japanese" msgstr ""

    Read the article

  • Help with Django localization--doesn't seem to be working. Nothing happens

    - by alex
    Can someone help me with Localization? I put {% trans "..." %} in my template, I filled in my django.po after running "makemessages". #: templates/main_content.html:136 msgid "Go to page" msgstr "¦~C~Z¦~C¦¦~B¦¦~L~G¦~Z" #: templates/main_content.html:138 msgid "Page" msgstr "¦~C~Z¦~C¦¦~B¦" #: templates/main_content.html:154 msgid "Next" msgstr "?" Then, I set LANGUAGES={} in my settings.py along with "gettext lambda": gettext = lambda s: s LANGUAGES = ( ('de', gettext('German')), ('en', gettext('English')), ('ja', gettext('Japanese')), ) Of course, I installed the LocaleMiddleware. I also set the request.session['django_language'] = "ja" How do I test that this is working? How do I see japanese on my site!?

    Read the article

  • WxPython Incompatible With Snow Leopard?

    - by Alex
    Hello all, Recently I upgraded to Snow Leopard, and now I can't run programs built with wxPython. The errors I get are (from Eclipse + PyDev): import wx File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT/System/Library/Frameworks /Python.framework/Versions/2.6/Extras/lib/ python/wx-2.8-mac-unicode/wx/__init__.py", line 45, in <module> File "/var/tmp/wxWidgets/wxWidgets-13~231/2.6/DSTROOT /System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib /python/wx-2.8-mac-unicode/wx/_core.py", line 4, in <module> ImportError:/System/Library/Frameworks /Python.framework/Versions/2.6/Extras/lib/python /wx-2.8-mac-unicode/wx/_core_.so: no appropriate 64-bit architecture (see "man python" for running in 32-bit mode) I don't really understand them and would appreciate if you could help me to do so, also, if you do know what's going on, how can I go about fixing them? Maybe this has something to do with the fact that Snow Leopard is 64-bit? Thanks!!

    Read the article

  • Should I update an application when a used framework release a new version?

    - by Alex
    I have an application that use several libraries and frameworks, should I update my application to use the latest version of those frameworks when a new stable version is available? For example, migrate from python 2.x to python 3.x, or from spring 2.5 to spring 3.0, but the question es very general, not language specific. If I keep the application updated to use the latest stable frameworks versions then I will have new features available in case I need them. If I don't, then may be in a future I will need to do the update and it will be a lot of work to update the application. Is there any best practice about this?

    Read the article

  • Fake "user initiated" <audio> tag on iPad

    - by Alex Ford
    I know that Apple's docs say that an mp3 within an <audio tag on iPhone OS can't be played without user intervention (they cite bandwidth concerns, totally reasonable). However, has anyone succeeded in faking a user action to play the audio? Perhaps faking events to off screen native audio controls with JavaScript? I'm using jPlayer right now which works great on desktop Safari, but is silent on my iPad. I'm prototyping a touch interface using WebKit on the iPad, and audio is an integral part of the experience, so yes, I do have a good reason to want to override this convention. I'd appreciate any help. Thanks.

    Read the article

  • Workaround for floats in DOMPDF

    - by alex
    DOMPDF does not support floats. However I am listing many tables, and they are mainly key & value pairs. I would like 2 of these tables to appear side by side. i.e. if I could use floats HTML <table id="stuff"> ... </table> <table id="other-stuff"> ... </table> CSS table#stuff { float: left; } table#other-stuff { float: right; } What sort of workaround can I do to support this? Or is it impossible?

    Read the article

  • Any books or other resources on Cognos TM1?

    - by Alex
    I have been assigned to a project to create a activity based costing system using Cognos TM1. I'm familiar with a number of other OLAP tools but have zero experience with TM1. Can anyone suggest a good book (searching doesn't turn up anything obvious) or any good online resources?

    Read the article

  • flv to mp3 converter

    - by alex
    hey im writing a c# flv2mp3 converter and i could need some help. flv is a container type, wich means that when i get all audio tags together, i just have have to reassemble them, or do i habe to save them in a special way? is it possible at all? and i do not want any flvextractors i wanna do it by myself

    Read the article

  • Validate form fields from InfoPath custom code

    - by Alex Angas
    I'm developing an InfoPath form for Forms Services. It has these views: View 1 asks the user to input some basic initial data View 2 calls a web service based on data in View 1 and populates drop-downs accordingly At the bottom of View 1 I've added a Next > button to move to View 2. As part of clicking that button I would like the inputs in View 1 to be validated first. However, there don't appear to be any rules that validate a view or anything in the object model to execute validation rules. Is there code that can trigger a field's validation event?

    Read the article

  • scroll/search JList when user starts typing

    - by alex
    I would like to implement one of the fanciest features I every now and then. I would like to allow a user to click on a JList and if words are typed, do a query and advance the caret to the next match (prefix). Is there and example of such an implementation in Java somewhere? I'm thinking a combination of key listeners, getNextMatch() and setSelectValue().

    Read the article

  • How to start/stop CrossSlide (jQuery)

    - by Alex
    I found that CrossSlide causes video playback on the same page to stutter quite badly. My thought was to have the cross slide effect on the same page stop or pause during video play back, annd then start again when video stops. Id doesn't look like there is any start stop function included. Does any one know how I might be able to accomplish this? Thanks.

    Read the article

  • Array Undefined index error (notice) in PHP

    - by Alex
    I have this function: function coin_matrix($test, $revs) { $coin = array(); for ($i = 0; $i < count($test); $i++) { foreach ($revs as $j => $rev) { foreach ($revs as $k => $rev) { if ($j != $k && $test[$i][$j] != null && $test[$i][$k] != null) { $coin[$test[$i][$j]][$test[$i][$k]] += 1 / ($some_var - 1); } } } } return $coin; } where $test = array( array('3'=>'1','5'=>'1'), array('3'=>'2','5'=>'2'), array('3'=>'1','5'=>'2'), array('3'=>'1','5'=>'1')); and $revs = array('3'=>'A','5'=>'B'); the problem is that when I run it, it returns these errors (notices): Notice: Undefined index: 1 at line 10 Notice: Undefined index: 1 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 2 at line 10 Notice: Undefined index: 1 at line 10 which is this line: $coin[$test[$i][$j]][$test[$i][$k]] += 1 / ($some_var - 1); Any suggestion is greatly appreciated! Thanks!

    Read the article

  • Conceptual website designer ideas?

    - by Alex Tang
    Hi, I'm just wondering if anyone knows of any tool (apart from Visio) to generate visually nice looking website site maps or diagrams of a conceptual website. We're wanting to present some nice diagrams to our client but we're unsure about where to get started - we're all coders, not designers. Visio shapes or stencils are quite old. Just wondered what others in the industry are using!

    Read the article

  • LINQ: Create persistable Associations in Code, Without Foreign Key

    - by Alex
    Hello, I know that I can create LINQ Associations without a Foreign Key. The problem is, I've been doing this by adding the [Association] attribute in the DBML file (same as through the designer), which will get erased again after I refresh my database (and reload the entire table structure). I know that there is the MyData.cs file (as part of the DBML) in which I can place my partial extensions etc. to domain objects (to persist even after I refresh the DBML), but I don't know how to create an association there?

    Read the article

  • Memcache in python

    - by alex
    I want to memcache an xmldata using python,also needs to update the cache with the refreshed xmldata retreived from webserver,could any one help me with sample code.

    Read the article

  • Is there a name for a language feature that allows assignment/creation?

    - by Alex Mcp
    This is a bit hard for me to articulate, but in PHP you can say something like: $myArray['someindex'] = "my string"; and if there is no index named that, it will create/assign the value, and if there IS an index, it will overwrite the existing value. Compare this to Javascript where today I had to do checks like so: if (!myObject[key]) myObject[key] = "value"; I know this may be a bit of a picky point, but is there a name for the ability of PHP (and many other languages) to do these checks on their own as opposed to the more verbose (read: PITA) method of Javascript?

    Read the article

  • Why would a variable in Scala code mysteriously become null?

    - by Alex R
    I've isolated the problem down to this: Predef.println("the value of argv1 here is " + argv(1)); var n: $ = undef; n = argv(1); Predef.println("the value of argv1 here is " + argv(1)); Predef.println("the value of n here is " + n); Predef.println("the class of n here is " + n.getClass); Here's the definition of $: class $ { println("constructed a new $ of type: " + this.getClass); def value: $ = this; def toValue: Value = { new ConstStringValue(this.toString()) }; def -(sym: Symbol): $ = { println("looked up: " + sym); this } def -(sym: $): $ = { println("looked up: " + sym); this } def update(sym: Symbol, any: Any) { println("update called: " + sym + "=" + any); } def apply(sym: Symbol) = { this } def apply(obj: $) = { this } def apply() = { this } def +(o:$) = this.toValue.div(o.toValue) def *(o:$) = this.toValue.mul(o.toValue) def >(o:$) = this.toValue.gt(o.toValue) def <(o:$) = this.toValue.lt(o.toValue) def ++() = { this } def -=(o:$) = { this } } When run, the code prints: the value of argv1 here is 10 the value of argv1 here is 10 the value of n here is null java.lang.NullPointerException at test_1_php$.include(_tmp.scala:149) at php.script.main(php.scala:57) at test_1_php.main(_tmp.scala) [...] Why would n mysteriously lose its value (or fail to take one on)?

    Read the article

  • Validate Canadian Postal Code Regex

    - by Alex Block
    I have a script written in JavaScript to Validate Canadian Postal Codes using Regex, however it does not seem to be working. Here is the script: If statement: if (myform.zip.value == "" || myform.zip.value == null || myform.zip.value == "Postal Code" || myform.zip.value.length < 12 ) { alert("Please fill in field Postal Code. You should only enter 7 characters"); myform.zip.focus(); return false; } Function: function okNumber(myform) { var regex = /^[ABCEGHJKLMNPRSTVXY]{1}\d{1}[A-Z]{1} *\d{1}[A-Z]{1}\d{1}$/; if (regex.test(myform.zip.value) == false) { alert("Input Valid Postal Code"); myform.zip.focus(); return false; } return true; }

    Read the article

< Previous Page | 45 46 47 48 49 50 51 52 53 54 55 56  | Next Page >