Search Results

Search found 1163 results on 47 pages for 'jeff'.

Page 28/47 | < Previous Page | 24 25 26 27 28 29 30 31 32 33 34 35  | Next Page >

  • How do I dynamically reference incremented properties in C#?

    - by Jeff Blankenburg
    I have properties called reel1, reel2, reel3, and reel4. How can I dynamically reference these properties by just passing an integer (1-4) to my method? Specifically, I am looking for how to get an object reference without knowing the name of the object. In Javascript, I would do: temp = eval("reel" + tempInt); and temp would be equal to reel1, the object. Can't seem to figure this simple concept out in C#.

    Read the article

  • Unicode data from NSData to NSString

    - by Jeff
    So if I have NSData from an HTTP request, then I do something like this: NSString *test = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; This will result in null if the data contains weird unicode data (title is from reddit): {"title":"click..¦¦me..and..then¦¦________ ¦¦check¦¦_.your...¦¦.__...¦¦____ ¦¦....¦¦¦¦¦¦¦¦¦¦¦¦¦¦....¦¦____ ¦¦¦¦¦¦....¦¦¦¦¦¦....¦¦¦¦¦¦____ ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦____ ....¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦______ ........¦¦..._recently....¦¦________ ....¦¦....viewed....links....¦¦_____"}, How would I convert the data to a string? Ideally, it would best if the string wasn't null so I could parse it as JSON, but even a lossy conversion is fine with me in these cases. I'm not familiar with unicode (naive American I am), so any enlightenment about that would be a nice bonus :)

    Read the article

  • automatic xml conversion in scala

    - by Jeff Bowman
    Let's say I have the following class: class Person(val firstName:String, val lastName:String) Is there an automatic way to generate xml from this class without having to hand create a toXml() method? Ideally the output would be something like: <Person <firstNameJohn</firstName <lastNameSmith</lastName </Person It seems like there should be a way to do this without having to write all that out manually. Perhaps there is a trait I haven't found yet?

    Read the article

  • Getting an icon to always be unrotated regardless of parent rotations in WPF

    - by Jeff Moser
    Is there an easy way in WPF to specify the orientation of an icon (or Button, or any WPF object) so that it always effectively remains unrotated regardless of the rotations of the parent transforms? For example, I'd like to have an icon like this: + + + + + +++++ + + + + + + + However, if I dock it to the left side, it'd by default look like this: +++++ + + + +++++ +++ + and if I docked it to the right, it'd be like this: + +++ +++++ + + + +++++ Is there a way to make it always be: + + + + + +++++ + + + + + + + ? I know I could manually track where it's docked and rotate it appropriately, but I was wondering if there's a clever way to effectively give the icon "gravity" to always point down. Thanks!

    Read the article

  • Is it possible to have a sound play before/during the splash screen?

    - by Jeff
    My app takes a few seconds to load and I have a splash screen. Once "viewDidLoad" I have a little sound play. I feel that the sound would be in better use if it started playing when the splash screen popped up. Is it possible to have a sound start before/during the splash screen? Here is my code: (under viewDidLoad) NSString *soundFilePath = [[NSBundle mainBundle] pathForResource: @"intorSound" ofType: @"aif"]; NSURL *fileURL = [[NSURL alloc] initFileURLWithPath: soundFilePath]; player = [[AVAudioPlayer alloc] initWithContentsOfURL: fileURL error: nil]; [player setVolume: soundVolumeValue]; // available range is 0.0 through 1.0 [player play]; [fileURL release]; Thank you for your time!

    Read the article

  • Java serialization testing

    - by Jeff Storey
    Does anyone know if there is a library that exists to help test if an object graph is fully serializable? It would probably be as simple as writing it out and reading it back in, but I figured someone must have abstracted this already - I just can't find it.

    Read the article

  • Converting ASP.NET MVC to n-Tiered Architecture

    - by Jeff
    I just built an application using ASP.NET MVC. The programmers at my company want to build all future modules using n-Tiered (Presentation Layer, Business Logic Layer, Data Access Layer) architecture. I am not the programmer and need to know why this makes sense? Do I have to completely rewrite the entire code or can it be converted? We are building an HRIS system with Business Intelligence. Somebody please explain why or why not this approach does or does not make sense.

    Read the article

  • having trouble with jpa, looks to be reading from cache when told to ignore

    - by jeff
    i'm using jpa and eclipselink. it says version 2.0.2.v20100323-r6872 for eclipselink. it's an SE application, small. local persistence unit. i am using a postgres database. i have some code the wakes up once per second and does a jpa query on a table. it's polling to see whether some fields on a given record change. but when i update a field in sql, it keeps showing the same value each time i query it. and this is after waiting, creating a new entitymanager, and giving a query hint. when i query the table from sql or python, i can see the changed field. but from within my jpa query, once i've read the value, it never changes in later executions of the query -- even though the entity manager has been recreated. i've tried telling it to not look in the cache. but it seems to ignore that. very puzzling, can you help please? here is the method. i call this once every 3 seconds. the tgt.getTrlDlrs() println shows me i get the same value for this field on every call of the method ("value won't change"). even if i change the field in the database. when i query the record from outside java, i see the change right away. also, if i stop the java program and restart it, i see the new value printed out immediately: public void exitChk(EntityManagerFactory emf, Main_1 mn){ // this will be a list of the trade close targets that are active List<Pairs01Tradeclosetgt> mn_res = new ArrayList<Pairs01Tradeclosetgt>(); //this is a list of the place number in the array list above //of positions to close ArrayList<Integer> idxsToCl = new ArrayList<Integer>(); EntityManager em = emf.createEntityManager(); em.getTransaction().begin(); em.clear(); String qryTxt = "SELECT p FROM Pairs01Tradeclosetgt p WHERE p.isClosed = :isClosed AND p.isFilled = :isFilled"; Query qMn = em.createQuery(qryTxt); qMn.setHint(QueryHints.CACHE_USAGE, CacheUsage.DoNotCheckCache); qMn.setParameter("isClosed", false); qMn.setParameter("isFilled", true); mn_res = (List<Pairs01Tradeclosetgt>) qMn.getResultList(); // are there any trade close targets we need to check for closing? if (mn_res!=null){ //if yes, see whether they've hit their target for (int i=0;i<mn_res.size();i++){ Pairs01Tradeclosetgt tgt = new Pairs01Tradeclosetgt(); tgt = mn_res.get(i); System.out.println("value won't change:" + tgt.getTrlDlrs()); here is my entity class (partial): @Entity @Table(name = "pairs01_tradeclosetgt", catalog = "blah", schema = "public") @NamedQueries({ @NamedQuery(name = "Pairs01Tradeclosetgt.findAll", query = "SELECT p FROM Pairs01Tradeclosetgt p"), @NamedQuery(name = "Pairs01Tradeclosetgt.findByClseRatio", query = "SELECT p FROM Pairs01Tradeclosetgt p WHERE p.clseRatio = :clseRatio")}) public class Pairs01Tradeclosetgt implements Serializable { private static final long serialVersionUID = 1L; @Id @Basic(optional = false) @Column(name = "id") @SequenceGenerator(name="pairs01_tradeclosetgt_id_seq", allocationSize=1) @GeneratedValue(strategy=GenerationType.SEQUENCE, generator = "pairs01_tradeclosetgt_id_seq") private Integer id; and my persitence unit: <?xml version="1.0" encoding="UTF-8"?> <persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"> <persistence-unit name="testpu" transaction-type="RESOURCE_LOCAL"> <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider> <class>mourv02.Pairs01Quotes</class> <class>mourv02.Pairs01Pair</class> <class>mourv02.Pairs01Trderrs</class> <class>mourv02.Pairs01Tradereq</class> <class>mourv02.Pairs01Tradeclosetgt</class> <class>mourv02.Pairs01Orderstatus</class> <properties> <property name="javax.persistence.jdbc.url" value="jdbc:postgresql://192.168.1.80:5432/blah"/> <property name="javax.persistence.jdbc.password" value="secret"/> <property name="javax.persistence.jdbc.driver" value="org.postgresql.Driver"/> <property name="javax.persistence.jdbc.user" value="noone"/> </properties> </persistence-unit> </persistence>

    Read the article

  • Retrieve class name hierarchy as string

    - by Jeff Wain
    Our system complexity has risen to the point that we need to make permission names tied to the client from the database more specific. In the client, permissions are referenced from a static class since a lot of client functionality is dependent on the permissions each user has and the roles have a ton of variety. I've referenced this post as an example, but I'm looking for a more specific use case. Take for instance this reference, where PermissionAlpha would be a const string: return HasPermission(PermissionNames.PermissionAlpha); Which is great, except now that things are growing more complex the classes are being structured like this: public static class PermissionNames { public static class PermissionAlpha { public const string SubPermission; } } I'm trying to find an easy way to reference PermissionAlpha in this new setup that will act similar to the first declaration above. Would the only way to do this be to resort to pulling the value of the class name like in the example below? I'm trying to keep all the names in one place that can be reference anywhere in the application. public static class PermissionAlpha { public static string Name { get { return typeof(PermissionAlpha).Name; } } }

    Read the article

  • Can't compile grails Tomcat plugin

    - by Jeff Beck
    I'm using Netbeans to build a Grails app, while I have used this fine before on this new computer I can not get even the basic project to compile and run. I am getting errors around compiling the Tomcat plugin. If I uninstall the plugin it and use Jetty instead it will compile but the project isn't set up for Jetty and is missing files. Below is the error I'm getting I'm thinking it is some issue with my classpath but I just don't know where to start any help would be much appreciated. java.lang.NoClassDefFoundError: org/apache/catalina/startup/Tomcat$ExistingStandardWrapper

    Read the article

  • [Rails] checkbox to update attribute

    - by Jeff
    [Updated a bit] I have a Task model that has a :completed boolean attribute. If I click on it I want it to execute the 'finish' method. The main problem is that I am displays a series of checkboxes in a list and subsequent checkboxes after the first one are ignored. The method is never called for the given task/checkbox combo. I have this chunk of code in my view: <% current_user.tasks.each do |t|%> <% if t.completed == false %> <%= check_box_tag :completed, true, checked = false %> <%= observe_field :completed, :url => { :controller => 'tasks', :action => :finish , :id => t.id }, :frequency => 0.25, :update => :completed, :with => true %> and my finish method looks like this: def finish @task = Task.find(params[:id]) new = {:completed => true} @task.update_attributes(new) render :update do |page| page.replace_html "taskListing", :partial => 'home/task_listing' end

    Read the article

  • How can I support conditional validation of model properties

    - by Jeff
    I currently have a form that I am building that needs to support two different versions. Each version might use a different subset of form fields. I have to do this to support two different clients, but I don't want to have entirely different controller actions for both. So, I am trying to come up with a way to use a strongly typed model with validation attributes but have some of these attributes be conditional. Some approaches I can think of is similar to steve sanderson's partial validation approach. Where I would clear the model errors in a filter OnActionExecuting based on which version of the form was active. The other approach I was thinking of would to break the model up into pieces using something like class FormModel { public Form1 Form1Model {get; set;} public Form2 FormModel {get; set;} } and then we would validate appropriately depending on

    Read the article

  • How to set initial size of a TreeViewer?

    - by Jeff
    Hello, I'm using a TreeViewer within a jface WizardPage and the initial input into the tree causes the WizardPage to grow vertically so that it can show all of the tree's values. When expanding one of the tree's values, then the vertical scrollbar works as expected. I'd like to be able to set the tree's size initially so that it is fixed and the scrollbar is already shown when the WizardPage is first drawn, but doing this isn't particularly obvious to me - the setSize method on the TreeViewer's Tree doesn't seem to do anything. Any help would be appreciated!

    Read the article

  • A 4-byte Unsigned Int for Sql Server 2008?

    - by Jeff Meatball Yang
    I understand there are multiple questions about this on SO, but I have yet to find a definitive answer of "yes, here's how..." So here it is again: What are the possible ways to store an unsigned integer value (32-bit value or 32-bit bitmap) into a 4-byte field in SQL Server? Here are ideas I have seen: 1) Use a -1*2^31 offset for all values Disadvantages: need to perform math on the values before reading/writing/aggregating. 2) Use 4 tinyint fields Disadvantages: need to concatenate values to perform any operations 3) Use binary(4) Disadvantages: actually uses 4 + 2 bytes of space

    Read the article

  • How do I restrict foreign keys choices to related objects only in django

    - by Jeff Mc
    I have a two way foreign relation similar to the following class Parent(models.Model): name = models.CharField(max_length=255) favoritechild = models.ForeignKey("Child", blank=True, null=True) class Child(models.Model): name = models.CharField(max_length=255) myparent = models.ForeignKey(Parent) How do I restrict the choices for Parent.favoritechild to only children whose parent is itself? I tried class Parent(models.Model): name = models.CharField(max_length=255) favoritechild = models.ForeignKey("Child", blank=True, null=True, limit_choices_to = {"myparent": "self"}) but that causes the admin interface to not list any children.

    Read the article

  • Adding css class to jspDrag on scroll

    - by Jeff
    Today I implemented the horizontal jScrollPane script and the element I intended to scrolls like a charm. Via CSS I'm using an image for the jspDrag element. Now for my question; I see that there are a few css classes added to the jspDrag like jspHover and jspActive. Is it also possible to add css classes when I scroll to the left or right? I would like to do this, so I can change the image according to the scroll. (Hoping my question is clear, a reaction would be highly appreciated. Kind regards)

    Read the article

  • Change string in SQL Server to abbreviate

    - by jeff
    How do I return the everything in a string from a sql query before a certain character? My data looks like this: HD TV HM45VM - HDTV widescreen television set with 45" lcd I want to limit or truncate the string to include everything before the dash. So the final result would be "HD TV HM45VM"

    Read the article

  • Returning currently displayed index of an array Javascript...

    - by Jeff Kindred
    I have a simple array with x number of items. I am displaying them individually via a link click... I want to update a number that say 1 of 10. when the next one is displayed i want it to display 2 of 10 etc... I have looked all around and my brain is fried right now... I know its simple I just cant get it out. <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Page Title</title> <link rel="stylesheet" href="style.css" type="text/css" media="screen" charset="utf-8"/> <script type="text/javascript"> var quotations = new Array() quotations[0]= "1" quotations[1]= "2" quotations[2]= "3" quotations[3]= "4" quotations[4]= "5" quotations[5]= "6" quotations[6]= "7" numQuotes = quotations.length; curQuote = 1; function move( xflip ) { curQuote = curQuote + xflip; if (curQuote > numQuotes) { curQuote = 1 ; } if (curQuote == 0) { curQuote = numQuotes ; } document.getElementById('quotation').innerHTML=quotations[curQuote - 1]; } var curPage = //this is where the current index should go </script> </head> <body> <div id="quotation"> <script type="text/javascript">document.write(quotations[0]);</script> </div> <div> <p><a href="javascript();" onclick="move(-1)">GO back</a> <script type="text/javascript">document.write(curPage + " of " + numQuotes)</script> <a href="javascript();" onclick="move(1)">GO FORTH</a></p> </div> </body> </html>

    Read the article

  • NotApplicable marker with display pattern

    - by Jeff Barger
    Ok, so I'm pretty new to Cocoa, especially Bindings, but here's what I'm trying to do. I've got a Core Data model consisting of two entities: Category and Item. Category has a to-many relationship to Item called children, and Item has a relationship to Category called parent. Item has two attributes that Category does not have: quantity and desiredQuantity. What I'd like to do is display the tree in an NSOutlineView with two columns. One column is bound to the name of either the Category or the Item. I want to the second column to display something along the lines of 2 of 5 for the Item rows and nothing at all for the Category rows. When I use a display pattern, the Category rows end up showing of I noticed that if I don't use a display pattern for the second column, and instead just bind its Value to either the quantity or the desiredQuantity, the Category rows show nothing; its only if I try to use the display pattern. How can I make it display nothing for the Category rows and still use the display pattern? Or can I? Edit: I guess I didn't explain what the NotApplicable marker has to do with anything - Category does have properties for quantity and desiredQuantity, but they just return NSNotApplicableMarker.

    Read the article

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