Daily Archives

Articles indexed Monday January 17 2011

Page 10/36 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Custom Annotation not showing all

    - by funatsg
    Okay, i have a number of pins on the mapkit. These pins showing different types of attractions. (E.g Parks, Farms and etc) I want to add custom images for these different types of pin. Parks have a park image and vice versa. However, when i added in, not all the images are showing successfully. For example, in parks, it should have 5 pins, but the image only came up in 2 pins, whereas other 3 is in default red pins. But if i used colours to differentiate them. For example, [pinsetPinColor:MKPinAnnotationColorGreen]; It works! Anyone knows what is the problem? Relevant codes below. Tell me if you need more. thanks! - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation{ if ([annotation isKindOfClass:MKUserLocation.class]) { //user location view is being requested, //return nil so it uses the default which is a blue dot... return nil; } //NSLog(@"View for Annotation is called"); MKPinAnnotationView *pin=[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:nil]; pin.userInteractionEnabled=TRUE; MapEvent* event = (MapEvent*)annotation; NSLog(@"thetype: %@", event.thetype); if ([event.thetype isEqualToString:@"adv"]) { //[pin setPinColor:MKPinAnnotationColorGreen]; pin.image = [UIImage imageNamed:@"padv.png"]; } else if ([event.thetype isEqualToString:@"muse"]){ //[pin setPinColor:MKPinAnnotationColorPurple]; pin.image = [UIImage imageNamed:@"pmuse.png"]; } else if ([event.thetype isEqualToString:@"nightlife"]){ pin.image = [UIImage imageNamed:@"pnight.png"]; } else if ([event.thetype isEqualToString:@"parks"]){ pin.image = [UIImage imageNamed:@"ppark.png"]; } else if ([event.thetype isEqualToString:@"farms"]){ pin.image = [UIImage imageNamed:@"pfarm.png"]; } else { [pin setPinColor:MKPinAnnotationColorRed]; } pin.canShowCallout = YES; pin.animatesDrop = YES; UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; [rightButton addTarget:self action:@selector(clickAnnotation:) forControlEvents:UIControlEventTouchUpInside]; [rightButton setTitle:event.uniqueID forState:UIControlStateNormal]; pin.rightCalloutAccessoryView = rightButton; return pin; }

    Read the article

  • GWT: creating a text widget for highly customized data entry

    - by Caffeine Coma
    I'm trying to implement a kind of "guided typing" widget for data entry, in which the user's text entry is highly controlled and filtered. When the user types a particular character I need to intercept and filter it before displaying it in the widget. Imagine if you will, a Unix shell embedded as a webapp; that's the kind of thing I'm trying to implement. I've tried two approaches. In the first, I extend a TextArea, and add a KeyPressHandler to filter the characters. This works, but the browser-provided spelling correction is totally inappropriate, and I don't see how to turn it off. I've tried: DOM.setElementProperty(textArea.getElement(), "spellcheck", "false"); But that seems to have no effect- I still get the red underlines over "typos". In the second approach I use a FocusWidget to get KeyPress events, and a separate Label or HTML widget to present the filtered characters back to the user. This avoids the spelling correction issue, but since the FocusWidget is not a TextArea, the browser tends to intercept certain typed characters for internal use; e.g. FireFox will use the "/" character to begin a "Quick Find" on the page, and hitting Backspace will load the previous web page. Is there a better way to accomplish what I'm trying to do?

    Read the article

  • Avoid slowdowns while using off-site database

    - by Anders Holmström
    The basic layout of my problem is this: Website (ASP.NET/C#) hosted at a dedicated hosting company (location 1) Company database (SQL Server) with records of relevant data (location 2). Location 1 & 2 connected through VPN. Customer visiting the website and wanting to pull data from the company database. No possibility of changing the server locations or layout (i.e. moving the website to an in-office server isn't possible). What I want to do is figure out the best way to handle the data acces in this case, minimizing the need for time-expensive database calls over the VPN. The first idea I'm getting is this: When a user enters the section of the website needing the DB data, you pull all the needed tables from the database into a in-memory dataset. All subsequent views/updates to the data is done on this dataset. When the user leaves (logout, session timeout, browser closed etc) the dataset gets sent to the SQL server. I'm not sure if this is a realistic solution, and it obviously has some problems. If two web visitors are performing updates on the same data, the one finishing up last will have their changes overwriting the first ones. There's also no way of knowing you have the latest data (i.e. if a customer pulls som info on their projects and we update this info while they are viewing them, they won't see these changes PLUS the above overwriting issue will arise). The other solution would be to somehow aggregate database calls and make sure they only happen when you need them, e.g. during data updates but not during data views. But then again the longer a pause between these refreshing DB calls, the bigger a chance that the data view is out of date as per the problem described above. Any input on the above or some fresh ideas would be most welcome.

    Read the article

  • What is the right method for parsing a blog post?

    - by Zedwal
    Hi guys, Need a guide line .... I am trying to write a personal blog. What is the standard structure for for input for the post. I am trying the format like: This is the simple text And I am [b] bold text[/b]. This is the code part: [code lang=java] public static void main (String args[]) { System.out.println("Hello World!"); } [/code] Is this the right way to store post in the database? And What is the right method to parse this kind of post? Shall I use regular expression to parse this or there is another standard for this. If the above mentioned format is not the right way for storage, then what it could be? Thanks

    Read the article

  • SQL Server Instance login issue

    - by reallyJim
    I've just brought up a new installation of SQL Server 2008. I installed the default instance as well as one named instance. I'm having a problem connecting to the named instance from anywhere besides the server itself with any user besides 'sa'. I am running in mixed mode. I have a login/user that has a known username. Using that user/login, I can properly connect when directly on the server. When I attempt to login from anywhere else, I recieve a "Login failed for user ''", with Error 18456. In the log file in the server, I see a reason that doesn't seem to help: "Reason: Could not find a login matching the name provided.". However, that user/login DOES exist, as I can use it locally. There are no further details about the error. Where can I start to find something to help me with this? I've tried deleting and recreating the user, as well as just creating a new one from scratch--same result, locally fine, remotely an error. EDIT: Partially Resolved. I'm now passed the base issue--the clients were trying to connect via the default instance. I don't know why. So, once proper ports were opened in the firewall, and a static port assigned to the named instance, I can now connect--BUT ONLY if I specify the connection as Server,Port. SQLBrowser is apparently not helping/working in this case. I've verified it IS running, and done a stop/restart after my config changes, but no difference yet.

    Read the article

  • How to make the ec2 ami work on the Xen on Debian

    - by user67103
    Hi. Here is the scenario. We are creating a cloud App. We have a Debian on which we create a customized image and upload it to the Amazon EC2. After uploading it to the cloud we have made some more customizations and are trying to rebundle it. We are facing some issues in rebundling it. We would like to know if we could do something like this. a. Create an AMI Image on Debian b. Load it on to the Xen Hypervisor which would be over the Debian c. Customize the image d. Save the customized image e. Upload it to EC2. The issue is that I am unable to find a proper solution on how to install Xen on Debian and will the AMI on Xen work on EC2. Any suggestions/Help would be greatly appreciated. thanks. Krishna

    Read the article

  • correct format for datetime appended to filename

    - by jhayes
    I'm trying to setup a batch file to execute a set of stored procs and dump the output to a timestamped text file. I'm having problems finding the correct format for the timestamp. Here is what I'm using osql.exe -S <server> -E -Q "EXEC <stored procedure> " -o "c:\filename_%date:~-0,10%_%time:~-0,10%.txt" The error I get is: Cannot open output file - x:\filename_Thu 06/25/_16:26:43.1.txt No such file or directory I can't find the documentation and I've played around with it but can't find the correct format.

    Read the article

  • How to find what files / directories are not copied yet?

    - by user8676
    Hi all, I found the following 'nice' situation: An archive of few disks (actually three disks) which has a bunch of photos (more or less) organized. Well, this is good. A big disk shared on a network which has a bunch of photos which has another folder structure (even if is somewhat recognizable for a human being) than the archive described above, but some of the files on this big network share are the same with the files from the archive. Well, this is bad. What we need is to move the different (new) files from the network share in the archive (perhaps we'll use for this a new disk added to archive). The program that we need is different from a regular File Duplicate Finder program because usually the File Duplicate Finder finds the duplicates from all sources comparing each file with another. We want to find the differences between the two sources. It is fine for us to have a report generated in text file which after this we'll use to do our move. A Windows solution will be preferred. Any ideas? TIA

    Read the article

  • Windows 7 trying to turn off UAC every time Windows starts

    - by Mehper C. Palavuzlar
    I have strange problem on my HP laptop. This began to happen recently. Whenever I start my machine, Windows 7 Action Center displays the following warning: You need to restart your computer for UAC to be turned off. I never disable UAC, but obviously some process or virus (I'm not sure, only guessing) causes this. As soon as I get this warning, I head for the UAC settings, and re-enable UAC to dismiss this warning. This is a bothersome situation as I really don't know what causes the problem. I have run a full scan on the computer for any probable virus activity, but TrendMicro OfficeScan said that no viruses have been found. There are no other strange incidents on the machine. Everthing works fine except this bizarre incident. How can I learn what process is trying to turn off UAC? What way should I follow to overcome this problem?

    Read the article

  • Low 'Burst Rate' from SATA drive in HDTune?

    - by UpTheCreek
    I recently upgraded my laptop's v slow hard drive to a seagate momentus 7200. Everything is working fine, but I'm a bit confused by these benchmark results: The burst rate is significantly less than the Maximim transfer rate, and not much higher than the normal minimum (if you ignore the spikes). What's going on here? On the HDtune website it defines Burst Rate as: ...the highest speed (in megabytes per second) at which data can be transferred from the drive interface (IDE or SCSI for example) to the operating system. Which begs some questions... e.g. if this is the highest, then how did the bechmarking tool record the 103MB/sec maximum? And if this really is the true maximum, then where is the bottleneck? The laptops SATA interface is on an Intel 82801GBM southbridge controller. When I check in hardware manager, I see that it's driver is iaStor.sys from 2005. Maybe that's the issue? I'll look for a newever version, but any insights would be appreciated. Thanks UPDATE: Acorting to this page on the HDTune website... An important parameter of the test is the Burst Rate. This value should always be higher than the maximum transfer rate. A lower value is usually an indication of a configuration problem. So what might be the configuration problem?

    Read the article

  • Missing time zones in OSX and Windows

    - by pellepim
    I am working on a javascript to automatically detect a user's timezone (https://bitbucket.org/pellepim/jstimezonedetect/). But there are two timezones that I have a really hard time to test, since I can not set my system to observe these timezones. The timezones I am talking about are UTC+1245 (Chatham Islands, NZ) and UTC+0845 (Australia/Eucla). As far as I can tell in OSX (Snow Leopard) and in Windows 7 these timezones do not exist as a setting. Granted, very few people live in these areas, and it might just not be worth it. Does anyone know of a way to set these timezones on a system level? In any operating system? If it is not possible in a trivial way, what do people who live in these areas do to get their systems working as they would like?

    Read the article

  • Toutes les semaines un peu de code pour aller plus loin avec Windows 7, La session des services Windows

    En cette fin d'année, la communauté de Developpez.com s'est alliée avec Microsoft France pour relayer une série de questions / réponses sur le développement Windows 7. A partir d'aujourd'hui, nous poserons une question chaque lundi sur une fonctionnalité propre au développement d'applications Windows 7. La bonne réponse de la question de la semaine sera ensuite dévoilée la semaine suivante avec un exemple de mise en pratique. Êtes-vous prêt à relever le défi ? Pensez-vous bien connaître les possibilités que proposent les API Windows 7 ? C'est ce que nous allons voir dès aujourd'hui, nous attendons vos propositions ! La réponse de la semaine : Dans quelle session tournent les ...

    Read the article

  • In SQLCMD mode, should CONNECT be an implicit batch separator?

    - by Greg Low
    Hi Folks, I've been working with SQLCMD mode again today and one thing about it always bites me. If I execute a script like: ::CONNECT SERVER1 SELECT @@VERSION; ::CONNECT SERVER2 SELECT @@VERSION; ::CONNECT SERVER3 SELECT @@VERSION; I'm sure I'm not the only person that would be surprised to see all three SELECT commands executed against SERVER3 and none executed against SERVER1 or SERVER2. If you think that's odd behavior, here's where to vote: https://connect.microsoft.com/SQLServer/feedback/details/611144/sqlcmd-connect-to-a-different-server-should-be-an-implicit-batch-separator#detail...(read more)

    Read the article

  • Using a GPL licensed library in a commercial app

    - by user577616
    I develop an android application and in my app I use a libary (jar) that I download from the internet. This jar is open-source under the "GNU General Public License v2". I tried to read the text of the license but had difficulty understanding it. My question is: can I use this libary without changing nothing in the jar in a commercial application? I will be making profit from selling my app which uses this GPL-ed .jar file. If possible, I would like to avoid converting my application to open-source.

    Read the article

  • Core i7 with 4GB - go 64 bit or stay 32bit..?

    - by tommed
    I have a Core i7 laptop with 4gb ram. In windows, the disadvantage of using the 32bit OS would be that a single app could not use more than 2gb of ram (+ the 2gb shared kernel-space memory) except when setting a boot switch which reduces the amount of shared kernel memory, then it's 3GB max per app. What disadvantages/limitations would I have in Ubuntu for sticking to the 32bit OS? (If any?) - As I only have 4GB of ram, I can't see why I need to use the 64bit version?

    Read the article

  • Why can't i ping server? VMware set to 'Bridged' loses IP address on 10.04.

    - by Dave
    I have installed a fresh 10.04 server onto a laptop on a home network as a VMware machine and set network connection to 'Bridged: connect directly to the physical network' from within VMware and rebooted the server. It then loses its IP address. 'dhclient eth0' says "No working leases in persistent database - sleeping" DHCP is working fine on the wi-fi router. The laptop is wired to a wireless router and from there wirelessly to a desktop. Desktop and Laptop can ping each other from Windows. I can ping the VM from Windows on the same laptop, but not from the desktop. Strangely ping has started to resolve hostnames to IPv6 addresses and not IPv4. Don't know whether that's connected? A kick in the right direction would be greatly appreciated. I've been an Ubuntu desktkop user for a few years, but new to ubuntu servers.

    Read the article

  • PHP curl post to login to wordpress

    - by Sbad
    I am using php curl to login to wordpress behind-the-scenes as described here: Wordpress autologin using CURL or fsockopen in PHP However my script is not setting the cookies necessary to retain the wordpress session. Instead they are being sent back to my script and stored in cookies.txt. Both the curl script and the wordpress login are on the same server in different directories. Do I need to write another curl script to manually set the wordpress cookies? Is that possible?

    Read the article

  • SEO Language information

    - by Kevin
    I was wondering if defining your language in HTML is better for search enigines. For example, I've got a French site, then i've got three options: 1.) have faith that google can say my site is french 2.) define language in the HTML tag <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="fr"> 3.) define language in a meta tag <meta http-equiv="content-language" content="FR-fr" /> Which option you believe is best? Or which combination of options?

    Read the article

  • All numbers that are NOT in an array under 1000

    - by baklap
    Hi, I've got this programming problem. I have number for example 1000. Now I have a number in an array, like 999. Now I need to display all numbers that are NOT in the array but are 1 to 1000; The next requirement is essential: It has to be displayed in a way that it's easy to oversee. So I was thinking, lets show: 100 200 300 400 500 600 700 800 900 910 920 930 940 950 960 970 980 990 991 992 993 994 995 996 997 998 1000 What is the best way to start programming this?

    Read the article

  • How can I find which process has opened a specific file?

    - by Hosam Aly
    How can I find which processes have a specific file opened, and their open, access and share modes? Additionally, is it possible to change these values for a process? Or is it even possible to open a file for reading if it is already opened for exclusive access by another process? Please note that I don't want to invalidate the handle of the process having the file opened. I just want to be able to access the file (if possible). (I'm mainly asking about Windows, but solutions for other platforms are welcome, since they contribute to the community's knowledge.) Edit: I found some answers for my first question here and there. Edit 2: Thanks everybody for the tools you mentioned, but I am mainly looking for programmatical techniques (e.g. using Win32 APIs).

    Read the article

  • How can I disable 'output escaping' in minidom

    - by William
    I'm trying to build an xml document from scratch using xml.dom.minidom. Everything was going well until I tried to make a text node with a ® (Registered Trademark) symbol in. My objective is for when I finally hit print mydoc.toxml() this particular node will actually contain a ® symbol. First I tried: import xml.dom.minidom as mdom data = '®' which gives the rather obvious error of: File "C:\src\python\HTMLGen\test2.py", line 3 SyntaxError: Non-ASCII character '\xae' in file C:\src\python\HTMLGen\test2.py on line 3, but no encoding declared; see http://www.python.or g/peps/pep-0263.html for details I have of course also tried changing the encoding of my python script to 'utf-8' using the opening line comment method, but this didn't help. So I thought import xml.dom.minidom as mdom data = '&#174;' #Both accepted xml encodings for registered trademark data = '&reg;' text = mdom.Text() text.data = data print data print text.toxml() But because when I print text.toxml(), the ampersands are being escaped, I get this output: &reg; &amp;reg; My question is, does anybody know of a way that I can force the ampersands not to be escaped in the output, so that I can have my special character reference carry through to the XML document? Basically, for this node, I want print text.toxml() to produce output of &reg; or &#174; in a happy and cooperative way! EDIT 1: By the way, if minidom actually doesn't have this capacity, I am perfectly happy using another module that you can recommend which does. EDIT 2: As Hugh suggested, I tried using data = u'®' (while also using data # -*- coding: utf-8 -*- Python source tags). This almost helped in the sense that it actually caused the ® symbol itself to be outputted to my xml. This is actually not the result I am looking for. As you may have guessed by now (and perhaps I should have specified earlier) this xml document happens to be an HTML page, which needs to work in a browser. So having ® in the document ends up causing rubbish in the browser (® to be precise!). I also tried: data = unichr(174) text.data = data.encode('ascii','xmlcharrefreplace') print text.toxml() But of course this lead to the same origional problem where all that happens is the ampersand gets escaped by .toxml(). My ideal scenario would be some way of escaping the ampersand so that the XML printing function won't "escape" it on my behalf for the document (in other words, achieving my original goal of having &reg; or &#174; appear in the document). Seems like soon I'm going to have to resort to regular expressions! EDIT 2a: Or perhaps not. Seems like getting my html meta information correct <META http-equiv="Content-Type" Content="text/html; charset=UTF-8"> could help, but I'm not sure yet how this fits in with the xml structure...

    Read the article

  • How to use a dynamic smarty variable in foreach loop

    - by P Kumar
    Hi, Can anyone tell me how to use dynamic variables in smarty foreach loop. I am trying to create a module in prestashop and m very close to get it done. here's my code: //file name index.php foreach($subCategories as $s) { $foo = intval($s['id_category']); $k = new Category($foo); $var1 = "subSubCategories.$foo"; $var1 = $k-getSubCategories(1); $smarty-assign(array('foo'.$foo = $var1)); } //file name:index.tpl {assign var=foo value=$foo$cat} //where $cat is a variable that counts the number of categories {if isset($foo) AND $foo} {foreach from=$foo item=subCategories name=homesubCategories} <p>{$subCategories.name}</p> {/foreach} {else} <p>{l s='test failed'}</p> {/if} I've exhausted all of my resources and knowledge and feeling quite helpless at this moment. so plz help me out.

    Read the article

  • Can I reuse my existing TCP-Server?

    - by Helper Method
    At the moment I have an existing application which basically consists of a desktop GUI and a TCP server. The client connects to the server, and the server notifies the client if something interesting happens. Now I'm supposed to replace the desktop GUI by a web GUI, and I'm wondering if I have to rewrite the server to send http packets instead of tcp packets or if I can somehow use some sort of proxy to grab the tcp packets and forward them to the web client? Do I need some sort of comet server?

    Read the article

  • Inserting mutable pairs into a mutable list

    - by Romelus
    How can I push a mutable pair onto a stack such that i'm only creating one stack. I have some code that works but creates lists within lists within lists.... Here is what I believe should work but throws an error. (define func (arg1 arg2 arg3) // Where arg3 is an empty list (mappend (mcons arg1 arg2) arg3)) The above code complains and says: "mcar: expects argument of type ; given ... Can anyone show me how I can get a result that looks like so,: (list (arg1 arg2) (arg# arg#) ...)

    Read the article

  • How to delete data in DB efficiently using LinQ to NHibernate (one-shot-delete)

    - by kastanf
    Hello, producing software for customers, mostly using MS SQL but some Oracle, a decision was made to plunge into Nhibernate (and C#). The task is to delete efficiently e.g. 10 000 rows from 100 000 and still stay sticked to ORM. I've tried named queries - link already, IQuery sql = s.GetNamedQuery("native-delete-car").SetString(0, "Kirsten"); sql.ExecuteUpdate(); but the best I have ever found seems to be: using (ITransaction tx = _session.BeginTransaction()) { try { string cmd = "delete from Customer where Id < GetSomeId()"; var count = _session.CreateSQLQuery(cmd).ExecuteUpdate(); ... Since it may not get into dB to get all complete rows before deleting them. My questions are: If there is a better way for this kind of delete. If there is a possibility to get the Where condition for Delete like this: Having a select statement (using LinQ to NHibernate) = which will generate appropriate SQL for DB = we get that Where condition and use it for Delete. Thanks :-)

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >