Daily Archives

Articles indexed Wednesday June 2 2010

Page 29/120 | < Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >

  • Can I programmatically find out if a drive is in use?

    - by Geo
    Is there any way of programmatically finding out if a mapped drive is currently in use? If I try to unmount the drive with net use, and the drive is being used, it will tell me that the drive is in use and prompt me to take further action. I'd like to be able to unmap drive automatically if it's no longer being used. The system is a Windows XP.

    Read the article

  • MySQL Create tables without commiting current transaction

    - by user276648
    I'd like my program to be able to install plugins, and rollback all the changes made if an error occurs. So I create a transaction that keeps all the things that were added while installing the plugin. The problem is that the plugin may want to create tables, and doing so automatically commits the current transaction in MySQL. See Statements That Cause an Implicit Commit on MySQL web site. Any idea on how I could do it? I thought of using temporary tables as they are not automatically commited, unless they are using too much memory, but it looks like temporary tables cannot be rolled back anyway (and I haven't found a way to convert them to permanent tables). I just found out about "save points" (http://dev.mysql.com/doc/refman/5.1/en/savepoint.html), but I don't really understand how/when it should be used nor if it can help me achieve what I want.

    Read the article

  • #validate does not seem to work correctly with :on => :create/:update

    - by Tobias
    Greetings, I have a custom validation in my exemplary Movie model: class Movie < ActiveRecord::Base validate :it, :on => :create private def it self.errors.add 'foo', 'bar' end end This works on movie creation but also on updating an existing movie. :on => :update will also work for both. Might that be a bug or am I missing something? Best regards Tobias

    Read the article

  • Create web page launcher, losing focus

    - by user356131
    I have created a php webpage. I now want to create a launcher application in android phone, it simply opens the browser with the url "http://<mywebsite>/m". I use uri intent to launch the browser in onCreate function. public void onCreate(...) { .... startActivity(new Intent(Intent.ACTION_VIEW, new Uri(http://<mywebsite>/m))); ... } I execute this program in my G1 phone (Cyan Mod 5). However, when I click the "Home" key, and then re-enter my application through Task list, I lose focus for my last started browser, and the screen blank Any suggestion?! Should I need any code in onResume function to re-focus my web!?

    Read the article

  • How do I decode this! It's not base64

    - by steve
    Here's what I know... this "GxvS117MfVw=" when decoded turns to "56699" now what does this "+sB6hF46GyU=" turn into "?????" Parentheses not included I tried base64 decoder and it doesn't seem to be right. It is supposed to be a number. I am not sure about the length, I don't think it should exceed 5 numbers. I would really appreciate it if you can decode it for me and show me how. Thank you!!

    Read the article

  • quartz 2d multiple UIViews

    - by coure06
    I want to create two UIViews in quartz 2D application. First UIView for static text, it will redraw automatically after each one second. Second UIView for animated text, it will be redrawn automatically after each .1 second. How can i create multiple Views/Layers? Is there drawRect methods will be different?

    Read the article

  • Experts help needed on libcurl programming in sending HTTP HEAD Request.

    - by Mani
    Hi all, I need clarifications on using libcurl for the following: I need to send an http HEAD request shown as below :: HEAD /mshare/3/30002:12:primary/stream_xNKNVH.mpeg HTTP/1.1 Host: 192.168.70.1:8080 Accept: */* User-Agent: Kreatel_IP-STB getcontentFeatures.dlna.org: 1 The code I wrote (shown below) , sends the HEAD Request in slightly different way: curl_global_init(CURL_GLOBAL_ALL); CURL* ctx = NULL; const char *url = "http://192.168.70.1:8080/mshare/3/30002:12:primary/stream_xNKNVH.mpeg" ; char *returnString; struct curl_slist *headers = NULL; ctx = curl_easy_init(); headers = curl_slist_append(headers,"Accept: /"); headers = curl_slist_append(headers,"User-Agent: Kreatel_IP-STB");\ headers = curl_slist_append(headers,"getcontentFeatures.dlna.org: 1"); headers = curl_slist_append(headers,"Pragma:"); headers = curl_slist_append(headers,"Proxy-Connection:"); curl_easy_setopt(ctx,CURLOPT_HTTPHEADER , headers ); curl_easy_setopt(ctx,CURLOPT_NOBODY ,1 ); curl_easy_setopt(ctx,CURLOPT_VERBOSE, 1); curl_easy_setopt(ctx,CURLOPT_URL,url ); curl_easy_setopt(ctx,CURLOPT_NOPROGRESS ,1 ); curl_easy_perform(ctx); curl_easy_cleanup(ctx); curl_global_cleanup(); The code shown above sends the HEAD Request in slightly different form (shown below) HEAD http://192.168.70.1:8080/mshare/3/30002:12:primary/stream_xNKNVH.mpeg HTTP/1.1 Host: 192.168.70.1:8080 Proxy-Connection: Keep-Alive Accept: */* User-Agent: Kreatel_IP-STB getcontentFeatures.dlna.org: 1 Can any one , share the appropriate code ?

    Read the article

  • PHP: read all files but randomly?

    - by mathiregister
    hi there, i wonder if there's a way of reading a directory in a random order. With the following code i'm running through the directory thumbs and it's printing images on my website. However, they are always read alphabetically and i wonder if there's a way in doing this randomly? <?php $path = 'thumbs'; if ($handle = opendir($path)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && $file != '.DS_Store' && $file != 'Thumbs.db') { print "<img class='thumb' src='$path/$file'/>"; } else { //no proper file } } closedir($handle); } ?> thank you for your suggestions! regards

    Read the article

  • EXEC_BAD_ACCESS error comes in my applicatoin in iphone

    - by Jaimin
    when i print dictionary i got this error.. here my dictTf is mutabledictionay.. when i m in home page i selct few fields and click find. so new view comes with the result.. now i go back and again click find without changing anything.. now comes proper.. now at this moment when i go back it shows this in the dictionay and EXEC_BAD_ACCESS eror comes... Printing description of dictTf: The program being debugged was signaled while in a function called from GDB. GDB has restored the context to what it was before the call. To change this behavior use "set unwindonsignal off" Evaluation of the expression containing the function (CFShow) will be abandoned. The program being debugged was signaled while in a function called from GDB. GDB has restored the context to what it was before the call. To change this behavior use "set unwindonsignal off" Evaluation of the expression containing the function (CFShow) will be abandoned. (gdb)

    Read the article

  • LINQ-SQL Updating Multiple Rows in a single transaction

    - by RPM1984
    Hi guys, I need help re-factoring this legacy LINQ-SQL code which is generating around 100 update statements. I'll keep playing around with the best solution, but would appreciate some ideas/past experience with this issue. Here's my code: List<Foo> foos; int userId = 123; using (DataClassesDataContext db = new FooDatabase()) { foos = (from f in db.FooBars where f.UserId = userId select f).ToList(); foreach (FooBar fooBar in foos) { fooBar.IsFoo = false; } db.SubmitChanges() } Essentially i want to update the IsFoo field to false for all records that have a particular UserId value. Whats happening is the .ToList() is firing off a query to get all the FooBars for a particular user, then for each Foo object, its executing an UPDATE statement updating the IsFoo property. Can the above code be re-factored to one single UPDATE statement? Ideally, the only SQL i want fired is the below: UPDATE FooBars SET IsFoo = FALSE WHERE UserId = 123 EDIT Ok so looks like it cant be done without using db.ExecuteCommand. Grr...! What i'll probably end up doing is creating another extension method for the DLINQ namespace. Still require some hardcoding (ie writing "WHERE" and "UPDATE"), but at least it hides most of the implementation details away from the actual LINQ query syntax.

    Read the article

  • Django and Google App Engine Helper not finding the ipaddr module.

    - by Phil
    I'm trying to get Django running on GAE using this tutorial. When I run python manage.py runserver I get the stacktrace below. I'm new to both django and python so I don't know what my next steps are (This is Ubuntu Jaunty btw). It seems django isn't finding the GAE module ipaddr which comes with SDK 1.3.1. How do I get django to find this module? /home/username/bin/google_appengine/google/appengine/api/datastore_file_stub.py:40: DeprecationWarning: the md5 module is deprecated; use hashlib instead import md5 /home/username/bin/google_appengine/google/appengine/api/memcache/__init__.py:31: DeprecationWarning: the sha module is deprecated; use the hashlib module instead import sha Traceback (most recent call last): File "manage.py", line 18, in <module> InstallAppengineHelperForDjango() File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 543, in InstallAppengineHelperForDjango InstallDjangoModuleReplacements() File "/home/username/Development/GAE/myapp/appengine_django/__init__.py", line 260, in InstallDjangoModuleReplacements import django.db File "/home/username/Development/GAE/myapp/django/db/__init__.py", line 57, in <module> 'TIME_ZONE': settings.TIME_ZONE, File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 117, in __init__ self._setup_stubs() File "/home/username/Development/GAE/myapp/appengine_django/db/base.py", line 128, in _setup_stubs from google.appengine.tools import dev_appserver_main File "/home/username/bin/google_appengine/google/appengine/tools/dev_appserver_main.py", line 82, in <module> from google.appengine.tools import appcfg File "/home/username/bin/google_appengine/google/appengine/tools/appcfg.py", line 53, in <module> from google.appengine.api import dosinfo File "/home/username/bin/google_appengine/google/appengine/api/dosinfo.py", line 25, in <module> import ipaddr ImportError: No module named ipaddr

    Read the article

  • UITableViewCell indentation not in edit mode.

    - by Eric P.
    When you enter editing mode on a grouped-style UITableView, the cells indent to show the editing control (if you aren't sure what I mean, see this picture (editing mode) http://i.imgur.com/GJXvL.png and this (non-editing mode) http://i.imgur.com/ahKYS.png). I am trying to manually indent a cell when the tableView is not in editing mode. I tried the indentationLevel property, but that just moves the text further to the right inside the cell and doesn't actually change the cell. Any ideas?

    Read the article

  • Scheduled task username changed

    - by Ernst
    Hi, I created a user on our exchange server, but later changed the username. Now, when I create a scheduled task for that user, and change it's settings (run only when logged on), the username is automatically changed back to the old username. What's causing this and how do I make sure the correct, new username is used for the task (otherwise it won't run), security settings are okay. I did already log in with a different user to delete the profile on the computer and tried again with this user to no avail. The OS is windows xp, the exchange server is on windows server 2003. Thanks

    Read the article

  • Is incrementing in a loop exponential time?

    - by user356106
    I've a simple but confusing doubt about whether the program below runs in exponential time. The question is : given a +ve integer as input, print it out. The catch is that you deliberately do this in a loop, like this: int input,output=0; cininput; while(input--) ++output; // Takes time proportional to the value of input cout<< output; I'm claiming that this problem runs in exponential time. Because, the moment you increase the # of bits in input by 1, the program takes double the amount of time to execute. Put another way, to print out log2(input) bits, it takes O(input) time. Is this reasoning right?

    Read the article

  • Data not displayed first time in android after copying the file from assets to data folder

    - by Thinkcomplete
    Description I have used the code tip from http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/ to copy a pre-filled data file to the target and handled this in a asynch task Problem : On starting the application it gives error and shuts down first time, starting again without any change it works perfectly fine. So first time after the file is copied, the error comes but after that no issues. Please help Code attached:.. private class CopyDatabase extends AsyncTask<String, Void, Boolean> { private final ProgressDialog dialog = new ProgressDialog(BabyNames.this); protected void onPreExecute() { this.dialog.setMessage("Loading..."); this.dialog.show(); } @Override protected Boolean doInBackground(String... params) { // TODO Auto-generated method stub try { namesDBSQLHelper.createDatabase(); return null; } catch(IOException ioe){ ioe.printStackTrace(); } return null; } protected void onPostExecute(final Boolean success){ if (this.dialog.isShowing()){ this.dialog.dismiss(); } } }

    Read the article

  • Banshee for MeeGo

    <b>Aaron Bockover:</b> "After lots of intense work and collaboration, the Netbook profile for MeeGo 1.0 has been released today. As such, I am particularly pleased to announce in conjunction that Banshee is the default and integrated media player for MeeGo."

    Read the article

  • Exporting Environment Variables in Ubuntu Linux

    - by stanigator
    I know many people have asked about environment variables before, but I am having a hard time dealing with these paths while ensuring I don't mess around with the original settings. How would you go about executing these commands in Ubuntu in terms of environment variables? Thanks in advance! Please put /home/stanley/Downloads/ns-allinone-2.34/bin:/home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/unix:/home/stanley/Downloads/ns-allinone-2.34/tk8.4.18/unix into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph. IMPORTANT NOTICES: (1) You MUST put /home/stanley/Downloads/ns-allinone-2.34/otcl-1.13, /home/stanley/Downloads/ns-allinone-2.34/lib, into your LD_LIBRARY_PATH environment variable. If it complains about X libraries, add path to your X libraries into LD_LIBRARY_PATH. If you are using csh, you can set it like: setenv LD_LIBRARY_PATH If you are using sh, you can set it like: export LD_LIBRARY_PATH= (2) You MUST put /home/stanley/Downloads/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental variable. Otherwise ns/nam will complain during startup.

    Read the article

  • Error burning DVD using Devede on Ubuntu 9.04

    - by tim-myers
    I'm trying to burn a DVD in DeVeDe under ubuntu -- on my computer it's already in DVD format (a VIDEO_TS folder) but when I try and drag it into DeVeDe it says "Some files weren't video files. None added." From looking at it, all the files look like they belong there, just from doing this a few times already and seeing all the files contained in a DVD. The file extensions in the folder are: VOB BUP IFO and the files are all named like VTS_02_1.VOB. I have tried excluding the IFO files when dragging them into DeVeDe but get the same error. Is the problem in the types of files in the DVD data or is the DVD corrupt?

    Read the article

  • win 7 back up utility cant detect external drive on a netbook

    - by decoder101
    im trying to image a new HP netbook via the windows 7 BACK UP util. however, it doesnt detect the external drive, although it's seen in my computer and BIOS. i tried using HP recovery manager with recovery disc creation but it says, no burning device installed although there is one... anyone successful in using the win7 back up utility? ive been tinkering this for a while but i cant make it right using an external dvd drive. unless i'll plug in an external hdd/

    Read the article

  • Weird behaviour with optparse and bash tab completion

    - by PulpFiction
    Hi I am building a script for users new to Linux, so please understand why I am asking this :) My script runs like this: python script.py -f filename.txt I am using the optparse module for this. However, I noticed the following when doing tab completion. The tab completion works when I do: python script.py <tab completion> # Tab completion works normally as expected But it does not work when I do it like this: python script.py -f <tab completion> # No type of tab completion works here. I really don't want my users typing the name of the input file. Tab completion is a must. How can I get it working or what am I doing wrong here?

    Read the article

  • how to make a explorer like logic in Obj C for iphone

    - by Ekra
    Hi friends, To make the query simple first we can take example:- If we open the explorer in our Windows desktop how it shows us the tree. As we keep on clicking the tree it get expanded and shows the file in it. The same way I want to show a explorer which gets expanded as the user clicks on it(I want to get the business logic the UI is simple). The information of the explorer i.e. which folder has what files come in a XML format to me. I have 2 options of getting the XML either I can get the whole XML at one query(but I guess this might slow the application if the XML is quite big). OR I can get the XML for every list like first only the root structure then if user clicks on any folder in root I can get the list(the files or folders inside that folder) of that particular folder. Now the question is What would be the approach to implement both the method and which would be the best. Should I need to create some dictionary to maintain the link of the files like which file is inside what. I am not able to get as how I would be able to link all the files. Any hint or direction would be highly appreciated. Thanks in advance

    Read the article

  • background image preload

    - by Bharanikumar
    Shall i use below snippet for preload background images, or else is there any snippet there , function preload(images) { if (document.images) { var i = 0; var imageArray = new Array(); imageArray = images.split(','); var imageObj = new Image(); for(i=0; i<=imageArray.length-1; i++) { //document.write('<img src="' + imageArray[i] + '" />');// Write to page (uncomment to check images) imageObj.src=images[i]; } } }

    Read the article

< Previous Page | 25 26 27 28 29 30 31 32 33 34 35 36  | Next Page >