Search Results

Search found 3180 results on 128 pages for 'david sauter'.

Page 101/128 | < Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >

  • Use CSS (and maybe JavaScript) to make an element be square (or maintain a specific aspect ratio)

    - by David Pfeffer
    I have a div that I want to have the following characteristics: Width = 50% of its parent element Height equal to whatever it needs to be in order to maintain a certain aspect ratio. I need to use percentages because the object will resize left-right when the browser is resized. I want the object to be resized top-bottom to ensure the object maintains the same aspect ratio. I don't think there's any way to use pure CSS to do this, but does anyone know of a way? Alternatively, is there an easy JavaScript way to do this? (JQuery is fine.)

    Read the article

  • How to reset keyboard for an entry field?

    - by David.Chu.ca
    I am using tag field as a flag for text fields text view fields for auto-jumping to the next field: - (BOOL)findNextEntryFieldAsResponder:(UIControl *)field { BOOL retVal = NO; for (UIView* aView in mEntryFields) { if (aView.tag == (field.tag + 1)) { [aView becomeFirstResponder]; retVal = YES; break; } } return retVal; } It works fine in terms of auto-jumping to the next field when Next key is pressed. However, my case is that the keyboards are different some fields. For example, one fields is numeric & punctuation, and the next one is default (alphabetic keys). For the numeric & punctuation keyboard is OK, but the next field will stay as the same layout. It requires user to press 123 to go back ABC keyboard. I am not sure if there is any way to reset the keyboard for a field as its keyboard defined in xib? Not sure if there is any APIs available? I guess I have to do something is the following delegate? -(void)textFieldDidBegingEditing:(UITextField*) textField { // reset to the keyboard to request specific keyboard view? .... } OK. I found a solution close to my case by slatvik: -(void) textFieldDidBeginEditing:(UITextField*) textField { textField.keyboardType = UIKeybardTypeAlphabet; } However, in the case of the previous text fields is numeric, the keyboard stays numeric when auto-jumped to the next field. Is there any way to set keyboard to alphabet mode?

    Read the article

  • Not Equal two Generic Lists

    - by David Johnson
    I have two generic lists, both containing different data, except 4 fields, which I want to compare to another list and find items that do not match in either list. I need to basically replace where it says equals below, with not equals! var unMatchedData = from liveLines in liveList join oldList in comapreSnapshotList on new {liveLines.ClientNo, liveLines.SequenceNo, liveLines.LineNo, liveLines.Text} equals new {oldList.ClientNo, oldList.SequenceNo, oldList.LineNo, oldList.Text} select new KNOWTXTS { ClientNo = liveLines.ClientNo, SequenceNo = liveLines.SequenceNo, LineNo = liveLines.LineNo, Text = liveLines.Text };

    Read the article

  • Facebook API, export group wall entries

    - by Guy David
    After trying to find a reference to an API/tutorial to such thing, I have come here. I would like to scan a specific group wall, pulling all posts from it, with PHP or C#. In the end, I would like to have a nested-array containing each posts, with the next details: An array of the related comments Likes Views Obviously, I don't ask for any code, only a reference to the related API I will need to use. EDIT: If this is not possible, should I consider cURL as an option?

    Read the article

  • Retain numerical precision in an R data frame?

    - by David
    When I create a dataframe from numeric vectors, R seems to truncate the value below the precision that I require in my analysis: data.frame(x=0.99999996) returns 1 (see update 1) I am stuck when fitting spline(x,y) and two of the x values are set to 1 due to rounding while y changes. I could hack around this but I would prefer to use a standard solution if available. example Here is an example data set d <- data.frame(x = c(0.668732936336141, 0.95351462456867, 0.994620622127435, 0.999602102672081, 0.999987126195509, 0.999999955814133, 0.999999999999966), y = c(38.3026509783688, 11.5895099585560, 10.0443344234229, 9.86152339768516, 9.84461434575695, 9.81648333804257, 9.83306725758297)) The following solution works, but I would prefer something that is less subjective: plot(d$x, d$y, ylim=c(0,50)) lines(spline(d$x, d$y),col='grey') #bad fit lines(spline(d[-c(4:6),]$x, d[-c(4:6),]$y),col='red') #reasonable fit Update 1 Since posting this question, I realize that this will return 1 even though the data frame still contains the original value, e.g. > dput(data.frame(x=0.99999999996)) returns structure(list(x = 0.99999999996), .Names = "x", row.names = c(NA, -1L), class = "data.frame") Update 2 After using dput to post this example data set, and some pointers from Dirk, I can see that the problem is not in the truncation of the x values but the limits of the numerical errors in the model that I have used to calculate y. This justifies dropping a few of the equivalent data points (as in the example red line).

    Read the article

  • Is there a C# equivalent of typeof for properties/methods/members?

    - by David
    A classes Type metadata can be obtained in several ways. Two of them are: var typeInfo = Type.GetType("MyClass") and var typeInfo = typeof(MyClass) The advantage of the second way is that typos will be caught by the compiler, and the IDE can understand what I'm talking about (allowing features like refactoring to work without silently breaking the code) Does there exist an equivalent way of strongly referencing members/properties/methods for metadata and reflection? Can I replace: var propertyInfo = typeof(MyClass).GetProperty("MyProperty") with something like: var propertyInfo = property(MyClass.MyProperty)

    Read the article

  • Java - StackOverflow Error on recursive 2D boolean array method that shouldn't happen.

    - by David W.
    Hey everyone, I'm working on a runnable java applet that has a fill feature much like the fill method in drawing programs such as Microsoft Paint. This is how my filling method works: 1.) The applet gets the color that the user clicked on using .getRGB 2.) The applet creates a 2D boolean array of all the pixels in the window, with the value "true" if that pixel is the same color as the color clicked on or "false" if not. The point of this step is to keep the .getRGB method out of the recursive method to hopefully prevent this error. 3.) The applet recursively searches the 2D array of booleans where the user clicked, recording each adjacent point that is "true" in an ArrayList. The method then changes each point it records to false and continues. 4.) The applet paints every point stored in the ArrayList to a user selected color. All of the above steps work PERFECTLY if the user clicks within a small area, where only a few thousand pixels or so have their color changed. If the user selects a large area however (such as about 360,000 / the size of the applet window), the applet gets to the recursive stage and then outputs this error: Exception in thread "AWT-EventQueue-1" java.lang.StackOverflowError at java.util.ArrayList.add(ArrayList.java:351) at paint.recursiveSearch(paint.java:185) at paint.recursiveSearch(paint.java:190) at paint.recursiveSearch(paint.java:190) at paint.recursiveSearch(paint.java:190) at paint.recursiveSearch(paint.java:190) at paint.recursiveSearch(paint.java:190) at paint.recursiveSearch(paint.java:190) (continues for a few pages) Here is my recursive code: public void recursiveSearch(boolean [][] list, Point p){ if(isValid(p)){ if(list[(int)p.y][(int)p.x]){ fillPoints.add(p); list[(int)p.y][(int)p.x] = false; recursiveSearch(list, new Point(p.x-1,p.y));//Checks to the left recursiveSearch(list, new Point(p.x,p.y-1));//Checks above recursiveSearch(list, new Point(p.x+1,p.y));//Checks to the right recursiveSearch(list, new Point(p.x,p.y+1));//Checks below } } } Is there any way I can work around an error like this? I know that the loop will never go on forever, it just could take a lot of time. Thanks in advance.

    Read the article

  • XmlDocument, XmlResolver and www.w3.org

    - by David Rutten
    One of my users had a single error while opening a file (I'm using standard xml 1.0): The remote name could not be resolved: 'www.w3.org' I found a post here in StackOverflow that deals with this and it suggest setting the XmlResolver property to null. I've tried this, and all my documents still seem to load fine. However, the last thing I want is to break the file-reading mechanism of my app, so is it actually safe to disable the resolver?

    Read the article

  • Should member variables of global objects be made global as well?

    - by David Wong
    I'm developing plugins in Eclipse which mandates the use of singleton pattern for the Plugin class in order to access the runtime plugin. The class holds references to objects such as Configuration and Resources. In Eclipse 3.0 plug-in runtime objects are not globally managed and so are not generically accessible. Rather, each plug-in is free to declare API which exposes the plug-in runtime object (e.g., MyPlugin.getInstance() In order for the other components of my system to access these objects, I have to do the following: MyPlugin.getInstance().getConfig().getValue(MyPlugin.CONFIGKEY_SOMEPARAMETER); , which is overly verbose IMO. Since MyPlugin provides global access, wouldn't it be easier for me to just provide global access to the objects it manages as well? MyConfig.getValue(MyPlugin.CONFIGKEY_SOMEPARAMETER); Any thoughts? (I'm actually asking because I was reading about the whole "Global variable access and singletons are evil" debates)

    Read the article

  • @Unique doesn't have any effect in DataNucleus w/ NeoDatis

    - by David Parks
    Using JDO / DataNucleus / NeoDatis datastore I added @Unique to a field of a persistable object, however I am allowed to create multiple objects which violate the unique constraint. The docs for DataNucleus/NeoDatis suggest that Unique fields are supported. @PersistenceCapable public class User { @Persistent @Unique private String username; //... } If I add multiple objects to the DB with the same username there's no problem doing so. :(

    Read the article

  • Sending a large file over network continuously

    - by David Parunakian
    Hello, We need to write software that would continuously (i.e. new data is sent as it becomes available) send very large files (several Tb) to several destinations simultaneously. Some destinations have a dedicated fiber connection to the source, while some do not. Several questions arise: We plan to use TCP sockets for this task. What failover procedure would you recommend in order to handle network outages and dropped connections? What should happen upon upload completion: should the server close the socket? If so, then is it a good design decision to have another daemon provide file checksums on another port? Could you recommend a method to handle corrupted files, aside from downloading them again? Perhaps I could break them into 10Mb chunks and calculate checksums for each chunk separately? Thanks.

    Read the article

  • in ruby, how do you make this nested hash work?

    - by David
    this one creates an error: @settings = { :tab1 => { :name => { :required => true }, :description } } need to change :descrpition to :description = {}, but i don't have any values for :description so i want it to remain as is (without the empty = {}) Would you show me the best way to handle this kind of situation? thanks in advance

    Read the article

  • Symfony form's i18n and add_empty

    - by David
    I have this widget: $this->setWidget('slug', new sfWidgetFormDoctrineChoice(array('model' => 'MyTable', 'method' => 'myMethod', 'key_method' => 'myMethod', 'add_empty' => 'Select option'))); Ok, what should I do to translate the "Select option"? I can't use the __() helper inside the form, and adding that string into my XLIFF file doesn't translate it automatically. If it can't be done, what workaround should I implement? I can't find any way, and neither can't find any tip in the official documentation. Thanks!

    Read the article

  • LINQ query for tag system: Matching any of several tags?

    - by David Veeneman
    I am just getting started with LINQ. I am creating an Entity Framework app that uses the canonical Post and Tag model. A Post contains an ID, Text, and Tags, and a Tag contains an ID, a Name, and Posts. A previous thread on StackOverflow showed me how to query for a Post that matches all Tag objects (A and B and C) in a search list. But how would I query for a Post that matches any Tag (A or B or C) in the list? Thanks for your help.

    Read the article

  • Android - update widget text

    - by david
    Hi, i have 2 questions about widgets update I have 2 buttons and i need to change one button text when i press the other one, how can i do this? The first time i open the widget it calls the onUpdate method, but it never calls it again. I need to update the widget every 2 seconds and i have this line in the xml. android:updatePeriodMillis="2000" Do i need a service or should it works just with the updatePeriodMillis tag? onUpdate method RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.newswidget); Intent intent = new Intent(context, DetalleConsulta.class); intent.putExtra(DetalleConsulta.CONSULTA_ID_NAME, "3"); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, intent, 0); views.setOnClickPendingIntent(R.id.btNews, pendingIntent); /* Inicializa variables para llamar el controlador */ this.imei = ((TelephonyManager)context.getSystemService(Context.TELEPHONY_SERVICE)).getDeviceId(); this.controlador = new Controlador(this.imei); try { this.respuestas = this.controlador.recuperarNuevasRespuestas(); if(this.respuestas != null &amp;&amp; this.respuestas.size() &gt; 0){ Iterator&lt;Consulta&gt; iterRespuestas = this.respuestas.iterator(); views.setTextViewText(R.id.btNews, ((Consulta)iterRespuestas.next()).getRespuesta()); } } catch (PersistenciaException e) { //TODO manejar error } appWidgetManager.updateAppWidget(appWidgetIds, views); thx a lot!!!

    Read the article

  • C++ string array from ifstream

    - by David Beck
    I have a program that I need to read in an array of strings from a file. The array must be C type strings (char * or char[]). Using the following code, I get a bad access error: for (i = 0; i < MAX_WORDS && !inputFile.eof(); i++) { inputFile >> words[i]; } words is declared as: char *words[MAX_WORDS];

    Read the article

  • C++ online Role Playing Game (RPG)

    - by David
    So I've been learning C++ and SDL to make some basic 2d games. I want to create a game sort of like World of Warcraft but a 2D version. I want it to be on-line and use a database or something to start data like amount of Gold, HP, etc. I was wondering though, if I do this in SDL, would it still work on-line or would the user have to download SDL themselves to play? I just want a game like this but be able to play it with some friends, just for learning purposes you know. I was also looking at DirectX because everyone has that on windows pretty much. Anyways much help is appreciated, thanks!

    Read the article

  • Release variable and assigning it again

    - by David Gonrab
    What is the preferred and/or correct way to release an NSMutableString (or any other class for that matter) instance and assign a new instance to the same variable in Objective-C on the iPhone? Currently I'm using [current release]; current = [NSMutableString new]; but I understand that the following works, too. NSMutableString *new = [NSMutableString new]; [current release]; current = [new retain]; [new release]; The variable current is declared in the interface definition of my class and gets released in dealloc.

    Read the article

  • Confused with objects in Ruby

    - by David
    Ruby Newbie here, I understand that everything is an object in Ruby, one thing that I wasn't sure about was understanding Variables. Variables basically give reference to objects (correct me if I'm wrong). During an instructional video, the teacher did a demonstration which went as below: (irb) a = 100 ==> 100 b = a ==> 100 b ==> 100 This part I get, makes total sense. Then he did a = 50 ==> 50 b ==> 100 If B is supposed to point to what a was set which was a 100, why does b still point to 100 if a has now been set as 50?

    Read the article

< Previous Page | 97 98 99 100 101 102 103 104 105 106 107 108  | Next Page >