Search Results

Search found 11338 results on 454 pages for 'big dave'.

Page 108/454 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • On saving a new record an associated id changes to 9 figure number

    - by Dave
    Hi, I have a table of venues, with each venue belonging to an area and a type. I recently dropped the table and added to it some addressline fields. I have re-migrated it but now the area_id field saves as a random? 9 figure number. Both the area_id and venuetype_id integers are created in the same way from the create new form and the venuetype_id saves as normal but not the area_id. Can anyone offer any help? whats shown in the console => [#<Venue id: 4, name: "sdf", addressline1: "", addressline2: "", addressline3 : "", addressline4: "", icontoppx: 234, iconleftpx: 234, area_id: 946717224, ven uetype_id: 8, created_at: "2011-03-17", updated_at: "2011-03-17 23:33:53">] irb(main):030:0> the area_id should be 8 in the above example. The area and venuetype id's are slected from dropdown boxes on the new venue form. new form <%= form_for @venue do |f| %> <p>name: <br> <%= f.text_field :name %></p> <p>top: <br> <%= f.text_field :icontoppx %></p> <p>left: <br> <%= f.text_field :iconleftpx %></p> <p>addressline1: <br> <%= f.text_field :addressline1 %></p> <p>addressline2: <br> <%= f.text_field :addressline2 %></p> <p>addressline3: <br> <%= f.text_field :addressline3 %></p> <p>addressline4: <br> <%= f.text_field :addressline4 %></p> <p>area: <br> <%= f.collection_select(:area_id, Area.all, :id, :name) %></p> <p>venuetype: <br> <%= f.collection_select(:venuetype_id, Venuetype.all, :id, :name) %></p> <br><br> <div class="button"><%= submit_tag %></div> <% end %> Areas table class CreateAreas < ActiveRecord::Migration def self.up create_table :areas do |t| t.string :name t.timestamps end end def self.down drop_table :areas end end Thanks very much for any help!

    Read the article

  • How can I encrypt a querystring in asp.net?

    - by Dave Haynes
    I need to encrypt and decrypt a querystring in ASP.NET. The querystring might look something like this: http://www.mysite.com/report.aspx?id=12345&year=2008 How do I go about encrypting the entire querystring so that it looks something like the following? http://www.mysite.com/report.aspx?crypt=asldjfaf32as98df8a And then, of course, how to I decrypt it? What's the best encryption to use for something like this? TripleDES?

    Read the article

  • How to create a screensaver?

    - by Dave
    Which is the best programming language to use for creating a screensaver? I am thinking of creating a screensaver to showcase projects i have done before for self satisfaction. How should i go about it? Thanks

    Read the article

  • Does a child control inherit its parents properties of the same name

    - by Dave Colwell
    Hi all, simple question regarding property value inheritance in UserControls. If i create a UserControl, it has some standard properties like Background, BorderBrush and BorderThickness. Within that UserControl i have a border. I want to know, if i dont specify any set value or binding for the property BorderBrush of that border, will it automatically inherit the value of BorderBrush from the parent control? Thanks!

    Read the article

  • Find completely commented files which are commented by /* */.

    - by Dave
    Similar to this question. I would like to find all commented files. But in my case /* */ is a possibility. Apparently when you write changes to a database project, dropped objects are only commented out instead of deleting the file. I would like to remove all of these commented out files from the project. Is is possible to find all files which start with /* and end with */?

    Read the article

  • Maintaining Logging and/or stdout/stderr in Python Daemon

    - by dave mankoff
    Every recipe that I've found for creating a daemon process in Python involves forking twice (for Unix) and then closing all open file descriptors. (See http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ for an example). This is all simple enough but I seem to have an issue. On the production machine that I am setting up, my daemon is aborting - silently since all open file descriptors were closed. I am having a tricky time debugging the issue currently and am wondering what the proper way to catch and log these errors are. What is the right way to setup logging such that it continues to work after daemonizing? Do I just call logging.basicConfig() a second time after daemonizing? What's the right way to capture stdout and stderr? I am fuzzy on the details of why all the files are closed. Ideally, my main code could just call daemon_start(pid_file) and logging would continue to work.

    Read the article

  • Optimize Duplicate Detection

    - by Dave Jarvis
    Background This is an optimization problem. Oracle Forms XML files have elements such as: <Trigger TriggerName="name" TriggerText="SELECT * FROM DUAL" ... /> Where the TriggerText is arbitrary SQL code. Each SQL statement has been extracted into uniquely named files such as: sql/module=DIAL_ACCESS+trigger=KEY-LISTVAL+filename=d_access.fmb.sql sql/module=REP_PAT_SEEN+trigger=KEY-LISTVAL+filename=rep_pat_seen.fmb.sql I wrote a script to generate a list of exact duplicates using a brute force approach. Problem There are 37,497 files to compare against each other; it takes 8 minutes to compare one file against all the others. Logically, if A = B and A = C, then there is no need to check if B = C. So the problem is: how do you eliminate the redundant comparisons? The script will complete in approximately 208 days. Script Source Code The comparison script is as follows: #!/bin/bash echo Loading directory ... for i in $(find sql/ -type f -name \*.sql); do echo Comparing $i ... for j in $(find sql/ -type f -name \*.sql); do if [ "$i" = "$j" ]; then continue; fi # Case insensitive compare, ignore spaces diff -IEbwBaq $i $j > /dev/null # 0 = no difference (i.e., duplicate code) if [ $? = 0 ]; then echo $i :: $j >> clones.txt fi done done Question How would you optimize the script so that checking for cloned code is a few orders of magnitude faster? System Constraints Using a quad-core CPU with an SSD; trying to avoid using cloud services if possible. The system is a Windows-based machine with Cygwin installed -- algorithms or solutions in other languages are welcome. Thank you!

    Read the article

  • Iphone 3d games using Open Gl Es

    - by Dave
    Hi, I want to make 3d games for the iphone and with all this doubt about Unity and Apples new sdk agreement I'm wondering what the best way forward is? A lot of people recommend opengl es and point me in the direction of the open gl es bible and likewise, the problem is none of this actually talk about setting a game up i.e loading a character, scene , AI etc. Yet a lot of people are using Open GL es please could someone help me out, I really feel like I'm missing out on something. Are there any good tutorials/books that cover this? Thanks,

    Read the article

  • Return value in Visual Studio's Autos window

    - by Dave
    When I used to develop in C++, I remember that Visual Studio had an entry in its Autos window whenever returning from a function call. This entry would tell me what value was returned from that function. One might argue that if a function returns a value, then you should set a variable to that value, i.e. int i = GetRandomInt(); But as a contrived example, suppose I wanted to do this: CycleTushKicker( GetRandomInt()); Instead of stepping into CycleTushKicker to figure out how many lickings my kid gets, I'd just like to know the value as soon as I exit GetRandomInt. Is there a way to get this when using C#?

    Read the article

  • transform file/directory structure into 'tree' in javascript

    - by dave
    I have an array of objects that looks like this: [{ name: 'test', size: 0, type: 'directory', path: '/storage/test' }, { name: 'asdf', size: 170, type: 'directory', path: '/storage/test/asdf' }, { name: '2.txt', size: 0, type: 'file', path: '/storage/test/asdf/2.txt' }] There could be any number of arbitrary path's, this is the result of iterating through files and folders within a directory. What I'm trying to do is determine the 'root' node of these. Ultimately, this will be stored in mongodb and use materialized path to determine it's relationships. In this example, /storage/test is a root with no parent. /storage/test/asdf has the parent of /storage/test which is the parent to /storage/test/asdf/2.txt. My question is, how would you go about iterating through this array, to determine the parent's and associated children? Any help in the right direction would be great! Thank you

    Read the article

  • updating an activity from an asynchronous service

    - by Dave.B
    I've implemented a service that does an asynchronous sync to between my application and google docs. I want to update the top level activity of my application when the sync is complete. However because of the service it's possible that the app could be be in a unknown state. Is there a way to make the top level activity, whatever that may be, recreate itself from an asynchtask in a service.

    Read the article

  • ASP.NET Radio Button State and Back Key

    - by Dave S
    When using the browser back key on a page with radio buttons and using auto-postback, the state of the buttons (checked) stays the same while other parts of the page do not. This results in a situation where button two is checked and the cached page (because of server-side logic) displays a message that button 1 is checked. What is the best way to handle this situation? The following code example exhibits this behavior: [Form:] <asp:RadioButton ID="rb1" runat="server" AutoPostBack="true" Text="Button1" OnCheckedChanged="rb_CheckedChanged" GroupName="rbgroup" Checked="true" /> <br /> <asp:RadioButton ID="rb2" runat="server" AutoPostBack="true" Text="Button2" OnCheckedChanged="rb_CheckedChanged" GroupName="rbgroup" /> <br /> <hr /> <asp:Label ID="lbl1" runat="server">Button 1</asp:Label> [Code Behind:] protected void rb_CheckedChanged(object sender, EventArgs e) { if (rb1.Checked == true) lbl1.Text = "Button 1"; else lbl1.Text = "Button 2"; }

    Read the article

  • Bypassing a requiredfieldvalidator

    - by Dave
    Hi, I have a webform which has validators on it that work well when the user presses the submit button. But when the user presses the logout button the validators stop that button from working. Any suggestions as to how remedy this?

    Read the article

  • Double # showing 0 on android

    - by Dave
    I'm embarrassed to ask this question, but after 45 minutes of not finding a solution I will resort to public humiliation. I have a number that is being divided by another number and I'm storing that number in a double variable. The numbers are randomly generated, but debugging the app shows that both numbers are in fact being generated. Lets just say the numbers are 476 & 733. I then take the numbers and divide them to get the percentage 476/733 = .64 I then print out the variable and it's always set to 0. I've tried using DecimalFormat and NumberFormat. No matter what I try though it always says the variable is 0. I know there is something simple that I'm missing, I just can't find it =/.

    Read the article

  • Return NSString from a recursive function

    - by Dave
    Hi, I have a recursive function that is designed to take parse a tree and store all the values of the tree nodes in an NSString. Is the algorithm below correct? NSString* finalString = [self parseTree:rootNode string:@""]; -(NSString*)parseTree:(Node*)currentNode string:(NSMutableString*)myString { [myString appendText:currentNode.value]; for(int i=0;i<[currentNode.children length];i++){ return [self parseTree:[currentNode.children] objectAtIndex:i] string:myString]; } }

    Read the article

  • Locale C++ shared library in /usr/local/lib

    - by Dave
    I'm venturing into the world of C++ and Linux, and am having problems linking against a shared library. I have a library, libicuuc.so.44.1, installed in /usr/local/lib. There is also a link in the same directory, libicuuc.so.44 pointing to that library. My /etc/ld.so.conf reads: include /etc/ld.so.conf.d/*.conf I have a file, /etc/ld.so.conf.d/libc.conf, that contains: # libc default configuration /usr/local/lib However, when I compile my program (that includes LIBS += -licuuc), I get the following error at runtime: error while loading shared libraries: libicuuc.so.44: cannot open shared object file: No such file or directory I am using Qt Creator on Ubuntu 10.04. Any help is greatly appreciated!

    Read the article

  • Setting XTick or XLabels for a plot containing millisecond data

    - by Dave
    I am trying to set the X-Axis labels on a plot. I have a vector of times, these go down to the millisecond level. I have tried setting both XTick and XTickLabel properties but things are not working correctly (labels are not valid). Any suggestions on what one needs to do to get datetick to work when working with times that go down to the second/millisecond level? Are there any alternatives to using datetick? Any suggestions are appreciated.

    Read the article

  • Empty R environment becomes large file when saved

    - by user1052019
    I'm getting behaviour I don't understand when saving environments. The code below demonstrates the problem. I would have expected the two files (far-too-big.RData, and right-size.RData) to be the same size, and also very small because the environments they contain are empty. In fact, far-too-big.R ends up the same size as bigfile.RData. I get the same results using 2.14.1 and 2.15.2, both on WinXP 5.1 SP3. Can anyone explain why this is happening? Thanks. a <- matrix(runif(1000000, 0, 1), ncol=1000) save(a, file="c:/temp/bigfile.RData") test <- function() { load("c:/temp/bigfile.RData") test <- new.env() save(test, file="c:/temp/far-too-big.RData") test1 <- new.env(parent=globalenv()) save(test1, file="c:/temp/right-size.RData") } test()

    Read the article

  • Static selection and Ruby on Rails objects

    - by Dave
    Hi all- I have a simple problem, but am having trouble wrapping my head around it. I have an video object that should have one or more "genres". This list of genres should be prepopulated and then the user should just select one or more using autocomplete or some such. Here is the question: Is it worth creating a table with genres for the static selection? Or should it just be included in the presentation layer? If there is a static table, how do we name it correctly. I envision something like this class Video < ActiveRecord::Base has_many :genres ... end class Genre < ... belongs_to :video ... end But then we get a table called genre, that basically maps all the selected genres to their parent videos. There would need to be some static table to reference the static genres. Is this the best way to do it? Sorry if this was rambl-y a little stream of conciousness. Thanks!

    Read the article

  • Is there a way to load multiple app.configs in memory?

    - by Dave
    I have a windows service that loads multiple "handlers" written by different developers. The windows service exe has it's own app.config which I need. I'm trying to make it so that each developer can provide their own app.config along with their handler code. However, it seems an exe can only have one app.config. However, ASP.NET seems to support nested web.config... That's not exactly what I want, but I don't even know how I would get that to work in a windows service. Anyone come across this before or have any ideas?

    Read the article

  • How to hook to a keystroke under Windows Vista?

    - by Dave
    Hi. I'm working on a program idea which needs to respond when a particular Function key is pressed on the keyboard(like F10). (A) is that possible? (B) what language should i use (i'll be getting the development outsourced, so its not a problem) (c) any sample code which shows how it works?

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >