instruction stringlengths 0 30k ⌀ |
|---|
|assembly|asm|masm| |
I have some code which is supposed to display a short message. Here's the pertinent code:
DATA SEGMENT 'DATA'
MSG DB 0AH, 0DH, 'Hello, Adam', '$'
CHAR DB 00H
DATA ENDS
CODE SEGMENT 'CODE'
PRINT_MSG:
MOV AH, 09H ;Command to print string of characters
MOV DX, OFFSET MSG ... |
Using the netsh interface
Usage set interface [name = ] IfName
[ [admin = ] ENABLED|DISABLED
[connect = ] CONNECTED|DISCONNECTED
[newname = ] NewName ]
Try including everything inside the outer brackets:
netsh interface set interface name="thename" admin=disabled connect... |
Using the netsh interface
Usage set interface [name = ] IfName
[ [admin = ] ENABLED|DISABLED
[connect = ] CONNECTED|DISCONNECTED
[newname = ] NewName ]
Try including everything inside the outer brackets:
netsh interface set interface name="thename" admin=disabled connect... |
A chap called Guy Thomas does some good introductions to powershell.
http://computerperformance.co.uk/ezine/ |
I don't see why you shouldn't run jira off a vm - but jira needs a good amount of resources, and if your vm resides on a heavily loaded machine, it may exhibit poor performance. Why not log a support request (support.atlassian.com) and ask? |
Many to Many Relationship in MS Dynamics CRM 4.0 - How to? |
Font Size Keywords (xx-small, x-small, small, medium, etc..) are based on the users default font size which is medium. It can also be used in the term of changing the size of a child element in relation to the parent element. |
My team and I use Restlet extensively, but not its JAX-RS features. I can tell you that I've been very impressed with the Restlet developers and community; they're very active, engaged, responsive, and committed to a stable, efficient, reliable, and effective framework. I'm sorry I can't directly address your primary i... |
What's the canonical way to store arbitrary (possibly marked up) text in SQL? |
|sql|text| |
What do wikis/stackoverflow/etc. do when it comes to storing text? Is the text broken at newlines? Is it broken into fixed-length chunks? How do you best store arbitrarily long chunks of text?
|
I would be interested to know this myself. I don't think that it's possible, because one of the things that got the Agile/Alt.Net community in a tizzy about the Entity Framework was this very problem of the lack of persistence ignorance.
|
Well, Your best bet is to understand what causes them, so you can look critically at your code, identify patterns that may cause a leak, and then avoid or refactor around them.
Here's a couple of links to get you started, both very informative:
* http://www-128.ibm.com/developerworks/web/library/wa-memleak/
* ... |
A Y-combinator is a "functional" (a function that operates on other functions) that enables recursion, when you can't refer to the function from within itself.
This is applicable in languages that support lambda functions. The [expression][1]-based nature of lambdas usually means that they cannot refer to themselve... |
If the code is .Net, use the stopwatch class (.net 2.0+) NOT DateTime.Now. DateTime.Now isn't updated accurately enough and will give you crazy results |
Given an unsigned int, what's the fastest way to get the "indexes" of the set bits? |
|algorithm|bit-manipulation| |
So for e.g. 0110 has bits 1 and 2 set, 1000 has bit 3 set 1111 has bits 0,1,2,3 set |
If it's always the first element, you should probably think about having the function return just the first item in the array. If that is the most common case, you could use a little bit of coolness:
function func($first = false) {
...
if $first return $array[0];
else return $array;
... |
How to fix the endless printing loop bug in Nevrona Rave |
|delphi|endless-loop|rave| |
[Nevrona Designs'][1] [Rave Reports][2] is a Report Engine for use by [Embarcadero's][3] [Delphi][4] IDE.
This is what I call the Rave Endless Loop bug. In Rave Reports
version 6.5.0 (VCL10) that comes bundled with Delphi 2006, there is a
nortorious bug that plagues many Rave report developers. If you have a
non-... |
[Nevrona Designs'][1] [Rave Reports][2] is a Report Engine for use by [Embarcadero's][3] [Delphi][4] IDE.
This is more of a work-around than a true solution. I first posted this work-around on the [Nevrona newsgroup][5] (Group=nevrona.public.rave.developer.delphi.rave; Subject="Are you suffering from the Rave Endles... |
I've been playing around with [Balsamiq Mockups][1] and it's OK for basic wireframes. I still prefer pen and paper sketches that are later refined in Photoshop when working on my own, but Balsamiq is useful when working in a team.
[1]: http://www.balsamiq.com/ "Balsamiq Mockups" |
It isn't possible to apply formatting to a standard dialogue box. However if you *really* want to format it you could flash up the message in HTML either next to the button or as a absolutely placed div, which you could format with CSS. |
javascript message box |
|javascript|with|.net|2.0| |
I want to display an error message on my asp.net application. This message is a warning message, this is the way I did it:
CmdCalcInvoke.Attributes["onclick"] = "return confirm('Are you sure you want to calculate the certification? WARNING: If the quarter has not finished, all the partners status will change')";
... |
|javascript|.net-2.0| |
How to change default order of Group By clause in mysql |
|mysql| |
By default data extracted by group by clause is ordered as ascending.
How to change it to descending. |
I use the exact same method on a vehicle-tracking application and have done for years. It works perfectly well. A quick check of some old code shows that I multiply the result by 6378137 which if memory serves converts to meters, but I haven't touched it for a very long time.
I believe SQL 2008 has a new spatial dat... |
It depends on what you call *legacy*. If by saying legacy you really mean 'code from some retired application which is so bad we'll never use it any more' it should be separated from you current code.
If it is something from your current project but is written by other people or is not up to your current standards ju... |
Amazon uses Xen, so you can probably just run your AMI in your own Xen installation. I'd just fire up an instance and run the tests there, though. It doesn't cost much and you should usually be fine with developing locally and infrequently testing it on their system. |
Whenever I need to do this I build a simple PL/SQL block with a local procedure like this:
declare
procedure ins
is
(p_exch_wh_key INTEGER,
p_exch_nat_key INTEGER,
p_exch_date DATE, exch_rate NUMBER,
p_from_curcy_cd VARCHAR2,
p_to_cur... |
Is the YUI Loader Utility reliable? |
|javascript|yui| |
I've been using the YUI Components and want to begin using the Loader Utility to specify my dependencies on my page. Is the YUI Loader Utility a reliable way to load Javascript dependencies in web pages? |
I've been using the YUI Components and want to begin using the Loader Utility to specify my dependencies on my page. From your experience, is the YUI Loader Utility a reliable way to load Javascript dependencies in web pages? |
I seem to recall doing so will have the effect of single threading your application which would be a bad thing. |
I think this is what you're trying to do:
public class ServiceProxyHelper<T> where T : MyInterface { ... }
|
I'd suggest you try it and see if it makes a difference.
However I'm pessimistic about this actually making any difference, since in the larger/clean builds you'll be writing out large amounts of data anyway, so adjusting the file access times wouldn't take that much time (plus it'd probably be cached anyway).
I... |
I'd suggest you try it and see if it makes a difference.
However I'm pessimistic about this actually making any difference, since in the larger/clean builds you'll be writing out large amounts of data anyway, so adjusting the file access times wouldn't take that much time (plus it'd probably be cached anyway).
I... |
You can create junctsymlinksions in windows with `mklink`.
edit: If you use Vista. |
This should be a pretty good solution for anywhere from 10-1000 strings:
Have a resource file for each locale. I don't know .NET but I'm sure there is some common way to do this. Then, in your resource-fetching code, load the appropriate one based on your user's the browser locale setting. Ask this code to fetch ... |
|microsoft|crm|entity-relationship|many-to-many| |
I'm working on a MS CRM server for a project at my university.
What I'm trying to do is to let the user of the CRM to tag some contacts, I thought of creating an entity to archive the tags an to create an N:N relationship between the tag entity and the contact one.
I've created and published the new entity and the ... |
Python sockets suddenly timing out? |
|python|api|ssl|sockets|gmail| |
I came back today to an old script I had for logging into Gmail via SSL. The script worked fine last time I ran it (several months ago) but now it dies immediately with:
<urlopen error The read operation timed out>
If I set the timeout (no matter how long), it dies even more immediately with:
<urlopen ... |
The only thing I can see that could cause issues is that while today your URL will never exceed N, you cannot guarantee that that won't be the case forever. And in a year, when you go back to make an edit to allow for a url to be N+y in length, you may forget to modify the url rejection code.
You'll always be bette... |
To learn the language, you will be just fine. There are some libraries missing in mono, but that would not prevent you from learning the language. You can find more information at the [Mono Project Page: FAQ][1].
[1]: http://www.mono-project.com/FAQ:_General |
.NET 2.0 is fully implemented and if you are planning to use only .NET 2.0 it's almost guaranteed that it will work properly (even WinForms) :) Other versions are still under heavy development so you have to check the Mono's website. |
I have been using mono for upwards of 2 years now. Work is windows and .Net, home is mono on GNU/Linux. I have been able to run both GUI and ASP.NET apps with no problems from the same SVN repository. The only changes I had to make were in connection strings. ASP.NET works well under mod_mono for apache and xsp2. ... |
Connecting to an oracle database should be no problem with the oci-interface, using "oci_connect()" for example.
Further examples are here:
http://php.net/manual/en/oci8.setup.php
But I do not understand, what the remark MAC OS X means - are you running an apache locally?
Hope this helps,
Bastian |
A Y-combinator is a "functional" (a function that operates on other functions) that enables recursion, when you can't refer to the function from within itself.
This is applicable in languages that support lambda functions. The [expression][1]-based nature of lambdas usually means that they cannot refer to themselve... |
One other small issue to consider with using GUIDS as primary keys if you are also using that column as a clustered index (a relatively common practice). You are going to take a hit on insert because of the nature of a guid not begin sequential in anyway, thus their will be page splits, etc when you insert. Just some... |
Anyone know of a scratch like program construction UI framework? |
|.net|scratch| |
I quite like the drag and drop pluggable programming blocks in scratch ( http://scratch.mit.edu/ )
I'd like to be able to get users to create their own mini scripts using the same kind of technique...
just wondering if anyone knows of anything similar I could utilise in .NET? ideally in WPF. |
# My solution/testing
Here's my solution and it does what i expected.
## Code
_cat.hh_ :
#include <string>
class Cat
{
std::string _name;
public:
Cat(const std::string & name);
void speak();
};
_cat.cpp_ :
#include <iostream>
#include <s... |
# My solution/testing
Here's my solution and it does what i expected.
## Code
_cat.hh_ :
#include <string>
class Cat
{
std::string _name;
public:
Cat(const std::string & name);
void speak();
};
_cat.cpp_ :
#include <iostream>
#include <s... |
A Y-combinator is a "functional" (a function that operates on other functions) that enables recursion, when you can't refer to the function from within itself. In computer-science theory, it **generalizes recursion**, abstracting its implementation, and thereby separating it from the actual work of the function in que... |
I don't think that's possible. The underlying representation of enums is up to the compiler. You are better off using:
const __int64 LARGE_VALUE = 0x10000000000000L;
|
I don't think that's possible. The underlying representation of enums is up to the compiler. You are better off using:
const __int64 LARGE_VALUE = 0x1000000000000000L;
|
It might help to clean the solution prior to rebuilding -- right click on the solution in the Solution Explorer and choose "clean solution" -- this deletes temporary files and is supposed to clear out the bin and obj folders, so everything is rebuilt. |
Unlike isfile(), exists() will yield True for directories. So depending if you want only plain files or also directories, you'll use isfile() or exists()
>>> print os.path.isfile("/etc/passwd")
True
>>> print os.path.isfile("/etc")
False
>>> print os.path.isfile("/does/not/exist")
False
... |
Service factory: extremely long path/filenames problems |
|service-factory| |
I have been trying out [Service Factory][1] and have run into some problems in regards to long filenames - surpassing the limit in Vista/XP. The problem is that when generating code from the models service factory prefixes everything with the namespace specified. Making the folder structure huge. For example starting i... |
I am quite sure that this is impossible to do at compile time.
However, this is an obvious task for a "unit"-test. If you have conventions like this that you would like enforced, but which can be difficult or impossible to check with the compiler, "unit"-tests are a simple way to check them.
Another possibility i... |
Actually, this looks like a perfect job for Awk. Now, like most people I will say "I'm no expert in Awk" before proceeding...
awk -F : '{print $5}' /etc/passwd
would get the 5th field where ':' is the field separator from /etc/passwd - it's probably the 5th field you are wanting.
awk -F , '{print $1}'... |
Wireshark: sniffing the glue that holds the internet together
<http://www.wireshark.org/> |
//untested -- public domain
// if you do a lot of conversions, using StringBuilder will be
// much, much more efficient with memory and time than using string
// alone.
string toStringWithBase(int number, int base)
{
if(0==number) //handle corner case
return "... |
//untested -- public domain
// if you do a lot of conversions, using StringBuilder will be
// much, much more efficient with memory and time than using string
// alone.
string toStringWithBase(int number, int base)
{
if(0==number) //handle corner case
return "... |
Just use the `height` property instead of the `min-height` property when setting `#container`. Once the data gets too big, the table will automatically grow. |
I use [TortoiseMerge][1] with the [xdocdiff][2] plugin to compare Word, Excel, PowerPoint and PDF versioned files
[1]: http://tortoisesvn.tigris.org/TortoiseMerge.html
[2]: http://freemind.s57.xrea.com/xdocdiff/e/index.html |
Back when I was on windows I used to use a hardlink shell extension. Not sure if this is the same one, but give this one a try: [Link Shell Extension](http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html). |
Generally speaking, from the several engineering excellence best practices papers that I have read, 80% for new code in unit tests is the point that yields the best return. Going above that CC% yields a lower amount of defects for the amount of effort exerted. This is a best practice that is used by many major corpo... |
Also to add to what Greg said, when preforming optimization (i.e. `inline`-ing) the compiler consults not only the key words in the code but also other command line arguments the specify how the compiler should optimize the code. |
You want to save or create (instead of new) the item and pack. Otherwise, the database has not assigned id's for the association. |
To see if there are special characters in your file, Try the -b or -q options to ls.
As another solution to deleting the file you can bring up the graphical file browser
(gasp!) and drag and drop the unwanted file to the trash.
Another solution might be to move the one file to a different name (the one without ... |
To see if there are special characters in your file, Try the -b or -q options to ls,
assuming solaris 8 has those options.
As another solution to deleting the file you can bring up the graphical file browser
(gasp!) and drag and drop the unwanted file to the trash.
Another solution might be to move the one fil... |
All your queries shall be answered in the book below. The initial chapters explain all the main concepts and terminology and fancy abbreviations like i18n. Didn't get time to read it till the end.. but good till the point I read. Recommended if you are serious about doing it the right way and have the time :)
http:/... |
It's sometimes called "Lazy Evaluation".
Depending upon the context, it can also be called "Guarding".
And I've seen it in just about every language I've worked in - which pushes close to a dozen. |
Depending upon the context, it can also be called "Guarding".
And I've seen it in just about every language I've worked in - which pushes close to a dozen. |
I'm afraid you might just need to trace down into the indy code. Indy has had a number of bugs in the past so this might be the cause. If you trace in you should find it pretty quickly. |
I have had similar issues. My previous team (on it for over a year) was large and we maintained a very large, rapidly changing codebase for series of initial product launches. Our burndowns were shameful looking, but it was the best we could ever do.
One thing that may help (make your graph look better) is stick t... |
As *sblundy* pointed out, if all objects are immutable, read-only, you don't need to worry about locking, however, this means you may have to copy objects a lot. Copying usually involves malloc and malloc uses locking to synchronize memory allocations across threads, so immutable objects may buy you less than you think... |
# My solution/testing
Here's my solution and it does what i expected.
## Code
_cat.hh_ :
#include <string>
class Cat
{
std::string _name;
public:
Cat(const std::string & name);
void speak();
};
_cat.cpp_ :
#include <iostream>
#include <s... |
if you're using linux, you can time a program's runtime by typing in the command line:
time [funtion_name]
if you run only the function in main() (assuming C++), the rest of the app's time should be negligible. |
I would shift it down and test the least significant bit in a loop. It might be faster testing with 32 bit masks (or whatever length your unsigned int is).
/Allan
|
If it's absolutely necessary to control how the files are loaded, then I believe Mike Chambers' suggestion to make an HTTP HEAD request is the way to go.
However, unless there's a good reason not to, I'd simply begin loading all the files at once and get my file sizes from each file's getBytesTotal method. Since Fla... |
If it's embedded Linux, look at Linux timers:
[http://linux.die.net/man/3/clock_gettime][1]
Embedded Java, look at nanoTime(), though I'm not sure this is in the embedded edition:
[http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#nanoTime()][2]
If you want to get at the hardware counters, t... |
If you're looking for sub-millisecond resolution, try one of these timing methods. They'll all get you resolution in at least the tens or hundreds of microseconds:
If it's embedded Linux, look at Linux timers:
[http://linux.die.net/man/3/clock_gettime][1]
Embedded Java, look at nanoTime(), though I'm not su... |
Yes there is.
<cfset sFactory = CreateObject("java","coldfusion.server.ServiceFactory")>
<cfset MailSpoolService = sFactory.mailSpoolService>
<cfset MailSpoolService.stop()>
<cfset MailSpoolService.start()>
|
I would say multi-threading is generally used to:
1. Allow data processing in the background while a GUI remains responsive
2. Split very big data analysis onto multiple processing units so that you can get your results quicker.
3. When you're receiving data from some hardware and need something to continuously... |
I would say multi-threading is generally used to:
1. Allow data processing in the background while a GUI remains responsive
2. Split very big data analysis onto multiple processing units so that you can get your results quicker.
3. When you're receiving data from some hardware and need something to continuously... |