Search Results

Search found 979 results on 40 pages for 'josh gare'.

Page 26/40 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • ASP.NET MVC pass information from controller to view WITHOUT ViewData, ViewModel, or Session

    - by josh
    I have a unique scenario where I want a base controller to grab some data and store it in a list. The list should be accessible from my views just as ViewData is. I will be using this list on every page and would like a cleaner solution than just shoving it in the ViewDataDictionary. After attempting to come up with a solution, I thought I would create a custom ViewPage with a property to hold my list. My custom ViewPage would inherit from System.Web.MVC.ViewPage. However, I do not know where MVC passes the viewdata from the controller off to the view. More importantly, how do I get it to pass my list down to the view? Thanks for the help.

    Read the article

  • Hot python input loop

    - by Josh K
    I'd like to have something similar to the following pseudo code: while input is not None and timer < 5: input = getChar() timer = time.time() - start if timer >= 5: print "took too long" else: print input Anyway to do this without threading? I would like an input method that returns whatever has been entered since the last time it was called, or None (null) if nothing was entered.

    Read the article

  • How to determine which side of a 3D plane is showing?

    - by Josh Santangelo
    This is a 3d n00b question. I'm working on a WPF control which implements the basics of Silverlight's PerspectiveTransform feature, allowing a 2D plane to be rotated on any of the three axes. It works pretty well. However I'm a little stuck on the math required to determine whether or not the back of the plane is showing. My naive code for figuring that out now is: bool isBackShowing = Math.Abs(RotationX) > 90 && Math.Abs(RotationY) < 90; if (!isBackShowing) { isBackShowing = Math.Abs(RotationX) < 90 && Math.Abs(RotationY) > 90; } However, this fails when the rotation is between +-270 and +-360 on either axis. The underlying transform is using a Quaternion object to do the actual rotation, and that has nice Axis and Angle properties, so I'm guessing I could just use that if I knew how.

    Read the article

  • jQuery accordion link issue

    - by Josh
    Slight problem, I've been working with a multi-accordion for a News panel. Everything is working fine, but there is an issue that has just recently come up. Underneath the headline I have information on when said headline+article was posted and when, and also if there are any comments. I intended to make the author and the number of comments as a link. The author link would most likely bring them to their contact page or maybe an email, the number of comments link would just expand it directly to the "View comments" which the user could also access by just expanding the article and then expanding the comments. A shortcut basically. Now, the issue is that I'm having to put this "Posted by..." information inside the a class which allows the user to expand the headline into the article. If I do this however, it breaks the entire accordion field for that headline because there are multiple A HREF links inside the original A link. I really don't know how to get around this, if anyone has a tip or a solution I would most appreciate it, thanks. You can view the demo here: http://www.notedls.com/demo

    Read the article

  • Settings aren't saving in WPF?

    - by JOSH
    I'm using the registry Settings.settings thingymabob I'm doing the following in my XAML: <TextBox x:Name="textBoxUsername" Text="{Binding Source={x:Static prop:Settings.Default}, Path=Username, Mode=TwoWay}"></TextBox> This is loading the settings fine. Now in my Window's Closing event I have the following: Properties.Settings.Default.Save(); But it wont save settings?

    Read the article

  • Can I improve this regex check for valid domain names?

    - by Josh
    So, I have been working on this domain name regular expression. So far, it seems to pick up domain names with SLDs and TLDs (with the optional ccTLD), but there is duplication of the TLD listing. Can this be refactored any further? params[:domain_name].downcase.strip.match(/^[a-z0-9\-]{2,63} \.((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)| (c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]| (g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)| (j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]| (m[acdghklmnopqrstuvwxyz]|me|mil|mobi|museum)|(n[acefgilopruz]|name|net)|(om|org)| (p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]| (t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]) (\.((a[cdefgilmnoqrstuwxz]|aero|arpa)|(b[abdefghijmnorstvwyz]|biz)| (c[acdfghiklmnorsuvxyz]|cat|com|coop)|d[ejkmoz]|(e[ceghrstu]|edu)|f[ijkmor]| (g[abdefghilmnpqrstuwy]|gov)|h[kmnrtu]|(i[delmnoqrst]|info|int)| (j[emop]|jobs)|k[eghimnprwyz]|l[abcikrstuvy]| m[acdghklmnopqrstuvwxyz]|mil|mobi|museum)| (n[acefgilopruz]|name|net)|(om|org)| (p[aefghklmnrstwy]|pro)|qa|r[eouw]|s[abcdeghijklmnortvyz]| (t[cdfghjklmnoprtvwz]|travel)|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]))?$/)

    Read the article

  • UIAlertView is not showing. What am I doing wrong?

    - by Josh Brown
    Here is the code: -(IBAction)signUpBtnPressed:(id)sender { UIAlertView *alert = [ [UIAlertView alloc] initWithTitle:@"k" message:@"Thanks for Signing up!" delegate:self cancelButtonTitle:@"Continue..." otherButtonTitles:nil ]; [alert show]; [alert release]; } I also have my Sign Up button attached to this action in my view.

    Read the article

  • Why is ARG_MAX not defined via limits.h?

    - by Josh Matthews
    On Fedora Core 7, I'm writing some code that relies on ARG_MAX. However, even if I #include <limits.h>, the constant is still not defined. My investigations show that it's present in <sys/linux/limits.h>, but this is supposed to be portable across Win32/Mac/Linux, so directly including it isn't an option. What's going on here?

    Read the article

  • Implementing IXmlSerializable on a generated class that has XmlTypeAttribute

    - by Josh
    Basically, the initial problem is I need to make a boolean value serialize as 0 or 1. The solution I found was to implement IXmlSerializable, which I did. Unfortunately the class I'm trying to serialize is generated code off a schema and has an XmlTypeAttribute on it. When I try to (de)serialize the object with the XmlSerializer created in the usual manner ( new XmlSerializer(type)) it throws this exception: System.InvalidOperationException: Only XmlRoot attribute may be specified for the type ______ Please use XmlSchemaProviderAttribute to specify schema type. Two options come to mind immediatly: 1) remove the attribute in the generated code. This change would have to be made every time the code was re-generated. 2) Use an XmlAttributeOverrides object when creating the serializer to remove the attribute. This would require the rest of the code base to "know" that it needs to override that attribute. Also, the exception thrown gives absolutly no clue as to what needs to be done to fix it. Both options kinda stink. Is there a third option?

    Read the article

  • Advantages/disadvantages of browser-based interface vs. graphics

    - by Josh
    Hello everyone, I'm in the design phase for a desktop-based application. Because of the nature of this particular application, I believe it would benefit greatly from a web-based approach (i.e., allowing a user to interface with the application through a browser running in kiosk mode) in order to leverage the simplicity of HTML/CSS/JS and the availability of many great JS interface plugins. Does taking this approach (rather than coding in a native or cross-platform graphics library) come with any gotchas?

    Read the article

  • how to grep for the whole word

    - by josh
    I am using the following command to grep stuff in subdirs find . | xargs grep -s 's:text' However, this also finds stuff like <s:textfield name="sdfsf"...../> What can I do to avoid that so it just finds stuff like <s:text name="sdfsdf"/> OR for that matter....also finds <s:text somethingElse="lkjkj" name="lkkj" basically s:text and name should be on same line....

    Read the article

  • Why hasn't MSSQL made a WHERE clause mandatory by default?

    - by Josh Einstein
    It seems like a no brainer to me. I've heard countless stories about people forgetting the WHERE clause in an UPDATE or DELETE and trashing an entire table. I know that careless people shouldn't be issuing queries directly and all that... and that there are legitimate cases where you want to affect all rows, but wouldn't it make sense to have an option on by default that requires such queries to be written like: UPDATE MyTable SET MyColumn = 0 WHERE * Or without changing the language, UPDATE MyTable SET MyColumn = 0 WHERE 1 = 1 -- tacky, I know

    Read the article

  • Android insert into sqlite database

    - by Josh
    I know there is probably a simple thing I'm missing, but I've been beating my head against the wall for the past hour or two. I have a database for the Android application I'm currently working on (Android v1.6) and I just want to insert a single record into a database table. My code looks like the following: //Save information to my table sql = "INSERT INTO table1 (field1, field2, field3) " + "VALUES (" + field_one + ", " + field_two + ")"; Log.v("Test Saving", sql); myDataBase.rawQuery(sql, null); the myDataBase variable is a SQLiteDatabase object that can select data fine from another table in the schema. The saving appears to work fine (no errors in LogCat) but when I copy the database from the device and open it in sqlite browser the new record isn't there. I also tried manually running the query in sqlite browser and that works fine. The table schema for table1 is _id, field1, field2, field3. Any help would be greatly appreciated. Thanks!

    Read the article

  • How do I echo out something different when reached last row?

    - by Josh Brown
    I am wanting to not echo out the comma at the end of the echo after the last row. How can I do that? Here is my code: <?php header("Content-type: application/json"); echo '{"points":['; mysql_connect("localhost", "user", "password"); mysql_select_db("database"); $q = "SELECT venues.id, venues.lat, venues.lon, heat_indexes.temperature FROM venues, heat_indexes WHERE venues.id = heat_indexes.venue_id"; $res = mysql_query($q) or die(mysql_error()); while ($point = mysql_fetch_assoc($res)) { echo $point['lat'] . "," . $point['lon'] . "," . $point['temperature'] . ","; } mysql_free_result($res); echo ']}'; ?>

    Read the article

  • Dealing with a badly formatted CSV file

    - by Josh K
    I have an exceptionally bad CSV file. Although I "solved" the problem in the end by manually writing scripts to process and reprocess this specific file I wanted to know if there were any other solutions out there. You have a CSV file that has all the fields terminated by | (pipe) characters. Running a quick check shows you that there are 53 fields in the file. The person who gave you the file claims there there are only 28 fields. Not all of the fields have information in them. For example there are five custom_field_{num} fields which may or may not have data. How would you get this into a database nicely? The ideal solution (and one I searched high and low for) would be to just throw it all into a table with no column names or specifications. Then remove any columns that were completely blank and then give them titles and specifications.

    Read the article

  • Create an NSManagedObject Without Saving?

    - by Josh Kahane
    I need to make an NSManagedObject without saving it, how can I do this? I have tried insetting one without a context but the app crashes. I have tried the following: GuestInfo *guest; guest = (GuestInfo *)[NSEntityDescription insertNewObjectForEntityForName:@"GuestInfo" inManagedObjectContext:nil]; This causes the crash with the following error message: 'NSInternalInconsistencyException', reason: '+entityForName: could not locate an NSManagedObjectModel for entity name 'GuestInfo'' This causes the Hope you can help, thanks.

    Read the article

  • How to obtain a pointer out of a C++ vtable?

    - by Josh Haberman
    Say you have a C++ class like: class Foo { public: virtual ~Foo() {} virtual DoSomething() = 0; }; The C++ compiler translates a call into a vtable lookup: Foo* foo; // Translated by C++ to: // foo->vtable->DoSomething(foo); foo->DoSomething(); Suppose I was writing a JIT compiler and I wanted to obtain the address of the DoSomething() function for a particular instance of class Foo, so I can generate code that jumps to it directly instead of doing a table lookup and an indirect branch. My questions are: Is there any standard C++ way to do this (I'm almost sure the answer is no, but wanted to ask for the sake of completeness). Is there any remotely compiler-independent way of doing this, like a library someone has implemented that provides an API for accessing a vtable? I'm open to completely hacks, if they will work. For example, if I created my own derived class and could determine the address of its DoSomething method, I could assume that the vtable is the first (hidden) member of Foo and search through its vtable until I find my pointer value. However, I don't know a way of getting this address: if I write &DerivedFoo::DoSomething I get a pointer-to-member, which is something totally different. Maybe I could turn the pointer-to-member into the vtable offset. When I compile the following: class Foo { public: virtual ~Foo() {} virtual void DoSomething() = 0; }; void foo(Foo *f, void (Foo::*member)()) { (f->*member)(); } On GCC/x86-64, I get this assembly output: Disassembly of section .text: 0000000000000000 <_Z3fooP3FooMS_FvvE>: 0: 40 f6 c6 01 test sil,0x1 4: 48 89 74 24 e8 mov QWORD PTR [rsp-0x18],rsi 9: 48 89 54 24 f0 mov QWORD PTR [rsp-0x10],rdx e: 74 10 je 20 <_Z3fooP3FooMS_FvvE+0x20> 10: 48 01 d7 add rdi,rdx 13: 48 8b 07 mov rax,QWORD PTR [rdi] 16: 48 8b 74 30 ff mov rsi,QWORD PTR [rax+rsi*1-0x1] 1b: ff e6 jmp rsi 1d: 0f 1f 00 nop DWORD PTR [rax] 20: 48 01 d7 add rdi,rdx 23: ff e6 jmp rsi I don't fully understand what's going on here, but if I could reverse-engineer this or use an ABI spec I could generate a fragment like the above for each separate platform, as a way of obtaining a pointer out of a vtable.

    Read the article

  • JavaScript method to write to Microsoft Visual Web Developer Debugger?

    - by Josh
    I generally test my web apps with Firefox and use Firebug. I love Firebug. But when I'm testing JavaScript code in IE I use the debugger in Microsoft's Visual Web Developer 2008 Express Edition. I would love to have an equivalent to Firebug's console.log methods which would allow me to log messages to Visual Web Developer. Any way to log messages to the error list/messages list/output pane using JavaScript?

    Read the article

  • confused about how to use JSON in C#

    - by Josh
    The answer to just about every single question about using C# with json seems to be "use JSON.NET" but that's not the answer I'm looking for. the reason I say that is, from everything I've been able to read in the documentation, JSON.NET is basically just a better performing version of the DataContractSerializer built into the .net framework... Which means if I want to deserialize a JSON string, I have to define the full, strongly-typed class for EVERY request I might have. so if I have a need to get categories, posts, authors, tags, etc, I have to define a new class for every one of these things. This is fine if I built the client and know exactly what the fields are, but I'm using someone else's api, so I have no idea what the contract is unless I download a sample response string and create the class manually from the JSON string. Is that the only way it's done? Is there not a way to have it create a kind of hashtable that can be read with json["propertyname"]? Finally, if I do have to build the classes myself, what happens when the API changes and they don't tell me (as twitter seems to be notorious for doing)? I'm guessing my entire project will break until I go in and update the object properties... So what exactly is the general workflow when working with JSON? And by general I mean library-agnostic. I want to know how it's done in general, not specifically to a target library... I hope that made sense, this has been a very confusing area to get into... thanks!

    Read the article

  • .NET MVC Code Generation

    - by Josh
    Is there a way to force the MVC automatically generated code to follow the conventions you have set in your preferences? For example, I keep all curly braces on the same lines as their declaring class, method, etc, but when generating a controller, it completely disregards my settings. Is there a setting someplace to force the same code generation as other parts of project?

    Read the article

  • Close Flash Player from FlashDevelop IDE

    - by Josh Mohan
    Whenever I compile my project using FlashDevelop in 'Debug' the Flash Player window remains after I have clicked the 'Stop' button in Flash Develop. I have to then switch over to the flash player, click through any error messages and then close the player, which wastes a lot of time in the long run. Any way to make it so Flash Player closes when I click 'Stop' in the Flash Develop debug tools? EDIT: My setup is a fresh install of Windows 7, a new copy of Flash Develop 4 and Flash Player 10. Thanks! J

    Read the article

  • How to add a "handle bar" to a sliding div

    - by Josh Brown
    I have a small splash page and have a browser-wide div that acts as a wrapper and have a div inside of #wrapper that is attached to a $.click(); event to slide the wrapper div out to view the browser-size background photo. I'm wanting to implement a small button/link that will slide in on the bottom right corner after the wrapper div is hidden. I know it is probably mainly CSS, but am needing some help. Thanks in advance for your help! PS: Using jQuery as my framework.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >