Daily Archives

Articles indexed Thursday June 17 2010

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

  • How do I get user input to refer to a variable in Python?

    - by somefreakingguy
    I would like to get user input to refer to some list in my code. I think it's called namespace? So, what would I have to do to this code for me to print whatever the user inputs, supposing they input 'list1' or 'list2'? list1 = ['cat', 'dog', 'juice'] list2 = ['skunk', 'bats', 'pogo stick'] x = raw_input('which list would you like me to print?') I plan to have many such lists, so a series of if...then statements seems unruly.

    Read the article

  • Drupal: cannot login with Safari !?!!

    - by Patrick
    hi, I've problems to access to drupal back-end from Safari. It is very strange, I can log-in in Firefox and Chrome but not in Safari. (www.website.com/?q=user) I've reset Safari, cleaned cache, history.. everything, the user and password are accepted, but I get access denied. (even if I login as administrator..) thanks

    Read the article

  • Irc server for ubuntu

    - by Ralphz
    The Ubuntu WIKI https://help.ubuntu.com/community/IrcServer it lists few IRC servers you can use in Ubuntu. My question is which one is you favorite one and more secure. I will also need one that will allow me to monitor rooms for regular expressions and run some scripts if regexp matches. Thanks

    Read the article

  • How to recover pixelated text from jpeg in photoshop?

    - by Chris Hil
    Hi there, I´ve got an jpeg image with text on it (badly scanned document), which is hardly readable. I have already played around with the sharpen filters, contrast, levels and the color replacement tool, with decent success. however my question is, what else can be done order to maximize the texts readablity? the picture is also somewhat noisy. Any help on this one would be greatly apreciated, since I absolutely need the images content.

    Read the article

  • How to prevent Spell checking code in MS Office?

    - by Aaron
    We use MS Office. Outlook for emails, Word for some documentation and I use OneNote a lot for my own note taking. What bugs me is when I drop some code or use key words or even camel case into these apps the spell checking picks them up and I have red squiggles everywhere. Ignore is pretty much useless, so either I have to turn off Spell Check altogether start adding these to the custom dictionary. What would be good is if I can use the Set Language function to mark a whole block of text to just not be spell checked. Has anyone found a nice solution to this or do you know of a blank dictionary is best to use? I found using "Mohawk" kind of does that... might just use that for now. Maybe create a macro to switch between them.

    Read the article

  • PlaySystemSound with mute switch on

    - by Sam V
    I know, I have to set the AudioSession to the 'playback' category, which allows audio even when the mute switch is on. This is what I do, but sound still gets muted when switch is on. UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,sizeof(sessionCategory), &sessionCategory); SystemSoundID soundID; NSString *path = [[NSBundle mainBundle] pathForResource:soundString ofType:@"wav"]; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path],&soundID); AudioServicesPlaySystemSound (soundID);

    Read the article

  • Public api to manage documents in Office Web apps

    - by Gregoire
    Is there any API or webservices that allows us to manage online Office web apps documents (on sky drive)? What I would like to do is to use this API (or webservice) in order to create some reports in excel format without the need to use the HTML table trick, neither to have the Excel Com components installed on my server.

    Read the article

  • Is it possible to connect slots of a model object to the GUI in QT4 -Designer?

    - by Robert0
    So I try to build a Model-View window using QTDesigner and C++. For that reason I created a QOBject derived class as my model. It provides slots and signals to access it like: setFileName(QString) or fileNameChanged(QString). I got a little into using signal drag and drop in QTDesigner and found it quite VA-Smalltalk-Like nice. After a while I was wondering if I could also connect my model to this. So is it possible to somehow introduce my model object into the Window/GUI and let QTDesigner connect signals and slots from the model object to the GUI. In essence: Write for me: connect( model, SIGNAL(fileNameChanged(QString)), ui->labelFn, SLOT(setText(QString))) connect( ui-textEdit2, SIGNAL(textChanged(QString)), model, SLOT(setFileName(QString))) Thanks for explaining

    Read the article

  • Run a form in another thread

    - by Smith
    i have five forms in my c# project. one host an httplistener that i want to run continionsly. when the listener gets a message, it passes it to a static class, which in turn calls the appropriate forms for another processing. is it possible that the static class calls the new form in a new thread? if so please help me out

    Read the article

  • Getting XML data from a external page and parsing it with PHP

    - by James P
    I'm trying to create a database of World of Warcraft gems. If I go to this page: http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items And go to View Source in Firefox, I see a tonne of XML data which is exactly what I want. I wrote up this quick script to try and parse some of it: <?php $gemUrls = array( 'Blue' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=blue&searchType=items', 'Red' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=red&searchType=items', 'Yellow' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=yellow&searchType=items', 'Meta' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=meta&searchType=items', 'Green' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=green&searchType=items', 'Orange' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=orange&searchType=items', 'Purple' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items', 'Prismatic' => 'http://www.wowarmory.com/search.xml?fl[source]=all&fl[type]=gems&fl[subTp]=purple&searchType=items' ); // Get blue gems $blueGems = file_get_contents($gemUrls['Blue']); $xml = new SimpleXMLElement($blueGems); echo $xml->items[0]->item; ?> But I get a load of errors like this: Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: Entity: line 20: parser error : xmlParseEntityRef: no name in C:\xampp\htdocs\WoW\index.php on line 19 Warning: SimpleXMLElement::__construct() [simplexmlelement.--construct]: if(Browser.iphone && Number(getcookie2("mobIntPageVisits")) < 3 && getcookie2( in C:\xampp\htdocs\WoW\index.php on line 19 I'm not sure what's wrong. I think file_get_contents() is bringing back data that isn't XML, maybe some Javascript files judging by the iPhone parts in the errors. Is there any way to just get back the XML from that page? Without any HTML or anything? Thanks :)

    Read the article

  • iPad to iPhone?

    - by Brodie4598
    Hello - I have written a tab based iPad application which has done well. I never intended for it to be an iPhone application because the content it displays really doesnt lend itself to such a small screen. However, I have been getting a lot of requestes for the application to be compatible with iPhones as well. Can someone point me in the direction of some documentation that may help me figure out how to convert my app. I presume it's not so simple as having aanother set of XIB files for iPhone and just have it display them if the app is running on a phone...

    Read the article

  • Postfix Inbound/Outbound Gateway for Google Apps

    - by geofflee
    I currently have a Postfix/Dovecot setup, but our server is hitting capacity, so we decided to switch to Google Apps. However, we have certain web applications that need to send and receive e-mail directly (for example, e-mail being redirected to a script). What I want to do is host certain e-mail accounts with Google Apps, while my current server continues to manage other e-mail accounts. I assume this means that I would use my current server as an Inbound/Outbound Gateway, so my questions are: 1) How do I setup Postfix as an Outbound Gateway without making it an (insecure) open relay? 2) How do I setup Postfix as an Inbound Gateway so that only certain e-mail addresses are forwarded to Google Apps? Thank you!

    Read the article

  • Which FTP Daemon should I use if I want to use MySQL for authentication?

    - by wag2639
    We want to set up a FTP Daemon on our Ubuntu 10.04 server that can use a simple (probably custom) built web interface for a FTP server using MySQL for authentication. It'll be public facing but only intended for use by a few customers or clients. I know vsftpd, ProFTPd, and Pure-FTPd but I'm not sure which is best for this application. Main features we would like: a. Very good MySQL authentication integration b. Able to specify a list folders/files (folder level is sufficient) each user has access to through MySQL Anything else would just be sprinkles on top.

    Read the article

  • secure data transport between web server and database server

    - by atypicalgeek
    I asked this question in stackoverflow and it was suggested to try here so here goes... I'm planning on provisioning a web server and database server in a server farm environment. They will be in the same network but not in the same domain, both windows server 2008 and the database server is sql server 2008. My question being, what is the best way to secure data in transport between the servers? I've looked into IPSEC and SSL but not sure how to go about implementing either.

    Read the article

  • Home Network Speed Control

    - by DanSpd
    I have a home network installed in following way: Internet<-server<-switch<-computers,etc Server has DHCP server installed and I would like to be able to limit download&upload speed for each client connected to server via switch. Anyone can suggest good free software to do that? Thanks

    Read the article

  • Optimising Database Calls

    - by Dwaine Bailey
    I have a database that is filled with information for films, which is (in turn) read in to the database from an XML file on a webserver. What happens is the following: Gather/Parse XML and store film info as objects Begin Statement For every film object we found: Check to see if record for film exists in database If no film record, write data for film Commit Statement Currently I just test for the existence of a film using (the very basic): SELECT film_title FROM film WHERE film_id = ? If that returns a row, then the film exists, if not then I need to add it... The only problem is, is that there are many many hundreds of records in the database (lots of films!) and because it has to check for the existence of a film in the database before it can write it, the whole process ends up taking quite a while (about 27 seconds for 210 films) Is there a more efficient method of doing this, or just any suggestions in general? Programming Language is Objective-C, database is in sqlite3 Thanks, Dwaine

    Read the article

  • hi all here is another problem of Ajax , strange but ...

    - by Dumbledore of flash
    when i put ajax on my code I send a group of variable via post but when i received the data it is in a obj.responseText ie TEXT format. say i have two files "form.php" and "index.php" ajax is implemented in form.php while index.php returns the text. but my problem is index.php also generates a variable named "tarriff_count" i want to catch systematically and separately this variable, Is there any systematic way to catch variable.also keep in mind "obj.responseText" is very complicated to get a variable from "preg_match" ?

    Read the article

  • Javascript Closures - What are the negatives?

    - by vol7ron
    Question: There seem to be many benefits to Closures, but what are the negatives (memory leakage? obfuscation problems? bandwidth increasage?)? Additionally, is my understanding of Closures correct? Finally, once closures are created, can they be destroyed? I've been reading a little bit about Javascript Closures. I hope someone a little more knowledgeable will guide my assertions, correcting me where wrong. Benefits of Closures: Encapsulate the variables to a local scope, by using an internal function. The anonymity of the function is insignificant. What I've found helpful is to do some basic testing, regarding local/global scope: <script type="text/javascript"> var global_text = ""; var global_count = 0; var global_num1 = 10; var global_num2 = 20; var global_num3 = 30; function outerFunc() { var local_count = local_count || 0; alert("global_num1: " + global_num1); // global_num1: undefined var global_num1 = global_num1 || 0; alert("global_num1: " + global_num1); // global_num1: 0 alert("global_num2: " + global_num2); // global_num2: 20 global_num2 = global_num2 || 0; // (notice) no definition with 'var' alert("global_num2: " + global_num2); // global_num2: 20 global_num2 = 0; alert("local_count: " + local_count); // local_count: 0 function output() { global_num3++; alert("local_count: " + local_count + "\n" + "global_count: " + global_count + "\n" + "global_text: " + global_text ); local_count++; } local_count++; global_count++; return output; } var myFunc = outerFunc(); myFunc(); /* Outputs: ********************** * local_count: 1 * global_count: 1 * global_text: **********************/ global_text = "global"; myFunc(); /* Outputs: ********************** * local_count: 2 * global_count: 1 * global_text: global **********************/ var local_count = 100; myFunc(); /* Outputs: ********************** * local_count: 3 * global_count: 1 * global_text: global **********************/ alert("global_num1: " + global_num1); // global_num1: 10 alert("global_num2: " + global_num2); // global_num2: 0 alert("global_num3: " + global_num3); // global_num3: 33 </script> Interesting things I took out of it: The alerts in outerFunc are only called once, which is when the outerFunc call is assigned to myFunc (myFunc = outerFunc()). This assignment seems to keep the outerFunc open, in what I would like to call a persistent state. Everytime myFunc is called, the return is executed. In this case, the return is the internal function. Something really interesting is the localization that occurs when defining local variables. Notice the difference in the first alert between global_num1 and global_num2, even before the variable is trying to be created, global_num1 is considered undefined because the 'var' was used to signify a local variable to that function. -- This has been talked about before, in the order of operation for the Javascript engine, it's just nice to see this put to work. Globals can still be used, but local variables will override them. Notice before the third myFunc call, a global variable called local_count is created, but it as no effect on the internal function, which has a variable that goes by the same name. Conversely, each function call has the ability to modify global variables, as noticed by global_var3. Post Thoughts: Even though the code is straightforward, it is cluttered by alerts for you guys, so you can plug and play. I know there are other examples of closures, many of which use anonymous functions in combination with looping structures, but I think this is good for a 101-starter course to see the effects. The one thing I'm concerned with is the negative impact closures will have on memory. Because it keeps the function environment open, it is also keeping those variables stored in memory, which may/may not have performance implications, especially regarding DOM traversals and garbage collection. I'm also not sure what kind of role this will play in terms of memory leakage and I'm not sure if the closure can be removed from memory by a simple "delete myFunc;." Hope this helps someone, vol7ron

    Read the article

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