Daily Archives

Articles indexed Sunday April 25 2010

Page 18/72 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • jQuery: select all inputs with unique id (Regex/Wildcard Selectors)

    - by d3020
    I have some textboxes on a webform that have ids like this: txtFinalDeadline_1 txtFinalDeadline_2 txtFinalDeadline_3 txtFinalDeadline_4 In my jQuery how do I find all of those in order to assign a value to them. Before I had the underscore and they were all named txtFinalDeadline I could do this and it worked. $(this).find("#txtFinalDeadline").val(formatDate); However, that was when they were all named the same thing. Now I have the _x after the name and I'm not sure how to go about assigning that same value as before to them. Thanks.

    Read the article

  • What's the best-practice way to update an Adapter's underlying data?

    - by skyler
    I'm running into an IllegalStateException updating an underlying List to an Adapter (might be an ArrayAdapter or an extension of BaseAdapter, I don't remember). I do not have or remember the text of the exception at the moment, but it says something to the effect of the List's content changing without the Adapter having been notified of the change. This List /may/ be updated from another thread other than the UI thread (main). After I update this list (adding an item), I call notifyDataSetChanged. The issue seems to be that the Adapter, or ListView attached to the Adapter attempts to update itself before this method is invoked. When this happens, the IllegalStateException is thrown. If I set the ListView's visibility to GONE before the update, then VISIBLE again, no error occurs. But this isn't always practical. I read somewhere that you cannot modify the underlying this from another thread--this would seem to limit an MVC pattern, as with this particular List, I want to add items from different threads. I assumed that as long as I called notifyDataSetChanged() I'd be safe--that the Adapter didn't revisit the underlying List until this method was invoked but this doesn't seem to be the case. I suppose what I'm asking is, can it be safe to update the underlying List from threads other than the UI? Additionally, if I want to modify the data within an Adapter, do I modify the underlying List or the Adapter itself (via its add(), etc. methods). Modifying the data through the Adapter seems wrong. I came across a thread on another site from someone who seems to be having a similar problem to mine: http://osdir.com/ml/Android-Developers/2010-04/msg01199.html (this is from where I grabbed the Visibility.GONE and .VISIBLE idea). To give you a better idea of my particular problem, I'll describe a bit of how my List, Adapter, etc. are set up. I've an object named Queue that contains a LinkedList. Queue extends Observable, and when things are added to its internal list through its methods, I call setChanged() and notifyListeners(). This Queue object can have items added or removed from any number of threads. I have a single "queue view" Activity that contains an Adapter. This Activity, in its onCreate() method, registers an Observer listener to my Queue object. In the Observer's update() method I call notifyDataSetChanged() on the Adapter. I added a lot of log output and determined that when this IllegalStateExcption occurs that my Observer callback was never invoked. So it's as if the Adapter noticed the List's change before the Observer had a chance to notify its Observers, and call my method to notify the Adapter that the contents had changed. So I suppose what I'm asking is, is this a good way to rig-up an Adapter? Is this a problem because I'm updating the Adapter's contents from a thread other than the UI thread? If this is the case, I may have a solution in mind (give the Queue object a Handler to the UI thread when it's created, and make all List modifications using that Handler, but this seems improper). I realize that this is a very open-ended post, but I'm a bit lost on this and would appreciate any comments on what I've written.

    Read the article

  • Protect value from changies using reflection?

    - by IordanTanev
    Hi, here is the problem case i am writing a little third party library. In this library i have a class like this public class TestClass { public int TestField { get; private set; } public TestClass( ) { TestField = 1; } } Then i have a varialbe form this class like this public TestClass test = new TestClass( ); The problem i am facing is that usnig reflection like this PropertyInfo field = typeof( TestClass ).GetProperty( "TestField" ); field.SetValue( test, 2, null ); programers can change internal value of this class. this will be very bad thing becouse it can crash the hole library. My question is what is the best way to protect my code form such changes.I know i can use some kind of bool flag so tha value can be changed only ones but this is not very good salution is there a better one? Best Regards, Iordan

    Read the article

  • How to slice a list of objects in association of the object attributes

    - by gizgok
    I have a list of fixtures.Each fixture has a home club and a away club attribute.I want to slice the list in association of its home club and away club.The sliced list should be of homeclub items and awayclub items. Easier way to implement this is to first slice a list of fixtures.Then make a new list of the corresponding Home Clubs and Away Clubs.I wanted to know if we can do this one step.

    Read the article

  • Cocoa-Created PDF Not Rendering Correctly

    - by Matthew Roberts
    I've created a PDF on the iPad, but the problem is when you have a line of text greater than 1 line, the content just goes off the page. This is my code: void CreatePDFFile (CGRect pageRect, const char *filename) { CGContextRef pdfContext; CFStringRef path; CFURLRef url; CFMutableDictionaryRef myDictionary = NULL; path = CFStringCreateWithCString (NULL, filename, kCFStringEncodingUTF8); url = CFURLCreateWithFileSystemPath (NULL, path, kCFURLPOSIXPathStyle, 0); CFRelease (path); myDictionary = CFDictionaryCreateMutable(NULL, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); NSString *foos = @"Title"; const char *text = [foos UTF8String]; CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR(text)); CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("Author")); pdfContext = CGPDFContextCreateWithURL (url, &pageRect, myDictionary); CFRelease(myDictionary); CFRelease(url); CGContextBeginPage (pdfContext, &pageRect); CGContextSelectFont (pdfContext, "Helvetica", 12, kCGEncodingMacRoman); CGContextSetTextDrawingMode (pdfContext, kCGTextFill); CGContextSetRGBFillColor (pdfContext, 0, 0, 0, 1); NSString *body = @"text goes here"; const char *text = [body UTF8String]; CGContextShowTextAtPoint (pdfContext, 30, 750, text, strlen(text)); CGContextEndPage (pdfContext); CGContextRelease (pdfContext);} Now the issue lies within me writing the text to the page, but the problem is that I can't seem to specify a multi-line "text view".

    Read the article

  • C# Retrieve Canon Specific EXIF Data

    - by dkpatt
    I have wrote an app that reads the basic EXIF data from an image via the PropertyItems exposed in .Net's System.Drawing.Image class. However, I cannot retrieve Canon specific EXIF data via these properties. How does one read this information? I know it exist in the file as Photoshop reads it.

    Read the article

  • What CPAN module can summarize error logs?

    - by mithaldu
    I'm maintaining some website code that will soon dump all its errors and warnings into a log file. In order to make this a bit more pro-active i plan to parse this log file daily, summarize the warnings and errors (i.e. count the occurrence of each specific one and group by either warning/error) and then email this to the devs on the project. This would likely admittedly be rather trivial with a hash and some further fiddling, I wondered if there is a suitable module on CPAN that i could use to do this task. It would either be one that summarizes specifically perl error/warnings logs or one that summarizes arbitrary text files. Any suggestions?

    Read the article

  • When using DrawText, what does TextFormatFlags.Internal (a.k.a. DT_INTERNAL) do?

    - by Daniel Stutzbach
    When using TextRenderer.DrawText(), what does setting the TextFormatFlags.Internal flag actually do? Equivalently, what does setting the DT_INTERNAL flag to Win32's DrawTextEx() function do? More to the point, when should I set that flag and when should I not set it? The documentation says: "Uses the system font to calculate text metrics", but I'm not entirely sure what that means. I've done some limited testing and setting the flag seems to change how the font is rendered when using a small font size, but doesn't seem to make a difference when using a large font size.

    Read the article

  • win7 64 bit. Fresh install on fresh pc fails with BSOD.

    - by 0plus1
    Hello, I've built a new machine: ASUS M4A785TD-V EVO OCZ DDR3 PC3-12800 (2x 2gb) Amd Athlon II X4 630 Box AM3 I tried memtest with hiren boot cd (tested only 3gb) and showed no error. Then I tried the built in ram test from the win7 cd (2 passes no errors). I also deleted with a 0 pass the hard drive. The error I get is this: 0x0000007e (0xFFFFFFFFFC0000005,0xFFFFF8000C1AB0F3,0xFFFFF880009A8498,0xFFFFF880009A7CF0) Any help is greatly appreciated. Thank you!

    Read the article

  • Contacts Issue: Google Contacts, Nokia 5800 And Outlook, Sync and Images

    - by josecortesp
    Hello everyone, this is a multi-question, so please, feel free to answer just one or all of them. My actual situation is: Google contacts sync with Nokia 5800 using MFE(google sync), using google's fake "exchange server". Outlook sync with google using GoContact Sync software (http://www.webgear.co.nz/Products/GOContactSync.aspx). What I want, a easy(or not) way to correctly sync the three of them, even if I have to change some of my "escenario". I know outlook<-google contacts sync is not good yet, but if someone can suggest me some better SW than GoContact Sync. It'll be good. What I really want is to sync a least name, phone, email and image. Then, is there a way to get all my google contacts to by default use their own google image? I noted that, usually i have to manually choose it, and sometimes it doesn't work. I'll like to use something or someone's service to do this automatically. I have tried some services like Soocial, but it gives me a lot of trouble after the first sync, because soccial can ONLY get ALL your contacts, not just "My Contacts"; and also it gives me like 100 bad contacts in outlook because of their beta client. The final goal of all of this is to Get only "My Contacts" from google in Outlook and in the 5800 with their images Get ALL my contacts with their default image, meaning, the contact's personal image Get a solution to correctly sync the three of them, using Google's as the base for the rest of them. Thanks in advance. Again, feel free to sugest me solutions to just one or all them.

    Read the article

  • .Net website create directory to remote server access denied

    - by tmfkmoney
    I have a web application that creates directories. The application works fine when creating a directory on the web server, however, it does not work when it tries to create a directory on our remote fileserver. The fileserver and the webserver are in the same domain. I have created a local user in our domain, "DOMAIN\aspnet". The local user is on both servers. I am running my .Net app pool under the domain user. I have also tried using windows impersonate in the web.config to run under the domain user. I have verified that the domain user has full control to the remote directory. In an effort to debug this I have also given the "everyone" full control to the remote directory. In an effort to debug this I have also added the domain user to the administrators group. I have a simple .net test page on the web server to test this. Through the test page I am able to read the directory on the file server and get a list of everything in it. I am not able to upload files or to create directories on the file server. Here's code that works: var path = @"\\fileserver\images\"; var di = new DirectoryInfo(path); foreach (var d in di.GetDirectories()) { Response.Write(d.Name); } Here's code that doesn't work: path = Path.Combine(path, "NewDirectory"); Directory.CreateDirectory(path); Here's the error I'm getting: Access to the path '\fileserver\images\NewDirectory' is denied. I'm pretty stuck on this. Any ideas?

    Read the article

  • passenger and nginx ssl conf

    - by chief
    I am having some trouble with the nginx https setting in the nginx.conf file. server { listen 443; server_name domain.com; root /path/current/public/; passenger_enabled on; rails_env production; ssl on; ssl_certificate combined.crt; ssl_certificate_key key; When I attempt to open a page requiring https nginx throws a 404 error.

    Read the article

  • no internet when Share VPN connection via ICS in windows 7

    - by Hamid
    Hi I have internet via LAN, also i have VPN connection (OpenSky) When i connect to VPN, i have internet, but when i share it (using ICS) , I not have internet, but other people on my network can access to internet via my shared VPN connection What's problem ? Note: I doing this on windows 2003 and not have any problem

    Read the article

  • How to resolve %CommonProgramFiles%\system\

    - by Faisal
    I have a situation where I need to return a directory path by reading the registry settings. Registry value returns me a path in the format %CommonProgramFiles%\System\web32.dll while the consumer code is expecting it in the format C:\Program Files\Common Files\System\web32.dll How can I resolve such directory path in .net code?

    Read the article

  • Pass variable number of variables to a class in PHP

    - by user325282
    I need to pass a variable number of strings to instantiate different classes. I can always do a switch on the size of the array: switch(count($a)) { case 1: new Class(${$a[0]}); break; case 2: new Class(${$a[0]}, ${$a[1]}); break; etc... There has to be a better way to do this. If I have an array of strings ("variable1", "variable2", 'variable3", ...), how can I instantiate a Class without manually accounting for every possibility?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >