Search Results

Search found 16 results on 1 pages for 'raghav kanwal'.

Page 1/1 | 1 

  • Rails noob - How to work on data stored in models

    - by Raghav Kanwal
    I'm a beginner to Ruby and Rails, and I have made a couple applications like a Microposts clone and a Todo-List for starters, but I'm starting work on another project. I've got 2 models - user and tracker, you log in via the username which is authenticated and you can log down data which is stored in the tracker table. The tracker has a column named "Calories" and I would like Rails to sum all of the values entered if they are on the same date, and output the result which is subtracted from, say 3000 in a new statement after the display of the model. I know what I'm talking about is just ruby code, im just not sure how to incorporate it. :( Could someone please guide me through this? And also link me to some guides/tutorials which teach working on data from models? Thank you :)

    Read the article

  • Emailing Interviewer after interview regarding technical solution

    - by Raghav Shankar
    I had an interview yesterday where I was given a programming problem and I was asked to figure the optimal solution for it. I gave a solution that worked in linear time, but used 2 loops (not inner loops). At the end of the interview, the interviewer saw I was interested in solving the problem, so he said the optimal solution uses only one loop and has linear complexity and at the end of the interview I had asked for his card and he gave one to me. I think I might have figured out a solution and I was wondering if it's alright to email the recruiter thanking him for his time and also mentioning about the solution I had figured out?

    Read the article

  • How to recover data from NTFS partition that was made into a Swap partition?

    - by Raghav Mehta
    I have extremely important stuff on my windows partition which during the ubuntu 10.10 installation,when it said that I should create something called swap space, I selected it to be a swap space (without even knowing what it actually meant) The Grub2 doesn't show up so I don't get a choice to boot Ubuntu or Windows. I don't get my windows partition as a removable device in Ubuntu either. When I go to disk utility and select the sda2 (i.e.. my windows partition) and click edit partition and select HPFS/NTFS for the type and tick bootable and click OK the small processing sign keep on rotating on the bottom right of the sda2 in the chart and after about 10 to 15 minutes it gives an unknown error and thus, I am still unable to use my windows. I am even worse than a beginner who doesn't know a thing about Ubuntu so please be patient and help me out.

    Read the article

  • 3D game editor with C++ support and Bullet Physics

    - by Raghav Bali
    I am very new to game development and hence the question. Is there any open-source game editor that uses Bullet Physics engine with C++ code edit support.I have read about blender but it allows python based editing(if I am not wrong here). I need an editor to quickly draw the needed objects and concentrate more on the logic on their interactions(mostly magnetism based). This(my project) is part of an already existing legacy code in C++ which is forcing the dependency. Also, is there any physics engine which provides support for magnetism? Any help will surely be great. Thanks

    Read the article

  • Windows XP-Physical memory dumping

    - by Raghav Bali
    I have windows XP professional installed on my desktop. It shows up the following errors - Physical memory dumping blue screen. : This aint a new problem, i have been facing this problem ever since i bought this systme. initially the maintainence guy said it was a faulty hard drive and i have got it replaced 3 times already in the past 1 yr. The system gets utterly slow after a usage of around 2-3 months and then these errors crop up and i have to reinstall my windows to keep away these errors. But this time,its been only a week and the blue screen has come up 3 times. What can be the actual cause of the error?? Mine is an assembled machine, its a core 2duo with gigabyte motherboard and a 1 gb ram, 160 gb seagate hdd. please help me its a seriously annoying problem. Edit : A new error recent popprd up, what should i do now??

    Read the article

  • Filter rows on the basis of "First Name" + "Last Name" in SQL

    - by Raghav Khunger
    Hi, I have a user table in my database which contains two columns FirstName and LastName. Now in my front end there is a textbox to filter out the users from this table. Let's suppose I am taking that input from the front end in the form of a input parameter "@SEARCHKEYWORD". I have created a sample below: DECLARE @Test TABLE ([ID] INT IDENTITY, [FNAME] NVARCHAR(100), [LNAME] NVARCHAR(100) ) INSERT INTO @Test( FNAME, LNAME ) SELECT 'John','Resig' UNION ALL SELECT 'Dave','Ward' UNION ALL SELECT 'Peter','Smith' UNION ALL SELECT 'Dave','Smith' UNION ALL SELECT 'Girija','Acharya' UNION ALL SELECT 'Devendra', 'Gujel' UNION ALL SELECT 'Arjit', 'Gupta' DECLARE @SEARCHKEYWORD NVARCHAR(100) SELECT * FROM @Test WHERE FNAME +' '+ LNAME LIKE @SEARCHKEYWORD i.e. so far I have thought of this query to filter out the rows but it is not giving the desired results: SELECT * FROM @Test WHERE FNAME +' '+ LNAME LIKE @SEARCHKEYWORD Here are the desired outputs which I needed for the inputs mentioned below: --WHEN @SEARCHKEYWORD='John Resig' --Desired OUTPUT: the row which contains 'John','Resig' --WHEN @SEARCHKEYWORD='Ac' --Desired OUTPUT: the row which contains 'Girija','Acharya' --WHEN @SEARCHKEYWORD='Smith' --Desired OUTPUT: the row which contains 'Peter','Smith' and 'Dave','Smith' --WHEN @SEARCHKEYWORD='g' --Desired OUTPUT: the row which contains 'Devendra', 'Gujel' and 'Arjit', 'Gupta' --WHEN @SEARCHKEYWORD='Smith' --Desired OUTPUT: the row which contains 'Peter','Smith' and 'Dave','Smith'

    Read the article

  • WPF: How to get the event when one FrameworkElement comes in contact with other FrameworkElement

    - by Raghav
    I am developing a small application with images and trash box icon on right hand bottom. I have multiple images floating in the main window, and using mouse I can move image from one corner to other corner of window, left, right, top and bottom. I can't figure out how do I catch an event when a image touches and panel (with trash box image), in the right hand corner. Does anybody knows which event or handler to listen? This is not a drag and drop case since my images are floating so no point using drag and drop. Thank you

    Read the article

  • numeric updown control c#

    - by Raghav
    I am using numeric updowncontrol. For min and max values changed listening for these events this.numDownMinLimit.ValueChanged += new System.EventHandler(this.numDownMinLimit_ValueChanged); this.numDownMaxLimit.ValueChanged += new System.EventHandler(this.numDownMaxLimit_ValueChanged); step size set is 0.1 The eventhandler takes some time to complete. If you keep the mouse pressed for a period of time and then release it, the eventhandler still executes with the previous values which were fired. How do we prevent this scenario from occurring? I would like to discard the remaining events which are still in the queue, waiting to be handled, when the user releases the mouse button.

    Read the article

  • bitmap interpolation c#

    - by Raghav
    Grid size : 160*160 No of row* columns = 16*16 I have created a bitmap for this. Each cell of the grid is filled with different colors. I need to perform color interpolation.

    Read the article

  • Windows Store App Visual Basic Rotate Object with code

    - by Ajay Raghav
    How to rotate an ellipse (or any other object) with VB code? In XAML, I designed an ellipse and easily rotated it from the properties (Transform - Rotate - Angle). When I am trying to do it with VB code, I cannot locate the rotate/angle property of that ellipse. So, I tried this: Dim Rotator As RotateTransform Rotator.Angle = 90 Ellipse1.RenderTransform = Rotator It didn’t work. It says: Unable to cast object of type 'Windows.UI.Xaml.Media.MatrixTransform' to type 'Windows.UI.Xaml.Media.RotateTransform'. I think I’m close to the right way. Please give me a push. Thanks

    Read the article

  • Spring - MVC - Sanitize URL before redisplaying to the user

    - by Raghav
    In my application , a HTTP GET request URL to the application with script tag is getting redisplayed as it is although it fails the authorization. Example: http://www.example.com/welcome<script>alert("hi")</script> The issue is sanitizing external input entered directly into address bar by modifying existing GET URL. Spring redisplays the submitted URL as it is. Though the script does not get executed in the browser(FF), is there anyway to strip the URL of these values before displaying it back to the user Reference: Spring MVC application filtering HTML in URL - Is this a security issue?

    Read the article

  • js regex replace multiple words

    - by Raghav
    I need to replace ${conferance name} with ABC, ${conference day} with Monday in the following sentence. Could some one help me with the regex. var text = "<td>${conference name}</td><td>${conference day}</td>" var list = ["${conferance name}", "${conference day}" ] for (var j = 1; j < list.length; j++) { //Extracting the col name var colName = list[j].split("${"); colName = colName.split("}")[0]; //Replacing the col name text = text.replace(new RegExp('\\$\\{' + colName + '\\}', 'g'), "ABC"); } The above code repalces fine if i have ${conference_name}, but it fails when i have a space in between. The list is a dynamic array. And the Replace statements are also dynamic. I just simulated them as objects here for fitting them in the Regex Statement. Thanks in Advance.

    Read the article

  • Unexpected result when comparing ints

    - by Raghav
    I tried to compare two ints with the following cases and got unexpected results when I did the following, @@@ was printed. class C { static Integer a = 127; static Integer b = 127; public static void main(String args[]){ if(a==b){ System.out.println("@@@"); } } } when I did the following, @@@ was not printed. class C { static Integer a = 145; static Integer b = 145; public static void main(String args[]){ if(a==b){ System.out.println("@@@"); } } } Can anyone tell me what could be the reason.

    Read the article

  • Do I need to keep "recompiling" my iPhone app code everytime apple releases a new iOS version?

    - by user1760606
    New here guys but have got a genuine problem. I have an iPhone app that was developed using SDK4. With apple introducing the new iOS version 6, does my code need to be recompiled on the new SDK to make it compatible with version 6? Right now it crashes on iOS6. Also, do I need to do that everytime apple brings out a new version? I wonder every other app on earth already does that ?! Thanks, Raghav

    Read the article

1