Search Results

Search found 1411 results on 57 pages for 'wi fi'.

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

  • Issues with HP Mini 110-1125NR

    - by Guga Figueiredo
    Just finished installing Ubuntu 12.04 Precise Pangolin on my HP Mini 110-1125NR and im having small, but rather irritating issues. I installed it over the Windows 7 (starter) which came with the netbook. Firstly, it will only boot from the USB flashdisk. If i try to boot from the hardrive, it goes to a black screen. Second, built-in wireless wont activate. system says its enabled and on, but the light indicator is still orange (as if its off), and i cant get a signal from my home wi-fi I havent found any solved threads for inspiration, and mos of them are pretty old (1 year +) so i thought of giving a try to see if any of you guys System is: HP Mini 110-1100 1gb memory Intel Atom CPU N270 @ 1.60GHz x 2 Os - Precise Pangolin - Ubuntu 12.04 160gb Hard disk If any of you are aware of the solutions of my issues it'd be awesome Thanks in advance for any help!

    Read the article

  • Setting up wireless drivers in Ubuntu 9.10?

    - by xdya
    I've just installed ubuntu to a notebook, deleting the windows xp that was installed before, so now nothing works I couldn't solve the problem of getting the blank screen with the versions 12.. and 10.. so now there is 9.10 installed, which works fine. Well, it boots up at least. I can't get working the drivers though. I'm totally new to linux, and I've read in some forums that in this version you have to install all of them yourself, because the system won't detect them automatically. Therefore I tried to find the drive for my wireless card, but actually I have no clue how to get it work. Could someone please help me out? So here are the specs: System installed as mentioned: Ubuntu 9.10 Computer: Acer Aspire 3100 Wireless according to laptop specs: 10/100 Fast Ethernet, Wake-on-LAN ready, Acer InviLink™ 802.11b/g Wi-Fi CERTIFIED I would really appreciate some detailed description to setting up my internet Thanks!!

    Read the article

  • Big delay to open web pages on Ubuntu 11.10; also slow torrent client speed

    - by user54234
    The keywords for my issue are too common among other issues, so, I couldn't find anything that could answer me: why will it take around 30+ seconds for any of my browsers to open a page? happens even with google.com... with both Firefox and Chromium. This does not happen while I use Windows, from exactly the same point at my house (I've got enough wi-fi signal here for sure). Also, the standard torrent client won't hit the max download speed... I can hit 1 Mb/s with utorrent on Windows, and can't go over 300 kbps here. I tried changing the program settings, no results. Please help me. I REALLY don't wanna go back to Windows. Thanks in advance, I admire this community, and I'm sorry that I couldn't find something that could help me. I already solved a lot of issues without asking, but couldn't do it this time.

    Read the article

  • chrubuntu installation help

    - by Sir_Yoshi
    my friend loaned me his Acer c720 in order to load ubuntu on it. I have previously liberated my netbook and UMPC with Ubuntu but those where normal windows PCs. I have followed all the steps so far in order to enter developer mode yet at the login screen, when I type ctrl+alt+= (F2) nothing happens. the terminal should open up but it does not. Please help me, my friend bought this craptop but does not have wi-fi thus rendering it useless. P.S. how do you right click without an external mouse?

    Read the article

  • Microsoft déploie une mise à jour pour Windows Phone 8, qui apporterait des correctifs et quelques nouveautés pas encore définies

    Microsoft déploie une mise à jour pour Windows Phone 8 Portico apporterait de meilleures performances, des correctifs et quelques nouveautés Six semaines seulement après la sortie de Windows Phone 8, Microsoft serait déjà en cours de déploiement d'une mise à jour pour son OS mobile. Selon le site spécialisé WPCentral, les consommateurs européens utilisant les smartphones HTC 8X sont les premiers à avoir reçu cette mise jour. Baptisée officieusement « Portico », cette mise à jour apporte essentiellement des correctifs pour un problème de redémarrage aléatoire signalé par certains utilisateurs, et pour un bug qui empêchait la connexion Wi-Fi de persister après une mise en v...

    Read the article

  • C#: How to avoid WIA-error when scanning documents with 2400dpi or more?

    - by Stephan_W
    Hello, when we scan a document with a resolution of 2400dpi or higher, we recieve (for example) the following error-message: COMException: Ausnahme von HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED) or COMException: Ausnahme von HRESULT: 0x8021006F in one of the following lines img = itm.Transfer(scanFormat.ScanFormat) as WIA.ImageFile; img = ip.Apply(img as WIA.ImageFile); some screenshots for the mentioned errors: http://www.amarant-it.de/TempDownload/WIA_Error01.png or the same path with WIA_Error02.png and WIA_Error03.png for scanning we use the following code: #region Image-Convert-Settings //IP.Filters.Add IP.FilterInfos("Convert").FilterID //IP.Filters(1).Properties("FormatID").Value = wiaFormatJPEG WIA.IImageProcess ip = new WIA.ImageProcessClass(); object convert = "Convert"; WIA.IFilterInfo fi = ip.FilterInfos.get_Item(ref convert); ip.Filters.Add(fi.FilterID, 0); convert = "FormatID"; object formatstring = scanFormat.ScanFormat; WIA.IFilter filter; foreach (WIA.IFilter fTemp in ip.Filters) { filter = fTemp; WIA.IProperty prop = filter.Properties.get_Item(ref convert); prop.set_Value(ref formatstring); } #endregion #region Image-Scan + Convert img = itm.Transfer(scanFormat.ScanFormat) as WIA.ImageFile; img = ip.Apply(img as WIA.ImageFile); img.SaveFile("D:\\scan2." + img.FileExtension); Image image = Image.FromFile("D:\\scan2." + img.FileExtension); ilImages.Images.Add(image.ToString(), image); alImages.Add(image); if (ImageScanned != null) { ImageScanned(image); } #endregion can anyone help us with this problem? thanks

    Read the article

  • PackageMaker install script for rxtx

    - by vinzenzweber
    I am using PackageMaker to create an installer for my application. During installation I need to run a bash script to properly install rxtx, a JNI library for serial port communication. This library needs to have the directory /var/lock in place with user "root" and group "uucp". The installation script also needs to add the current user to the group "uucp" for the lib to be able to write to /var/lock. Now when I run my application installer the preinstall script is run as root. Therefore "whoami" returns root instead of the user who is actually running the installer. The result is that rxtx is not able to create lock files in /var/lock because the actual user was not added as a member to "uucp". How can I get the user while my script is run by the installer. Or is it better to set the permissions for /var/lock to a different group maybe? Any suggestions are welcome! !/bin/sh curruser=whoami logger "Setting permissions for /var/lock for user $curruser!" if [ ! -d /var/lock ] then logger "Creating /var/lock!" sudo mkdir /var/lock fi sudo chgrp uucp /var/lock sudo chmod 775 /var/lock MacOSX 10.5 and later use dscl if [ sudo dscl . -read /Groups/uucp GroupMembership | grep $curruser | wc -l = "0" ] then logger "Add user $curruser to /Groups/uucp!" sudo dscl . -append /Groups/uucp GroupMembership $curruser # to revert use: # sudo dscl . -delete /Groups/uucp GroupMembership $curruser else logger "GroupMembership of /var/lock not changed!" fi

    Read the article

  • how to download a file from remote server using asp.net

    - by ush
    The below code works fine for downloading a file from a current pc.plz suggest me how to download it from remote server using ip address or any method protected void Button1_Click(object sender, EventArgs e) { const string fName = @"C:\ITFSPDFbills\February\AA.pdf"; FileInfo fi = new FileInfo(fName); long sz = fi.Length; Response.ClearContent(); Response.ContentType = MimeType(Path.GetExtension(fName)); Response.AddHeader("Content-Disposition", string.Format("attachment; filename = {0}", System.IO.Path.GetFileName(fName))); Response.AddHeader("Content-Length", sz.ToString("F0")); Response.TransmitFile(fName); Response.End(); } public static string MimeType(string Extension) { string mime = "application/octetstream"; if (string.IsNullOrEmpty(Extension)) return mime; string ext = Extension.ToLower(); Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext); if (rk != null && rk.GetValue("Content Type") != null) mime = rk.GetValue("Content Type").ToString(); return mime; }

    Read the article

  • playframework auto-test Jenkins CI wait for completion?

    - by notbrain
    I am trying to set up Jenkins CI for a playframework.org application but am having trouble properly launching play after the auto-test command is run. The tests all run fine, but it seems as though my script is launching both play auto-test and play start --%ci at the same time. When the play start --%ci command runs, it gets a pid and everything, but it's not running. FILE: auto-test.sh, jenkins runs this with execute shell #!/bin/bash # pwd is jenkins workspace dir # change into approot dir cd customer-portal; # kill any previous play launches if [ -e "server.pid" ] then kill `cat server.pid`; rm -rf server.pid; fi # drop and re-create the DB mysql --user=USER --password=PASS --host=HOSTNAME < ../setupdb.sql # auto-test the most recent build /usr/local/lib/play/play auto-test; # this is inadequate for waiting for auto-test to complete? # how to wait for actual process completion? # sleep 60; wait; # Conditional start based on tests # Launch normal on pass, test on fail # if [ -e "./test-result/result.passed" ] then /usr/local/lib/play/play start --%ci; exit 0; else /usr/local/lib/play/play test; exit 1; fi

    Read the article

  • Percent-Encoded Percent in URI

    - by Lukas
    In our application, it is possible for a user to upload files then download them later. We don't restrict them from having any special characters in the file name. The problem comes in when we create the link for the user to download the file. I use the Java URL encoder to encode the file name that gets put into the href of the link, but I'm still having problems with percent (%) signs. For example, if the user uploads a file named fi%le.jpg, the href that gets generated is fi%25le.jpg, and everything is fine. The problem is when the percent sign is right before the period (i.e., file%.jpg, which gets converted to file%25.jpg). When the user clicks on the link, they get a 404 (Not Found) error. The strange thing is that it is not a problem if the two characters following the percent sign are hex characters.... Weird, eh? Any help is appreciated. I am using Tomcat/Struts. Could the built-in URL decoder have anything to do with this problem?

    Read the article

  • Bash Array Problem

    - by Deepak Prasanna
    I wrote a bash script which tries to find a process and run the process if it had stopped. This is the script. #!/bin/bash process=thin path=/home/deepak/abc/ initiate=thin start -d process_id=`ps -ef | pgrep $process | wc -m` if [ "$process_id" -gt "0" ]; then echo "The process process is running!!" else cd $path $initiate echo "Oops the process has stopped" fi This worked fine and I thought of using arrays so that i can form a loop use this script to check multiple processes. So I modified my script like this #!/bin/bash process[1]=thin path[1]=/home/deepak/abc/ initiate[1]=thin start -d process_id=`ps -ef | pgrep $process[1] | wc -m` if [ "$process_id" -gt "0" ]; then echo "Hurray the process ${process[1]} is running!!" else cd ${path[1]} ${initiate[1]} echo "Oops the process has stopped" echo "Continue your coffee, the process has been stated again! ;)" fi I get this error if i run this script. DontWorry.sh: 2: process[1]=thin: not found DontWorry.sh: 3: path[1]=/home/deepak/abc/: not found DontWorry.sh: 4: initiate[1]=thin start -d: not found I googled to find any solution for this, most them insisted to use "#!/bin/bash" instead of "#!/bin/sh". I tried both but nothing worked. What am i missing?

    Read the article

  • Why is the Clojure Hello World program so slow compared to Java and Python?

    - by viksit
    Hi all, I'm reading "Programming Clojure" and I was comparing some languages I use for some simple code. I noticed that the clojure implementations were the slowest in each case. For instance, Python - hello.py def hello_world(name): print "Hello, %s" % name hello_world("world") and result, $ time python hello.py Hello, world real 0m0.027s user 0m0.013s sys 0m0.014s Java - hello.java import java.io.*; public class hello { public static void hello_world(String name) { System.out.println("Hello, " + name); } public static void main(String[] args) { hello_world("world"); } } and result, $ time java hello Hello, world real 0m0.324s user 0m0.296s sys 0m0.065s and finally, Clojure - hellofun.clj (defn hello-world [username] (println (format "Hello, %s" username))) (hello-world "world") and results, $ time clj hellofun.clj Hello, world real 0m1.418s user 0m1.649s sys 0m0.154s Thats a whole, garangutan 1.4 seconds! Does anyone have pointers on what the cause of this could be? Is Clojure really that slow, or are there JVM tricks et al that need to be used in order to speed up execution? More importantly - isn't this huge difference in performance going to be an issue at some point? (I mean, lets say I was using Clojure for a production system - the gain I get in using lisp seems completely offset by the performance issues I can see here). The machine used here is a 2007 Macbook Pro running Snow Leopard, a 2.16Ghz Intel C2D and 2G DDR2 SDRAM. BTW, the clj script I'm using is from here and looks like, #!/bin/bash JAVA=/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java CLJ_DIR=/opt/jars CLOJURE=$CLJ_DIR/clojure.jar CONTRIB=$CLJ_DIR/clojure-contrib.jar JLINE=$CLJ_DIR/jline-0.9.94.jar CP=$PWD:$CLOJURE:$JLINE:$CONTRIB # Add extra jars as specified by `.clojure` file if [ -f .clojure ] then CP=$CP:`cat .clojure` fi if [ -z "$1" ]; then $JAVA -server -cp $CP \ jline.ConsoleRunner clojure.lang.Repl else scriptname=$1 $JAVA -server -cp $CP clojure.main $scriptname -- $* fi

    Read the article

  • Does anyone know how to detect whether a Windows Service is running through Java

    - by GKelly
    There's plenty of information on running Java apps as services, but I need to know how to detect whether a windows service is running or not. Does anyone know how??? At the DOS prompt, I can run: tasklist /svc|findstr "NonRunningService" echo Return code for N onRunningService is %ERRORLEVEL% tasklist /svc|findstr "RunningService" echo Return code for RunningService is %ERRORLEVEL% I get the following: Return code for NonRunningService is 1 Return code for RunningService is 0 In code, I have: int retCode = Runtime.getRuntime.exec("tasklist /svc|findstr \"NonRunningService\"").waitFor(); System.out.println("Return code for NonRunningService is " + retCode); retCode = Runtime.getRuntime.exec("tasklist /svc|findstr \"RunningService\"").waitFor(); System.out.println("Return code for RunningService is " + retCode); I get the following output Return code for NonRunningService is 1 Return code for RunningService is 1 According to the JavaDocs, the waitFor() should block until the process finishes, and give me the exit value of the process. I've also tried using the Process/ProcessBuilder command line calls: //'tasklist /nh /fi "SERVICES eq RunningService"' will return a line for // each running service of the requested type. Process p1 = new ProcessBuilder("tasklist", "/nh", "/fi" "SERVICES eq RunningService").start(); p1.waitFor(); BufferedReader is = new BufferedReader(new InputStreamReader(p1.getInputStream())); String line = is.readLine(); System.out.println("Service - " + line); System.out.println("Running? ", (line==null?"No":"Yes"); gives: Service - Running? No even when I get lines in the output at the command line!

    Read the article

  • how to download a file from remote server usingh asp.net

    - by ush
    The below code works fine for downloading a file from a current pc.plz suggest me how to download it from remote server using ip address or any method protected void Button1_Click(object sender, EventArgs e) { const string fName = @"C:\ITFSPDFbills\February\AA.pdf"; FileInfo fi = new FileInfo(fName); long sz = fi.Length; Response.ClearContent(); Response.ContentType = MimeType(Path.GetExtension(fName)); Response.AddHeader("Content-Disposition", string.Format("attachment; filename = {0}", System.IO.Path.GetFileName(fName))); Response.AddHeader("Content-Length", sz.ToString("F0")); Response.TransmitFile(fName); Response.End(); } public static string MimeType(string Extension) { string mime = "application/octetstream"; if (string.IsNullOrEmpty(Extension)) return mime; string ext = Extension.ToLower(); Microsoft.Win32.RegistryKey rk = Microsoft.Win32.Registry.ClassesRoot.OpenSubKey(ext); if (rk != null && rk.GetValue("Content Type") != null) mime = rk.GetValue("Content Type").ToString(); return mime; }

    Read the article

  • Error when decoding image C# asp

    - by Wayneio
    I am trying to use MessagingToolkit to decode an image in C#/ASP. I have managed to encode a qr using this package, but when i try to decode, using the code below it comes up with 2 errors (at the bottom of the page) I believe this is because I am not getting the image correctly after uploading, but can someone point out exactly where I have gone wrong. Thanks. protected void CreateCode_OnClick(object sender, EventArgs e) { string path = "C:\\Users\\Wayneio\\Documents\\Visual Studio 2012\\Projects\\BAMSystem\\BAMSystem\\"; if (QRUpload.HasFiles == true) { FileInfo fi = new FileInfo(QRUpload.FileName); string extA = fi.Extension; if (extA == ".jpg" || extA == ".png") { QRCodeDecoder decoder = new QRCodeDecoder(); QRUpload.SaveAs(path + QRUpload.FileName); System.Drawing.Image myImg = System.Drawing.Image.FromFile(path + QRUpload.FileName); decoder.Decode(myImg); } else { error.Text = "You have uploaded a " + extA + " file. Please upload either a PNG or a JPG"; } } else { error.Text = "You have not uploaded an image."; } } Error1: Error 2 Argument 1: cannot convert from 'System.Drawing.Image' to 'MessagingToolkit.QRCode.Codec.Data.QRCodeImage' c:\users\wayneio\documents\visual studio 2012\Projects\BAMSystem\BAMSystem\default.aspx.cs 38 35 BAMSystem Error2: Error 1 The best overloaded method match for 'MessagingToolkit.QRCode.Codec.QRCodeDecoder.Decode(MessagingToolkit.QRCode.Codec.Data.QRCodeImage)' has some invalid arguments c:\users\wayneio\documents\visual studio 2012\Projects\BAMSystem\BAMSystem\default.aspx.cs 38 20 BAMSystem P.S if anyone has documentation on this MessagingToolkit QR package, it would be useful

    Read the article

  • Shell script task status monitoring

    - by Bikram Agarwal
    I'm running an ANT task in background and checking in 60 second intervals whether that task is complete or not. If it is not, every 60 seconds, a message should be displayed on screen - "Deploy process is still running. $slept seconds since deploy started", where $slept is 60, 120, 180 n so on. There's a limit of 1200 seconds, after which the script will show the log via 'ant log' command and ask the user whether to continue. If the user chooses to continue, 300 seconds are added to the time limit and the process repeats. The code that I am using for this task is - ant deploy & limit=1200 deploy_check() { while [ ${slept:-0} -le $limit ]; do sleep 60 && slept=`expr ${slept:-0} + 60` if [ $$ = "`ps -o ppid= -p $!`" ]; then echo "Deploy process is still running. $slept seconds since deploy started." else wait $! && echo "Application ${New_App_Name} deployed successfully" || echo "Deployment of ${New_App_Name} failed" break fi done } deploy_check if [ $$ = "`ps -o ppid= -p $!`" ]; then echo "Deploy process did not finish in $slept seconds. Here's the log." ant log echo "Do you want to kill the process? Press Ctrl+C to kill. Press Enter to continue." read log limit=`expr ${limit} + 300` deploy_check fi Now, the problem is - this code is not working. This looks like a perfectly good code and yet, this is not working. Can anyone point out what is wrong with this code, please.

    Read the article

  • Access denied for pdf to read using itextsharp at server level..

    - by apekshabs
    Am facing error after uploadind to server... as access denied .... can anyone help me.... Document myDocument = new Document(PageSize.A5, 26, 72, 180, 180); string strUniqueFn = "onlineinvoice.pdf"; string imgpath = "logo.gif"; string strUser = Thread.CurrentPrincipal.Identity.Name.Substring(Thread.CurrentPrincipal.Identity.Name.IndexOf("\\") + 1).ToUpper(); string strFolder = Server.MapPath("."); System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(strFolder); System.IO.FileInfo[] fi = di.GetFiles(strUser + "*.*"); for (i = 0; i <= fi.Length - 1; i++) { System.IO.File.Delete(strFolder + "\\" + strUniqueFn); } string strPath = strFolder + "\\" + strUniqueFn; PdfWriter pdfw = PdfWriter.GetInstance(myDocument, new FileStream(strPath, FileMode.Create)); string iPath = strFolder + "\\" + imgpath; pdfw.CloseStream = false; myDocument.Open(); ...................... myDocument.Close(); Am facing error at PdfWriter pdfw = PdfWriter.GetInstance(myDocument, new FileStream(strPath, FileMode.Create)); can anyone help me... Thank you

    Read the article

  • XCode 4.4 bundle version updates not picked up until subsequent build

    - by Mark Struzinski
    I'm probably missing something simple here. I am trying to auto increment my build number in XCode 4.4 only when archiving my application (in preparation for a TestFlight deployment). I have a working shell script that runs on the target and successfully updates the info.plist file for each build. My build configuration for archiving is name 'Ad-Hoc'. Here is the script: if [ $CONFIGURATION == Ad-Hoc ]; then echo "Ad-Hoc build. Bumping build#..." plist=${PROJECT_DIR}/${INFOPLIST_FILE} buildnum=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${plist}") if [[ "${buildnum}" == "" ]]; then echo "No build number in $plist" exit 2 fi buildnum=$(expr $buildnum + 1) /usr/libexec/Plistbuddy -c "Set CFBundleVersion $buildnum" "${plist}" echo "Bumped build number to $buildnum" else echo $CONFIGURATION " build - Not bumping build number." fi This script updates the plist file appropriately and is reflected in XCode each time I archive. The problem is that the .ipa file that comes out of the archive process is still showing the previous build number. I have tried the following solutions with no success: Clean before build Clean build folder before build Move Run Script phase to directly after the Target Dependencies step in Build Phases Adding the script as a Run Script action in my scheme as a pre-action No matter what I do, when I look at the build log, I see that the info.plist file is being processed as one of the very first steps. It is always prior to my script running and updating the build number, which is, I assume, why the build number is never current in the .ipa file. Is there a way to force the Run Script phase to run before the info.plist file is processed?

    Read the article

  • GetAccessControl error with NTAccount

    - by Adam Witko
    private bool HasRights(FileSystemRights fileSystemRights_, string fileName_, bool isFile_) { bool hasRights = false; WindowsIdentity WinIdentity = System.Security.Principal.WindowsIdentity.GetCurrent(); WindowsPrincipal WinPrincipal = new WindowsPrincipal(WinIdentity); AuthorizationRuleCollection arc = null; if (isFile_) { FileInfo fi = new FileInfo(@fileName_); arc = fi.GetAccessControl().GetAccessRules(true, true, typeof(NTAccount)); } else { DirectoryInfo di = new DirectoryInfo(@fileName_); arc = di.GetAccessControl().GetAccessRules(true, true, typeof(NTAccount)); } foreach (FileSystemAccessRule rule in arc) { if (WinPrincipal.IsInRole(rule.IdentityReference.Value)) { if (((int)rule.FileSystemRights & (int)fileSystemRights_) > 0) { if (rule.AccessControlType == AccessControlType.Allow) hasRights = true; else if (rule.AccessControlType == AccessControlType.Deny) { hasRights = false; break; } } } } return hasRights; } The above code block is causing me problems. When the WinPrincipal.IsInRole(rule.IdentityReference.Value) is executed the following exception occurs: "The trust relationship between the primary domain and the trusted domain failed.". I'm very new to using identities, principles and such so I don't know what's the problem. I'm assuming it's with the use of NTAccount? Thanks

    Read the article

  • Batch File to Delete Folders

    - by Homebrew
    I found some code to delete folders, in this case deleting all but 'n' # of folders. I created 10 test folders, plus 1 that was already there. I want to delete all but 4. The code works, it leaves 4 of my test folders, except that it also leaves the other folder. Is there some attribute of the other folder that's getting checked in the batch file that's stopping it from getting deleted ? It was created through a job a couple of weeks ago. Here's the code I stole (but don't really understand the details): rem DOS - Delete Folders if # folders > n @Echo Off :: User Variables :: Set this to the number of folders you want to keep Set _NumtoKeep=4 :: Set this to the folder that contains the folders to check and delete Set _Path=C:\MyFolder_Temp\FolderTest If Exist "%temp%\tf}1{" Del "%temp%\tf}1{" PushD %_Path% Set _s=%_NumtoKeep% If %_NumtoKeep%==1 set _s=single For /F "tokens=* skip=%_NumtoKeep%" %%I In ('dir "%_Path%" /AD /B /O-D /TW') Do ( If Exist "%temp%\tf}1{" ( Echo %%I:%%~fI >>"%temp%\tf}1{" ) Else ( Echo.>"%temp%\tf}1{" Echo Do you wish to delete the following folders?>>"%temp%\tf}1{" Echo Date Name>>"%temp%\tf}1{" Echo %%I:%%~fI >>"%temp%\tf}1{" )) PopD If Not Exist "%temp%\tf}1{" Echo No Folders Found to delete & Goto _Done Type "%temp%\tf}1{" | More Set _rdflag= /q Goto _Removeold Set _rdflag= :_Removeold For /F "tokens=1* skip=3 Delims=:" %%I In ('type "%temp%\tf}1{"') Do ( If "%_rdflag%"=="" Echo Deleting rd /s%_rdflag% "%%J") :_Done If Exist "%temp%\tf}1{" Del "%temp%\tf}1{"

    Read the article

  • Reasonably faster way to traverse a directory tree in Python?

    - by Sridhar Ratnakumar
    Assuming that the given directory tree is of reasonable size: say an open source project like Twisted or Python, what is the fastest way to traverse and iterate over the absolute path of all files/directories inside that directory? I want to do this from within Python (subprocess is allowed). os.path.walk is slow. So I tried ls -lR and tree -fi. For a project with about 8337 files (including tmp, pyc, test, .svn files): $ time tree -fi > /dev/null real 0m0.170s user 0m0.044s sys 0m0.123s $ time ls -lR > /dev/null real 0m0.292s user 0m0.138s sys 0m0.152s $ time find . > /dev/null real 0m0.074s user 0m0.017s sys 0m0.056s $ tree appears to be faster than ls -lR (though ls -R is faster than tree, but it does not give full paths). find is the fastest. Can anyone think of a faster and/or better approach? On Windows, I may simply ship a 32-bit binary tree.exe or ls.exe if necessary. Update 1: Added find

    Read the article

  • ASP.NET enum dropdownlist validation

    - by Arun Kumar
    I have got a enum public enum TypeDesc { [Description("Please Specify")] PleaseSpecify, Auckland, Wellington, [Description("Palmerston North")] PalmerstonNorth, Christchurch } I am binding this enum to drop down list using the following code on page_Load protected void Page_Load(object sender, EventArgs e) { if (TypeDropDownList.Items.Count == 0) { foreach (TypeDesc newPatient in EnumToDropDown.EnumToList<TypeDesc>()) { TypeDropDownList.Items.Add(EnumToDropDown.GetEnumDescription(newPatient)); } } } public static string GetEnumDescription(Enum value) { FieldInfo fi = value.GetType().GetField(value.ToString()); DescriptionAttribute[] attributes = (DescriptionAttribute[])fi.GetCustomAttributes(typeof(DescriptionAttribute), false); if (attributes != null && attributes.Length > 0) return attributes[0].Description; else return value.ToString(); } public static IEnumerable<T> EnumToList<T>() { Type enumType = typeof(T); // Can't use generic type constraints on value types, // so have to do check like this if (enumType.BaseType != typeof(Enum)) throw new ArgumentException("T must be of type System.Enum"); Array enumValArray = Enum.GetValues(enumType); List<T> enumValList = new List<T>(enumValArray.Length); foreach (int val in enumValArray) { enumValList.Add((T)Enum.Parse(enumType, val.ToString())); } return enumValList; } and my aspx page use the following code to validate <asp:DropDownList ID="TypeDropDownList" runat="server" > </asp:DropDownList> <asp:RequiredFieldValidator ID="TypeRequiredValidator" runat="server" ControlToValidate="TypeDropDownList" ErrorMessage="Please Select a City" Text="<img src='Styles/images/Exclamation.gif' />" ValidationGroup="city"></asp:RequiredFieldValidator> But my validation is accepting "Please Specify" as city name. I want to stop user to submit if the city is not selected.

    Read the article

  • How to prevent the other threads from accessing a method when one thread is accessing a method?

    - by geeta
    I want to search for a string in 10 files and write the matching lines to a single file. I wrote the matching lines from each file to 10 output files(o/p file1,o/p file2...) and then copied those to a single file using 10 threads. But the output single file has mixed output(one line from o/p file1,another line from o/p file 2 etc...) because its accessed simultaneously by many threads. If I wait for all threads to complete and then write the single file it will be much slower. I want the output file to be written by one thread at a time. What should i do? My source code:(only writing to single file method) public void WriteSingle(File output_file,File final_output) throws IOException { synchronized(output_file){ System.out.println("Writing Single file"); FileOutputStream fo = new FileOutputStream(final_output,true); FileChannel fi = fo.getChannel(); FileInputStream fs = new FileInputStream(output_file); FileChannel fc = fs.getChannel(); int maxCount = (64 * 1024 * 1024) - (32 * 1024); long size = fc.size(); long position = 0; while (position < size) { position += fc.transferTo(position, maxCount, fi); } } }

    Read the article

  • File size monitoring in C#

    - by manemawanna
    Hello, I work in the Systems & admin team and have been given the task of creating a quota management application to try and encourage users to better manage there resources as we currently have issues with disc space and don't enforce hard quotas. At the moment I'm using the code below to go through all the files in a users homespace to retrieve the overall amount of space they are using. As from what I've seen else where theres no other way to do this in C#, the issue with it is theirs quite a high overhead while it retireves the size of each file then creates a total. try { long dirSize = 0; FileInfo[] FI = new DirectoryInfo("I:\\").GetFiles("*.*", SearchOption.AllDirectories); foreach (FileInfo F1 in FI) { dirSize += F1.Length; } return dirSize; } So I'm looking for a quicker way to do this or a quick way to monitor changes in the size of files while using the options avaliable through FileSystemWatcher. At the moment the only thing I can think of is creating a hashtable containing the file location and size of each file, so when a size changed event occurs I can compare the old size against the new one and update the total. Any suggestions would be greatly appreciated.

    Read the article

  • Preventing a child process (HandbrakeCLI) from causing the parent script to exit

    - by Chris
    I have a batch conversion script to turn .mkvs of various dimensions into ipod/iphone sized .mp4s, cropping/scaling to suit. Determining the original dimensions, required crop, output file is all working fine. However, on successful completion of the first conversion, HandbrakeCLI causes the parent script to exit. Why would this be? And how can I stop it? The code, as it currently stands: #!/bin/bash find . -name "*.mkv" | while read FILE do # What would the output file be? DST=../Touch/$(dirname "$FILE") MKV=$(basename "$FILE") MP4=${MKV%%.mkv}.mp4 # If it already exists, don't overwrite it if [ -e "$DST/$MP4" ] then echo "NOT overwriting $DST/$MP4" else # Stuff to determine dimensions/cropping removed for brevity HandbrakeCLI --preset "iPhone & iPod Touch" --vb 900 --crop $crop -i "$FILE" -o "$DST/$MP4" > /dev/null 2>&1 if [ $? != 0 ] then echo "$FILE had problems" >> errors.log fi fi done I have additionally tried it with a trap, but that didn't change the behaviour (although the last trap did fire) trap "echo Handbrake SIGINT-d" SIGINT trap "echo Handbrake SIGTERM-d" SIGTERM trap "echo Handbrake EXIT-d" EXIT trap "echo Handbrake 0-d" 0

    Read the article

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