instruction stringlengths 0 30k ⌀ |
|---|
Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Adminstrator running in the background? |
|installation|registry|windows-services|runonce| |
Is there any way to force an update of software using RunOnce, without having an administrator log in, if there is a service running as Adminstrator running in the background?
**EDIT**: The main thing I want to be able to do is Run when the RunOnce does, I.E. before Explorer starts. I need to be able to install thi... |
SOLID principles and Liskov's pattern, along with Single responsibility pattern. |
Generally I advise against it. Entities are just that and should represent some identifiable and important part of your core domain. They should have one responsibility and be very, very good at doing it. If the entity requires additional services in order to complete a task (say persist itself) you're starting to let ... |
In reference to the comment above about walking the heap.
Different GC's do it different ways.
Typically copying collectors when they walk the heap, they don't walk all of the objects in the heap. Rather they walk the LIVE objects in the heap. The implication is that if it's reachable from the "root" object, the... |
I don't think anyone has mentioned this yet. Learning a new language can be fun! Surely that's a good enough reason to try something new. |
JDB is incredibly difficult to use. Placing System.outs or using an IDE debugger will produce better results. And for the more interesting features (e.g. tracking threads, heap size, etc.), you can get the information graphically with the [JConsole][1] tool.
[1]: http://java.sun.com/developer/technicalArticles/J... |
Best C++ IDE or Editor for Windows |
|c++|ide|editor| |
What is the best C++ IDE or editor for using on Windows? I use Notepad++, but am missing IntelliSense from Visual Studio. |
The largest commonality you'll find in functional languages is using functions to store data. It's a bit like using accessor functions on an object without the object. Instead, the function is created in an environment where it has access to the data it needs. Now this function can be passed and used anywhere and still... |
Functionally, the two are the same; `open` will call `file` anyway, so currently the difference is a matter of style. The [Python docs][1] recommend using `open`.
> When opening a file, it's preferable to use open() instead of invoking the file constructor directly.
The reason is that in future versions they is... |
How to return the date part only from a SQL Server datetime datatype |
|sql-server|date| |
SELECT GETDATE()
Returns: <code>2008-09-22 15:24:13.790</code>
I want that date part without the time part: <code>2008-09-22 00:00:00.000</code> |
|sql|sql-server|date| |
htmlencode/htmldecode should do the trick. |
A Player.addCardToHand() method is not unreasonable, if you have no reason to otherwise expose a Hand. This is probably ideal in some ways, as you can still provide copies of the Hand for win-checking comparisons, and no-one can modify them. |
I'd actually be tempted to add a birthmonth column, if you expect the list of customers to get very large. So far, the queries I've seen (including the example) will require a full table scan, as you're passing the the data column to a function and comparing that. If the table is of any size, this could take a fair amo... |
I say all the following not because I think you don't already know it, but to provide moral support while you suppress your inner critic :-)
The key is to retain sanity.
If you find yourself writing a Theta(N!) algorithm which is expected to scale, then you're crazy. You'll have to throw it away, so you might as... |
You'll need to tell us what `pUnkReturn` is and how it's defined.
You'll also need to tell us what the handler for s_MaxGetTaskInterface is expecting.
If you expect the handler to populate whatever is pointed to by pUnkReturn, then you'll need to call SendMessage with (WPARAM)pUnkReturn, however if the handler re... |
you can construct your entity set from a IEnumerable using a helper class, something like:
public static class EntityCollectionHelper
{
public static EntitySet<T> ToEntitySet<T>(this IEnumerable<T> source) where T:class
{
EntitySet<T> set = new EntitySet<T>();
set... |
lassevk,
Thanks for that (semantic nitpicking aside :=) - however, maybe I wasn't as clear as I could be, I was trying to *show* rather than *tell* as to someone new to development, a block of prose like that means about as much as the average bit of Star Trek-esque technobabble.
The page Grimtron linked to, and ... |
If you installed mysql it with ports:
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
or sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5-devel.plist
if you installed mysql5-devel |
If you installed mysql5 package with macports:
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist
or
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql5-devel.plist
if you installed mysql5-devel package. |
Idea or IoC is to delegate part of your component functionality to other part of the system. In IoC world you have components that don't know about each other. You example violates this, you're creating tight coupling between MyClass and some implementation of IMyInterface
|
Idea or IoC is to delegate part of your component functionality to other part of the system. In IoC world you have components that don't know about each other. You example violates this, you're creating tight coupling between MyClass and some implementation of IMyInterface. **Main idea** is that your component **has no... |
There is a re-captcha plugin if you want to use captch to verifye that only human can register, or add content: http://ambethia.com/recaptcha/files/README_rdoc.html |
How to configure ResourceBundleViewResolver in Spring Framework 2.0 |
|java|spring|frameworks| |
Everywhere I look always the same explanation pop ups.<br/>
Configure the view resolver.
<bean id="viewMappings"
class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<property name="basename" value="views" />
</bean>
And then put a file in the classpath named view.properties with ... |
You can add Attributes to ListItems programmatically as follows.
Say you've got a CheckBoxList and you are adding ListItems. You can add Attributes along the way.
ListItem li = new ListItem("Richard Byrd", "11");
li.Selected = false;
li.Attributes.Add("Style", "color: red;");
CheckBoxList1.Ite... |
Trying using [synonyms][1] for linked databases.
[1]: http://msdn.microsoft.com/en-us/library/ms177544.aspx |
Tempting, but I don't think this feature warrants a new keyword in Java (and that much more complexity in the language).
I've found the use of Throwable.printStackTrace has usually been plenty to quickly point to the problems that need my attention.
|
As Jim McKeeth points out, you can't get a definitive answer, but it seems to me that one could *partially* answer the question by some static analysis: given a particular function/procedure, construct a call graph. Check each of the functions in that call graph for a raise statement. That would tell you, for instance,... |
You can include CSS inside an HTML page. It goes within the `<style>` tag, which goes within the `<head>` tag:
<head>
<style type="text/css">
body{ background-color: blue; }
</style>
</head>
Note, however, that it is best practice to use .css files. |
Mod rewrite can't do (potentially) boundless replaces like you want to do in the second part of your question. But check out the External Rewriting Engine at the bottom of the [Apache URL Rewriting Guide][guide]:
> External Rewriting Engine
> Description:
> A FAQ: How can we solve the FOO/BAR/QUUX/etc. problem... |
My bank does this too. It used to allow any password, and I had a 20 character one. One day I changed it, and lo and behold it gave me a maximum of 8, and had cut out non-alphanumeric characters which were in my old password. Didn't make any sense to me.
All the back-end systems at the bank worked before when I was ... |
I generally stay away from stored procedures because it adds load to the database which is 99% of the time, your biggest bottleneck. Adding a new php server is nothing compared to making your MySQL db replicate. |
In my experience, White box reuse is normally done through inheritance and black box is done through composition.
# White Box Reuse
Pro: You can customize the module to fit the specific situation, this allows reuse in more situations
Con: You now own the customized result, so it adds to your code complexity.
... |
At one point (in the 90s) MIPS-derived processors were the best selling processors in the world, dwarfing sales of Intel x86 processors. This was because of their huge presence in the embedded market. I think now ARM-based processors may have taken over that title, but there are still tons of embedded systems out there... |
At one point (in the 90s) MIPS-derived processors were the best selling processors in the world, dwarfing sales of Intel x86 processors. This was because of their huge presence in the embedded market. I think now ARM-based processors may have taken over that title, but there are still tons of embedded systems out there... |
These directives does not mitigate any security risk. They are really intended to force UA's to refresh volatile information, not keep information from being retained. See [this similar question][1].
[1]: http://stackoverflow.com/questions/64059/is-there-a-way-to-keep-a-page-from-rendering-once-a-person-has-log... |
Um, that's because Visual Studio is the best IDE. Come back to the darkside. |
There's a key in the Registry that's used to hide mapped drives.
If you want to stop any combination of drives appearing in My Computer
Add the Binary Value of 'NoDrives' in the registry at
> "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
Here is the table of all the values... |
There's a key in the Registry that's used to hide mapped drives.
If you want to stop any combination of drives appearing in My Computer
Add the Binary Value of 'NoDrives' in the registry at
> "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"
Here is the table of all the values... |
`use strict;`. Always.
Try declaring
our %in;
and seeing if that helps. Failing that, `strict` may produce a more useful error. |
Benefits of using short-circuit evaluation |
|architecture|pipeline| |
boolean a = false, b = true;
if ( a && b ) { ... };
In most languages, `b` will not get evaluated because `a` is false so `a && b` cannot be true. My question is, wouldn't short circuiting be slower in terms of architecture? In a pipeline, do you just stall while waiting to get the result of a to determine ... |
boolean a = false, b = true;
if ( a && b ) { ... };
In most languages, `b` will not get evaluated because `a` is false so `a && b` cannot be true. My question is, wouldn't short circuiting be slower in terms of architecture? In a pipeline, do you just stall while waiting to get the result of a to determine ... |
I say all the following not because I think you don't already know it, but to provide moral support while you suppress your inner critic :-)
The key is to retain sanity.
If you find yourself writing a Theta(N!) algorithm which is expected to scale, then you're crazy. You'll have to throw it away, so you might as... |
To add on what JayTee mentioned - loading functionality when you need it. If you're not using any of the frameworks that do this automatically, you might want to look into the __autoload() functionality that was introduced in PHP5 - basically, your own logic can be invoked when you instantiate a particular class if it'... |
Ive been using htmlentities/html_entity_decode but for some reason it doesnt work with the parser. In a normal test it works, but parser always returns html code without < > " characters. |
I recommend [Rome][1].
[1]: https://rome.dev.java.net/ |
Your method needs to return a pointer or a refernce to the player's Hand object. You could then call it like "player1.getHand()->addCard(c)". Note that that is the syntax you'd use it it were a pointer. |
If you're in Windows, you want [GetFileSizeEx (MSDN)][1]. The return value is a 64bit int.
On linux [stat64 (manpage)][2] is correct. fstat if you're working with a FILE*.
[1]: http://msdn.microsoft.com/en-us/library/aa364957(VS.85).aspx
[2]: http://www.manpagez.com/man/2/stat64/ |
Return a reference to the hand object eg.
Hand &Player::getHand() {
return hand;
}
Now your addCard() function is operating on the correct object. |
[PyInstaller][1] will create a single .exe file with no dependencies; use the `--onefile` option. It does this by packing all the needed shared libs into the executable, and unpacking them before it runs.
I use the version from svn, the latest release is somewhat outdated.
[1]: http://pyinstaller.python-hosti... |
These directives does not mitigate any security risk. They are really intended to force UA's to refresh volatile information, not keep UA's from being retaining information. See [this similar question][1]. At the very least, there is no guarantee that any routers, proxies, etc. will not ignore the caching directives as... |
[http://technet.microsoft.com/en-us/library/cc772833.aspx][1] has it all.
Run the drainstop and then query until it is drained.
**nlb query *yourServer***
[1]: http://technet.microsoft.com/en-us/library/cc772833.aspx |
C# COM Office Automation - RPC_E_SYS_CALL_FAILED |
|c#|com| |
I'm writing a C# program that acts as a PowerPoint 2007 plugin. On some machines, some calls to the PowerPoint object model throws a COMException with the message RPC_E_SYS_CALL_FAILED. I couldn't find any specific advice on what to do regarding this error, or how to avoid it. From Googling it looks like something to d... |
An important value behind CodeSite is Ray Kanopka's support. He personally answers emails and newsgroup posts, and has done so for many years. His answers often contain code that illustrates excellent coding habits. |
I was the for loop for clarity. While I use the *while loop* when faced with some undeterministic condition. |
Developing Windows Mobile Applications and availability of Database Projects are the showstoppers for me (this applies to Visual Studio 2008).
That's it really. This was a dealbreaker for me though since I wanted to join this mobile application programming contest and was floored when I found out I couldn't do it wi... |
Very little difference between the two. The only one I can think of is remote debugging is not available in standard. |
The answer is in the [GCC manual][1]: use the `-MT` flag.
> -MT target
Change the target of the rule emitted by dependency generation. By default CPP takes the name of the main input file, deletes any directory components and any file suffix such as `.c', and appends the platform's usual object suffix. The resu... |
[SQLite Manager for FireFox][1]
[1]: https://addons.mozilla.org/en-US/firefox/addon/5817 |
As long as you're switching your Webapp on Lisp, consider using persistence: you now have a constantly running Lisp image that holds everything about your application. I personnally used [Elephant](http://www.common-lisp.net/project/elephant) for that.
Elephant can use CL-SQL or BDB as it's backend, which means that... |
Subclass a MonthCal control in Win32 |
|winapi|controls|monthcalendar| |
Objective: use the standard Win32 MonthCal control, and paint days such as holidays in RED.
It seems like the Win32's native approach would be use the [MCN_GETDAYSTATE][1] notification, which seems to allow only painting specific days in Bold.
Possible (but declined) solution would be to write my own painted-at-w... |
spring & web service client - Fault Detail |
|spring|service|webservicetemplate| |
How could I get the Fault Detail sent by a SoapFaultClientException ?
I use a WebServiceTemplate as shown below :
WebServiceTemplate ws = new WebServiceTemplate();
ws.setMarshaller(client.getMarshaller());
ws.setUnmarshaller(client.getUnMarshaller());
try {
MyResponse resp = (MyResponse)... |
you could create a snprintf wrapper that returns -1 for each case when there is not enough space in the buffer.
See the [man page][1] for more docs. It has also an example which threats all the cases.
while (1) {
/* Try to print in the allocated space. */
va_start(ap, fmt);
... |
have you looked at RichFaces? It comes with a lot really cool rich UI stuff. |
If you say that it's the Windows process that runs out of memory as opposed to the JVM, then my initial guess is that you probably invoke some (your own) native methods from the JVM and those native methods leak memory. So, I concur with @John Gardner here. |
ASP.NET Response.Redirect to new window |
|c#|asp.net|response.redirect| |
I want to do a Response.Redirect("MyPage.aspx") but have it open in a new browser window. I've done this before without using the JavaScript register script method. I just can't remember how =)
Thanks |
I'm managing just fine on a Mac mini. It only has the stock 1GB RAM at the moment so thats the current bottleneck. |
Accessing a Collection Through Reflection |
|c#|reflection|collections| |
Is there a way to iterate (through foreach preferably) over a collection using reflection? I'm iterating over the properties in an object using reflection, and when the program gets to a type that is a collection, I'd like it to iterate over the contents of the collection and be able to access the objects in the colle... |
I kept to standard C/C++ for years before learning Win32 API, and to be quite blunt, this is not the best technical experience of my life.
In one hand Win32 API is quite cool. It's like an extension of the C standard API (who needs <code>fopen</code> when you can have <code>CreateFile</code>. But I guess UNIX/Linux/... |
With the constraint that the condition clause can be "anything", then you're limited to scanning the entire list and applying the condition.
If there are limitations on the condition clause, then you can look at organizing the data to more efficiently handle the queries.
For example, the code sample with the "byF... |
This Firefox extension is does exactly what you want:
http://www.sitepoint.com/dustmeselectors/
It locates all unused selectors. |
You can convert your color into the HSL color-space, manipulate it there and convert back to your color-space of choice (most likely that's RGB)
Lighter colors have a higher L-value, darker a lower.
Here's the relevant stuff and all the equations:
http://en.wikipedia.org/wiki/HSL_color_space
Another method ... |
We have used Steeplechase to connect to our profibus to our automated pick system.
http://www.phoenixcontact.com/automation/32131_31909.htm |
Image cropping C# |
|silverlight|c#| |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the recommended way in Silverlight...
Or point to a library? |
|silverlight|c#|image-manipulation| |
Can anyone advise on how to crop an image, let's say jpeg, without using any .NET framework constructs, just raw bytes? Since this is the only* way in Silverlight...
Or point to a library?
I'm not concerned with rendering i'm wanting to manipulate a jpg before uploading.
*There are no GDI+ or WPF libraries av... |
[PyInstaller][1] will create a single .exe file with no dependencies; use the `--onefile` option. It does this by packing all the needed shared libs into the executable, and unpacking them before it runs, just as you describe. I don't think py2exe has this feature.
I use the version of PyInstaller from svn, since th... |
[PyInstaller][1] will create a single .exe file with no dependencies; use the `--onefile` option. It does this by packing all the needed shared libs into the executable, and unpacking them before it runs, just as you describe. I don't think py2exe has this feature. (EDIT: apparently it does, see [minty's answer][2])
... |