Search Results

Search found 5784 results on 232 pages for 'points'.

Page 142/232 | < Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >

  • Interview question: How do I detect a loop in this linked list?

    - by jjujuma
    Say you have a linked list structure in Java. It's made up of Nodes: class Node { Node next; // some user data } and each Node points to the next node, except for the last Node, which has null for next. Say there is a possibility that the list can contain a loop - i.e. the final Node, instead of having a null, has a reference to one of the nodes in the list which came before it. What's the best way of writing boolean hasLoop(Node first) which would return true if the given Node is the first of a list with a loop, and false otherwise? How could you write so that it takes a constant amount of space and a reasonable amount of time? Here's a picture of what a list with a loop looks like: Node->Node->Node->Node->Node->Node--\ \ | ----------------

    Read the article

  • Texture repeats even with GL_CLAMP_TO_EDGE set

    - by Lliane
    Hi, i'm trying to put a translucing texture on a face which uses points 1 to 4 (don't mind the numbers) on the following screenshot Sadly as you can see the texture repeats herself in both dimensions, I tried to switch the TEXTURE_WRAP_S from REPEAT to CLAMP_to_EDGE but it doesn't change anything. Texture loading code is here : gl.glBindTexture(gl.GL_TEXTURE_2D, mTexture.get(4)); gl.glActiveTexture(4); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MIN_FILTER, gl.GL_LINEAR); gl.glTexParameterf(gl.GL_TEXTURE_2D, gl.GL_TEXTURE_MAG_FILTER, gl.GL_LINEAR); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_S, GL10.GL_CLAMP_TO_EDGE); gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T, GL10.GL_CLAMP_TO_EDGE); gl.glTexImage2D(gl.GL_TEXTURE_2D, 0, gl.GL_RGBA, shadowbmp.width, shadowbmp.height, 0, gl.GL_RGBA, gl.GL_UNSIGNED_SHORT_4_4_4_4, shadowbmp.buffer); Texture coordinates are the following : float shadow_bot_text[] = { 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, 1.0f }; Thanks

    Read the article

  • Would it be faster to use CMS for building the first site in ASP.NET?

    - by rem
    I need an opinion and advise from experienced ASP.NET people, what way to go. Assuming that a developer has some practical background with HTML/JavaScript/PHP on one side and some .NET/C#/WPF experience on the other side. No previous hands on experience with ASP.NET - only theory and some read books on the topic. The task is to build ASP.NET web site with User Managment functionality (user authentication, user account, user buying history, user points and so on) and E-commerce functionality with shopping cart, checkout and all needed for this. Is it worth, i.e. will it be faster, more reliable and secure in the result to use a ASP.NET CMS system (for example Sitefinity from Telerik as declared developer friendly) to build such first site? In what case the learning curve will be more steep and it will take more time to achieve similar results? Notes to take into consideration: 1) Price of the CMS matters not very much 2) E-commerce module should be written from scratch in any case (and integrated in case of using CMS) due to very specific requirements

    Read the article

  • Why use a Rails-like deployment mechanism over 'git pull' for releasing?

    - by Chad Johnson
    To release my centralized webapp, I COULD have a vhost pointed to some directory and then just do a 'git pull' when I want to release, updating the files. But Rails has a different deployment mechanism: it copies files to a subdirectory and then points a symlink ('current') to that new subdirectory. I understand that it probably more acceptable to do a Rails-like deployment because the release is built in some directory, and then the symlink is pointed to that directory, so this is much faster, and it's less likely that users would experience weird issues while a release is happening. Are there any other advantages to the Rails approach? Or, is a 'git pull' approach actually more widely accepted?

    Read the article

  • How To? Use an Expression Tree to call a Generic Method when the Type is only known at runtime.

    - by David Williams
    Please bear with me; I am very new to expression trees and lambda expressions, but trying to learn. This is something that I solved using reflection, but would like to see how to do it using expression trees. I have a generic function: private void DoSomeThing<T>( param object[] args ) { // Some work is done here. } that I need to call from else where in my class. Now, normally, this would be be simple: DoSomeThing<int>( blah ); but only if I know, at design time that I am working with an int. When I do not know the type until runtime is where I need the help. Like I said, I know how to do it via reflection, but I would like to do it via expression trees, as my (very limited) understanding is that I can do so. Any suggestions or points to sites where I can get this understanding, preferably with sample code?

    Read the article

  • strange results with /fp:fast

    - by martinus
    We have some code that looks like this: inline int calc_something(double x) { if (x > 0.0) { // do something return 1; } else { // do something else return 0; } } Unfortunately, when using the flag /fp:fast, we get calc_something(0)==1 so we are clearly taking the wrong code path. This only happens when we use the method at multiple points in our code with different parameters, so I think there is some fishy optimization going on here from the compiler (Microsoft Visual Studio 2008, SP1). Also, the above problem goes away when we change the interface to inline int calc_something(const double& x) { But I have no idea why this fixes the strange behaviour. Can anyone explane this behaviour? If I cannot understand what's going on we will have to remove the /fp:fastswitch, but this would make our application quite a bit slower.

    Read the article

  • Trouble with Canvas rendering in Safari/Opera

    - by Jon
    Been banging my head against this one for a while, and figured I'd turn to the experts for some advice. I've made a jQuery snippet that grabs the values from a table and plots them in a line graph on a canvas element (also generated by the JS). All's well in Firefox and Chrome, but Safari and Opera aren't displaying the plotted points. I've reviewed in Firebug, Web Inspector debugger, JSLint, and checked the markup with the w3 validator, but still can't find anything glaringly obvious. Any chance one of you guys could help me out? Here's a page with a simplified example: http://bit.ly/aAshPQ Thanks!

    Read the article

  • Control margins of an automatically generated content presenter in Windows Phone Panorama Control

    - by Maxim V. Pavlov
    I am building an MVVM Panorama Windows Phone 7 application. At some point of Panorama Item's layout I get a bottom margin of a panorama header box, that moves my content too far down. Is there a way I can set a bottom margin of a ContentPresenter, that is generated to hold the controls, defined in the Panorama.HeaderTemplate? Here is my layout list in Silverlight Spy: In case the screen shot is not readable, here is a large version: http://bit.ly/rBvNp8 Something generates a 26 points bottom margin for a header box (probably the control's code, that handles a layout). How can I control this value? I need it to be set to 0.

    Read the article

  • Sintra app in a gem

    - by JP
    I have a Sinatra application I've created and I'd like to package it as a gem-based binary. I have my gemspec and gem set up to generate a suitable executable that points to the my_sinatra_app.rb (which is executable) but the sinatra server never runs. Any ideas why and how to make it work? my_sinatra_app executable: #!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby # # This file was generated by RubyGems. require 'rubygems' version = ">= 0" if ARGV.first =~ /^_(.*)_$/ and Gem::Version.correct? $1 then version = $1 ARGV.shift end gem 'my_sinatra_app', version load Gem.bin_path('my_sinatra_app', 'my_sinatra_app', version)

    Read the article

  • standard debugging way for javascript/jquery

    - by ZX12R
    This is my usual way to debug javascript. Include alert(0); to break the flow and find out what is happening. sometimes when i need multiple check points i do alert('the flow is now in function 1'); alert('the flow is now in function 2'); or sometimes just alert('success'); i would like to know if there is any standard way for debugging adopted as i am finding my current method very intrusive. thanks in advance..:)

    Read the article

  • uitextfield delegate must be file's owner?

    - by deafgreatdane
    I've seen a few references (eg here) in response to folks having trouble getting the keyboard to dismiss in iPhone that say "double check that the delegate is attached to file's owner. Is this necessarily true? Or just standard practice? Can't I have other objects in my nib, such as a subclass of UIViewController, and make connections to those as I like? I'd hate to have to route everything into the object that happens to be file owner. That said, I'm having a difficult time getting the keyboard to disappear. I know it's connected to the delegate, because I can set break points and step through the code. I can see the [theTextField resignFirstResponder] get called (and return true), but the keyboard still won't go away. Any other suggestions?

    Read the article

  • rewrite a function using only pointer increment/decrement

    - by Richard Nguyen
    can anyone help me rewrite the function i wrote below using only points and pointer increment/decrement? I dont have much experience with pointer so I dont know what to do. void reverse(char * s) { int i, l = strlen(s); char c; for(i = 0; i < (l >> 1); i++) { c = s[i]; s[i] = s[l - i - 1]; s[l - i - 1] = c; } } do not use pointer arithmetic or array notation. any help or hint on how to rewrite the function above is appriciated. Thanks!

    Read the article

  • In Bloomberg API how do you specify to get FX forwards as a spread rather than absolute values?

    - by Nick Fortescue
    How do you explicitly request fx forwards as outrights using the bloomberg API? In the Bloomberg terminal you can choose whether to get FX Forwards as absolute rates (outrights) or as offsets from Spots (Points) by doing XDF, hitting 7, then the option is about half way down. 0 means outrights, and 1 means offfsets. With most defaults you can explicitly set them in the API, so your code gives the same result whichever computer you run on. How do you set this one in a V3 API query?

    Read the article

  • Process for beginning a Ruby on Rails project

    - by Daniel Beardsley
    I'm about to begin a Ruby on Rails project and I'd love to hear how others go through the process of starting an application design. I have quite a bit of experience with RoR, but don't have that many starting from scratch with only a vision experiences and would appreciate the wisdom of others who've been there. I'm looking for an order of events, reasons for the order, and maybe why each part is important. I can think of a few starting points, but I'm not sure where it's best to begin Model design and relationships (entities, how they relate, and their attributes) Think of user use-cases (or story-boards) and implement the minimum to get these done Create Model unit-tests then create the necessary migrations and AR models to get the tests to pass Hack out the most basic version of the simplest part of your application and go from there Start with a template for a rails app (like http://github.com/thoughtbot/suspenders) Do the boring gruntwork first (User auth, session management, ...) ...

    Read the article

  • WPF application in obj directory doesn't work.

    - by juharr
    When I build my WPF application the exe that ends up in the bin directory works just fine, but the one in the obj directory does not. When I Debug the exe from the obj directory I get the following exception: TypeInitializationException was unhandled: The type initializer for 'MyProject.App' threw an exception. So basically I'm wondering why the obj exe doesn't work while the bin one does (I was under the assumption that the obj exe was just copied to the bin) and how to fix it. The reason that I even care is because I'm using Wix to create a MSI for my application and I have a Votive project setup that uses var.MyProject.TargetPath which points to the exe in the obj directory.

    Read the article

  • Custom DataSource Extender

    - by Brian
    I dream of creating a control which works something like this: <asp:SqlDataSource id="dsFoo" runat="server" ConnectionString="<%$ ConnectionStrings:conn %>" SelectCommandType="StoredProcedure" SelectCommand="cmd_foo"> </asp:SqlDataSource> <Custom:DataViewSource id="dvFoo" runat="server" rowfilter="colid &gt; 10" datasourceid="dsFoo"> </Custom:DataViewSource> I can accomplish the same thing in the code behind by executing cmd_foo, loading the results into a DataTable, then loading them into a DataView with a RowFilter. The goal would be to have multiple DataViews for one DataSource with whatever special filters I wish to apply to the select portion of the DataSource. I could imagine extending this to be more powerful. I tried peaking at this and this but am a bit confused on a few points. Currently, my main issue is being unsure where to grab the output data of the DataSource so I can stick it into a DataTable.

    Read the article

  • Why does my Eclipse crash all the time?

    - by Marcel
    Somehow stupid question, I have to admit - hope it won't cost me too many points. To make it clear: I would also be happy if you can help me find the reason for the crashes. I wouldn't expect a precise answer. However, I don't see why my Eclipse is crashing (freezing) all the time. Mostly when I save a file. For some reason, crashes seem to increase lately... I use Eclipse Helios (Version: 3.6.1) and java version "1.6.0_20" (OpenJDK Runtime Environment (IcedTea6 1.9.2) (6b20-1.9.2-0ubuntu2) OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)) on Ubuntu 10.10 (64-Bit). Thank you!

    Read the article

  • NSURLConnection shown as leaking in instruments

    - by Gyozo Kudor
    Hello another stupid question regarding leaks and also NSURLConnection. How do i release it? Is it enough if i release in the following 2 methods? (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error (void)connectionDidFinishLoading:(NSURLConnection *)connection Because in instruments it shows me the line where I alloc my connection as the source of leaking. OK I don't get it. After the following code my urlConnection has a retain count of 2. WTF? NSURLConnection *urlConnection = [[NSURLConnection alloc] initWithRequest: urlRequest delegate: self]; This is the line that instruments points me to. I find this very weird.

    Read the article

  • Slow query with unexpected scan

    - by zerkms
    Hello I have this query: SELECT * FROM SAMPLE SAMPLE INNER JOIN TEST TEST ON SAMPLE.SAMPLE_NUMBER = TEST.SAMPLE_NUMBER INNER JOIN RESULT RESULT ON TEST.TEST_NUMBER = RESULT . TEST_NUMBER WHERE SAMPLED_DATE BETWEEN '2010-03-17 09:00' AND '2010-03-17 12:00' the biggest table here is RESULT, contains 11.1M records. The left 2 tables about 1M. this query works slowly (more than 10 minutes) and returns about 800 records. executing plan shows clustered index scan over all 11M records. RESULT.TEST_NUMBER is a clustered primary key. if I change 2010-03-17 09:00 to 2010-03-17 10:00 - i get about 40 records. it executes for 300ms. and plan shows clustered index seek if i replace * in SELECT clause to RESULT.TEST_NUMBER (covered with index) - then all become fast in first case too. this points to hdd io issues, but doesn't clarifies changing plan. so, any ideas?

    Read the article

  • white-label collaborative open-source development (e.g. github/sourceforge/google-code in a box) ?

    - by Justin Grant
    Does anyone have a recommendation for an open-source or paid (either packaged or SaaS) solution for integrating collaborative development features into your own website? Here's more details: We currently host an online plugin gallery for our product. Users can upload and download plugins. But users can't easily collaborate on a plugin's development, can't easily report and track bugs on a plugin, can't easily track a plugin's versions or roadmap, etc. Of course, contributors can host their plugin development on github, sourceforge, google code, codeplex, etc. But keeping users on our website has some advantages. For example: We can use single-sign-on to avoid yet another username/password required we can integrate end-user issue tracking into our existing online issue-tracking systems we can get integrated analytics so we can better meet the needs of top contributors as well as downloaders We can easily reward reputation points to committers just like we do for people who answer lots of questions Anyone know a good solution for white-label sites for open-source project developer collaboration?

    Read the article

  • Running a stored procedure in a SqlDataSource on button click

    - by Gapton
    I am building a C# ASP.NET page where I want to call a stored procedure in a database. I have setup a SqlDataSource which points to the stored procedure. Parameters are obtained from the Web's control directly (TextBox) I have a button, when the user clicks it it should run the stored procedure, so I was going to add code like this : mySqlDataSource.run() or mySqlDataSource.exec() or mySqlDataSource.storedProcedure() but of course none of these methods exist. How do I initial the stored procedure? and how do I get the value returned by the stored procedure please? Thank you!

    Read the article

  • Shortest distance between a point and a line segment

    - by Eli Courtwright
    I need a basic function to find the shortest distance between a point and a line segment. Feel free to write the solution in any language you want; I can translate it into what I'm using (Javascript). EDIT: My line segment is defined by two endpoints. So my line segment AB is defined by the two points A (x1,y1) and B (x2,y2). I'm trying to find the distance between this line segment and a point C (x3,y3). My geometry skills are rusty, so the examples I've seen are confusing, I'm sorry to admit.

    Read the article

  • matlab constant anonymous function returns only one value instead of an array

    - by Filo
    I've been searching the net for a couple of mornings and found nothing, hope you can help. I have an anonymous function like this f = @(x,y) [sin(2*pi*x).*cos(2*pi*y), cos(2*pi*x).*sin(2*pi*y)]; that needs to be evaluated on an array of points, something like x = 0:0.1:1; y = 0:0.1:1; w = f(x',y'); Now, in the above example everything works fine, the result w is a 11x2 matrix with in each row the correct value f(x(i), y(i)). The problem comes when I change my function to have constant values: f = @(x,y) [0, 1]; Now, even with array inputs like before, I only get out a 1x2 array like w = [0,1]; while of course I want to have the same structure as before, i.e. a 11x2 matrix. I have no idea why Matlab is doing this...

    Read the article

  • valgrind - ignore glibc functions?

    - by Jack
    Is it possible to tell valgrind to ignore some set of libraries? Specifically glibc libraries.. Actual Problem: I have some code that runs fine in normal execution. No leaks etc. When I try to run it through valgrind, I get core dumps and program restarts/stops. Core usually points to glibc functions (usually fseek, mutex etc). I understand that there might be some issue with incompatible glibc / valgrind version. I tried various valgrind releases and glibc versions but no luck. Any suggestions?

    Read the article

< Previous Page | 138 139 140 141 142 143 144 145 146 147 148 149  | Next Page >