instruction stringlengths 0 30k ⌀ |
|---|
I have an application that writes information to file. This information is used post-execution to determine pass/failure/correctness of the application. I'd like to be able to read the file as it is being written so that I can do these pass/failure/correctness checks in realtime. I assume it is possible to do this, but... |
Best way to cache data in .NET |
|.net|caching| |
I am in the process of figuring out a cache strategy for our current setup, currently have multiple web servers and wanted to know what is the best way to cache data in this environment. I have done research about MemCache and the native asp.net caching but wanted to get some feedback first. Should I go with a Linux bo... |
What about checking out Microsoft Velocity ([http://code.msdn.microsoft.com/velocity][1])?
Another option if you don't want to start using Microsoft CTP-ware is to check out Nache which allows distributed cache/session state management ([http://www.alachisoft.com/ncache/][2])
[1]: http://code.msdn.microsoft.com... |
OP asked about diagramming views and view dependencies, SQL Management Studio and Enterprise Manager doesn't allow you to diagram views. I can't vouch for the other tools.
The LINQ to SQL designer for Visual Studio does allow you to drop views on the design surface but there isn't a easy way to model the dependencie... |
Are there any alternatives to Gigaspaces? |
|java|jakarta-ee|gigaspaces| |
Anything thats as good and as stable and as feature-rich as gigaspaces? |
Yeah, the more I get into software, I start to see myself focusing less on the language and more on the design..
Yeah there are framework bits we need to get our head around but most of the time ( _most_ not all ) you can look those up as-and-when you need them..
But a good design head? That takes years of experi... |
Why don't you swap stacks and look at the LAMP stack?
Or how about a functional language like haskell?
Or write a DSL?
Or an app for your phone? |
In your Flex SDK folders you should see a 'runtimes\player\win\FlashPlayer.exe' which is a stand alone Flash player. Open your SWF with that and you'll see a 'Create Projector...' menu item in the File menu which will create the stand-alone EXE. |
Subversion with tortoisesvn. (tortoisesvn because you can see a lot of what goes on visually and will provide a good jumping off point for the command line stuff. ) There is tons of documentation out there and most likely you will see it at least one point in your career. Almost every company I have worked for and inte... |
@Jeff
I actually think this is an interesting question. I'm not sure how useful it is, but it is a valid question.
@Ed
Can you provide a little more info on this question? You said the dimension of the array is dynamic, but is the number of elements dynamic as well? |
@Jeff
I actually think this is an interesting question. I'm not sure how useful it is, but it is a valid question.
@Ed
Can you provide a little more info on this question? You said the dimension of the array is dynamic, but is the number of elements dynamic as well?
EDIT: I'm going to try and answer the que... |
**Polymorphic Tree Walking**, Python version
#!/usr/bin/python
class Node:
"""base class, you should not process one of these"""
def process(self):
raise('you should not be processing a node')
class BinaryNode(Node):
"""base class for binary nodes"""
... |
Considering most develops want to reach the larger audience, it just means one more place to test. Since it uses Webkit, hopefully it will render almost identical to Safari.
Integrated Gears may mean a solid place for apps to be developed though. If you have an internal system it may be nicer to just put Chrome on... |
Visual Studio comes with a [remote debugger][1] that you can run as an exe on your server. It works best if you can run it as the same domain user as your copy of visual studio. You can then do an attach to process from the debugger on your machine to the IIS process on the server and debug as if it was running on your... |
If you know a bound on the number of items then use the "IN" clause, as others have suggested:
UPDATE foo SET flag=true WHERE id in (1, 2, 3, 5, 6)
One warning though, is that depending on your db there may be a limit to the number of elements in the clause. Eg oracle 7 or 8 (?) used to have a limit of 256 item... |
Can't you just add an Exception at that point and inspect it? |
gvim with lots of useful plugins, i.e. taglist, c-syntax, matchit, vcscommand, bufexplorer and many more. gvim is also nice in conjunction with file manager Total Commander where F4 invokes gvim to edit the file under the cursor. |
Just follow closely the chain of events.
* Grab 10
* Grab 20
* Grab 30
* Grab EOF
Look at the second-to-last iteration. You grabbed 30, then carried on to check for EOF. You haven't reached EOF because the EOF mark hasn't been read yet ("binarically" speaking, its conceptual location is just after the 30... |
Just follow closely the chain of events.
* Grab 10
* Grab 20
* Grab 30
* Grab EOF
Look at the second-to-last iteration. You grabbed 30, then carried on to check for EOF. You haven't reached EOF because the EOF mark hasn't been read yet ("binarically" speaking, its conceptual location is just after the 30... |
I like this example, which for now, leaves out the check which you could add inside the while block:
ifstream iFile("input.txt"); // input.txt has integers, one per line
int x;
while (iFile >> x)
{
cerr << x << endl;
}
Not sure how safe it is... |
It depends on what your application is doing. You might want to throw individual exceptions in cases like
- The application is high availability
- Sending e-mail is particularly important
- The scope of the application is small and sending e-mail is a large part of it
- The application will be deploye... |
I'll echo the others who have endorsed Emacs. I program every day on, at a bare minimum, OS X, Windows, and Linux. Having the same IDE on all three systems gives me an enormous productivity boost. That said, the vanilla version of GNU Emacs...well, it sucks. I'd strongly encourage you to try [EmacsW32](http://ourcommen... |
Hurray for pointers!
This code works by looking ahead 12 bits for each byte and copying the proper bits forward. 12 bits is the bottom half (nybble) of the next byte and the top half of 2 bytes away.
unsigned char length = 10;
unsigned char data[10] = {0x00, 0x00, 0x0A, 0xBC, 0x00, 0x00, 0x00, 0x00, 0x0A, 0xB... |
Hurray for pointers!
This code works by looking ahead 12 bits for each byte and copying the proper bits forward. 12 bits is the bottom half (nybble) of the next byte and the top half of 2 bytes away.
unsigned char length = 10;
unsigned char data[10] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0A,0xBC};
unsigned... |
Hurray for pointers!
This code works by looking ahead 12 bits for each byte and copying the proper bits forward. 12 bits is the bottom half (nybble) of the next byte and the top half of 2 bytes away.
unsigned char length = 10;
unsigned char data[10] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0A,0xBC};
unsigned... |
|html|css| |
|html|css|float| |
A good hash function has the following properties:
1. Given a hash of a message it is computationally infeasible for an attacker to find another message such that their hashes are identical.
2. Given a pair of message, m' and m, it is computationally infeasible to find two such that that h(m) = h(m')
The t... |
A good hash function has the following properties:
1. Given a hash of a message it is computationally infeasible for an attacker to find another message such that their hashes are identical.
2. Given a pair of message, m' and m, it is computationally infeasible to find two such that that h(m) = h(m')
The t... |
Integers are immutable, which means that when you pass it as an argument it creates a copy rather than a reference to the same item. ([explanation][1]).
To get the behavior you're looking for, you can write your own class which is like Integer only mutable. Then, just pass it to the recursive function, it is increme... |
First, accept the fact that problems with your app (code, usability, etc.) will be discovered.
Then, make sure you have a clear way for users to communicate with you (form mail, email, uservoice, etc.). The easier you make this the better. For example, there is a uservoice link on every page of SO.
One philosophy... |
In Visual Studio - Debug -> Exceptions -> Check the box by "Common Language Runtime Exceptions" in the Thrown Column |
In VS, if you look in the Locals area of your IDE while inside the catch block, you will have something to the effect of $EXCEPTION which will have all of the information for the exception that was just caught. |
You can write
catch (Exception ex) { }
Then when an exception is thrown and caught here, you can inspect ex. |
No it is impossible, because that code block says "I don't care about the exception". You could do a global find and replace with the following code to see the exception.
catch {}
with the following
catch (Exception exc) {
#IF DEBUG
object o = exc;
#ENDIF
}
What this will do... |
HTML Help keyword location |
|indexing|chm|keywords| |
I'm writing a manual and some important keywords are repeated in several pages. In the project's index I defined the keywords like this:
<LI> <OBJECT type="text/sitemap">
<param name="Name" value="Stackoverflow">
<param name="Name" value="Overview">
<param name="Local" value="overview.html#stackoverflow">
... |
After you place a break point in them, you can also call them by name in the firebug console, and see the output of (or step through) any intermediate functions. This can help when the main entry point calls many other helper functions, and you are really just concerned with how these helpers are working.
That bein... |
Now, I'm not saying that this is the greatest name in the world, but here was the idea as I understand it.
The python keyword `open`, well, opens files. `Popen` was to open a Process and allow you to read and write from it's stdio like a file. Thus `Popen` is short for `ProccesOpen` in an attempt to kind of, sorta,... |
The . operator basically says "send this message to the object". In your example it is calling that particular method. The :: operator "drills down" to the scope defined to the left of the operator, and then calls the message defined on the right side of operator. |
The `.` operator basically says "send this message to the object". In your example it is calling that particular message. The `::` operator "drills down" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.
When you use `::` you have to be referencing mem... |
The `.` operator basically says "send this message to the object". In your example it is calling that particular member. The `::` operator "drills down" to the scope defined to the left of the operator, and then calls the member defined on the right side of operator.
When you use `::` you have to be referencing memb... |
Depending on what you are using in C++ (MFC, ATL, etc) you are probably going to have to install Visual Studio Professional (not express) as a lot of the libraries and headers are part of Visual Studio and not included in the SDK or Visual Studio Express (if you are doing managed C++ using .Net as the main framework th... |
[WCF configuration default limits, concurrency and scalability][1]
[1]: http://weblogs.asp.net/paolopia/archive/2008/03/23/wcf-configuration-default-limits-concurrency-and-scalability.aspx |
[phpThumb][1] is a high-level abstraction that may be worth looking at.
[1]: http://phpthumb.sourceforge.net/ |
One explanation might be that negative numbers are stored using [2's complement](http://en.wikipedia.org/wiki/Two%27s_complement). When the python interpreter tries to do the modulo operation it converts to unsigned value. As such instead of doing (-2) % 5 it actually computes 0xFFFF_FFFF_FFFF_FFFD % 5 which is 3. |
[Google's Webmaster Tools][1] report that disallow always takes precedence over allow, so there's no easy way of doing this in a `robots.txt` file.
You could accomplish this by puting a `noindex,nofollow` `META` tag in the HTML every page but the home page.
[1]: http://google.com/webmasters/tools |
How do I write a While loop |
|conditional-statements|c#|vb.net| |
How do you write the syntax for a While loop?
## C`#`
> int i=0;
While (i! = 10)
{
Console.WriteLine(i);
i++;
}
## VB.Net
> Dim i As Integer = 0
While i <> 10
Console.WriteLine(i)
i += 1
End Whil... |
I think Windows' built-in Task Scheduler is the suggested tool for this job. That requires an outside application. |
I would vote for Option B. If you go with Option A and the assumption that if a user exists, they can get in, then you'll eventually run into the problem that you'll want to deny access to a user, without removing the user record.
There will be lots of cases where you'll want to lock a user out, but won't want to... |
Possibly a version of spawn() for python? <http://en.wikipedia.org/wiki/Spawn_(operating_system)> |
As you continue to gain more experience in ASP.Net, C#, etc - it's always good to go check out the competition and see if it sparks ideas on how you can do things better in what you're doing. Taking a look at something like Rails or Django might change how you look at designing or building your apps.
|
B. It allows for much better checks whether the data is complete (for example, when you add an allowable/deniable feature).
Also, table size should only be a consideration for tables that you know will contain many records (as in, 100,000+). You even taking the time to type the table size consideration into this que... |
Gigaspaces is top notch as far as a Javaspaces implementation goes for scalability and performance. Are you restricted to a Javaspaces implementation? Blitz Javaspaces is top notch for a free product. |
This may or may not be what you're looking for, but read this article, "[Simulate a Windows Service using ASP.NET to run scheduled jobs][1]". I think StackOverflow may use this method or it was at least talked about using it.
[1]: http://www.codeproject.com/kb/aspnet/aspnetservice.aspx |
If you're now proficient with the languages and technologies you use, then start spending more time focusing on the design, solution architecture, and systems integration. The "bigger picture" that will set you apart from your contemporaries.
Check out some Martin Fowler books like "Patterns of Enterprise Applicatio... |
javascript: in JS code (like in an onclick attribute) is just a label. It could be zipzambam: instead.
javascript: in the href attribute signifies a Javascript URI.
[Example](http://shadow2531.com/js/jsuri.html):
javascript:(function()%7Balert(%22test%22)%3B%7D)()%3B |
javascript: in JS code (like in an onclick attribute) is just a label for use with continue statements that may or may not be supported by the browser. It could be zipzambam: instead.
javascript: in the href attribute signifies a Javascript URI.
[Example](http://shadow2531.com/js/jsuri.html):
javascript:(f... |
Hurray for pointers!
This code works by looking ahead 12 bits for each byte and copying the proper bits forward. 12 bits is the bottom half (nybble) of the next byte and the top half of 2 bytes away.
unsigned char length = 10;
unsigned char data[10] = {0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0A,0xBC};
unsigned... |
How do you get a custom id to render using HtmlHelper in MVC |
|asp.netmvc| |
|asp.net|mvc| |
Using [preview 4][1] of [ASP.NET MVC][2]
Code like:
<%= Html.CheckBox( "myCheckBox", "Click Here", "True", false ) %>
only outputs:
<input type="checkbox" value="True" name="myCheckBox" />
There is a `name` there for the form post back but no `id` for javascript or labels :-(
I was hoping th... |
Does JavaScript need access to cookies if AJAX is used? |
Are cookies required for an AJAX website? |
Are Http-Only cookies a viable option for an AJAX website? |
Does JavaScript need access to cookies if AJAX is used?
*Edit:* I'm sorry, I guess a lot of people don't understand the question, as evidenced by the edit to my question & the answers. Microsoft created a way to prevent XSS attacks by disallowing JavaScript access to cookies if Http-Only is specified. FireFox later ... |
JavaScript needs access to cookies if AJAX is used on a site with access restrictions based on cookies. Therefore, can we use Http-Only cookies. **Please look up Http-Onlybefore answering this question.**
*Edit:* I'm sorry, I guess a lot of people don't understand the question, as evidenced by the edit to my questi... |
Are HttpOnly cookies a viable option for an AJAX website? |
|ajax|cookies|httponly| |
JavaScript needs access to cookies if AJAX is used on a site with access restrictions based on cookies. Will Http-Only cookies work on an AJAX site? **Please look up Http-Only before answering this question.**
*Edit:* I'm sorry, I guess a lot of people don't understand the question, as evidenced by the edit to my q... |
JavaScript needs access to cookies if AJAX is used on a site with access restrictions based on cookies. Will HttpOnly cookies work on an AJAX site? **Please look up HttpOnly before answering this question.**
*Edit:* I'm sorry, I guess a lot of people don't understand the question, as evidenced by the edit to my que... |
Right click > TortoiseSVN > Settings > System Sounds..
Scroll down to the bottom. |
If you have somewhat of a legacy application and you're not allowed to change the visibility of your methods, best way to test private methods is to use Reflection. Internally we're using helpers to get/set <code>private</code> and <code>private static</code> variables as well as invoke <code>private</code> and <code>p... |
If you have somewhat of a legacy application and you're not allowed to change the visibility of your methods, best way to test private methods is to use Reflection. Internally we're using helpers to get/set <code>private</code> and <code>private static</code> variables as well as invoke <code>private</code> and <code>p... |
If you have somewhat of a legacy application and you're not allowed to change the visibility of your methods, best way to test private methods is to use Reflection. Internally we're using helpers to get/set <code>private</code> and <code>private static</code> variables as well as invoke <code>private</code> and <code>p... |
You can do this from the Sounds panel in Control Panel. |
How do you write the syntax for a While loop?
## C`#`
> int i=0;
while (i != 10)
{
Console.WriteLine(i);
i++;
}
## VB.Net
> Dim i As Integer = 0
While i <> 10
Console.WriteLine(i)
i += 1
End Whil... |
How do you write the syntax for a While loop?
## C`#`
> int i = 0;
while (i != 10)
{
Console.WriteLine(i);
i++;
}
## VB.Net
> Dim i As Integer = 0
While i <> 10
Console.WriteLine(i)
i += 1
End Wh... |
|c#|php|vb.net|conditional-statements| |
|c#|php|vb.net|python|conditional-statements| |
|c#|php|python|vb.net|conditional-statements| |
|c#|python|php|vb.net|conditional-statements| |
How do you write the syntax for a While loop?
## C`#`
> int i = 0;
while (i != 10)
{
Console.WriteLine(i);
i++;
}
## VB.Net
> Dim i As Integer = 0
While i <> 10
Console.WriteLine(i)
i += 1
End Wh... |
How do you write the syntax for a While loop?
## C`#`
> int i = 0;
while (i != 10)
{
Console.WriteLine(i);
i++;
}
## VB.Net
> Dim i As Integer = 0
While i <> 10
Console.WriteLine(i)
i += 1
End Wh... |
javascript: in JS code (like in an onclick attribute) is just a label for use with continue/goto label statements that may or may not be supported by the browser. It could be zipzambam: instead.
javascript: in the href attribute signifies a Javascript URI.
[Example](http://shadow2531.com/js/jsuri.html):
ja... |
javascript: in JS code (like in an onclick attribute) is just a label for use with continue/goto label statements that may or may not be supported by the browser (probably not anywhere). It could be zipzambam: instead. Even if the label can't be used, browsers still accept it so it doesn't cause an error.
This means... |
Have a look at the process management functions in the [os module](http://python.org/doc/2.5/lib/os-process.html). There are function for starting new processes in many different ways, both synchronously and asynchronously.
I should note also that Windows doesn't provide functionality that is exactly like fork() on ... |
Maybe learn more about Usability (best practices, testing, etc.) if you haven't already done so.
Steve Krug's "Don't Make Me Think" is a good book to start with. [Jakob Nielsen][1] always has interesting stuff as well.
[1]: http://www.useit.com/alertbox/ |
imaginaryboy gets it right, I believe. Btw, since you don't have Flex Builder, you might look into the free and open source FlashDevelop if you're on Windows. It's my favorite environment for developing anything Actionscript (the Flex support is pretty great, too). |
I found http://unfuddle.com saved me messing about with installing SVN or git. You can get a free account in there and use either of those - plus you can use your OpenID there.
Then you avoid having to mess about setting it up right and focus on how you're going to use it! |
There are a few ambiguities in your question. What operation needs to be successful?
For everything you want to know about drag and drop, browse through these search results (multiple pages worth):
[Raymond Chen on drag and drop][1]
[1]: http://www.google.com/search?q=drag+drop+site%3Ablogs.msdn.com%2Foldn... |
If it's only going to be Allow/Deny, then a simple linking table between Users and Resources would work fine. If there is an entry keyed to the User-Resource in the linking table, allow access.
UserResources
-------------
UserId FK->Users
ResourceId FK->Resources
and the sql would be something... |