Search Results

Search found 1369 results on 55 pages for 'jc martin'.

Page 33/55 | < Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >

  • Is Win32_PerfFormattedData_PerfDisk_PhysicalDisk missing from WMI in Vista?

    - by Martin
    From what I understand, the following script should work in Windows XP and higher, but it doesn't work for me in Vista Business 32-bit Service Pack 2. Thus far I have been very unsuccessful googling for information about this performance class. strComputer = "." Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2") Set colApps = objWMIService.ExecQuery("Select * from Win32_PerfFormattedData_PerfDisk_PhysicalDisk") For Each objApp in colApps Wscript.Echo objApp.Caption Next Does this WMI class simply not exist in Vista? If it is just me, is there a way to fix WMI? I have already tried running winmgmt /resetrepository and winmgmt /resyncperf and neither helps.

    Read the article

  • multipart file-upload post request from java

    - by Martin
    I'm trying to make a program that uploads a image to a webserver that accepts multipart file-uploads. More specificly i want to make a http POST request to http://iqs.me that sends a file in the variable "pic". I've made a lot of tries but i don't know if i've even been close. The hardest part seems to be to get a HttpURLConnection to make a request of the type POST. The response i get looks like it makes a GET. (And i want to do this without any third party libs) UPDATE: non-working code goes here (no errors but doesn't seem to do a POST): HttpURLConnection conn = null; BufferedReader br = null; DataOutputStream dos = null; DataInputStream inStream = null; InputStream is = null; OutputStream os = null; boolean ret = false; String StrMessage = ""; String exsistingFileName = "myScreenShot.png"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; String responseFromServer = ""; String urlString = "http://iqs.local.com/index.php"; try{ FileInputStream fileInputStream = new FileInputStream( new File(exsistingFileName) ); URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setUseCaches(false); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); dos = new DataOutputStream( conn.getOutputStream() ); dos.writeBytes(twoHyphens + boundary + lineEnd); dos.writeBytes("Content-Disposition: form-data; name=\"pic\";" + " filename=\"" + exsistingFileName +"\"" + lineEnd); dos.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0){ dos.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); fileInputStream.close(); dos.flush(); dos.close(); }catch (MalformedURLException ex){ System.out.println("Error:"+ex); }catch (IOException ioe){ System.out.println("Error:"+ioe); } try{ inStream = new DataInputStream ( conn.getInputStream() ); String str; while (( str = inStream.readLine()) != null){ System.out.println(str); } inStream.close(); }catch (IOException ioex){ System.out.println("Error: "+ioex); }

    Read the article

  • Parsec Haskell Lists

    - by Martin
    I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input and get a HTML output. If my input is: * First item, First level ** First item, Second level ** Second item, Second level * Second item, First level My output should be: <ul><li>First item, First level <ul><li>First item, Second level </li><li>Second item, Second level </li></ul></li><li>Second item, First level</li></ul> I wrote this, but obviously does not work recursively list= do{ s <- many1 item;return (olist << s) } item= do{ (count 1 (char '*')) ;s <- manyTill anyChar newline ;return ( li << s) } Any ideas? the recursion can be more than two levels Thanks!

    Read the article

  • How to use xcode compiler warnings to determine minimum IOS deployment target

    - by Martin Bayly
    I'm building an iOS app using Xcode 3.2.5 with the Base SDK set to iOS 4.2 I know I've used some api's from 4.0 and 4.1 but not sure about whether I actually require 4.2. According to the iOS Development Guide, "Xcode displays build warnings when it detects that your application is using a feature that’s not available in the target OS release". So I was hoping to use the compiler warnings to derive my minimum OS requirement. However, even when I set my iOS Deployment Target to iOS 3.0, I still don't get any compiler warnings. I must be doing something wrong, but not sure what? Can anyone confirm that they get compiler warnings when the iOS deployment target is less than the base SDK and the code uses base SDK functions? Or do the compiler warnings only show if you link a framework that didn't exist in the iOS deployment target version?

    Read the article

  • Cache inferno - how can Model.A be two different things at the same time?

    - by Martin
    I have this <%=Model.StartDate%> <%=Html.Hidden("StartDate", Model.StartDate)%> it outputs: 2010-05-11 11:00:00 +01:00 <input type="hidden" value="2010-03-17 11:00:00 +01:00" name="StartDate" id="StartDate"> What the... It's a paging mechanism so the hidden value was valid on the first page and I've been able to move forward to the next page. But since the values won't update properly it ends there. What do I need to do. Using firefox.

    Read the article

  • Get HTML element informations in .NET

    - by martin.malek
    Hi, I'm just thinking if there is any way how to get information about element in HTML in my .NET application. The input is HTML page and path to CSS files etc. I want to take e.g. H1 tag and found what will be the CSS for it. Is there any code or can I use IE and try to take this information from it automatically inside of my application?

    Read the article

  • Show different sub-sets of a view model's properties in an edit view

    - by Martin R-L
    In the context of C# 4, ASP.NET MVC 2, and NHibernate; I've got the following scenario: Let's assume an entity Product that have an association to ProductType. In a product edit view; how do I implement that only a sub-set of the product's properties are shown based on the ProductType association in an elegant and DRY way? I.e., different properties shall be shown for different values of a property of the ProductType. Use a product view model builder, and from different view models automagically generate the view with my own Html.EditorForModel() (including drop-downs and other stuff not out-of-the-box)? Attribute the properties of one view model and use the Html.EditorForModel() way aforementioned? Use one model, but implement different web controls (view strategies) (can it be done DRY?)? Something else entirely?

    Read the article

  • cross-user C# mutex

    - by Martin
    My app is forced to use a 3rd party module which will blue-screen Windows if two instances are started at the same time on the same machine. To work around the issue, my C# app has a mutex: static Mutex mutex = new Mutex(true, "{MyApp_b9d19f99-b83e-4755-9b11-d204dbd6d096}"); And I check if it's present - and if so I show an error message and close the app: bool IsAnotherInstanceRunning() { if (mutex.WaitOne(TimeSpan.Zero, true)) return (true); else return (false); } The problem is if two users can log in and open the application at the same time, and IsAnotherInstanceRunning() will return false. How do I get around this?

    Read the article

  • To what point is making an HTML page valid worth it?

    - by Martín Fixman
    Since a long time ago, when I found out about the W3C Validator, I made sure every HTML document I made was valid HTML. However, I think sometimes it just isn't necessary to waste time making it valid. Of course, for actual Internet pages may be important, but is making pages on an Intranet, or even little front-ends that are used with other programs, when the HTML page renders correctly in the most used browsers (not necessarily counting IE 6 and 7). I think I'm mostly talking about little improvements over code, such as wrapping every shown element of the page on <p> or <div> tags.

    Read the article

  • How Can I Automatically Execute A Link In Internet Explorer

    - by Martin
    I am trying to create an application to print documents over the web. I have created my document, and made a web page with a meta refresh tag, along the lines of this: <meta http-equiv="refresh" content="3;http://example.com/download.epl2" /> I specify that the document has a content-type of application/x-epl2, and I have associated .epl2 files on my computer with a program that silently sends them to the printer. I have put the website into my trusted sites zone. Currently Internet Explorer pops up the "Open, Save, Cancel" dialog box with no option to automatically open the file. Is there a setting in IE6/7/8 that I can use to have IE just open the file without prompting?

    Read the article

  • Changing timezone without changing time in Java

    - by Martin
    Hi! I'm receiving a datetime from a SOAP webservice without timzone information. Hence, the Axis deserializer assumes UTC. However, the datetime really is in Sydney time. I've solved the problem by substracting the timezone offset: Calendar trade_date = trade.getTradeDateTime(); TimeZone est_tz = TimeZone.getTimeZone("Australia/Sydney"); long millis = trade_date.getTimeInMillis() - est_tz.getRawOffset(); trade_date.setTimeZone( est_tz ); trade_date.setTimeInMillis( millis ); However, I'm not sure if this solution also takes daylight saving into account. I think it should, because all operations are on UTC time. Any experiences with manipulating time in Java? Better ideas on how to solve this problem?

    Read the article

  • Bind any version of MySql.Data using the app.config

    - by Martin Kirsche
    How do I bind any version or a range of versions of an assembly by using the app.config? I'm currently binding the MySql.Data assembly like this: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1" applies-to="v2.0.50727"> <qualifyAssembly partialName="MySql.Data" fullName="MySql.Data, Version=6.2.2.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"/> </assemblyBinding> </runtime> Any version of MySql.Data other than 6.2.2.0 is not working this way. The versions of this assembly are changing fast so I either want to bind any or all versions beginning with 6.2 to my application without changing the app.config each time.

    Read the article

  • passing unicode string from C# exe to C++ DLL

    - by Martin
    Using this function in my C# exe, I try to pass a Unicode string to my C++ DLL: [DllImport("Test.dll", CharSet = CharSet.Unicode, CallingConvention = CallingConvention.StdCall)] public static extern int xSetTestString(StringBuilder xmlSettings); This is the function on the C++ DLL side: __declspec(dllexport) int xSetTestString(char* pSettingsXML); Before calling the function in C#, I do a MessageBox.Show(string) and it displays all characters properly. On the C++ side, I do: OutputDebugStringW((wchar_t*)pString);, but that shows that the non-ASCII characters were replaced by '?'.

    Read the article

  • Parsec Haskell to HTML

    - by Martin
    I'm using Text.ParserCombinators.Parsec and Text.XHtml to parse an input like this: hello 123 --this is an emphasized text-- bye\n And my output should be: <p>hello 123 <em>this is an emphasized text</em> bye\n</p> Any ideas? Thanks!!

    Read the article

  • What does the :compiler command do in Vim?

    - by Martín Fixman
    I recently found that there is a command in Vim called compiler. You can call it with any common compiler (for example, :compiler gcc, :compiler php, etc.), but it doesn't seem to have any immediate effect. I searched on the manpages but didn't find anything useful about what it actually does, nor does the Vim Wiki. Does anyone know what that command actually does?

    Read the article

  • Does Scheme work with Microsoft COM?

    - by Martin
    I'm new to Scheme -- the functional programming language and I like it a lot for its first-class/higher-order functions. However, my data comes from a COM source with an object-oriented API. I know Scheme and COM belong to different programming paradigms, but I'm wondering if there is any interface or a way for Scheme to connect to a COM source? Thanks.

    Read the article

  • IEnumerable.Cast not calling cast overload

    - by Martin Neal
    I'm not understanding something about the way .Cast works. I have an explicit (though implicit also fails) cast defined which seems to work when I use it "regularly", but not when I try to use .Cast. Why? Here is some compilable code that demonstrates my problem. public class Class1 { public string prop1 { get; set; } public int prop2 { get; set; } public static explicit operator Class2(Class1 c1) { return new Class2() { prop1 = c1.prop1, prop2 = c1.prop2 }; } } public class Class2 { public string prop1 { get; set; } public int prop2 { get; set; } } void Main() { Class1[] c1 = new Class1[] { new Class1() {prop1 = "asdf",prop2 = 1}}; //works Class2 c2 = (Class2)c1[0]; //doesn't work: Compiles, but throws at run-time //InvalidCastException: Unable to cast object of type 'Class1' to type 'Class2'. Class2 c3 = c1.Cast<Class2>().First(); }

    Read the article

  • multipart file-upload post request from java

    - by Martin
    I'm trying to make a program that uploads a image to a webserver that accepts multipart file-uploads. More specificly i want to make a http POST request to http://iqs.me that sends a file in the variable "pic". I've made a lot of tries but i don't know if i've even been close. The hardest part seems to be to get a HttpURLConnection to make a request of the type POST. The response i get looks like it makes a GET. (And i want to do this without any third party libs) UPDATE: non-working code goes here (no errors but doesn't seem to do a POST): HttpURLConnection conn = null; BufferedReader br = null; DataOutputStream dos = null; DataInputStream inStream = null; InputStream is = null; OutputStream os = null; boolean ret = false; String StrMessage = ""; String exsistingFileName = "myScreenShot.png"; String lineEnd = "\r\n"; String twoHyphens = "--"; String boundary = "*****"; int bytesRead, bytesAvailable, bufferSize; byte[] buffer; int maxBufferSize = 1*1024*1024; String responseFromServer = ""; String urlString = "http://iqs.local.com/index.php"; try{ FileInputStream fileInputStream = new FileInputStream( new File(exsistingFileName) ); URL url = new URL(urlString); conn = (HttpURLConnection) url.openConnection(); conn.setDoInput(true); conn.setDoOutput(true); conn.setRequestMethod("POST"); conn.setUseCaches(false); conn.setRequestProperty("Connection", "Keep-Alive"); conn.setRequestProperty("Content-Type", "multipart/form-data;boundary="+boundary); dos = new DataOutputStream( conn.getOutputStream() ); dos.writeBytes(twoHyphens + boundary + lineEnd); dos.writeBytes("Content-Disposition: form-data; name=\"pic\";" + " filename=\"" + exsistingFileName +"\"" + lineEnd); dos.writeBytes(lineEnd); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); buffer = new byte[bufferSize]; bytesRead = fileInputStream.read(buffer, 0, bufferSize); while (bytesRead > 0){ dos.write(buffer, 0, bufferSize); bytesAvailable = fileInputStream.available(); bufferSize = Math.min(bytesAvailable, maxBufferSize); bytesRead = fileInputStream.read(buffer, 0, bufferSize); } dos.writeBytes(lineEnd); dos.writeBytes(twoHyphens + boundary + twoHyphens + lineEnd); fileInputStream.close(); dos.flush(); dos.close(); }catch (MalformedURLException ex){ System.out.println("Error:"+ex); }catch (IOException ioe){ System.out.println("Error:"+ioe); } try{ inStream = new DataInputStream ( conn.getInputStream() ); String str; while (( str = inStream.readLine()) != null){ System.out.println(str); } inStream.close(); }catch (IOException ioex){ System.out.println("Error: "+ioex); }

    Read the article

  • Custom editor in QAbstractTableModel

    - by Martin Beckett
    Does anyone have an example of using a QWidget as an editor in a QAbstractTableModel? I have a column which when edited should create a QCombobox with the list of choices. The docs seem to suggest I need to write a QAbstractItemDelegate and a custom paint function but that seems overkill to simply pop-up a standard QCombobox in Qt::EditRole. Note - the combo box contents are the same for every row and it only needs to be shown when somebody clicks in the cell. I know this should be simple but I can't get it to work. It's easy for a QTableWidget based table - but I need it for a very large data table.

    Read the article

< Previous Page | 29 30 31 32 33 34 35 36 37 38 39 40  | Next Page >