Search Results

Search found 1557 results on 63 pages for 'daniel gollas'.

Page 52/63 | < Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >

  • Rewriting simple C# nested class

    - by Daniel
    What would be an elegant way to implement the functionality of this nested class in F#? private class Aliaser { private int _count; internal Aliaser() { } internal string GetNextAlias() { return "t" + (_count++).ToString(); } } This was my first attempt, but it feels like there should be a sexy one-liner for this: let aliases = (Seq.initInfinite (sprintf "t%d")).GetEnumerator() let getNextAlias() = aliases.MoveNext() |> ignore aliases.Current

    Read the article

  • Setting the correct orientation for scrollbars in right-to-left pages.

    - by Daniel Lew
    I'm working with right-to-left layouts at the moment (think Hebrew or Arabic). In RTL, the page is generally flipped horizontally. However, I can't figure out how to change the orientation of the scrollbars. I would assume that the scrollbars should appear on the left side of a scrollable element, not the right side like it does in an LTR layout. Here is an example page where the scrollbar still appears on the right: <html dir="rtl"> <body> <div style="height: 100px; overflow: auto;"> <p>This is some text</p> <p>This is some text</p> <p>This is some text</p> <p>This is some text</p> <p>This is some text</p> </body> </html> Is the orientation of a scrollbar a browser locale setting, and thus is not something I should be concerned about, or is there a way to set the orientation of the scrollbar? (I'm not interested in implementing my own JavaScript scrollbar; if it turns out this is just a limitation of browsers then I'd rather live with that than add complexity to the page.)

    Read the article

  • accessing variable sheet ranges within Google spreadsheet?

    - by Daniel Harvey
    I've been trying to keep this little project entirely within Google docs, but I may have hit a wall. The spreadsheet is being used as a way for multiple users to record individual events with a Template they duplicate. I want to be able to compile a list of names of those attended onto a "report" sheet from all of the unique sheets, which should be after a certain sheet index [3] to [infinite]. Is this sort of variable sheet range possible in Google spreadsheets or do I need to go to the API to get this accomplished?

    Read the article

  • Int property in class definition

    - by Daniel I-S
    I have the following class structure for custom UITableViewCells: NumericEntryCell - Contains method for controlling max value that can be entered into a textbox. SliderCell - inherits from NEC and contains methods for handling slider-control of textbox value TextOnlyCell - just contains a textbox CellA - inherits from SliderCell and has a max value of 28 CellB - inherits from TextOnlyCell and has a max value of 150. I want NumericEntryCell to contain a definition for a property that contains the maxValue. I want to be able to set a value for this in the initialize method of a child class (CellA or CellB). Currently I have an int maxValue declared in the interface of NEC. I declare a property for this with @property int maxValue and @synthesize it within the .m file. However, attempting to modify this property's value from CellA or CellB's initialize method has no effect - when I hit a breakpoint in the NEC method that uses this value, its value is always zero. How can I get this to work?

    Read the article

  • Double join with habtm in ActiveRecord

    - by Daniel Huckstep
    I have a weird situation involving the need of a double inner join. I have tried the query I need, I just don't know how to make rails do it. The Data Account (has_many :sites) Site (habtm :users, belongs_to :account) User (habtm :sites) Ignore that they are habtm or whatever, I can make them habtm or has_many :through. I want to be able to do @user.accounts or @account.users Then of course I should be able to do @user.accounts < @some_other_account And then have @user.sites include all the sites from @some_other_account. I've fiddled with habtm and has_many :through but can't get it to do what I want. Basically I need to end up with a query like this (copied from phpmyadmin. Tested and works): SELECT accounts.* FROM accounts INNER JOIN sites ON sites.account_id = accounts.id INNER JOIN user_sites ON sites.id = user_sites.site_id WHERE user_sites.user_id = 2 Can I do this? Is it even a good idea to have this double join? I am assuming it would work better if users had the association with accounts to begin with, and then worry about getting @user.sites instead, but it works better for many other things if it is kept the way it is (users <- sites).

    Read the article

  • ASP.NET MVC 2 Client Side Validation doesn't work as advertised in VS2010

    - by Daniel Crenna
    In VS2010 and ASP.NET MVC 2, it seems that client-side validation (JQuery Futures or the stock option) doesn't quite work as advertised. I'm noticing that "tabbing off" a validated element will not invoke the client-side validation as promised. For a required field, you have to tab into the element, enter something, then remove it completely, in order to trigger the required validation. That's not really what I'm after here, and I'm hoping it's just a configuration issue on my side. How do I get the validation effects from previous versions so that a previous value isn't necessary (without having to modify the client-side scripts if possible)?

    Read the article

  • GTK+ and GdkPixbuf

    - by Daniel
    Hi all, I think I've got an understanding problem of GTK. My simple application has a stream of images and I'd like to display them within my GTK Window. Up to now, it looks like this: GdkPixbuf *pb = gdk_pixbuf_new_from_data(img2, GDK_COLORSPACE_RGB, FALSE, 24/3, 320, 240, 320*3, NULL, NULL); if(pb == NULL) fprintf(stderr, "Pixbuf is null!\n"); if(image != NULL) gtk_container_remove(GTK_CONTAINER(window), image); image = gtk_image_new_from_pixbuf(pb); gtk_container_add(GTK_CONTAINER(window), image); printf("Updated!\n"); img2 is my (rgb) buffer that gets updated from a stream each time. I guess gtk_container_remove and gtk_container_add might be stupid to use for this? Here's what I've got in addition: GtkWidget *window; GtkWidget *image; gtk_init(&argc, &argv); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_signal_connect(GTK_OBJECT(window), "destroy", GTK_SIGNAL_FUNC(destroy), NULL); /* ... */ start_routine_for_stream_that_calls_the_above(...) /* ... */ gtk_widget_show_all(window); gtk_main(); My problem is that it's not working this way... either I see only the last GdkPixbuf image or I see none, which is the correct behaviour ... But how do I manage it to show an (stream of) updated GdkPixbuf? Thanks for help

    Read the article

  • Call Single StrConn from Multiple Pages

    - by Daniel
    I have a ocnnection to SQL Server set up in my vba code. The format is: strConn = "ODBC;Driver=SQL;Server=SQL1;Database=DB1;Uid=1;Pwd=1" I have this in 4 sheets, but there will be times when I will want to change it to call from SQL2 or SQL3, and instead of changing the code on each sheet 4 times, I want to change it only once. Is there a way to set up that line to run by calling it from somewhere else or by passing in a string into the ""?

    Read the article

  • Change clickable TextView's color on focus and click?

    - by Daniel Jonsson
    I have a clickable TextView that I want to give some colors to. But I don't know how. Here are the relevant code snippets from my two files that I'm working with: TextView title = new TextView(this); title.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT)); title.setTextColor(R.color.textcolor); title.setText(titleLine); title.setTypeface(null, Typeface.BOLD); title.setClickable(true); title.setId(idLine); title.setFocusable(true); title.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { /* Irrelevant code */ } }); And this is my textcolor.xml file: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true" android:color="#000000"/> <!-- pressed --> <item android:state_focused="true" android:color="#000000"/> <!-- focused --> <item android:color="#000000"/> <!-- default --> </selector> When I use the textcolor-file by typing title.setTextColor(R.color.textcolor);, the textcolor just becomes grey, regardless if I press it or so. Which is strange since I have written "#000000" in all color fields. But if I remove the setTextColor code, gets the textView a light grey color, and when I press it, it becomes black. But that aren't the colors that I want. So, can anyone help me with this problem? Just to clarify: I want to be able to specify the colors for the text when it's normal, pressed and focused.

    Read the article

  • Objective-C property getter

    - by Daniel
    What is technically wrong with the following: @property(nonatomic, assign) NSUInteger timestamp; @property(nonatomic, readonly, getter = timestamp) NSUInteger startTime; @property(nonatomic, assign) NSUInteger endTime; I am sure I can find a better way to organise this, but this is what I ended up with at one point in my project and I noticed that accessing the startTime property always returned 0, even when the timestamp property was set to a correct timestamp. It seems having set the getter of startTime to an existing property (timestamp), it is not forwarding the value of timestamp when I do: event.startTime => 0 event.timestamp => 1340920893 All these are timestamps by the way. Just a reminder, I know the above should have happened in my project but I don't understand why accessing startTime doesn't forward onto timestamp property. UPDATE In my implementation I am synthesising all of these properties: @synthesize timestamp, endTime, startTime; Please check an example object to use that demonstrates this at my gist on GitHub: https://gist.github.com/3013951

    Read the article

  • If Key Value pair exists in multidimensional array.. How to?

    - by Daniel White
    I have a codeigniter shopping cart going and its "cart" array is the following: Array ( [a87ff679a2f3e71d9181a67b7542122c] => Array ( [rowid] => a87ff679a2f3e71d9181a67b7542122c [id] => 4 [qty] => 1 [price] => 12.95 [name] => Maroon Choir Stole [image] => 2353463627maroon_3.jpg [custprod] => 0 [subtotal] => 12.95 ) [8f14e45fceea167a5a36dedd4bea2543] => Array ( [rowid] => 8f14e45fceea167a5a36dedd4bea2543 [id] => 7 [qty] => 1 [price] => 12.95 [name] => Shiny Red Choir Stole [image] => 2899638984red_vstole_1.jpg [custprod] => 0 [subtotal] => 12.95 ) [eccbc87e4b5ce2fe28308fd9f2a7baf3] => Array ( [rowid] => eccbc87e4b5ce2fe28308fd9f2a7baf3 [id] => 3 [qty] => 1 [price] => 14.95 [name] => Royal Blue Choir Stole [image] => 1270984005royal_vstole.jpg [custprod] => 1 [subtotal] => 14.95 ) ) My goal is to loop through this multidimensional array some how and if ANY product with the key value pair "custprod == 1" exists, then my checkout page will display one thing, and if no custom products are in the cart it displays another thing. Any help is appreciated. Thanks.

    Read the article

  • Why is Apache + Rails is spitting out two status headers for code 500?

    - by Daniel Beardsley
    I have a rails app that is working fine except for one thing. When I request something that doesn't exist (i.e. /not_a_controller_or_file.txt) and rails throws a "No Route matches..." exception, the response is this (blank line intentional): HTTP/1.1 200 OK Date: Thu, 02 Oct 2008 10:28:02 GMT Content-Type: text/html Content-Length: 122 Vary: Accept-Encoding Keep-Alive: timeout=15, max=100 Connection: Keep-Alive Status: 500 Internal Server Error Content-Type: text/html <html><body><h1>500 Internal Server Error</h1></body></html> I have the ExceptionLogger plugin in /vendor, though that doesn't seem to be the problem. I haven't added any error handling beyond the custom 500.html in public (though the response doesn't contain that HTML) and I have no idea where this bit of html is coming from. So Something, somewhere is adding that HTTP/1.1 200 status code too early, or the Status: 500 too late. I suspect it's Apache because I get the appropriate HTTP/1.1 500 header (at the top) when I use Webrick. My production stack is as follows: Apache 2 Mongrel (5 instances) RubyOnRails 2.1.1 (happens in both 1.2 and 2.1.1) I forgot to mention, the error is caused by a "no route matches..." exception

    Read the article

  • Margin-Top push outer div down

    - by Daniel Hertz
    Hello, I have a header div as the first element in my wrapper div, but when I add a top margin to a h1 inside the header div it pushes the entire header div down. I realize this happens whenever I apply a top margin to the first visible element on a page. Here is a sample of the css. Thanks! div#header{ width: 100%; background-color: #000; position: relative; } div#header h1{ text-align: center; width: 375px; height: 50px; margin: 0 auto; font-size: 220%; text-indent: -5000px; background: url('../../images/name_logo.png') no-repeat; } html part <div id="header"> <h1><a href="/home.php">Title</a></h1> <ul id="navbar">

    Read the article

  • Continuously updating chat messages

    - by Daniel
    I'm creating a very simple chat application. It has an ASP.NET web page as front-end and a WCF service as back-end for storing the messages to a database. Everything works great except one thing; when Browser A enters a chat message I want Browser B to see the message as soon as possible (yeah, I know, that's the purpose of a chat). What I've done so far is to setup a trigger within the UpdatePanel, like this: <Triggers> <asp:AsyncPostBackTrigger ControlID="chatTimer" EventName="Tick" /> </Triggers> which uses a timer: <asp:Timer ID="chatTimer" runat="server" OnTick="chatTimer_Tick" Interval="1000" /> Is this the best approach or is there a better, yet simple, way to accomplish updating of messages. One drawback with this solution is that the textbox used to enter chat messages loses focus every time the Tick event runs. Any piece of feedback or advice regarding updating of messages is appreciated. Thank you!

    Read the article

  • telephone application programming on Linux

    - by Daniel Stevens
    I'm a Linux user looking to write a program which will pick up the phone, dial a number, play a recording and record what the person on the other end of the line says and save it to an audio file. I will want to use the modem that came with my computer if possible. What should I use to write this program?

    Read the article

  • Dealing with Struts2 float conversion type

    - by Daniel Calderon Mori
    I have a question regarding float type conversion in Struts2. I have a form that contains a serie of normal input elements. A serie of textfields with an add button by the side of each one is included in the window. Clicking on one of this buttons has the effect of adding an input type "hidden" inside the form with the value of its correspondent textfield. That value will often be a float number that, this is very important, uses the point format (example: 1.34). The inputs created look like this: <input class="hidden_material" type="hidden" name="form[0].cantidad_formulacion" value='1.34'"> <input class="hidden_material" type="hidden" name="form[1].cantidad_formulacion" value='1.54'"> Anyway, the whole proccess is made correctly until the data is used by the server after the form submission. The numbers are present as if the point wouldn't have been placed in the number (using the example above, as 134). If a comma is used (as in 1,34), there wouldn't be a problem. But that will not be the case with the users of the system. How could I solve this problem?

    Read the article

  • Core Data - Best way to save a "number of items"

    - by Daniel Granger
    The user will have a static list of items to choose from. Using a Picker View they will choose one of the items and then select how many of them they want. Whats the best way to save this in core data? A Struct? struct order { NSInteger item; NSInteger numberOf; }; Or some sort of relationship? Many Thanks

    Read the article

  • Wordpress: Does exists some simple code to retrieve the page when inserting the ID to form input?

    - by Daniel
    I would like to know if there's exists some simple code to get to the page i know its ID , I would like to create small input (no matter where in templates)from where the people can easily get to the page if they know it's page ID . I have the girls portfolio in wordpress - portfolio=pages x jobs in clubs offers=posts , I would like the girls portfolios to be easily searchable by ID(s) , if possible the same for the posts=jobs in clubs

    Read the article

  • TableView problem with Tab Bar!?!?!

    - by Daniel Granger
    I created a tableView which worked fine in a single view app but as soon as I changed the view controller for a Tab Bar Controller and tapped the tab for the view with the table view in I suddenly get this! What has gone wrong? [Session started at 2010-03-28 15:30:15 +0100.] 2010-03-28 15:30:17.763 LogbookTable[13473:207] *** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x3b14d10 2010-03-28 15:30:17.765 LogbookTable[13473:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x3b14d10' 2010-03-28 15:30:17.766 LogbookTable[13473:207] Stack: ( 29303899, 2465178889, 29685819, 29255286, 29107906, 4372518, 4379894, 4378891, 3095430, 3035941, 3077376, 3065931, 55820976, 55820399, 55818438, 55817530, 2739877, 2763572, 2745983, 2773089, 37399897, 29088640, 29084744, 2739733, 2777007, 10496, 10350 )

    Read the article

  • F# function calling syntax confusion

    - by Daniel
    I have a piece of code: links |> Seq.map (fun x -> x.GetAttributeValue ("href", "no url")) Which I wanted to rewrite to: links |> Seq.map (fun x -> (x.GetAttributeValue "href" "no url")) But the F# compiler doesn't seem to like that. I was under the impression that these two function calls were interchangeable: f (a, b) (f a b) The error that I get is: The member or object constructor 'GetAttributeValue' taking 2 arguments are not accessible from this code location. All accessible versions of method 'GetAttributeValue' take 2 arguments. Which seems amusing, as it seems to indicate that it needs what I'm giving it. What am I missing here?

    Read the article

  • Inheriting and overriding interfaces in C#

    - by Daniel A. White
    Please note: I am writing this question. I have these interfaces in a library/framework I am working on: interface IRepository<TKey,TModel> { void Remove(TModel entity); } interface IRepository<T> : IRepository<int, T> { } interface ISoftDeleteRepository<TKey,TModel> : IRepository<TKey, TModel> { } interface ISoftDeleteRepository<TModel> : ISoftDeleteRepository<int, TModel>, IRepository<TModel> { } and these implementations class Repository : IRepository { void Remove(TModel entity) { // actually Delete } } interface IRepository<T> : IRepository<int, T> { } interface ISoftDeleteRepository<TKey,TModel> : IRepository<TKey, TModel> { } interface ISoftDeleteRepository<TModel> : ISoftDeleteRepository<int, TModel>, IRepository<TModel> { }

    Read the article

< Previous Page | 48 49 50 51 52 53 54 55 56 57 58 59  | Next Page >