Search Results

Search found 1251 results on 51 pages for 'nick forge'.

Page 39/51 | < Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >

  • Calculate difference in days ActiveSupport:TimeWithZone in the most "rubyish" style?

    - by Nick
    I have a feeling someone is going to point me to another question that answers this but I've been searching with no luck over this simple issue. I have a Activerecord with a datetime property. It returns as an ActiveSupport:TimeWithZone. I know I can't compare that to DateTime.now because that doesn't include a zone so I need to use Time.zone. Makes sense. What I'm wondering is stylewise is there a "cleaner" way to do this than subtracting and dividing the result by 86400? Here's what I do: ((Time.zone.now - myActiveRecord.visit_date)/86400).to_i Works but seems un-rubyish and I feel like I'm missing something. Should I be casting, comparing or converting some other route or is this really the typical way to do this in rails? Appreciate any tips or a link to a question that already covers this. Thank you

    Read the article

  • Where should I report mistakes in Android documentation?

    - by Nick
    Hi all, This is my first post ever -- I love the Android SDK (been at it for a week), but I did notice a small typo in the official documentation that needs correcting. Not sure if this is where I post it, but on this page: http://developer.android.com/reference/android/os/CountDownTimer.html within the example source code, the source says "CountdownTimer" on line one when it should say "CountDownTimer" (notice the capitalization of the letter "D"). An easy fix for one with programming experience, but the code as written will not compile, which could be confusing for someone using this code for the first time. Is this where documentation bugs are submitted, and if not, where should I go to request the fix? Thanks all!

    Read the article

  • Are there any FTP programs which can automatically send the contents of a folder to a remote server?

    - by Nick G
    Are there any FTP programs which can automatically copy (or rather 'move') the contents of a folder to a remote server? I have of course googled this but only really found one or two ancient products which look really clunky and unmaintained. I was wondering if there's a way to do this from the command line or any better solution to the base problem. In more detail, new files get written to a folder every few hours. These new files need to be FTP'd elsewhere and then deleted. Mirroring or synchonisation systems are probably out of the picture as we need to delete the source files once they've been successfully transferred. If it's easier, the 'solution' could pull the files off the server (rather than the server pushing them to the client). The computers will both be Windows OS.

    Read the article

  • Array returning Null values

    - by Nick Gibson
    Dunno why it is...heres the coding for it. http://pastebin.org/301343 I know theres a lot of repetitiveness in the coding...but its because the arrays were retuning null so I got tired of messing with them. Everything works until it reaches line 224, which returns null values.

    Read the article

  • An efficient way to store view counts for objects?

    - by Nick Brooks
    I maintain an application where users are able to store images, and then share them. The system is powered by MongoDB at the back end. Most of the image depiction pages are cached as flat HTML files, but I can run some code just before loading the file. I've decided to implement a view count for the system. I am wondering what is the best storage place for that. It should be like Memcached but it should save the viewcounts every hour or so, so even if our server has to be restarted we won't lose the view counts. What is the best solution for that (preferably with a PHP extension as a client)?

    Read the article

  • Is there a link to the "latest" jquery library on Google APIs?

    - by Nick Pierpoint
    I use the following for a jquery link in my <script> tags: http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js Just wondered if anyone had discovered whether there's a link to the "latest" version: Something like the following (which doesn't work): http://ajax.googleapis.com/ajax/libs/jquery/latest/jquery.js (Obviously not necessarily a great plan to link your code to potentially changing libraries but useful in development)

    Read the article

  • Using the HttpWebRequest class.

    - by Nick
    I instantiate the HttpWebRequest object: HttpWebRequest httpWebRequest = WebRequest.Create("http://game.stop.com/webservice/services/gameup") as HttpWebRequest; When I "post" the data to this service, how does the service know which web method to submit the data to? I do not have the code to this web service, all I know is that it was written in Java.

    Read the article

  • Using Linq to filter parents by their children

    - by Nick L
    Having some problems with my Silverlight app (with RIA services) filtering my results. The idea is on the client I set up the EntityQuery and its filters and call load. However this isn't working for me. Heres my code. public void FireQuery(string filterValue) { EntityQuery<Parent> query = m_ParentDomainContext.GetParentQuery(); query = query.Where(p => p.Children.Any(c => c.Name.Contains(filterValue))); m_ParentDomainContext.Load(query, Query_Completed, null); } Compiles just fine, however, runtime I get "Query operator 'Any' is not supported." Exception. Does anyone know of a good way to filter like this? Again, I'm looking for a way to set this up on the client.

    Read the article

  • JQuery AJAX syntax

    - by Nick
    I am trying to find the correct syntax to pass a varible to my JQuery Post. var id = empid; $.ajax({ type: "POST", url: "../Webservices/EmployeeService.asmx/GetEmployeeOrders", data: "{empid: empid}", contentType: "application/json; charset=utf-8", dataType: "json", success: function(result) { alert(result.d); } I don't think the data: value is quite right. Someone set me straight? Thanks!

    Read the article

  • Normal C++ code in Qt doesnt build and run

    - by Nick
    Hello. I am using Qt under linux, if it matters. I ran successfully under Geany (a simple c++ compiler) the following: //my first program in C++ Hello World! include using namespace std; int main () {cout << "Hello World!"; return 0;} I opened Qt source file and copied the exact same code and i can't build or run. Thank you for your responses to this simple problem.

    Read the article

  • Can I modify an ASP.NET AJAX History Point?

    - by Nick
    I'm using ASP.NET 3.5 with AJAX and have enabled history on the Script Manager. I have 2 pages, Default.aspx and Default2.aspx. I'm using the AJAX History on the Default.aspx page and saving history points on the server-side. There are some dropdowns on Default.aspx that I don't want to save a history point for each change but would like to save the latest state so that when I click on a link on Default.aspx that navigates to Default2.aspx, when I click the back button on Default2.aspx to return I want the dropdowns to reflect what they were prior to clicking on the hyperlink. So what I'd like to do is modify the history point that I originally set on one of my ajax async postbacks on the client-side before the page navigates away to Default2.aspx. There is a location.hash javascript property that looks like it may do what I want but when I modify the value the Script Manager Navigate event is firing. Is there a way to prevent this event from firing? And would this then do the job?

    Read the article

  • XNA, C# - Check if a Vector2 path crosses another Vector2 path.

    - by Nick
    Hello all, I have an XNA question for those with more experience in these matters than myself (maths). Background: I have a game that implements a boundary class, this simply hosts 2 Vector2 objects, a start and an end point. The current implementation crudely handles collision detection by assuming boundaries are always vertical or horizontal, i.e. if start.x and end.x are the same check I am not trying to pass x etc. Ideally what I would like to implement is a method that accepts two Vector2 parameters. The first being a current location, the second being a requested location (where I would like to move it to assuming no objections). The method would also accept a boundary object. What the method should then do is tell me if I am going to cross the boundry in this move. this could be a bool or ideally something representing how far I can actually move. This empty method might explain better than I can in words. /// <summary> /// Checks the move. /// </summary> /// <param name="current">The current.</param> /// <param name="requested">The requested.</param> /// <param name="boundry">The boundry.</param> /// <returns></returns> public bool CheckMove(Vector2 current, Vector2 requested, Boundry boundry) { //return a bool that indicated if the suggested move will cross the boundry. return true; }

    Read the article

  • Using "null" in jQuery functions. Is this okay?

    - by Nick
    My database consists of some entries which are NULL (so they don't affect max, min, etc..). When I pull all of the data from the database, I need to repopulate form fields with the values. Using .val(value) where value = NULL seems to work without any problems, but I'm not sure if this is a valid way to go about this. It doesn't say anything in the jQuery documentation (that I can find) about using NULL as parameters to functions.

    Read the article

  • Can an Oracle user get a list of its own running sessions without access to v$session?

    - by Nick Pierpoint
    I have an application that runs a process and I only want one process to run at a time. Some options are: Use an object lock to prevent subsequent processes running. This would be fine, but I want the calling session to return immediately and not wait for the running session to complete. Use a custom Y/N to set whether a process is running or not. I set a "Y" flag at the start of the process and set it to "N" when it finishes or fails. Also fine but feels like I'm re-inventing the wheel and doesn't feel like the way to go. It also falls short if the running session is killed as the flag stays at "Y". Use dbms_application_info.set_module This approach seems the most robust, but if I'm to know there's an existing running process I think I need to be able to query v$session and I don't want this application to have such wide access. Any ideas?

    Read the article

  • How to Download my MYSQL Backup?

    - by NiCk Newman
    Okay I use this script here to make a backup of my database: mysqldump -u root -h localhost -pPASSWORD forums | gzip -9 > backup-$(date +%Y-%m-%d).sql.gz This is used in a cron daily. But I need to download this remotely or through a ftp program every day as well so I have a physical copy of it on my home hard drive, is this possible? I know it is, can anyone tell me a quick way to do it?

    Read the article

  • Merging hashes into one hash in perl

    - by Nick
    how do I get this: $VAR1 = { '999' => { '998' => [ '908', '906', '0', '998', '907' ] } }; $VAR1 = { '999' => { '991' => [ '913', '920', '918', '998', '916', '919', '917', '915', '912', '914' ] } }; $VAR1 = { '999' => { '996' => [] } }; $VAR1 = { '999' => { '995' => [] } }; $VAR1 = { '999' => { '994' => [] } }; $VAR1 = { '999' => { '993' => [] } }; $VAR1 = { '999' => { '997' => [ '986', '987', '990', '984', '989', '988' ] } }; $VAR1 = { '995' => { '101' => [] } }; $VAR1 = { '995' => { '102' => [] } }; $VAR1 = { '995' => { '103' => [] } }; $VAR1 = { '995' => { '104' => [] } }; $VAR1 = { '995' => { '105' => [] } }; $VAR1 = { '995' => { '106' => [] } }; $VAR1 = { '995' => { '107' => [] } }; $VAR1 = { '994' => { '910' => [] } }; $VAR1 = { '993' => { '909' => [] } }; $VAR1 = { '993' => { '904' => [] } }; $VAR1 = { '994' => { '985' => [] } }; $VAR1 = { '994' => { '983' => [] } }; $VAR1 = { '993' => { '902' => [] } }; $VAR1 = { '999' => { '992' => [ '905' ] } }; to this: $VAR1 = { '999:' => [ { '992' => [ '905' ] }, { '993' => [ { '909' => [] }, { '904' => [] }, { '902' => [] } ] }, { '994' => [ { '910' => [] }, { '985' => [] }, { '983' => [] } ] }, { '995' => [ { '101' => [] }, { '102' => [] }, { '103' => [] }, { '104' => [] }, { '105' => [] }, { '106' => [] }, { '107' => [] } ] }, { '996' => [] }, { '997' => [ '986', '987', '990', '984', '989', '988' ] }, { '998' => [ '908', '906', '0', '998', '907' ] }, { '991' => [ '913', '920', '918', '998', '916', '919', '917', '915', '912', '914' ] } ]}; in Perl?

    Read the article

  • Setting CSS attributes on Change using jQuery

    - by Nick B
    I want to change css visibility and display attributes using jQuery on click when the state of another div's visibility attribute changes. (Many apologies for the obfuscated markup, but needing to manipulate someone else's construction): There are four instances of [data-label="Checkbox"] [data-label="Checked"] in this page. I want to set [data-label="trash"] and [data-label="Sort Options"] to visibility: visible; display: [empty value] when any of the [data-label="Checkbox"] [data-label="Checked"]'s attributes changes to 'visibility', 'visible'. Else, if none of [data-label="Checkbox"] [data-label="Checked"]'s have the attribute 'visibility', 'visible', I want to set [data-label="trash"] and [data-label="Sort Options"] back to their initial states: display: none; visibility: hidden;. Here's the markup: <div data-label="Sort Options" style="display: none; visibility: hidden;"> <div data-label="trash" style="display: none; visibility: hidden;"></div> </div> <div data-label="Checkbox"> <div data-label="Unchecked"></div> <div data-label="Checked" style="display: none; visibility: hidden;"></div> </div> Here is what I have tried unsuccessfully: $('[data-label="Checkbox"]').click(function() { if ('[data-label="Checkbox"] [data-label="Checked"]').css('visibility', 'visible') { $('[data-label="trash"], [data-label="Sort Options"]').css({'display': '', 'visibility': 'visible'}); } else { $('[data-label="trash"], [data-label="Sort Options"]').css({'display': 'none', 'visibility': 'hidden'}); } }); Any help would be greatly appreciated! Thanks

    Read the article

  • Resolve circular typedef dependency?

    - by Nick
    What is the best way to resolve the following circular dependency in typedef-ing these structs? Note the C language tag - I'm looking for a solution in standard gcc C. typedef struct { char* name; int age; int lefthanded; People* friends; } Person; typedef struct { int count; int max; Person* data; } People;

    Read the article

  • What's the difference between UI development and front-end development?

    - by Nick Lowman
    I'm a front-end developer and really enjoy jQuery and JavaScript. I've built a lot a websites, done some good jQuery work and built a few JavaScript based applications and would really like to get in UI development. Or so I thought. I guessed it would be pretty similar to what I already do except maybe a little more JavaScript heavy but when I looked into it all the job specs said I needed to know about Scrum or Agile development, knowledge of testing frameworks and a good knowledge of JavaScript frameworks and custom events. So, from the specs I get the idea that a UI developer is actually a dedicated JavaScript developer. Is that the case? I understand (with much help from the users on stackoverflow), about JavaScript OO, inheritance, closures, custom events, debugging in Firefox or Aptana etc, and the people I work with seem to think I pretty OK at what I do but clearly my knowledge is not good enough to go for UI jobs. If anyone could tell me a little more about UI development and if there are any good resources for learning about it I would be most grateful as I couldn't find much on the internet.

    Read the article

  • Visual Studio Folder Structure

    - by nick
    I am not sure how this works. I am using Visual Studio 2008 and I created a Class Library (say the name is Test). I also selected the option to create a folder for the solution. Following is the directory structure I get: Test - Test - bin - Debug - obj - Debug - Properties - AassemblyInfo.cs - Test.cs - Test.csproj - Test.sln - Test.suo This is default and I have no problems running my code this way. My querry is I see other solutions (class libraries) created in the Subversion by others before have a different structure. The structure for that is as follows: Test - .svn - lib - <<Reference 1>> - <<Reference 2>> - .... - <<Reference N>> - src - bin - Debug - obj - Debug - Properties - AassemblyInfo.cs - Test.cs - Test.csproj - Test.sln - Test.suo My query is how to create this structure? All the references to other projects are maintained in lib folder and source code is maintained in src folder. This is not the case happening with me. When I open the solution in Visual Studio, I cannot see any such folder like lib or src. It shows the same way as mine. Kindly help and forgive me for being so elaborative. Thanks

    Read the article

  • What is the best place to store globals in Rails app?

    - by Nick Gorbikoff
    Hello. I was wondering if there is the best practice on where to store global settings in a rails app. What I mean by that is i.e: I have a few globals defined that may change, but not likely and it seems inappropriate to store them in DB since they are used so much. For instance I have SYSTEM_EMAIL & SYSTEM_EMAIL_SIGNATURE & SYSTEM_STORAGE_ROOT. Right now I keep them in environment.rb, but I'm not sure if this is the right palce to store them. Thank you

    Read the article

  • Moving the ScrollBar To the Selected Node In A TreeView Control

    - by Nick LaMarca
    I have a treeview control where I am dynamically selecting a node depending on user interaction. when a node is selected I want to be able to have the scrollbar go to the location of that selected node in the tree. The scrollbar is simply made by overflow:auto in the div tag where the treeview is located. Can someone give me some detailed code to accomplish this? Thanks in advance.

    Read the article

  • generate random characters in c

    - by Nick
    I'm new to programming in C and have been given the task of creating a 2D array that stores random letters from A-Z using the random () function. I know how to do random numbers. nextvalue = random ( ) % 10001; but am unsure on how exactly to create a random character. I know that you can use ASCII to create a random character using the range 65 - 90 in the ASCII table. Can anyone help me come up with a solution? I would greatly appreciate it.

    Read the article

< Previous Page | 35 36 37 38 39 40 41 42 43 44 45 46  | Next Page >