instruction stringlengths 0 30k ⌀ |
|---|
Using .NET 2.0 with WinForms, I'd like to create a custom, multi-columned menu (similiar to the word 2007 look&feel, but without the ribbon).
My approach was creating a control, and using a left/right docked toolstrip, I have constructed a similar look&feel of a menu. However, there are a few shortcomings of this so... |
The following article lists just about all the different ways of calling .Net code from an SSRS report. [Extending Microsoft SQL Server 2000 Reporting Services with Custom Code
][1]
If all these reports run against the same server, another option to consider would be to use .Net stored procedures in the database to... |
[Graphviz][1] is great if you want the layout to be automatic.
[1]: http://www.graphviz.org/ |
Omnigraffle if you want to do it by hand and have a Mac. |
[NDepend][1] is your friend for this kind of thing
[1]: http://www.ndepend.com/ |
I found that googl has a class called GTrafficOverlay and this is based on extending the GOverlay class. Now, it is getting clearer that I am looking for an open implementation of the GTrafficOverlay |
“Magic quotes” is a palliative remedy for some of the worst XSS flaws which works by escaping everything on input, something that's wrong by design. The only case where one would want to use it is when you absolutely must use an existing PHP application known to be written carelessly with regard to XSS. (In this case y... |
Did this eval a while back. You will find a lot of "free" solutions that are horrible at edge cases. This commercial product http://www.tangiblesoftwaresolutions.com is by no means perfect; but, was the best we could find at the time doing real conversion tests. Note: I am speaking only as a customer. If someone ha... |
You can also use `String.fromCharCode()` to output a character from a numeric entity.
e.g. `String.fromCharCode( 8226 )` will create a bullet character. |
There have been a number of answers recommending Perl Mechanize, but I think that Ruby Mechanize (very similar to Perl's version) is even better. It handles some things like forms in a much cleaner way syntactically. Also, there are a few frontends which run *on top* of Ruby Mechanize which make things even easier. |
Adding to what JP said: most of the overhead belongs to Win32 startup for the process.
The Windows NT kernel actually does support COW fork. <a href="http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx">SFU</a> (Microsoft's UNIX environment for Windows) uses them. However, Win32 does not support fork. ... |
1. It's very small, especially when minified, and offers a lot in the core library.
2. It's also easy to extend, and has an active community.
3. Finally, it's extremely easy to learn; once you've grasped the core concepts you can start coding complex solutions right away.
|
I would say my top reasons for using JQuery are:
- Large development community and many plugins.
- It's on Microsoft's radar and they are adding some plugin support and
debug capabilities.
- Very good documentation for a 3rd party library.
- Lightweight.
- Chaining capabilities are very powerful... |
To add on to what everyone else has said, if all of your columns that you are selecting are included in an index, your result set will be pulled from the index instead of looking up additional data from SQL. |
I just this week put together some slides and demo code for doing 2d graphics using opengl from python using the library pyglet. You can see my stuff here: http://www.tartley.com/?p=378
It is very fast (relatively speaking, for python) I have managed to get around 1,000 independantly positioned and oriented objects ... |
|c#|.net|lambda| |
I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference. |
Win32 Programming by Charles Petzold |
For Firefox 3.x on Window XP, Ubutntu Linux, and Mac OS X (Tiger and Leopard), [Flash Switcher][1] works well.
[1]: http://www.sephiroth.it/firefox/flash_switcher/ |
It sounds to me like you are trying to put too many bytes into a column. I ran across a very similar error with MySQL last night due to a bug in my code. I meant to do
foo.status = 'inactive'
but had actually typed
foo.state = 'inactive'
Where foo.state is supposed to be a two character code for a ... |
I've used Codesite and it has been fantastic. On one project, a word-processor, I could easily output a million debug lines, all structured, and Codesite helped greatly with its auto-collapsing indented output. For any task where you have to know what really is happening "underneath" a process that can't be interrupted... |
[Rapid Development](http://www.amazon.com/Rapid-Development-Taming-Software-Schedules/dp/1556159005/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1221576873&sr=8-1) by McConnell |
I've found that scripting languages are generally better suited for doing such tasks. I personally prefer Python, but PHP will work as well. Chopping, mincing and parsing strings in Java is just too much work. |
Not sure why you'd want to do that. The underlying data type can't store more than one char, by representing it as a string variable you introduce the need to check lengths before committing to the db, where as if you leave it as is you can just call ToString() on the char to get a string |
Make it less open.
i do not want the same identity on multiple sites.
i do not want to have to create a flickr account before StackOverflow will let me post.
i do not have to have to create a new flickr account for each website that i want to register with. |
There are no true alternatives for big AAA titles, especially on the consoles. For smaller titles C# should do. |
Real-time + garbage collection don't match very well I'm afraid.
It's a bit hard to make any real-time response guarantees if a garbage collector can kick in at any time and spend an undefined amount of processing... |
I think this is correct (not sure 100%) .. but this data used in production environment to check card type
Visa usually start with 49,44 or 47
Visa electron : 42,45,48,49
Mastercard : 51
Amex :34
Diners : 30,36,38
JCB : 35
|
Well, the really oversimplified version is that a lambda is just shorthand for an anonymous function. A delegate can do a lot more than just anonymous functions: things like events, asynchronous calls, and multiple method chains. |
Spend ten years posting to Usenet from a machine where only vi and emacs were available (and where emacs had an annoying long startup time when invoked from 'rn').
That's how I learned it.
But for a quicker approach, all I can recommend is that you just commit yourself to learning it, and spend a few hours workin... |
If you can tolerate using factory methods (instead of the constructors MyClass<T> you asked for) you could always do something like this:
class MyClass<T>
{
private readonly T _value;
private MyClass(T value) { _value = value; }
public static MyClass<int> FromInt32(int value) { retu... |
If you can tolerate using factory methods (instead of the constructors MyClass<T> you asked for) you could always do something like this:
class MyClass<T>
{
private readonly T _value;
private MyClass(T value) { _value = value; }
public static MyClass<int> FromInt32(int value) { retu... |
|https|ftp|download| |
|http|ftp|download| |
**System.ComponentModel.BackgroundWorker** is indeed a good starting point. It will do your asynchronous work, give you notifications of important events, and has ways to better integrate with your forms.
For example, you can activate progress notifications by registering a handler for the ProgressChanged event. (w... |
If you rewrite the question you can end up asking:
"SELECT name FROM ... "<br>
"SELECT SSN FROM ... "<br>
"SELECT email FROM ... "<br>
vs.<br>
"SELECT * FROM ..."
And I guess the answer to this is easy and everyone knows it.
What happens if you change the Employee class? E.g.: You have to remove the email ... |
How do I convert a date to a HTTP-formatted date in .Net / C# |
|c#|.net|http| |
How does one convert a .Net DateTime into a valid HTTP-formatted date string? |
|c#|.net|https| |
|c#|.net|http| |
> Under Windows, the pressure value drops, but outside of that, there is no event. (I don't know about linux.)
Under linux you`ll get "ProximityEvents"
Most likely these events WT_PROXIMITY are avaliable in windows (please refer to: http://www.wacomeng.com/devsupport/ibmpc/wacomwindevfaq.html )
|
What is the best way to upload a file via an HTTP POST with a web form? |
|forms|html|http|post| |
Basically, something better than this:
> [input type="file" name="myfile" size="50"]
First of all, the "browse" button looks different on every browser. Unlike the "submit" button on a form, you have to come up with some [hack-y](http://www.quirksmode.org/dom/inputfile.html) way to style it.
Secondly, there's... |
|forms|html|http|post|upload| |
Basically, something better than this:
> [input type="file" name="myfile" size="50"]
First of all, the "browse" button looks different on every browser. Unlike the "submit" button on a form, you have to come up with some [hack-y](http://www.quirksmode.org/dom/inputfile.html) way to style it.
Secondly, there's... |
I use D for a hardware in the loop (HIL) test environment. This is for software tests in the automotive area. D can be used here, because as a system porgramming language it is possible to be used in realtime programms (IRQ handlers in a linux realtime extension RTAI-LXRT).
With the ongoing port of SWT/JFace i plan ... |
As mentioned above, probably the easiest thing to do is use Apache CXF or Apache Axis2 to automatically generate your WSDL for you.
If you have downloaded the JEE version of Eclipse, you should be able to create a Dynamic Web Project with the Axis2 facets. If you create a simple Java class in the project, you shoul... |
`OnLogin` on xmpp is probably an event declared like this :
public event LoginEventHandler OnLogin;
where `LoginEventHandler` is as delegate type probably declared as :
public delegate void LoginEventHandler(Object o);
That means that in order to subscribe to the event, you need to provide a method ... |
I don't have a ton of experience with this, but the way I would describe it is that a delegate is a wrapper around any function, whereas a lambda expression is itself an anonymous function. |
Turns out that you don't need explicit text paths. Firefox 3 has only partial support of the vertical alignment tags ([see this thread][1]). It also seems that dominant-baseline only works when applied as a style whereas text-anchor can be part of the style or a tag attribute.
<path d="M10, 20 L17, 20"
... |
The following works for me in Firefox and IE7... a guideline, though is: if you set width on an element, don't set margin or padding on the same element. This holds true _especially_ if you're mixing units -- say, mixing percents and pixels.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://... |
Be an information snob.
If the blog doesn't absolutely rock your world, don't read it. It's so easy to get bogged down, even obsessed, with too much information. No matter what tools you have, you're still human and can only read so many words per day. |
Not sure how it's done in C++, but in .NET if you set the MinimizeBox property to false, you get an OK button. Since .NET Windows code is fancy wrapper code, there should be a C++ equivalent |
If you are using Tomcat, check out <a href="http://www.lambdaprobe.org/d/index.htm">Lambda Probe</a>, which lets you monitor internal and external memory consumption as well as a host of other areas.
|
Can you send a signal to Windows Explorer to make it refresh the systray icons? |
|icons|system-tray|windows-explorer|systray| |
This problem has been afflicting me for quite a while and it's been really annoying.
Every time I login after a reboot/power cycle the explorer takes some time to show up.
I've taken the step of waiting for all the services to boot up and then I login, but it doesn't make any difference.
The result is always the s... |
Java's [Runtime][1] object can report the JVM's memory usage. For CPU consumption you'll have to use an external utility, like Unix's top or Windows Process Manager.
[1]: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html |
I use [Evernote](http://evernote.com/) to keep notes and search through them. |
I'd use an applet. You could do the resizing of the pictures and rotating on the client side.
It looks like [JUpload][1] may do this for you.
[1]: http://sourceforge.net/projects/jupload/ |
Don't use **X11**?
$ sudu rm /usr/local/bin/emacs
Change your login shell to **vi**?
First, force yourself to use **ed**, then **vi** will seem like a luxury?
Use the **vi** key bindings in **bash**?
Just start using **vi** all the time?
It seems to me that learning an editor isn't terribly differ... |
Try [Dia][1] - it's open source and cross platform.
[1]: http://live.gnome.org/Dia |
From the [`post-commit` hook][1], run the [`svnlook changed` command][2] to find out which paths are affected by a commit. You could use a `grep` to see if they include some project path.
[1]: http://svnbook.red-bean.com/en/1.5/svn.ref.reposhooks.post-commit.html
[2]: http://svnbook.red-bean.com/en/1.5/svn.ref.... |
<blockquote>... run faster ...</blockquote>
Not necessarily - your compiler/interpreter is generally better at optimizing code than you are.
I think it makes me say "yuck!" because it's lazy - when I'm reading code (particularly someone else's) I like to see explicit code. So I'd even write "this.field" instead of... |
No, as of PHP 5.2. However, you may use `__call` magic method to forward call to arbitraty function or method.
class A {
public function __call($method, $args) {
if ($method == 'foo') {
return call_user_func_array('bar', $args);
}
}
}
f... |
5000+ text rendering is slow even with GDI, especially if you need scrolling. create a separate rendering thread and notify the ui thread on every 200ms and bitblt the current results. it gives a smooth user experience. |
[SmartDraw][1] is the best there is. It costs, but is worth the dosh.
[1]: http://www.smartdraw.com |
No it is not posible. if you define function/method outside class construct it becomes global function. |
A Microsoft developer has posted a [GDI vs. GDI+ Text Rendering Performance][1] article on his blog which answers the raw speed question: on his system, GDI DrawText was about 6 times faster than GDI+ DrawString.
If you need to be a real speed demon, TextOut is faster than DrawText, but you'll have to take care of c... |
You could try putting the iframe inside a div and then use the div for the scrolling. You can control the scrolling on the div in IE without issues, IE only really has problems with iframe scrolling. Here's a quick example that should do the trick.
<html>
<head>
<title>iframe test</title>
... |
Assuming you know the PK of the two rows you want to update... This works in SQL Server, can't speak for other products. SQL is (supposed to be) atomic at the statement level:
CREATE TABLE testing
(
cola int NOT NULL,
colb CHAR(1) NOT NULL
)
CREATE UNIQUE INDEX UIX_testing_a ON testing(colb)
INSERT INT... |
Delegates are equivalent to function pointers/method pointers/callbacks (take your pick), and lambdas are pretty much simplified anonymous functions. At least that's what I tell people. |
What is your choice for a Time Managment Solution? |
|project-management|time| |
I've come across a few different applications that monitor my usage while on the computer, but what have you used, and like? whether it be writing down your activities in a composition notbook or install an app that reports silently to a server? what do you like? |
Use a typedef for the function pointer. See my [answer][1] for [this question][2]
[1]:http://stackoverflow.com/questions/9410/how-do-you-pass-a-function-as-a-parameter-in-c#9421
[2]:http://stackoverflow.com/questions/9410/how-do-you-pass-a-function-as-a-parameter-in-c |
Parallel processing isn't the answer. You should simply "record" the players actions then play them back for the "previous actions"
So you create a vector (singly linked list) of vectors that holds the actions. Simply store the frame number that the action was taken (or the delta) and complete that action on the "... |
It's likely not harming your application so much as harming your machine - since the nic is still configured into the multicast group, it's still listening to those messages and passing them up, before your software ignores them and they get discarded. That's a lot of extra work that your network stack and kernel are... |
Saving HTML tables to a Database |
|screen-scraping|html| |
I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program.
I'm most comfortable with Java and PHP but really a solution in any language would be helpful. |
|html|screen-scraping| |
I am trying to scrape an html table and save its data in a database. What strategies/solutions have you found to be helpful in approaching this program.
I'm most comfortable with Java and PHP but really a solution in any language would be helpful.
EDIT: For more detail, the UTA (Salt Lake's Bus system) provides b... |
Implementing permissions in PHP |
|php|permissions| |
I've tried to do this several times with no luck. After reading [this post][1], it made me interested in doing this again. So can anyone tell me why the following doesn't work?
<?php
$guest = 1;
$editor = 2;
$admin = 4;
$user = $editor;
if( $user == ($editor | $admi... |
It's been a long time since I used PHP, but I will assume that this will work:
<?php
$guest = 1;
$editor = 2;
$admin = 4;
$user = $editor;
if( ($user == $editor) || ($user == $admin) ) {
echo "Test";
}
?> |
If you're a windows user, use [Fiddler][1]. It is invaluable for looking at the raw Http requests and responses. It also has the ability to create requests with the request builder and it has an auto responder also, so you can intercept requests. It even lets you inspect Https traffic and it has a built event script... |
If you're a windows user, use [Fiddler][1]. It is invaluable for looking at the raw Http requests and responses. It also has the ability to create requests with the request builder and it has an auto responder also, so you can intercept requests. It even lets you inspect HTTPS traffic and it has a built in event scr... |
I don't think there are hard and fast rules for this type of thing, but I usually go by the guideline of using the lightest possible way until absolutely necessary.
For example, let's say you have a `Person` class and a `Group` class. A `Group` instance has many people, so a List here would make sense. When I declar... |
Use the bitwise OR operator (|) to set bits, use the AND operator (&) to check bits. Your code should look like this:
<?php
$guest = 1;
$editor = 2;
$admin = 4;
$user = $editor;
if( $user & ($editor | $admin) ) {
echo "Test";
... |
In situations I usually come across, I rarely use IList directly.
Usually I just use it as an argument to a method
void ProcessArrayData(IList almostAnyTypeOfArray)
{
// Do some stuff with the IList array
}
This will allow me to do generic processing on almost any array in the .NET fra... |
I use [moreUnit][1], an Eclipse plugin to assist writing unit tests. Among other features, it lets you configure the default source folder of tests.
[1]: http://moreunit.sourceforge.net/ |
I was just talking with a guy who is an expert in microfilm. While it is an old technology, for long term storage it is one of the most enduring forms of data storage if properly maintained. It doesn't require sophisticated equipment (magifying lens and a light) to read altough storing it may take some work.
Then ... |
Joomla Blog/Wordpress Integration |
|wordpress|joomla| |
I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible.
What I am looking for is an easy-to-use posting interface that supports multiple users with different accounts/names, a taggi... |
I'm looking for a wordpress-like blog interface to put inside a Joomla hosted site. The admin interface of Joomla is quirky enough and hard enough to use that daily updates are infeasible.
What I am looking for is an easy-to-use posting interface that supports multiple users with different accounts/names, a taggi... |