local

VB.Net - Local WMI Connection with user credentials

扶醉桌前 提交于 2019-12-05 08:12:21
问题 In VB.Net, I'm trying to connect to WMI on my local computer with different credentials (the user won't have admin rights) and I get this exception : « User credentials cannot be used for local connections » Here's the code : Dim path As ManagementPath = Nothing Dim options As ConnectionOptions = Nothing Dim scope As ManagementScope = Nothing path = New ManagementPath("\\" & vServerName & "\root\CIMV2") options = New ConnectionOptions options.Username = vUsername options.Password = vPassword

Which type to declare to avoid copy and make sure returned value is moved

a 夏天 提交于 2019-12-05 08:00:58
问题 Suppose that I have a function A f() ; I want to initialize a local variable a to the return value of f ; I don't want to rely on RVO; What is the best option (and why) to avoid the return value of f being copied when a may have to be modified I know that a will not be modified Options: a) A a = f(); b) A&& a = f(); c) const A& = f(); d) const A&& = f(); EDIT: I would say: b) c) Because both use references and avoid an extra copy (which could be avoided by RVO as well, but that is not

Large XML Files and Pagination, is it possible?

家住魔仙堡 提交于 2019-12-05 07:42:53
The problem When opening very large XML files locally, on your machine, it's almost a certainty that it will take an age for that file to open - it can often mean your computer locks down because it thinks it's not responding. This is an issue if you serve users XML backups of rather complex databases or systems they use - the likehood of them being able to open large backups, let alone use them, is slim. Is pagination possible? I use XSLT to present readable backups to users. In this same way, would it be possible to pull only a page at a time of data, to prevent the entire file from being

ios - local notification not updating badge number when application is closed

倾然丶 夕夏残阳落幕 提交于 2019-12-05 07:24:28
I have noticed that when a local notification is being received in an ios device, the notification appears in the Notification Center but the app badge number is not updated when the app is closed. I need to touch the notification in the Notification Center for the local push message to be transferred to the app. Is this the normal behavior? Can this be solved by using remote push notifications? staticVoidMan You can utilize the applicationIconBadgeNumber parameter in a UILocalNotification object. Basically: localNotificationObject.applicationIconBadgeNumber++; Example: UILocalNotification

In Java, do methods that don't use static or class variables need to be synchronized?

耗尽温柔 提交于 2019-12-05 07:05:28
Do methods that only use local variables inside suffer any threading issues ?. Somewhere it was mentioned that the method with local variables are copied to each thread stack frame to work with and do not need to synchronized for multithreaded implementation unless it uses class level or static references/variables ? JUST MY correct OPINION If your method only operates on parameters and locally-defined (as opposed to class member) variables then there are zero synchronization problems to worry about. But... This means any mutable reference types you use must live and die only within the scope

Pointers and memory scope

孤者浪人 提交于 2019-12-05 05:39:58
I have been programming C for a while (but still pretty new to C) and I am sometimes getting confused of the way the C is handling the memory. Consider following valid C snippet: const char *string(void) { /* where is this pointer variable located in the memory? */ const char *s; /* where is this text data located in the memory? */ /* and when the program allocates memory for it? */ s = "Hello, World"; return s; } int main(void) { printf( "%s", string() ); return 0; } I am asking what exactly is going on in the memory? Isn't the pointer variable 's' a local variable or where is the pointer

Sending mail to local mail server - “SENT: 550 The address is not valid.”

◇◆丶佛笑我妖孽 提交于 2019-12-05 02:01:35
I am trying to send mail to my local mail server. I am using hMailServer as mail server and I have configured it as mentioned here: Setting up local Mail (SMTP, POP3, IMAP) Server on XAMPP But when I try to send mail I am getting this error: ( ! ) Warning: mail() [function.mail]: SMTP server response: 550 The address is not valid. in C:\wamp\www\kariyersitem\register.php on line 161 Log files of the mail server indicates this error as below: "DEBUG" 3108 "2012-01-08 18:04:24.447" "Creating session 14" "SMTPD" 3108 14 "2012-01-08 18:04:24.448" "127.0.0.1" "SENT: 220 localhost ESMTP" "SMTPD"

Is it possible to create function-local closures pre-C++11?

烂漫一生 提交于 2019-12-05 01:45:29
问题 With C++11, we get lambdas, and the possibility to create functions/functors/closures on-the-fly where we actually need them, not somewhere where they don't really belong. In C++98/03, a nice way to make function-local functors/closures would've been the following: struct{ void operator()(int& item){ ++item; } }foo_functor; some_templated_func(some_args, foo_functor); Sadly, you can't use local types for templates (Visual Studio allows this with language extensions enabled). My train of

Xcode UIWebView local HTML

天大地大妈咪最大 提交于 2019-12-05 01:43:29
问题 I know HTML, javascript, CSS… but I wanted to make a native/hybrid iPhone app using HTML5 but without using something like PhoneGap or Nimblekit. I never wrote a real (not web app) iPhone app before, so i don't really know anything about Xcode. I already made a UIWebView with a tutorial that i found, but it displays a website (apple.com). How can i make this display a local file (index.html)? My code in ViewController.m under (void)viewDidLoad: [super viewDidLoad]; NSString *fullURL = @"html

Loading fixed-width, space delimited .txt file into mySQL

孤街浪徒 提交于 2019-12-05 00:28:37
问题 I have a .txt file that has a bunch of formatted data in it that looks like the following: ... 1 75175.18 95128.46 1 790890.89 795829.16 1 875975.98 880914.25 8 2137704.37 2162195.53 8 2167267.27 2375275.28 10 2375408.74 2763997.33 14 2764264.26 2804437.77 15 2804504.50 2881981.98 16 2882048.72 2887921.25 16 2993093.09 2998031.36 19 3004104.10 3008041.37 ... I am trying to load each row as an entry into a table in my database, where each column is a different field. I am having trouble