Daily Archives

Articles indexed Saturday April 3 2010

Page 3/78 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How come I get a timed-out when I try to download something off my own domain?

    - by alex
    def download(source_url): socket.setdefaulttimeout(10) agents = ['Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)','Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 5.1)','Microsoft Internet Explorer/4.0b1 (Windows 95)','Opera/8.00 (Windows NT 5.1; U; en)'] ree = urllib2.Request(source_url) ree.add_header('User-Agent',random.choice(agents)) resp = urllib2.urlopen(ree) htmlSource = resp.read() return htmlSource url = "http://myIP/details/?id=4" result_html = download(url) It shouldn't time out...even with the 10 second timeout..

    Read the article

  • Regex - find and replace complete string occurrences only (not partial matches)

    - by vittore
    I'm not very good at regex but maybe there's a simple way to achieve this task. I'm given a string like "bla @a bla @a1 bla" I'm also given pairs like {"a", "a2"} , {"a1", "a13"}, and I need to replace @a with @a2 for the first pair, and @a1 with @a13 for the second one. The problem is when i use String.Replace and look for @a, it also replaces @a1 but it should not. I need it to completely match @a and avoid partially matching it in other places. Note: the given string could also be brackets, commas, dots and so on. However, pairs will always be [a-z]*[0-9]+ Help me with regex replace, please. Cheers

    Read the article

  • How do I set the Execute Permissions for an IIS6 website with Powershell using WMI?

    - by DarkwingDuck
    In inetmgr you can set the property I desire by going to Home Directory - Application Settings - Execute Permissions - and setting the drop down to 'Scripts Only'. I'm trying to replicate this behavior in Powershell. The Target OS is Windows Server 2003 running IIS6. Currently I have this simple code to get the site: $Site = get-wmiobject -Namespace root\MicrosoftIISv2 -query ('select * from IISWebServerSetting where ServerComment="mySite"') There are lots of properties it might be but nothing really leaps out. I've tried changing the setting in inetmgr and dumping the properties out before and after, but I see no differences (it could be a child property though). Any ideas? Thanks in advance.

    Read the article

  • iTextSharp 5.0 Footer is not displaying

    - by Rick Make
    I am trying to create a simple footer that would display on the bottom of each page of the pdf document. I created a class that inherits from PdfPageEventHelper and it is set properly because the OnEndPage() method is called. But my temporary footer is not displaying. Is there something wrong that I am doing in my OnEndPage() method: public override void OnEndPage(PdfWriter writer, Document document) { base.OnEndPage(writer, document); int pageN = writer.PageNumber; String text = "Page " + pageN + " of "; float len = bf.GetWidthPoint(text, 8); Rectangle pageSize = document.PageSize; cb.SetRGBColorFill(100, 100, 100); cb.BeginText(); cb.SetFontAndSize(bf, 8); cb.SetTextMatrix(pageSize.GetLeft(40), pageSize.GetBottom(30)); cb.ShowText(text); cb.EndText(); cb.AddTemplate(template, pageSize.GetLeft(40) + len, pageSize.GetBottom(30)); cb.BeginText(); cb.SetFontAndSize(bf, 8); cb.ShowTextAligned(PdfContentByte.ALIGN_RIGHT, "Printed On " + PrintTime.ToString(), pageSize.GetRight(40), pageSize.GetBottom(30), 0); cb.EndText(); }

    Read the article

  • movie silent until button press, flash as3

    - by pixelGreaser
    I thought I could change the Boolean true/false value, but it's not working. How do I get this to hush, until the button is pressed? import flash.media.Sound; import flash.media.SoundChannel; var soundOn:Boolean = true; //music is ON when we start var myToons:TitleMusic = new TitleMusic(); var myChannel:SoundChannel = myToons.play(0,1000); // endless loop, in effect var myTransform:SoundTransform; mySoundButton.addEventListener(MouseEvent.CLICK,toggleSound); mySoundButton.buttonMode = true; mySoundButton.mouseChildren = false; function toggleSound(e:MouseEvent) { if(soundOn) { // turn sound off myTransform = new SoundTransform(); myTransform.volume = 0; // silent myChannel.soundTransform = myTransform; soundOn = false; mySoundButton.myButtonText.text = "click to turn sound ON"; } else // sound is off { // turn sound on myTransform = new SoundTransform(); myTransform.volume = 1; // full volume myChannel.soundTransform = myTransform; soundOn = true; mySoundButton.myButtonText.text = "click to turn sound OFF"; } }

    Read the article

  • Hooking the http/https protocol in IE causes GET requests to be sequential

    - by watsonmw
    I'm using the PassthruAPP method to hook into HTTP/HTTPS requests made by IE. It's working well for the most part, however I noticed a problem. Only one download thread is active at a time. I can see two IInternetProtocol objects getting created, but IE uses only one at a time. This is happening with IE7. The odd thing is that the problem occurs when overriding the existing default HTTP/HTTPS handler, even if the handler is not the one being used to make the request. E.g. Registering a handler for the HTTPS protocol will cause HTTP requests to be made sequentially, even though HTTP requests are not hooked. I installed Google Gears and it has the same problem. This always happens for the first few items on the page, but it seems that after the document complete is issued, concurrent downloads can occur again. For example Javascript code that is executed after the page has finished loading can load images concurrently just fine. One option is to try to IAT patch the 'IInternetProtocol' registered for HTTP requests, but Google Gears does this already and it has the same problem. I know installing a HTTP Proxy is another option, but I don't want to monkey with the users' HTTP Proxy settings if there another option.

    Read the article

  • Ldap_add() : Invalid Syntax

    - by Suezy
    I have a program here that uses the ldap_add, when i try to run the program, it displays an error: Warning: ldap_add() [function.ldap-add]: Add: Invalid syntax in /var/www/suey/costcenter.20090617.php on line 780 My lil' code here is: $ldapservers='ourServer'; $ds = ldap_connect($ldapservers); if ($ds){ $r = ldap_bind($ds, $ldaprootun, $ldaprootpw); $add = ldap_add($ds, "uid=$fuid, $ldapbasedn", $infonew); } ldapbasedn is set to o=ourGroup; infonew is an array of entries (person information) and am so sure that the array is not empty because i already tested it. the uid is not empty too. What could be wrong? Is it the entries(array)? or the server am trying to connect to? I tried testing the ldap_bind, and it also works well too..hmmm.. Pls help.. thanks! I found the problem.. it's in the index infonew["createdBy"] = getenv("REMOTE_USER"); it returns NULL! now, is that right?

    Read the article

  • In PHP, how do I add 3 months to the purchase date retrieved from the iPhone InApp receipt?

    - by Cocoanut
    After I have validated the receipt against the App Store from my PHP server, the App Store sends me back a JSON response with "status" : 0 "receipt" : ( .... ) One of the receipt items is "purchase_date" which contains the following string (example) "2010-02-09 19:17:04 Etc/GMT" I'm trying to establish a subscription service and would like to add 3 months to this date and then write that expiry date into a MySQL table. Is there a string-to-date type function in PHP that can allow me to achieve the adding of 3 months? I have found this example which looks like it adds 1 month to a date: $date = date("Y-m-d");// current date $date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month"); But I'm not sure how I can turn the string passed by the App Store into a PHP recognised date.

    Read the article

  • Keeping some choices in the Table for the Field of Type Dropdown

    - by Mercy
    Hi, i am having a Table named Attributes which has id form_id label size sequence_no Type 1 1 Name 200 1 Text 2 1 Age 150 2 Number 3 1 Address 300 3 Textarea 4 1 Gender 200 4 Dropdown I am having the doubt how can i keep the Choices of the Field of type "Dropdown" in the Table Eg. For Gender the choices will Male , Female.. Please give me the suggestions...

    Read the article

  • Getting HTTP GET variables using Tipfy

    - by Vestonian
    Hey everyone, I'm currently playing around with tipfy on Google's Appengine and just recently ran into a problem: I can't for the life of me find any documentation on how to use GET variables in my application, I've tried sifting through both tipfy and Werkzeug's documentations with no success. I know that I can use request.form.get('variable') to get POST variables and **kwargs in my handlers for URL variables, but that's as much as the documentation will tell me. Any ideas?

    Read the article

  • Link error in Borland

    - by Oren
    Hello Got Link error (Fatal: Access violation. Link terminated) in Borland 6.0. How do I know what is the cause of it ? Is there any output file that I can open and get more informative message ? Thanks in advance.

    Read the article

  • Any simple tools for re-loading a specified web page periodically (Windows)?

    - by Luke
    I've got a website that is exhibiting slow performance on the first load and would like to attempt to load it every 5 minutes or so to keep the cache fresh. Are there any simple tools to accomplish this? Scheduled tasks doesn't have quite the time resolution I need. The tricky thing is that this site uses Windows authentication so a wget script won't work. I'm also worried about instantiating a bunch of copies of internet explorer or attempting to kill iexplore.exe tasks blindly.

    Read the article

  • Crashing HVM domain, what do I do?

    - by rassie
    My DomUs on a Xen 3.4 on an RHEL5 are crashing when too much memory is needed: (XEN) p2m_pod_demand_populate: Out of populate-on-demand memory! (XEN) domain_crash called from p2m.c:1091 (XEN) Domain 15 (vcpu#3) crashed on cpu#2: (XEN) ----[ Xen-3.4.0 x86_64 debug=n Not tainted ]---- (XEN) CPU: 2 (XEN) RIP: 0010:[<ffffffff80062c02>] (XEN) RFLAGS: 0000000000010216 CONTEXT: hvm guest (XEN) rax: 0000000000000000 rbx: 0000000000000001 rcx: 000000000000003f (XEN) rdx: 0000000004812000 rsi: ffff810001000000 rdi: ffff810004812000 (XEN) rbp: 0000000000000282 rsp: ffff810007635cf0 r8: ffff810037c0288e (XEN) r9: 00000000000023e1 r10: 0000000000000000 r11: 0000000000000001 (XEN) r12: ffff81000000cb00 r13: ffff8100007e43f0 r14: ffff81000000fc10 (XEN) r15: 00000000000280d2 cr0: 0000000080050033 cr4: 00000000000006e0 (XEN) cr3: 0000000006760000 cr2: 0000000003d47078 (XEN) ds: 0000 es: 0000 fs: 0000 gs: 0000 ss: 0000 cs: 0010 Can I disable populate-on-demand for HVM somehow? Xen 3.3 didn't exhibit such behaviour...

    Read the article

  • windows 7 64bit rc with SSD saving problem

    - by Tariq
    Hi All, I have this problem where, in any application, 95% of the time when i try to save it pops up with a "Save As" dialogue. And if i try to select the original file i get an error popup "The operation could not be completed". I have Windows 7 RC 64bit with a X-25M SSD. I have upgraded the firmware for the SSD just in case and still the problem persists. Has anyone come across this before or know the problem? Or is there some indication i should be looking for in the event logs? Thanks

    Read the article

  • Changing Windows public folder in batch script.

    - by Angus
    I've installed Steam on an external hard drive so I can play games on different computers by just moving the drive around. Since save games are often saved in My Documents or AppData, but I want them to move with the external hard drive, I wrote a batch file that sets environment variables before starting steam. setocal set USERPROFILE=%EXTERNAL_LETTER%\Profile\Me set APPDATA=%USERPROFILE%\AppData\Roaming ... start %TARGETAPP% endlocal I'm not sure if this is the right way to do this on Windows, but it seems to work. However, one game saves its games in the Shared Documents folder. I've tried setting %PUBLIC% and %ALLUSERSPROFILE% but that does not seem to affect where the game looks. Is it possible to make this one program use a different Shared Documents folder, either by environment variables or some other means? The change in Shared Documents should only affect the one program, I do not want it to be a permanent or system wide change to Windows.

    Read the article

  • Where should I exclude and select information BL or DL?

    - by MRFerocius
    Hi guys; I have another conceptual question. Suppose I have a Data Layer and a Bussines Layer. I have on my data base for example Customers and those customers has an assigned Vendor: Customers(customerID, customerName, customerAddress, vendorID) Vendors(vendorID, vendorName, vendorAddress) Now suppose my Vendor logs into my web application and wants to see all his customers: a) Should I use my Datalayer method and there find his customers on the query? b) Should the data layer return all the customers and on the Buissnes Layer filter that vendor ones? Is B even a good approach because is the one I want to use.... Is it correct? Thanks in advance!!!

    Read the article

  • Flash10 Triangle Rendering

    - by anon
    I know about Papervision 3D. However, alot of the realism there comes from textures. Does anyone know of a benchmark that shows how many single-color, flash-shaded 3D triagnels flash10 can reasonably render? I can't find this benchmark online or an engine for this (most seems to really value bitmaps / texture). Thanks!

    Read the article

  • How do you data drive task dependencies via properties in psake?

    - by Jordan
    In MSBuild you can data drive target dependencies by passing a item group into a target, like so: <ItemGroup> <FullBuildDependsOn Include="Package;CoreFinalize" Condition="@(FullBuildDependsOn) == ''" /> </ItemGroup> <Target Name="FullBuild" DependsOnTargets="@(FullBuildDependsOn)" /> If you don't override the FullBuildDependsOn item group, the FullBuild target defaults to depending on the Package and CoreFinalize targets. However, you can override this by defining your own FullBuildDependsOn item group. I'd like to do the same in psake - for example: properties { $FullBuildDependsOn = "Package", "CoreFinalize" } task default -depends FullBuild # this won't work because $FullBuildDependsOn hasn't been defined yet - the "Task" function will see this as a null depends array task FullBuild -depends $FullBuildDependsOn What do I need to do to data drive the task dependencies in psake?

    Read the article

  • Jquery, FadeIn before unload

    - by Starboy
    I'm trying to accomplish a transition effect if you will. On doc ready div fades out, the problem im having is when a visitor navigates away from the page (or .unload) I want the div to fade back in. $(document).ready(function(){ $('#overlay').fadeOut(2000, 'easeOutQuad'); }); $(window).beforeunload(function() { $('#overlay').fadeIn(2000, 'easeOutQuad'); });

    Read the article

  • How to display default text "--Select Team --" in combo box on pageload in WPF?

    - by Aditya
    Hi, In a WPF app, in MVP app I have a combo box,for which I display the data fetched from Database. Before the items added to the Combo box, I want to display the default text such as " -- Select Team --" , so that on pageload it displays and on selecting it the text should be cleared and the items should be displayed. Selecting data from DB is happening. I need to display the default text until the user selects an item from combo box. Please guide me Thanks Ramm

    Read the article

  • problem in start up my RMI server(under ISP) so that it can recieve remote calls over Internet.--Jav

    - by Lokesh Kumar
    i m creating a Client/Server application in which my server and client can be on the same or on different machines but both are under ISP. My RMI programs:- -Remote Intreface:- //Calculator.java public interface Calculator extends java.rmi.Remote { public long add(long a, long b) throws java.rmi.RemoteException; public long sub(long a, long b) throws java.rmi.RemoteException; public long mul(long a, long b) throws java.rmi.RemoteException; public long div(long a, long b) throws java.rmi.RemoteException; } Remote Interface Implementation:- //CalculatorImpl.java public class CalculatorImpl extends java.rmi.server.UnicastRemoteObject implements Calculator { public CalculatorImpl() throws java.rmi.RemoteException { super(); } public long add(long a, long b) throws java.rmi.RemoteException { return a + b; } public long sub(long a, long b) throws java.rmi.RemoteException { return a - b; } public long mul(long a, long b) throws java.rmi.RemoteException { return a * b; } public long div(long a, long b) throws java.rmi.RemoteException { return a / b; } } Server:- //CalculatorServer.java import java.rmi.Naming; import java.rmi.server.RemoteServer; public class CalculatorServer { public CalculatorServer() { try { Calculator c = new CalculatorImpl(); Naming.rebind("rmi://"+args[0]+":1099/CalculatorService", c); } catch (Exception e) { System.out.println("Trouble: " + e); } } public static void main(String args[]) { new CalculatorServer(); } } Client:- //CalculatorClient.java import java.rmi.Naming; import java.rmi.RemoteException; import java.net.MalformedURLException; import java.rmi.NotBoundException; public class CalculatorClient { public static void main(String[] args) { try { Calculator c = (Calculator)Naming.lookup("rmi://"+args[0]+"/CalculatorService"); System.out.println( c.sub(4, 3) ); System.out.println( c.add(4, 5) ); System.out.println( c.mul(3, 6) ); System.out.println( c.div(9, 3) ); } catch (MalformedURLException murle) { System.out.println(); System.out.println("MalformedURLException"); System.out.println(murle); } catch (RemoteException re) { System.out.println(); System.out.println("RemoteException"); System.out.println(re); } catch (NotBoundException nbe) { System.out.println(); System.out.println("NotBoundException"); System.out.println(nbe); } catch (java.lang.ArithmeticException ae) { System.out.println(); System.out.println("java.lang.ArithmeticException"); System.out.println(ae); } } } when both Server and client programs are on same machine:- i start my server program by passing my router static IP address:-192.168.1.35 in args[0] and my server starts...fine. and by passing the same Static IP address in my Client's args[0] also works fine. but:- when both Server and client programs are on different machines:- now,i m trying to start my Server Program by passing it's public IP address:59.178.198.247 in args[0] so that it can recieve call over internet. but i am unable to start it. and the following exception occurs:- Trouble: java.rmi.ConnectException: Connection refused to host: 59.178.198.247; nested exception is: java.net.ConnectException: Connection refused: connect i think it is due to NAT Problem because i am under ISP. so,my problem is that how can i start my RMI Server under ISP so that it can recieve remote calls from internet????

    Read the article

  • Having trouble setting up API call using array of parameters

    - by Josh
    I am building a class to send API calls to Rapidshare and return the results of said call. Here's how I want the call to be done: $rs = new rs(); $params = array( 'sub' => 'listfiles_v1', 'type' => 'prem', 'login' => '10347455', 'password' => 'not_real_pass', 'realfolder' => '0', 'fields' => 'filename,downloads,size', ); print_r($rs->apiCall($params)); And here's the class so far: class RS { var $baseUrl = 'http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub='; function apiCall($params) { $newUrl = $baseUrl; $keys = array_keys($params); $count = count($params); for($i = 0; $i < $count; $i++) { $newUrl .= $keys[$i]; $newUrl .= '&'; $newUrl .= $params[$keys[$i]]; } return $newUrl; } } Obviously i'm returning $newUrl and using print_r() to test the query string, and this is what it comes out as with the code shown above: sub&listfiles_v1type&premlogin&10347455password&_not_real_passrealfolder&0fields&filename,downloads,size When it should be: http://api.rapidshare.com/cgi-bin/rsapi.cgi?sub=listfiles_v1&type=prem&login=10347455&password=not_real_pass&realfolder=0&fields=filename,downloads,size Hopefully you can see what I'm trying to do here :P It's probably a silly mistake that I'm failing to find or a logical error. Thanks in advance.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >