Search Results

Search found 964 results on 39 pages for 'ryan a'.

Page 33/39 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • If cookie found, get data, else create cookie, is this good logic?

    - by Ryan
    I have an Action that basically adds an item to a cart, the only way the cart is known is by checking the cookie, here is the flow of logic, please let me know if you see any issue... /order/add/[id] is called via GET action checks for cookie, if no cookie found, it makes a new cart, writes the identifier to the cookie, and adds the item to the database with a relation to the cart created if cookie is found, it gets the cart identifier from the cookie, gets the cart object, adds the item to the database with a relation to the cart found so it's basically like... action add(int id){ if(cookie is there) cart = getcart(cookievalue) else cart = makecart() createcookie(cart.id) additemtocart(cart.id, id) return "success"; } Seem right? I can't really thing of another way that would make sense.

    Read the article

  • Modifying MySQL Where Statement Based on Array

    - by Ryan
    Using an array like this: $data = array ( 'host' => 1, 'country' => 'fr', ) I would like to create a MySQL query that uses the values of the array to form its WHERE clause like: SELECT * FROM table WHERE host = 1 and country = 'fr' How can I generate this query string to use with MySQL?

    Read the article

  • How to query for entities with no matching siblings, with LINQ?

    - by Ryan
    I've got the two following entities ... class Citation { public int CitationId { get; set; } public string Identifier { get; set; } } class CitationIdentifier { public int CitationIdentifierId { get; set; } public string Identifier { get; set; } } I'm trying to query for all Citation records where the Identifier property does not match any of the CitationIdentifiers record Identifier property. So, if I have a Citation with an Identifier property containing "foo", but there are no CitationIdentifier records with an Identifier property containing "foo", then I'd like to retrieve that Citation. I'm working with an IDbSet<Citation>. Any ideas? Thanks.

    Read the article

  • Do assembly strong names change when new versions of .Net are released?

    - by Ryan Michela
    I'm trying to load an assembly that was installed as part of .Net 3.5 SP1 using Assembly.Load() by referencing its strong name. This works fine on my computer right now, but is it future proof? Will the strong name of core .Net assemblies change when patches are installed or new versions of the .Net framework are released? If so, how can I load an assembly from the GAC without using it's strong name?

    Read the article

  • How to structure data... Sequential or Hierarchical?

    - by Ryan
    I'm going through the exercise of building a CMS that will organize a lot of the common documents that my employer generates each time we get a new sales order. Each new sales order gets a 5 digit number (12222,12223,122224, etc...) but internally we have applied a hierarchy to these numbers: + 121XX |--01 |--02 + 122XX |--22 |--23 |--24 In my table for sales orders, is it better to use the 5 digital number as an ID and populate up or would it be better to use the hierarchical structure that we use when referring to jobs in regular conversation? The only benefit to not populating sequentially seems to be formatting the data later on in my view, but that doesn't sound like a good enough reason to go through the extra work. Thanks

    Read the article

  • Ruby (with Rails) convert a string of time into seconds?

    - by Ryan
    So, I've got a string of time... something along the lines of '4 hours' '48 hours' '3 days' '15 minutes' I would like to convert those all into seconds. For '4 hours', this works fine Time.parse('4 hours').to_i - Time.prase('0 hours').to_i => 14400 # 4 hours in seconds, yay However, this doesn't work for 48 hours (outside of range error). It also does not work for 3 days (no information error), etc. Is there a simple way to convert these strings into seconds?

    Read the article

  • unit testing methods with arrays as argument

    - by Ryan
    I am porting over some C++ assembly to VB that performs demodulation of various waveforms. I decided to go the unit test route instead of building a test app to get a feel for how testing is performed. The original demodulation code accepts an array that is the waveform along with some other arguments. How should one go about performing a test on something that has an array as an argument? Is it acceptable to generate fake data in a file and read it in at the beginning of the test? On a side note - The original C++ code was written because we were performing math that we couldn't do in VB6 so we had to cross boundaries between C++ and VB6 and arrays were used. Is there a "better" way of handling large amounts of data in the .NET world that us VB6 programmers may not yet be privy to? Or if we aren't crossing that managed/un-managed boundary, should we be representing our data as objects instead? Thanks all!

    Read the article

  • How to restore files that were removed by git?

    - by Ryan
    I am a git noob and git just deleted a bunch of important files. How do I get them back? I have a repo on my local machine. To get into git, I just right click my project folder and select "git bash here". This brings up the master where I do all my giting. So I had some changes to stage and I did: git add . This staged a bunch of changes. I noticed that I didn't want some of these staged so I decided that I'd try to unstage everthing. I did this: git reset --hard HEAD^ This basically deleted a bunch of files that I had made on the last commit and jumped to the commit before. How do I get those files back? If I can't do it through git is there another way?

    Read the article

  • Mapping to a different view based on child type

    - by Ryan Burnham
    So i have a situation where i have common base type but i need to map to a different view based on the child type. It looks like i can use a generic mapping class to handle the inheritance http://geekswithblogs.net/nharrison/archive/2010/07/09/inheriting-a-class-map-in-fluent-nhibernate.aspx But how can i conditionally map to a different view based on the child type? I see an EntityType property but it says its obsolete and will be made private in the next version. As an example i have a base class of ContactInfo is standard between contact types but the values come from different places depending on the contact type, this I'll handle through the sql view.

    Read the article

  • What type of programs are C/C++ used for now?

    - by Ryan Detzel
    I started off with C in school, went to Java and now I primarily use the P's(Php, Perl, Python) so my exposure to the lower level languages have all but disappeared. I would like to get back into it but I can never justify using C over Perl or Python. What real-world apps are being built with these languages? Any suggestions if I want to dive back in, what can I do with C/C++ that I can't easily do with Perl/Python?

    Read the article

  • Making a select choice result in a popup in javascript

    - by Ryan Johsonson
    So this is using javascript and HTML. For example: <select name='test' > <option value='1'> <option value='2'> <option value='3'> </select> If someone chooses option value 2 (from the dropdown) I want a popup to appear. However if they choose option value 1 or option value 3 (from the dropdown) I want nothing to happen. How can I do this? Thanks

    Read the article

  • Sending a message to nil?

    - by Ryan Delucchi
    As a Java developer who is reading Apple's Objective-C 2.0 documentation: I wonder as to what sending a message to nil means - let alone how it is actually useful. Taking an excerpt from the documentation: There are several patterns in Cocoa that take advantage of this fact. The value returned from a message to nil may also be valid: If the method returns an object, any pointer type, any integer scalar of size less than or equal to sizeof(void*), a float, a double, a long double, or a long long, then a message sent to nil returns 0. If the method returns a struct, as defined by the Mac OS X ABI Function Call Guide to be returned in registers, then a message sent to nil returns 0.0 for every field in the data structure. Other struct data types will not be filled with zeros. If the method returns anything other than the aforementioned value types the return value of a message sent to nil is undefined. Has Java rendered my brain incapable of grokking the explanation above? Or is there something that I am missing that would make this as clear as glass? Note: Yes, I do get the idea of messages/receivers in Objective-C, I am simply confused about a receiver that happens to be nil.

    Read the article

  • Selecting records in SQL that have the minimum value for that record based on another field

    - by Ryan
    I have a set of data, and while the number of fields and tables it joins with is quite complex, I believe I can distill my problem down using the required fields/tables here for illustration regarding this particular problem. I have three tables: ClientData, Sources, Prices Here is what my current query looks like before selecting the minimum value: select c.RecordID, c.Description, s.Source, p.Price, p.Type, p.Weight from ClientData c inner join Sources s ON c.RecordID = s.RecordID inner join Prices p ON s.SourceID = p.SourceID This produces the following result: RecordID Description Source Price Type Weight ============================================================= 001002003 ABC Common Stock Vendor 1 104.5 Close 1 001002003 ABC Common Stock Vendor 1 103 Bid 2 001002003 ABC Common Stock Vendor 2 106 Close 1 001002003 ABC Common Stock Vendor 2 100 Unknwn 0 111222333 DEF Preferred Stk Vendor 3 80 Bid 2 111222333 DEF Preferred Stk Vendor 3 82 Mid 3 111222333 DEF Preferred Stk Vendor 2 81 Ask 4 What I am trying to do is display prices that belong to the same record which have the minimum non-zero weight for that record (so the weight must be greater than 0, but it has to be the minimum from amongst the remaining weights). So in the above example, for record 001002003 I would want to show the close prices from Vendor 1 and Vendor 2 because they both have a weight of 1 (the minimum weight for that record). But for 111222333 I would want to show just the bid price from Vendor 3 because its weight of 2 is the minimum, non-zero for that record. The result that I'm after would like like: RecordID Description Source Price Type Weight ============================================================= 001002003 ABC Common Stock Vendor 1 104.5 Close 1 001002003 ABC Common Stock Vendor 2 106 Close 1 111222333 DEF Preferred Stk Vendor 3 80 Bid 2 Any ideas on how to achieve this? EDIT: This is for SQL Compact Edition.

    Read the article

  • Navigate to browser from selected listbox binded hyperlink (windows phone7)

    - by Ryan Smith
    I am bindind rss items from the net to this page, I cannot Seem to navigate to the link of a selected items hyper link which through binding is string. can anyone help me to navigate to weblink from a listbox item when selected ??? <ListBox Height="712" HorizontalAlignment="Left" Name="listNews" VerticalAlignment="Top" Width="468" SelectionChanged="listNews_SelectionChanged" Margin="0,-22,0,0"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Height="132"> <Image Source="{Binding Avatar}" Height="73" Width="73" VerticalAlignment="Top" Margin="0,7,5,0"/> <StackPanel Width="370"> <TextBlock Text="{Binding Newstitle}" TextWrapping="Wrap" Foreground="#FFC8AB14" FontSize="28" /> <HyperlinkButton Name="{Binding NewsLink}" Content="{Binding NewsLink}" NavigateUri="{Binding NewsLink}" FontSize="18" ClickMode="Press" Click="Selected" /> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> private void listNews_SelectionChanged(object sender, SelectionChangedEventArgs e) { WebBrowserTask webBrowserTask = new WebBrowserTask(); webBrowserTask.URL = **???????;** webBrowserTask.Show();

    Read the article

  • Align/Wrap images around div

    - by Ryan Phillips
    What I'm trying to achieve is a page with a div centered in the middle of the screen (720x360). This is done with jQuery using $(window).height() and $(window).width() and works perfectly. The next part is getting 180x180 images to fit around that middle div. These will fill the screen + beyond. I'm stuck on how to get these to align that way and I couldn't find a live example of anyone doing the same thing. So, is this even possible? Thanks, Any help is appreciated!

    Read the article

  • Label field problem in the treenode Tag. (Struts2/Ajax)

    - by ryan
    I'm using struts as a framework for a web-app. The following code runs inside a loop where I access the database to retrieve values to be used as nodes for a tree. <s:set name="categoryValue" value= "%{'<%=rs.getString("category")%>'}"> </s:set> <sx:treenode id="child1" label ="%{#categoryValue}"/> The error I get is "/jsp/tree.jsp(249,65) equal symbol expected" However if i give <s:set name="categoryValue" value= "%{'Test'}"> the value Test is obtained. Can anyone tell me how to set the value of the 'label' with strings?

    Read the article

  • Prototype 'on show' Event.observe handler

    - by ryan
    I am trying to make an AJAX request that updates a div's content when that div is shown. My initial thought was to use an Event observer that watched for a div to be shown, but I cannot seem to find an appropriate handler. Is there an easy way to make an AJAX request for an element 'on show?'

    Read the article

  • Javascript function not working with an array

    - by Ryan Harvie
    Hi, i have this function which loops through an array of check boxes checking if the boxes value is equal to something in a text box, i dont know whats wrong. function checkValue(contain) { var boxes = document.getElementsByTagName("input"); for (var i = 0; i < boxes.length; i++) { if (boxes[i].name == "vote[]") { if (boxes[i].value.indexOf(contain.value) != -1) { boxes[i].checked = true; } } } } and this is how i call it OnClick="uncheckAll(); checkValue(document.getElementsByName("countrylist"));" this code is in side a echo in php which is like this echo ' ';

    Read the article

  • Div not expanding even with content inside

    - by Aiden Ryan
    I have a stack of divs inside of each other, all of which have an ID which specifies CSS only. But for some reason the surrounding DIV tag only expands to it's anointed height value, and not it's default auto, meaning that although the content is inside, the backing DIV is only a specific height. I need it to adjust the heigh to the size of whatever is inside of it (As there will be user submitted data being echoed out possibly in paragraphs with 500+ words.) Here is my HTML <div id="albumhold"> <div id="albumpic">Pic here</div> <div id="infohold"> <div id="albumhead">Name | Date</div> <div id="albuminfo">Information</div> </div> And the CSS for the HTML code: #albumhold { width: 920px; padding: 10px; height: auto; border: 1px solid #E1E1E1; margin-left: auto; margin-right: auto; background-color: #E1E1E1; background-image: url(../global-images/albumback.png); background-position: top center; background-repeat: repeat-x; } #albumpic { display: block; height: 110px; width: 110px; float: left; border: 1px solid #000; } #infohold { width: 800px; background-color: #CCC; float: right; height: 20px; } #albumhead { width: 800px; height: 20px; text-indent: 10px; border: 1px solid #000; color: #09F; } #albuminfo { margin-top: 5px; width: 800px; float: right; color: #09F; word-wrap:break-word; } Help is greatly appreciated.

    Read the article

  • PHP string enocding issue - Extra characters appearing

    - by ryan
    I see extra characters like â showing because of encoding issues as I found out here - HTML encoding issues - "Â" character showing up instead of "&nbsp;" I understand that if I set the browser meta encoding to UTF-8, these will not affect anything but I need to strip these extra characters from the database for other purposes. For eg. : Text: ↑ should be become Text: ? But if I run it through utf8_decode it gives me Text: ??? For every other occurrence of the â character, it converts properly to a blank space. Any help will be appreciated.

    Read the article

  • When my object is no longer referenced why do its events continue to run?

    - by Ryan Peschel
    Say I am making a game and have a base Buff class. I may also have a subclass named ThornsBuff which subscribes to the Player class's Damaged event. The Player may have a list of Buffs and one of them may be the ThornsBuff. For example: Test Class Player player = new Player(); player.ActiveBuffs.Add(new ThornsBuff(player)); ThornsBuff Class public ThornsBuff(Player player) { player.DamageTaken += player_DamageTaken; } private void player_DamageTaken(MessagePlayerDamaged m) { m.Assailant.Stats.Health -= (int)(m.DamageAmount * .25); } This is all to illustrate an example. If I were to remove the buff from the list, the event is not detached. Even though the player no longer has the buff, the event is still executed as if he did. Now, I could have a Dispel method to unregister the event, but that forces the developer to call Dispel in addition to removing the Buff from the list. What if they forget, increased coupling, etc. What I don't understand is why the event doesn't detatch itself automatically when the Buff is removed from the list. The Buff only existed in the list and that is its one reference. After it is removed shouldn't the event be detached? I tried adding the detaching code to the finalizer of the Buff but that didn't fix it either. The event is still running even after it has 0 references. I suppose it is because the garbage collector had not run yet? Is there any way to make it automatic and instant so that when the object has no references all its events are unregisted? Thanks.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39  | Next Page >