Daily Archives

Articles indexed Wednesday April 21 2010

Page 33/126 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • CakePHP Form Helper Database Interaction

    - by xtine
    Currently I am developing a CakePHP that will list various businesses. In the database, there is a table for businesses that lists them like so: id | name | address | city | state | state_id | zip | url The state column are abbreviations of states (for listing purposes) CA, AK, FL, etc and the state_id matches up with the ids in the states table: id | name | state_abbr I have an admin_add.ctp template with form helpers for inserting new businesses. For entering a state for a business I am going to have a pull down that lists all the states. However, how do I make the database insert so it will know how to add the state abbreviation and state id when I submit the form to add the business?

    Read the article

  • Python vs Ruby Top Sites

    - by Steve
    Hi, I was just trying to find some comparison of the existing python web frameworks and ruby frameworks. There are few promising frameworks in python but I was not able to find a top 100 site using python except for google, which uses python extensively. Python has great frameworks but I am not able to find a really popular sites using python. Definitely most of the site would use python for background processing and stuff. On the other hand, ruby on rails has a few sites like twitter,hulu,yellowpages,scribd are present in top 100 sites. Can you mention some really popular sites using either of these languages.

    Read the article

  • rake test fails

    - by Pavel K.
    i have a model (simplified) class Myfile < ActiveRecord::Base validates_attachment_size :body, :less_than => AdminOptions.first.max_file_size.megabytes end max_file_size is defined in AdminOptions fixture, but when i try to run "rake test", i get: /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/whiny_nil.rb:52:in `method_missing': undefined method `max_file_size' for nil:NilClass (NoMethodError) from /myapp/app/models/myfile.rb:1 if i run ruby test/unit/myfile_test.rb i get same mistake. if i run: RAILS_ENV=test rake db:load:fixtures ruby test/unit/myfile_test.rb tests execute properly. if i try to RAILS_ENV=test rake db:load:fixtures rake test it fails with same mistake. does anyone know how to fix that?

    Read the article

  • Apache configuration to accept all data

    - by ServerDown
    Hi, I have apache running on port 7979 to talk with a device that sends data to webserver and later will run php scripts to process and send reply xml. The problem now is that it sends data like POST HTTP/1.1 Content-Type:text/xml Content-Length:369 Followed by XML When apache sees this it gives a 400 error. Since the device cannot be changed is there any way to accept the full data sent from the device and write to some log? Currently apache simply keeps sending 400 errors back. If there was a way to log the entire xml or create some custom handler for 400 error then the xml could be read by a php script. Looking forward to solutions.

    Read the article

  • Windows 7 - User-specific %PATH%

    - by MiffTheFox
    I'd like to set up a system for Windows 7 where each user has their own private directory in %PATH%. I tried setting %PATH% to %HOMEDRIVE%%HOMEPATH%\Bin;%SystemRoot%\System32;[...] but it doesn't seem to work. For those who don't realize what I'm trying to do, it's sort of like EXPORT PATH=~/bin would be on *nix. It can be on a user specific basis if need be (and that would actually be prefer to the machine-wide settings).

    Read the article

  • Wherer can I get Windows XP Images for WMware Workstation

    - by Saif Bechan
    Does anyone know where I can get windows images for vmware. I know Microsoft gives away the images for Virtual PC. These images work pretty well, but when I try to import them in VMware I need to activate the copies again, because the virtual hardware they use is just to different. I want Images of different versions of windows 2000,xp,vista. Does anyone where I can download them, or do I need to build them from CD.

    Read the article

  • UVA #10410 Tree Reconstruction

    - by Vincent
    I have worked on UVA 10410 Tree Reconstruction several days. But I can't get the correct answer unitl now. I have used an algorithm similar to the one which we always use to recovery a binary tree through the preorder traversal and the inorder traversal. But it can't work. Can anyone help me? Thanks in advance.

    Read the article

  • Combining two input fields to one, jquery

    - by nic_dk
    Im trying to combine the name field, and msg field, and input all values into #msg, but cant quite get it to work $('#DocumentCommentsForm_21').bind('submit', function(){ var name = "##" + $('#navn').val() + "##"; var msg = $('#msg').val(); $('#msg').val(name+' '+msg); }); alert($('#msg').val(name+' '+msg));

    Read the article

  • Prototypal inheritance should save memory, right?

    - by Techpriester
    Hi Folks, I've been wondering: Using prototypes in JavaScript should be more memory efficient than attaching every member of an object directly to it for the following reasons: The prototype is just one single object. The instances hold only references to their prototype. Versus: Every instance holds a copy of all the members and methods that are defined by the constructor. I started a little experiment with this: var TestObjectFat = function() { this.number = 42; this.text = randomString(1000); } var TestObjectThin = function() { this.number = 42; } TestObjectThin.prototype.text = randomString(1000); randomString(x) just produces a, well, random String of length x. I then instantiated the objects in large quantities like this: var arr = new Array(); for (var i = 0; i < 1000; i++) { arr.push(new TestObjectFat()); // or new TestObjectThin() } ... and checked the memory usage of the browser process (Google Chrome). I know, that's not very exact... However, in both cases the memory usage went up significantly as expected (about 30MB for TestObjectFat), but the prototype variant used not much less memory (about 26MB for TestObjectThin). I also checked: The TestObjectThin instances contain the same string in their "text" property, so they are really using the property of the prototype. Now, I'm not so sure what to think about this. The prototyping doesn't seem to be the big memory saver at all. I know that prototyping is a great idea for many other reasons, but I'm specifically concerned with memory usage here. Any explanations why the prototype variant uses almost the same amount of memory? Am I missing something?

    Read the article

  • How to make non-blurry image in WPF 3d

    - by terenf
    I used Viewport3D and ModelVisual3D to create a simple rectangle with an image (I tried it with JPG, PNG), but it shows the image blurry, but the original image is very sharp and clear. I don't know how to make it with the original quality in 3D... I also tried some 2D solutions like RenderOptions.BitmapScalingMode and SnapsToDevicePixels but they do not seem to not work in the 3D case. Has anyone encountered this problem or know the solution?

    Read the article

  • Does anyone know what causes this error? VC++ with VisualAssert

    - by TerryJohnson
    Hi does anyone know what causes this error? In Visual Studio 2008 with Visual Assert Thanks 1>------ Build started: Project: ChessRound1, Configuration: Debug Win32 ------ 1>Compiling... 1>stdafx.cpp 1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xlocnum(135) : error C2857: '#include' statement specified with the /Ycstdafx.h command-line option was not found in the source file 1>Build log was saved at "file://c:\Users\Admin1\Documents\Visual Studio 2008\Projects\ChessRound1\ChessRound1\Debug\BuildLog.htm" 1>ChessRound1 - 1 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    Read the article

  • How would you write this C# code succinctly in 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; } } } } If it is possible, please give an example.

    Read the article

  • Find Shortest element in Array

    - by Ani
    I have a Array string[] names = { "Jim Rand", "Barry Williams", "Nicole Dyne", "Peter Levitt", "Jane Jones", "Cathy Hortings"}; Is there any way to find which is the shortest(Length wise) element in this array and then store rest of elements in a different array. Thanks, Ani

    Read the article

  • mouse rollover event in Python (VPython)

    - by kame
    Is there something similar to scene.mouse.getclick in the visual module (VPython)? I need it for a rollover. Thanks in advance. EDIT: I need a function for doing something when the mouse moves inside a special area without clicking.

    Read the article

  • Subversion to TFS 2010 RTM migration with timestamps

    - by ooOOoo
    Question is simple, if one needs to migrate subversion repository to TFS 2010 RTM what is the best tool to use. I have found http://www.timelymigration.com/ and looks good but after contacting them I found out that during the migration timestamps on the changesets are lost. All timestamps are set to date of migration and real timestamps are stored in the comment of the changeset. How to migrate from SVN to TFS 2010 RTM and keep the timestamps ??

    Read the article

  • InvalidCastException when creating an instance using assembly.CreateInstance

    - by Yossi Dahan
    I'm looking for an explanation for the following - I have an assembly I'm loading using Assembly assembly = Assembly.LoadFrom(filename); I then loop on all the types in the assembly, and wish to try and find out if a type implements a particular interface and if so I want an instance of that type, I've tried several things which did not work, but when I fell back to the most basic (and probably inefficient) way, I realised there's something more fundamental I don't understand - foreach (Type t in assembly.GetTypes()) { foreach (Type i in t.GetInterfaces()) { if (i.FullName == pluginInterfaceType.FullName) { object o = assembly.CreateInstance(t.ToString()); IInterface plugin = (IInterface)o; That last line causes an InvalidCastException, despite the fact that the type created definitely implements that interface. Further more - if I use Activator.CreateInstance instead of Assembly.CreateInstance (which I don't want to do), casting to the interface works just fine.

    Read the article

  • Pros and cons of Localisation of technical words ?

    - by paercebal
    This question is directed to the non-english speaking people here. It is somewhat biased because SO is an "english-speaking" web forum, so... In the other hand, most developers would know english anyway... In your locale culture, are technical words translated into locale words ? For example, how "Design Pattern", or "Factory", or whatever are written/said in german, spanish, etc. etc. when used by IT? Are the english words prefered? The local translation? Do the two version (english/locale) are evenly used? Edit Could you write with your answer the locale translation of "Design Pattern"? In french, according to Wikipedia.fr, it is "Patron de conception", which translates back as "Model of Conceptualization" (I guess).

    Read the article

  • Similar Application to GemBox for word

    - by darrick
    Hi all, I'm using GemBox for my project now. Currently my module requires only excel which is why I've tried and really like using this application. Talk to my PM about the possibility of purchasing it but they wanted something similar that might work for word documents as well as just excel so that others might use it as it is more common for word documents to be generated.

    Read the article

  • Can i Convert VB code to C++ code

    - by shubu
    Can I convert my VB code to C++? How can I do it? This is my VB code: Dim OpenFileDialog1 As New OpenFileDialog With OpenFileDialog1 .CheckFileExists = True .ShowReadOnly = False .Filter = "All Files|*.*|Bitmap Files (*)|*.bmp;*.gif;*.jpg" .FilterIndex = 2 If .ShowDialog = DialogResult.OK Then ' Load the specified file into a PictureBox control. PictureBox1.Image = Image.FromFile(.FileName) End If End With

    Read the article

  • Stop Master page refreshing while navigating between pages?

    - by Wael Dalloul
    I'm using Master Page in my ASP.net application, in the master page I put a ContentPlaceHolder in Update Panel to support AJAX in child pages, the question is how to stop Refreshing "master page controls" while navigating between pages? For navigation between pages I tried to use Response.Redirect, windows.location java script with no success, shall I use the Frames or IFrames instead of Master Pages to stop Refreshing? any suggestion to solve this issue will be highly appreciated, Thanks in advance...

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >