Search Results

Search found 15 results on 1 pages for 'jorgen lundberg'.

Page 1/1 | 1 

  • How to read Unicode characters from command-line arguments in Python on Windows

    - by Craig McQueen
    I want my Python script to be able to read Unicode command line arguments in Windows. But it appears that sys.argv is a string encoded in some local encoding, rather than Unicode. How can I read the command line in full Unicode? Example code: argv.py import sys first_arg = sys.argv[1] print first_arg print type(first_arg) print first_arg.encode("hex") print open(first_arg) On my PC set up for Japanese code page, I get: C:\temp>argv.py "PC·??????08.09.24.doc" PC·??????08.09.24.doc <type 'str'> 50438145835c83748367905c90bf8f9130382e30392e32342e646f63 <open file 'PC·??????08.09.24.doc', mode 'r' at 0x00917D90> That's Shift-JIS encoded I believe, and it "works" for that filename. But it breaks for filenames with characters that aren't in the Shift-JIS character set—the final "open" call fails: C:\temp>argv.py Jörgen.txt Jorgen.txt <type 'str'> 4a6f7267656e2e747874 Traceback (most recent call last): File "C:\temp\argv.py", line 7, in <module> print open(first_arg) IOError: [Errno 2] No such file or directory: 'Jorgen.txt' Note—I'm talking about Python 2.x, not Python 3.0. I've found that Python 3.0 gives sys.argv as proper Unicode. But it's a bit early yet to transition to Python 3.0 (due to lack of 3rd party library support). Update: A few answers have said I should decode according to whatever the sys.argv is encoded in. The problem with that is that it's not full Unicode, so some characters are not representable. Here's the use case that gives me grief: I have enabled drag-and-drop of files onto .py files in Windows Explorer. I have file names with all sorts of characters, including some not in the system default code page. My Python script doesn't get the right Unicode filenames passed to it via sys.argv in all cases, when the characters aren't representable in the current code page encoding. There is certainly some Windows API to read the command line with full Unicode (and Python 3.0 does it). I assume the Python 2.x interpreter is not using it.

    Read the article

  • Changing the cell range of conditional formatting in LibreOffice Calc

    - by Simon Lundberg
    Is there any way of changing the range of conditional formatting in LibreOffice Calc (version 3.6)? I have a set applied already to a range of cells, but there is no obvious way of changing which cells a given set of conditional formatting is applied to. I either have to copy and paste the formatting, which results in multiple entries in the conditional formatting (which makes it difficult to manage), or delete the entire thing and create a new one every single time I want to change the range of cells. Is there a better way? link to screenshot

    Read the article

  • SAN cache memory upgrade

    - by Scott Lundberg
    We currently have an IBM DS4300 Dual Controller Fibre SAN. It is a good box, but getting pretty old. It came with 256MB of cache per controller. Recently we replaced the batteries in one of the controllers and noticed that the cache is a DDR PC2100 ECC DIMM. Of course, we are thinking about how cheap this RAM is now and is there any good reason we can't upgrade the RAM. IBM used to have a "Turbo" upgrade to this box that doubled the cache and had a bunch of software features for about 10K USD. Since that product has been end-of-lifed, I don't think we can get that upgrade and we don't need the software upgrades (FlashCopy, StorageCopy, etc). Besides the obvious potential warranty issue, what if any issues would we expect to see if attempting to put 2 - 1GB DIMMS in this unit? Any other things I am missing here? EDIT: Memory label: Samsung CN 0433 PC2100U-25331-A1 M381L3223ETM-CB0 256MB DDR PC2100 CL2.5 ECC

    Read the article

  • Option do not show schema names in SQL Server Management Studio

    - by Jörgen Sigvardsson
    I love the fact that tree and list controls in Windows allows incremental searches. Just select a starting point, and type, and the control will select the best matching node for you. This works in SSMS, but there's an annoying problem, especially so in the table node. SSMS prefixes all table names with the schema name and a dot. To make an incremental search here, I have to type 'dbo.', followed by whatever I'm searching for. Is there an option to turn off this table name representation in SSMS? I hope I'm asking this on the right stack exchange site. If you feel it's off base, let me know!

    Read the article

  • Connecting PC to TV via HDMI/DVI: Windows XP doesn't allow the appropriate screen resolution

    - by Jørgen
    I have a computer that is connected to the living room TV (a Panasonic) via HDMI. There is no other monitor connected. My problem is that the computer, which is running Windows XP, does not allow me to set the proper resolution for the TV. Both the graphics adapter and the TV should support the 1280x720 resolution, but it cannot be selected - the only available options are 1280x600 and 800x600, both in the "native" Windows dialog box and the custom Intel graphics options dialog box. Do anyone have a suggestion for a solution for this? Things I've thought of: Setting the resolution directly in the registry (where?) Installing some "custom" monitor driver (the TV manufacturer does not appear to provide any, currently the "generic" one is used) Details on the setup: Connection: DVI output on the computer via a passive DVI-HDMI adapter to the HDMI input on the TV, audio is run on a separate link, the TV is able to combine video and audio without any problem, the problem is there regardless of whether or not the audio is connected. The connection is several meters long through some walls, for this reason using a VGA cable instead is not an option. Note that the report explicitly says that the TV supports 1280x720. Still, I am not allowed to select it in Graphics Options, only 1280x600 and 800x600 is available. For 800x600, there's a lot of black around the edges; for 1280x600, the screen is "zoomed" so the edges of the monitor image (like the taskbar) is not visible. Other: The computer is running Windows XP. More recent versions of Windows are not an option (I have no licence). Linux is probably not an option (some of the video streaming sites I plan to use do not support it, I think) I wrote the rest of the details below. Thanks for any help!! TV: Panasonic TX-L32X10Y, European version; a 720p 32" quite "regular" LCD TV. Allowed resolutions according to manual: Signal name: 640x480 @60HZ Horizontal frequency: 31.47 kHz Vertical frequency: 60Hz Signal name: 750/720) /60p Horizontal frequency: 45.00 kHz Vertical frequency: 60Hz Signal name: 1,125 (1,080) / 60p Horizontal frequency: 67.50 kHz Vertical frequency: 60Hz (this is exactly how the manual presents it. PC via D-SUB (VGA cable) and "regular" HDMI have more alternatives.) Messing with the "zoom" settings on the TV does not affect the available resolution options on the computer. Computer: The following is a printout from one of the graphics adapter option pages. I think it covers most of it. The computer is a Dell. INTEL(R) EXTREME GRAPHICS 2 REPORT Report Date: 04/17/2011 Report Time[hr:mm:ss]: 20:18:02 Driver Version: 6.14.10.4396 Operating System: Windows XP* Professional, Service Pack 3 (5.1.2600) Default Language: English DirectX* Version: 9.0 Physical Memory: 1021 MB Minimum Graphics Memory: 1 MB Maximum Graphics Memory: 96 MB Graphics Memory in Use: 6 MB Processor: x86 Processor Speed: 2593 MHZ Vendor ID: 8086 Device ID: 2572 Device Revision: 02 * Accelerator Information * Accelerator in Use: Intel(R) 82865G Graphics Controller Video BIOS: 2972 Current Graphics Mode: 1280 by 600 True Color (60 Hz) * Devices Connected to the Graphics Accelerator * Active Digital Displays: 1 * Digital Display * Monitor Name: Plug and Play Monitor Display Type: Digital Gamma Value: 2.20 DDC2 Protocol: Supported Maximum Image Size: Horizontal: Not Available Vertical: Not Available Monitor Supported Modes: 1280 by 720 (50 Hz) 1280 by 720 (60 Hz) Display Power Management Support: Standby Mode: Not Supported Suspend Mode: Not Supported Active Off Mode: Not Supported (disclaimer: this question was also asked at the Wikipedia Reference Desk some time ago and might show up in a Google search. I got no useful answers there.)

    Read the article

  • how to declare a public string with a textbox's text

    - by Ian Lundberg
    i am trying to do public string str = txtText.Text; but it wont let me use txtText.txt so how would I declare that so it can be used everywhere? I can't use it in the button1_click event because if I do it messes it up because I am having a string retrieve from the textbox and set to the textbox so it doesn't work right so I have to have it retrieve the textbox's text somewhere else then set to it.

    Read the article

  • Send mail from a Windows script

    - by Jörgen Lundberg
    I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box. The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl is not available on the server. Is there an easy way of doing this from a .bat-file or any other way that doesn't require installing some additional software? Edit: Thanks for the quick replies. The "blat" thingie would probably work fine but with wscript I don't have to use a separate binary. I didn't see PhiLho's post the first time I edited and selected an answer. No need for me to duplicate the code here. Just save the script to a file, say sendmail.vbs, and then call it from the command prompt like so: wscript sendmail.vbs

    Read the article

  • how to edit controls in a system::thread

    - by Ian Lundberg
    I need to be able to add items to a listbox inside of a thread. Code is below. 1. ref class Work 2. { 3. public: 4. static void RecieveThread() 5. { 6. while (true) 7. { 8. ZeroMemory(cID, 64); 9. ZeroMemory(message, 256); 10. if(recv(sConnect, message, 256, NULL) != SOCKET_ERROR && recv(sConnect, cID, 64, NULL) != SOCKET_ERROR) 11. { 12. ID = atoi(cID); 13. String^ meep = gcnew String(message); 14. lbxMessages->Items->Add(meep); 15. check = 1; 16. } 17. } 18. } 19. }; I get the error Error: a nonstatic member reference must be relative to a specific object on line 14. Is there any way to get it to let me do that? Because if I try to use String^ meep; outside of that Thread it doesn't contain anything. It works PERFECT when I use it within the thread but not outside of it. I need to be able to add that message to the listbox. If anyone can help I would appreciate it.

    Read the article

  • Is there a calculator with LaTeX-syntax?

    - by Jørgen Fogh
    When I write math in LaTeX I often need to perform simple arithmetic on numbers in my LaTeX source, like 515.1544 + 454 = ???. I usually copy-paste the LaTeX code into Google to get the result, but I still have to manually change the syntax, e.g. \frac{154,7}{25} - (289 - \frac{1337}{42}) must be changed to 154,7/25 - (289 - 1337/42) It seems trivial to write a program to do this for the most commonly used operations. Is there a calculator which understand this syntax? EDIT: I know that doing this perfectly is impossible (because of the halting problem). Doing it for the simple cases I need is trivial. \frac, \cdot, \sqrt and a few other tags would do the trick. The program could just return an error for cases it does not understand.

    Read the article

  • How do you unit test Scala in Eclipse?

    - by Jørgen Fogh
    I am learning Scala and would like to set up integrated unit testing in Eclipse. As far as I can tell from googling, ScalaTest is the way to go, possibly in combination with JUnit. What are your experiences with unit testing Scala in Eclipse? Should I use the JUnit runner or something else?

    Read the article

  • Recommendation needed for text content, should I use text files or database?

    - by Jörgen
    I'm doing a web application in asp.net mvc. Now I'm at the point where I do alot of text info such as help texts, eula, privacy policy etc. I realized that I'm not sure what would the best way to store these texts. 1. Directly in the aspx page 2. In text files and then load the text via ViewData[] to the aspx file 3. In my sql database If use option 3 how would I then design the database e.g. eula = table x, privacypolicy=table y? I guess I just need some directions of what't the pros and cons with the options above.

    Read the article

  • Can processor cores thrash each other's caches?

    - by Jørgen Fogh
    If more than one core on a processor is accessing the same memory address, will they thrash each other's caches or will some snooping protocol allow each to keep the data in L1-cache? I am interested in a general answer as well as answers for specific processors. How many layers of cache are invalidated? Will accessing another address within the same cache-line invalidate the entire line? What can you do to alleviate these problems?

    Read the article

  • Google I/O 2012 - Getting Direct Feedback from your YouTube Community

    Google I/O 2012 - Getting Direct Feedback from your YouTube Community Eric Lundberg, Jeffrey Posnick Do you want to hear from (and see!) your site's community? We will be sharing a new way to solicit videos from your users. Come and learn about how it was developed and see an example of it put to use as part of the YouTube Direct open source video submission platform. For all I/O 2012 sessions, go to developers.google.com From: GoogleDevelopers Views: 0 0 ratings Time: 40:44 More in Science & Technology

    Read the article

  • multiple calender in exchange web service

    - by user3559462
    i have multiple calender in my mailbox, i can retrieve only one calender that is main calnder folder using ews api 2.0, now i want whole list of calenders and appointments and meetings in that. like i have three calender one is main calnder 1.Calender(color-code:default) 2.Jorgen(color-code:pink) 3.Soren(color-code: yellow) i can retrieve all the values of main "Calnder", using the below code Folder inbox = Folder.Bind(service, WellKnownFolderName.Calendar); view.PropertySet = new PropertySet(BasePropertySet.IdOnly); // This results in a FindItem call to EWS. FindItemsResults<Item> results = inbox.FindItems(view); i = 1; m = results.TotalCount; if (results.Count() > 0) { foreach (var item in results) { PropertySet props = new PropertySet(AppointmentSchema.MimeContent,AppointmentSchema.ParentFolderId,AppointmentSchema.Id,AppointmentSchema.Categories,AppointmentSchema.Location); // This results in a GetItem call to EWS. var email = Appointment.Bind(service, item.Id, props); string iCalFileName = @"C:\export\appointment" +i ".ics"; // Save as .eml. using (FileStream fs = new FileStream(iCalFileName, FileMode.Create, FileAccess.Write)) { fs.Write(email.MimeContent.Content, 0, email.MimeContent.Content.Length); } i++; } now i want to get all the remaining calender schedules also, i am not able to get is Please help, need it urgently

    Read the article

  • SHGetFolderPath returns path with question marks in it

    - by Colen
    Hi, Our application calls ShGetFolderPath when it runs, to get the My Documents folder. This normally works great. However, for three users - ???????, Jörg and Jörgen (see if you can spot the pattern!) - the call returns some very strange results. For example, for ???????, the call returns: c:\Users\???????\Documents I assume there's some sort of character encoding shenanigan going on here, possibly related to Unicode, but I don't have any experience with that sort of thing. How can I get a useful path to the folder (and other related folders) out of windows, without grovelling through registry keys for the information? In an email to me, ??????? ("Dmitry"), told me his "my documents" folder was actually located here: C:\Users\43D6~1\Documents So I know there's a way to get a "normal" version of the path out of Windows, I just don't know what it is. Background: Our application is not unicode-aware, and uses standard "char *" strings. How can we get the "normal" path? I'm not opposed to calling the "unicode" version of the function, then converting it to "normal" text, if that's possible. Converting the application entirely to use unicode is not an option here (we don't have the time). Thanks.

    Read the article

1