Search Results

Search found 556 results on 23 pages for 'nathan f77'.

Page 15/23 | < Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >

  • Global variable life in Javascript - destroyed on a reload?

    - by Paul Nathan
    (I am learning Javascript) Problem: A page I am working on has 2 views, a data entry view with a textbox and a data rendering view. There is a a href src="currentpage#" link that switches between the 2 views. In order to transmit data from view to view, the javascript parses it from the current HTML and pushes it into the correct form for the other view. This is ugly and I want to refactor it out, ideally into some sort of global where it can be neatly rendered down into the view on command (I'm refactoring the code base to a point where I can AJAX it from a server). However, I am not certain about scoping rules and variable life in JS.

    Read the article

  • ASP.NET MVC - Binding a Child Entity to the Model

    - by Nathan Taylor
    This one seems painfully obvious to me, but for some reason I can't get it working the way I want it to. Perhaps it isn't possible the way I am doing it, but that seems unlikely. This question may be somewhat related: http://stackoverflow.com/questions/1274855/asp-net-mvc-model-binding-related-entities-on-same-page. I have an EditorTemplate to edit an entity with multiple related entity references. When the editor is rendered the user is given a drop down list to select related entities from, with the drop down list returning an ID as its value. <%=Html.DropDownListFor(m => m.Entity.ID)%> When the request is sent the form value is named as expected: "Entity.ID", however my strongly typed Model defined as an action parameter doesn't have Entity.ID populated with the value passed in the request. public ActionResult AddEntity(EntityWithChildEntities entityWithChildEntities) { } I tried fiddling around with the Bind() attribute and specified Bind(Include = "Entity.ID") on the entityWithChildEntities, but that doesn't seem to work. I also tried Bind(Include = "Entity"), but that resulted in the ModelBinder attempting to bind a full "Entity" definition (not surprisingly). Is there any way to get the default model binder to fill the child entity ID or will I need to add action parameters for each child entity's ID and then manually copy the values into the model definition?

    Read the article

  • Combining prefixes in SSE

    - by Nathan Fellman
    In SSE the prefixes 066h (operand size override) 0F2H (REPNE) and 0F3h (REPE) are part of the opcode. In non-SSE 066h switches between 32-bit (or 64-bit) and 16-bit operation. 0F2h and 0F3h are used for string operations. They can be combined so that 066h and 0F2h (or 0F3h) can be used in the same instruction, because this is meaningful. What is the behavior in an SSE instruction? For instance, we have (ignoring mod/rm for now): 0f 58 -- addps 66 0f 58 -- addpd f2 0f 58 -- addsd f3 0f 58 -- addss But what is this? 66 f2 0f 58 And how about? f2 66 0f 58 Not to mention the following which has two conflicting REP prefixes: f2 f3 0f 58 What is the spec for thse?

    Read the article

  • Modifying vertex properties in a Boost::Graph

    - by Paul Nathan
    I am trying to figure out how to use boost::graph to store some information. However, there is information I want tied to each vertex. Staring at the documentation for the library reveals either(a)badly written documentation, or (b), I'm obviously not as good at C++ as I thought. Pick two. I am looking for either a tutorial on assigning properties, or a simple example use.

    Read the article

  • Width of li with two floats different in IE, correct in FF

    - by Nathan Loding
    I've worked out most of the kinks with my "lava-lamp" effect that I'm trying to create. Basically I want two curly braces (both are images) to wrap a list-item, then follow over to the next list-item. I always build in FF, then make exceptions for IE. I can't figure out what exception I need to make! I'm using an absolutely positioned li that contains two div's. The first div is floated left, the second is floated right. The width of the li is set to the width of the li it supposed to be wrapping. Thus creating the effect of the braces on the left and right sides of the text. It works beautifully in Firefox, but IE has two issues: The bottoms of the images are cut off. Sometimes they reappear when the animation ends, sometimes they don't. I assume this has to do with height, but no matter what I set the height to, it fails! The width is completely wrong. Here's a live example of it: http://jsbin.com/odome/2 The left position in IE is always 5-7px more than in FF, but that's a small difference. I'm more concerned with the width and the bottoms of the images being trimmed. Thanks, as always, for the help!

    Read the article

  • Someone please help google create instuctions that windows users understand. googles "instructions"

    - by nathan
    Below are the only instructions i managed to find from google on how to install the android NDK, it is written as if we all run Linux and presumes we all understand what these obscure tools are. My comments and questions appear in Italics if somone who knows unix and windows would translate for google that would be great! Android NDK Installation Introduction: Please read docs/OVERVIEW.TXT to understand what the Android NDK is and is not. This file gives instructions on how to properly setup your NDK. I. Requirements: The Android NDK currently requires a Linux, OS X or Windows host operating system. Windows users will need to install Cygwin (http://www.cygwin.com) to use it. Note that running the NDK under MSys is not supported. You will need to have the Android SDK and its dependencies installed. The NDK cannot generate final application packages (.apk files), only the shared library files that can go into them. IMPORTANT: The Android NDK can only be used to target system images using the Cupcake (1.5) or later releases of the platform. This is due to subtle toolchain and ABI related changed that make it incompatible with 1.0 and 1.1 system images. The NDK requires GNU Make 3.81 or later being available on your development system. Earlier versions of GNU Make might work but have not been tested. You can check this by running 'make -v' from the command-line. The output should look like: GNU Make 3.81 Copyright (C) 2006 Free Software Foundation, Inc. ... On certain systems, GNU Make might be available through a different command like 'gmake' or 'gnumake'. For these systems, replace 'make' by the appropriate command when invoking the NDK build system as described in the documentation. Great some strange thing called gnu make.. if your not going to tell me what it does maybe you then at least you could give me a URL to it? The NDK also requires a Nawk or GNU Awk executable being available on your development system. Note that the original 'awk' program doesn't implement the 'match' and 'substr' functions used by the NDK build system. Ok another tool, with 1 of 2 possible names, but not the third... and again where should i download this?? On Windows, you will need to install a recent release of Cygwin to use the NDK. See http://www.cygwin.com for instructions. Woohoo a URL! download took about a day because these install instructions do not specify what parts to download. II. Preparing your installation prebuilt cross-toolchain binaries: After installing and unarchiving the NDK, you will need to run the following command from the root folder: build/host-setup.sh hello? windows dont run nothing but .exe .com or .dll, just tell me how you want me to run it.. This will test your setup and make sure the NDK can work properly. Nothing is said about where any of these things need to be installed to (what directory)

    Read the article

  • SQL to get list of dates as well as days before and after without duplicates

    - by Nathan Koop
    I need to display a list of dates, which I have in a table SELECT mydate AS MyDate, 1 AS DateType FROM myTable WHERE myTable.fkId = @MyFkId; Jan 1, 2010 - 1 Jan 2, 2010 - 1 Jan 10, 2010 - 1 No problem. However, I now need to display the date before and the date after as well with a different DateType. Dec 31, 2009 - 2 Jan 1, 2010 - 1 Jan 2, 2010 - 1 Jan 3, 2010 - 2 Jan 9, 2010 - 2 Jan 10, 2010 - 1 Jan 11, 2010 - 2 I thought I could use a union SELECT MyDate, DateType FROM ( SELECT mydate - 1 AS MyDate, 2 AS DateType FROM myTable WHERE myTable.fkId = @MyFkId; UNION SELECT mydate + 1 AS MyDate, 2 AS DateType FROM myTable WHERE myTable.fkId = @MyFkId; UNION SELECT mydate AS MyDate, 1 AS DateType FROM myTable WHERE myTable.fkId = @MyFkId; ) AS myCombinedDateTable This however includes duplicates of the original dates. Dec 31, 2009 - 2 Jan 1, 2009 - 2 Jan 1, 2010 - 1 Jan 2, 2010 - 2 Jan 2, 2010 - 1 Jan 3, 2010 - 2 Jan 9, 2010 - 2 Jan 10, 2010 - 1 Jan 11, 2010 - 2 How can I best remove these duplicates? I am considering a temporary table, but am unsure if that is the best way to do it. This also appears to me that it may provide performance issues as I am running the same query three separate times. What would be the best way to handle this request?

    Read the article

  • Version control: delete branches after merging?

    - by Nathan Long
    When you branch some code, finish working with the branch, and merge it back to the trunk, what do you do with the branch? Delete it from the repository? Keep it for reference? It seems like you would keep it for reference, but I imagine the /branches directory could get pretty cluttered. (If this isn't something people generally agree on, please comment and I'll make it a community wiki.)

    Read the article

  • Is there any way to limit the size of an STL Map?

    - by Nathan Fellman
    I want to implement some sort of lookup table in C++ that will act as a cache. It is meant to emulate a piece of hardware I'm simulating. The keys are non-integer, so I'm guessing a hash is in order. I have no intention of inventing the wheel so I intend to use stl::map for this (though suggestions for alternatives are welcome). The question is, is there any way to limit the size of the hash to emulate the fact that my hardware is of finite size? I'd expect the hash's insert method to return an error message or throw an exception if the limit is reached. If there is no such way, I'll simply check its size before trying to insert, but that seems like an inelegant way to do it.

    Read the article

  • Create Personalized Controls For Java ME

    - by Nathan Campos
    I'm starting to develop a eBook reader for mobile using Java ME, but for the control were the book will be shown I need a personalized control. For this I need to first know how to do one, to workaround with my needs. Then I need to know how can I do a personalized control as we do with Visual Basic. PS: I want to do a personalized TextBox, that in some parts can be in bold, italic, sublined, that supports topics(as the Edit, the MS-DOS Text Editor) and many other things that make a eBook better viewed than a simple plain text

    Read the article

  • Is it possible to capture mouse events on a scroll bar in JavaScript

    - by Nathan
    I have an HTML element with overflow: scroll. The click event listener registered with the element is triggered when I click on the element, but not when I click on the scroll bar for the element. Is it possible to capture mouse events which occur on an HTML element's scroll bar? The reason I want to do this is to make a visual popup element disappear when ever a click event occurs anywhere outside the popup element.

    Read the article

  • Can PHP dissect its own syntax?

    - by Nathan Long
    Can PHP dissect its own syntax? For example, I'd like to write a function that takes in an input like $object->attribute and says to itself: OK, he's giving me $foo->bar, which means he must think that $foo is an object that has a property called bar. Before I try accessing bar and potentially get a 'Trying to get property of non-object' error, let me check whether $foo is even an object. The end goal is to echo a value if it is set, and fail silently if not. I want to avoid repetition like this: <input value="<? if(is_object($foo) && is_set($foo->bar)){ echo $foo->bar; }?> "/> ...and to avoid writing a function that does the above, but has to have the object and attribute passed in separately, like this: <input value="<? echoAttribute($foo,'bar') ?>" /> ...but to instead write something which: preserves the object-attribute syntax is flexible: can also handle array keys or regular variables Like this: <input value="<? echoIfSet($foo->bar); ?> /> <input value="<? echoIfSet($baz['buzz']); ?> /> <input value="<? echoIfSet($moo); ?> /> But this all depends on PHP being able to tell me "what kind of thing am I asking for when I say $object->attribute or $array[$key]", so that my function can handle each according to its own type. Is this possible?

    Read the article

  • Why aren't min-width and max-width working as I expect?

    - by Nathan Long
    I'm trying to adjust a CSS page layout using min-width and max-width. To simplify the problem, I made this test page. I'm trying it out in the latest versions of Firefox and Chrome with the same results. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Testing min-width and max-width</title> <style type="text/css"> div{float: left; max-width: 400px; min-width: 200px;} div.a{background: orange;} div.b{background: gray;} </style> </head> <body> <div class="a"> (Giant block of filler text here) </div> <div class="b"> (Giant block of filler text here) </div> </body> </html> Here's what I expect to happen: With the browser maximized, the divs sit side by side, each 400px wide: their maximum width Shrink the browser window, and they both shrink to 200px: their minimum width Further shrinking the browser has no effect on them Here's what actually happens, starting at step 2: Shrink the browser window, and as soon as they can't sit side-by-side at their max width, the second div drops below the first Further shrinking the browser makes them get narrower and narrower, as small as I can make the window So here's are my questions: What does max-width mean if the element will sooner hop down in the layout than go lower than its maximum width? What does min-width mean if the element will happily get narrower than that if the browser window keeps shrinking? Is there any way to achieve what I want: have these elements sit side-by-side, happily shrinking until they reach 200px each, and only then adjust the layout so that the second one drops down? And of course... What am I doing wrong?

    Read the article

  • Subscribing to MSMQ over the internet

    - by Nathan Palmer
    I haven't been able to find a clear answer to this problem. Is there a good way to subscribe to a MSMQ through the internet? Ideally I need security both in authentication and encryption for this connection. But I would like the subscriber to act just like any other client that would be subscribed on the local network. I believe I have a couple of options here Expose the MSMQ ports publicly Put the MSMQ behind some type of WCF service (not sure if that works for a subscriber) What other options do I have? We're sitting in a .NET environment and the main problem domain that is trying to be solved is to change the remote connections from a pulling system to an event based system to reduce the load on the main server.

    Read the article

  • Literal ampersands in System.Uri query string

    - by Nathan Baulch
    I'm working on a client app that uses a restful service to look up companies by name. It's important that I'm able to include literal ampersands in my queries since this character is quite common in company names. However whenever I pass %26 (the URI escaped ampersand character) to System.Uri, it converts it back to a regular ampersand character! On closer inspection, the only two characters that aren't converted back are hash (%23) and percent (%25). Lets say I want to search for a company named "Pierce & Pierce": var endPoint = "http://localhost/companies?where=Name eq '{0}'"; var name = "Pierce & Pierce"; Console.WriteLine(new Uri(string.Format(endPoint, name))); Console.WriteLine(new Uri(string.Format(endPoint, Uri.EscapeUriString(name)))); Console.WriteLine(new Uri(string.Format(endPoint, Uri.EscapeDataString(name)))); All three of the above combinations return: http://localhost/companies?where=Name eq 'Pierce & Pierce' This causes errors on the server side since the ampersand is (correctly) interpreted as a query arg delimiter. What I really need it to return is the original string: http://localhost/companies?where=Name eq 'Pierce %26 Pierce' How can I work around this behavior without discarding System.Uri entirely? I can't replace all ampersands with %26 at the last moment because there will usually be multiple query args involved and I don't want to destroy their delimiters. Note: A similar problem was discussed in this question but I'm specifically referring to System.Uri.

    Read the article

  • Cast errors with IXmlSerializable

    - by Nathan
    I am trying to use the IXmlSerializable interface to deserialize an Object (I am using it because I need specific control over what gets deserialized and what does not. See my previous question for more information). However, I'm stumped as to the error message I get. Below is the error message I get (I have changed some names for clarity): An unhandled exception of type 'System.InvalidCastException' occurred in App.exe Additional information: Unable to cast object of type 'System.Xml.XmlNode[]' to type 'MyObject'. MyObject has all the correct methods defined for the interface, and regardless of what I put in the method body for ReadXml() I still get this error. It doesn't matter if it has my implementation code or if it's just blank. I did some googling and found an error that looks similar to this involving polymorphic objects that implement IXmlSerializable. However, my class does not inherit from any others (besides Object). I suspected this may be an issue because I never reference XmlNode any other time in my code. Microsoft describes a solution to the polymorphism error: https://connect.microsoft.com/VisualStudio/feedback/details/422577/incorrect-deserialization-of-polymorphic-type-that-implements-ixmlserializable?wa=wsignin1.0#details The code the error occurs at is as follows. The object to be read back in is an ArrayList of "MyObjects" IO::FileStream ^fs = gcnew IO::FileStream(filename, IO::FileMode::Open); array<System::Type^>^ extraTypes = gcnew array<System::Type^>(1); extraTypes[0] = MyObject::typeid; XmlSerializer ^xmlser = gcnew XmlSerializer(ArrayList::typeid, extraTypes); System::Object ^obj; obj = xmlser->Deserialize(fs); fs->Close(); ArrayList ^al = safe_cast<ArrayList^>(obj); MyObject ^objs; for each(objs in al) //Error occurs here { //do some processing } Thanks for reading and for any help.

    Read the article

  • Why does my Opengl es android testbed app not render anything besides a red screen?

    - by nathan
    For some reason my code here (this is the entire thing) doesnt actually render anything besides a red screen.. can anyone tell me why? package com.ntu.way2fungames.earth.testbed; import java.nio.FloatBuffer; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.app.Activity; import android.content.Context; import android.opengl.GLSurfaceView; import android.opengl.GLSurfaceView.Renderer; import android.os.Bundle; public class projectiles extends Activity { GLSurfaceView lGLView; Renderer lGLRenderer; float projectilesX[]= new float[5001]; float projectilesY[]= new float[5001]; float projectilesXa[]= new float[5001]; float projectilesYa[]= new float[5001]; float projectilesTheta[]= new float[5001]; float projectilesSpeed[]= new float[5001]; private static FloatBuffer drawBuffer; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); SetupProjectiles(); Context mContext = this.getWindow().getContext(); lGLView= new MyView(mContext); lGLRenderer= new MyRenderer(); lGLView.setRenderer(lGLRenderer); setContentView(lGLView); } private void SetupProjectiles() { int i=0; for (i=5000;i>0;i=i-1){ projectilesX[i] = 240; projectilesY[i] = 427; float theta = (float) ((i/5000)*Math.PI*2); projectilesXa[i] = (float) Math.cos(theta); projectilesYa[i] = (float) Math.sin(theta); projectilesTheta[i]= theta; projectilesSpeed[i]= (float) (Math.random()+1); } } public class MyView extends GLSurfaceView{ public MyView(Context context) { super(context); // TODO Auto-generated constructor stub } } public class MyRenderer implements Renderer{ private float[] projectilecords = new float[] { .0f, .5f, 0, -.5f, 0f, 0, .5f, 0f, 0, 0, -5f, 0, }; @Override public void onDrawFrame(GL10 gl) { gl.glClear(GL10.GL_COLOR_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); //gl.glLoadIdentity(); gl.glEnableClientState(GL10.GL_VERTEX_ARRAY); for (int i=5000;i>4500;i=i-1){ //drawing section gl.glLoadIdentity(); gl.glColor4f(.9f, .9f,.9f,.9f); gl.glTranslatef(projectilesY[i], projectilesX[i],1); gl.glVertexPointer(3, GL10.GL_FLOAT, 0, drawBuffer); gl.glDrawArrays(GL10.GL_TRIANGLE_STRIP, 0, 12); //physics section projectilesX[i]=projectilesX[i]+projectilesXa[i]; projectilesY[i]=projectilesY[i]+projectilesYa[i]; } gl.glDisableClientState(GL10.GL_VERTEX_ARRAY); } @Override public void onSurfaceChanged(GL10 gl, int width, int height) { if (height == 0) height = 1; // draw on the entire screen gl.glViewport(0, 0, width, height); // setup projection matrix gl.glMatrixMode(GL10.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrthof(0,width,height,0, -100, 100); } @Override public void onSurfaceCreated(GL10 gl, EGLConfig arg1) { gl.glShadeModel(GL10.GL_SMOOTH); gl.glClearColor(1f, .01f, .01f, 1f); gl.glClearDepthf(1.0f); gl.glEnable(GL10.GL_DEPTH_TEST); gl.glDepthFunc(GL10.GL_LEQUAL); gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); drawBuffer = FloatBuffer.wrap(projectilecords); } } }

    Read the article

  • Best solution for managing navigation (and marking currently active item) in CakePHP

    - by Nathan
    So I have been looking around for a couple hours for a solid solution to handling site navigation in CakePHP. Over the course of a dozen projects, I have rigged together something that works for each one, but what I'm looking for is ideally a CakePHP plugin that handles the following: Navigation Model Component for handing off to the view Element View Helper for displaying the navigation (with control over sublevels displayed and automatically determining the "active" item based on URL and/or controller/model/slug Admin pages for managing a tree of navigation Any suggestions for an all-in-one solution or even the individual components would be very appreciated! Or even suggestions on how you have handled it in the past

    Read the article

  • Android & Eclipse 2 different versions of the same app.

    - by nathan
    Hello I am a beginning android developer using windows and the eclipse IDE to develop java android applications.I have published one game but there is a free version of the game and a paid version. The google market insists that the different versions must have different package names. So far i have been refactoring the package with 2 different names and changing the R resource file import each time i build the different versions. The code is 99% the same for both versions.Is there a better way?

    Read the article

< Previous Page | 11 12 13 14 15 16 17 18 19 20 21 22  | Next Page >