windows-8

Why does the Node.js scripts console close instantly in Windows 8?

妖精的绣舞 提交于 2020-01-11 05:45:07
问题 I've tried nearly every example for scripts I can find. Every sample opens the terminal for a split second. Even this closes as soon as input is entered. Is this normal? var rl = require('readline'); var prompts = rl.createInterface(process.stdin, process.stdout); prompts.question("How many servings of fruits and vegetables do you eat each day? ", function (servings) { var message = ''; if (servings < 5) { message = "Since you're only eating " + servings + " right now, you might want to start

Execute automatic change connected displays in Windows 8

本秂侑毒 提交于 2020-01-10 19:33:10
问题 Short version How do I automate changing multiple display settings? NVIDIA, 3x monitors (2x DVI and 1x HDMI), GPU only supports 2 active monitors. Long version So I have a NVIDIA GeForce GTX 560 Ti which can run two displays simultaneously. It has two DVI connections and one HDMI . I often swap from using my two desktop monitors and connect only one of the desktop monitors plus my TV using HDMI . I would like to automate the change back and forward using a batch script or other program

How to get the mac address in WinRT (Windows 8) programmatically?

时光怂恿深爱的人放手 提交于 2020-01-10 04:15:26
问题 I am looking for an API in WinRT to access the mac address. 回答1: You can't retrieve the MAC Address per say, but you do can retrieve hardware specific information to identify a machine if that's what you're trying to do. Here's a complete msdn article discussing the subject: Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic (Windows) Be careful to use just the information you need and not the complete id, as it might change based on information that are

Handling WinRT StreamSocket disconnects (both server and client side)

最后都变了- 提交于 2020-01-10 03:04:19
问题 I have an application I'm writing for Windows 8/WinRT that uses the StreamSocket API to do a streaming connection to a server. That is to say, the server streams data to the client, sometimes with meta tags, and can disconnect at any time. The problem I'm having is that I have no idea how to detect when the server has disconnected. There don't appear to be any events or properties on the StreamSocket class, either its input or output streams, or on the DataReader/DataWriter classes that have

Address is invalid on local machine [on windows 8 only]

扶醉桌前 提交于 2020-01-09 08:12:32
问题 I want to check the status code of request to url but getting code java.net.ConnectException: connect: Address is invalid on local machine or port is not valid on remote machine here is my code public static boolean linkExists(String URLName){ URLName = "http://www.google.com"; try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection(); con.connect(); System.out.println(con.getResponseCode()); return (con.getResponseCode()

Address is invalid on local machine [on windows 8 only]

拟墨画扇 提交于 2020-01-09 08:12:09
问题 I want to check the status code of request to url but getting code java.net.ConnectException: connect: Address is invalid on local machine or port is not valid on remote machine here is my code public static boolean linkExists(String URLName){ URLName = "http://www.google.com"; try { HttpURLConnection.setFollowRedirects(false); HttpURLConnection con = (HttpURLConnection) new URL(URLName).openConnection(); con.connect(); System.out.println(con.getResponseCode()); return (con.getResponseCode()

Improper WinRT exception behavior

被刻印的时光 ゝ 提交于 2020-01-07 04:18:08
问题 I observe very strange exception handling behavior in any Windows 8.1 (WinRT) application. I've created default project "Blank App (Windows 8.1)", declared MyException exception class and throw it in button's click event handler. I have submitted to Application.UnhandledException event and trying to get the type of received exception. Sometimes it is my exception, sometimes it is common System.Exception . Sometimes debugger shows it is common Exception but application works as it would be

Pixastic javascript library is returning false in image tag when i am trying to use it in Windows 8 Metro Style app in javascript?

社会主义新天地 提交于 2020-01-07 02:30:46
问题 I am trying to use Pixastic JavaScript library for image manipulation in Windows 8 Metry Style app using JavaScript as language. I am passing canvas as input parameter and trying to get image and binging again to canvas but the image value that i am getting all the time is FALSE. CODE: // First, draw it into the backing canvas context.drawImage(video, 0, 0, width, height); // change brightness and contrast Pixastic.Client.isIE = false; Pixastic.process(canvas, 'brightness', { 'brightness': 2,

passing some argument to the callback function of WinJs xhr

假装没事ソ 提交于 2020-01-07 02:29:11
问题 In Windows 8, I am using WinJs.xhr in a loop to download some content, and as it arrives afterward to the "done callback", I would like to pass an argument to retrieve the element who call xhr. for (var k = 0 ; k < 9; k++) { var title = dataArray[k].name; if (title != null) url = monUrl+ title; WinJS.xhr({ url: url, responseType: "responseXML" }) .done(function complete(result) { //I would like to retrieve the right title here for example var dataArray = new Array(); var xml = result

create image from character

心不动则不痛 提交于 2020-01-06 20:01:28
问题 I'm using standard styles for my Metro app. Most of these styles contains an Image and I wanna use Segoe UI Symbol s as these images. how can I achieve this? 回答1: You can insert the "character" in any text content that is using the Segoe UI Symbol as the font. If I wanted a Favorite's Star in a TextBlock, it would look like this... <TextBox x:Name="textBox" HorizontalAlignment="Left" Margin="372,375,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top" FontFamily="Segoe UI Symbol"/> If I