instruction stringlengths 0 30k ⌀ |
|---|
You need a class name on either the `a` elements you want to include or exclude. If you don't want to do this in your server side code or documents, you could add the classes with javascript as the page is loaded. With the selection logic wrapped up elsewhere, your rule could just be:
a.external_link
{
... |
Each table should only include columns that pertain to the entity that's uniquely identified by the primary key. If all the columns in the database are all attributes of the same entity, then you'd only need one table with all the columns.
If any of the columns may be null, though, you would need to put each nullabl... |
I've always read this like so:
If the property/method is prefixed with an underscore, it is for some "internal" workings. Therefore if you are about to use/call/alter this property/method, you had better darn well know what you are doing, and or expect it to possibly be renamed/removed in a future release. |
[SnagIt][1]
captures everything you could want, and lets you annotate it.
[1]: http://www.techsmith.com/screen-capture.asp |
Based on your examples above, I'd say option 1 is the best - simplicity always wins, and you can handle a failed connection differently depending on the method (you might want to fail differently for a stored procedure call than a simple SELECT, for instance). |
Printing in Adobe AIR - Standalone PDF Generation |
|apache-flex|air|printing|ria| |
<p>Is it possible to generate PDF Documents in an Adobe AIR application without resorting to a round trip web service for generating the PDF? I've looked at the initial Flex Reports on GoogleCode but it requires a round trip for generating the actual PDF.</p>
<p>Given that AIR is supposed to be the Desktop end for RIA... |
This is a good reference: <http://support.microsoft.com/kb/130510>
i.e.:
explorer /e,%HOMEDRIVE%%HOMEPATH% |
How do you create a shortcut to a directory so that it opens in explorer |
|windows|explorer|generic| |
Better yet, how can I make My Computer always open in Explorer as well?
I usually make a shortcut to my programming directories on my quick launch bar, but I'd love for them to open in Explorer. |
|windows|generics|explorer| |
|windows|explorer| |
For async stuff try ICS
[http://www.overbyte.be/frame_index.html?redirTo=/products/ics.html][1]
[1]: http://www.overbyte.be/frame_index.html?redirTo=/products/ics.html
|
There is nothing wrong with typed datasets. The only problem I faced is weak support for schema changes. Partial classes can help but not in every case. |
There is nothing wrong with typed datasets. They are not not perfect, however it's a next step toward solution of object-relational impedance mismatch problem. The only problem I faced is weak support for schema changes. Partial classes can help but not in every case. |
Where are people getting that rotaty loading image? |
|image|animation| |
I keep running across this loading image
<http://georgia.ubuntuforums.com/images/misc/lightbox_progress.gif>
which seems to have entered into existence in the last 18 months. All of a sudden it is in every application and is on every web site. Not wanting to be left out is there somewhere I can get this logo, p... |
|ajax|image|animation| |
Assuming that Form1 - is your main form and SplashForm is top level, borderles nice splash form:
private void Form1_Load(object sender, EventArgs e)
{
Hide();
bool done = false;
ThreadPool.QueueUserWorkItem((x) =>
{
using (var splashForm = new SplashForm())
... |
The trick is to to create separate thread responsible for splash screen showing.
When you run you app .net creates main thread and loads specified (main) form. To conceal hard work you can hide main form until loading is done.
Assuming that Form1 - is your main form and SplashForm is top level, borderles nice sp... |
Well, for a ClickOnce app that I deployed in the past, we used the Microsoft.VisualBasic namespace to handle the splash screen threading. You can reference and use the Microsoft.VisualBasic assembly from C# in .NET 2.0 and it provides a lot of nice services.
1. Have the main for inherit from Microsoft.VisualBasic.... |
Ruby and C# both easily let you create accessors by specifying getter/setter methods for an attribute, much like in Python. However, this isn't designed to naturally let you write the code for these methods in another class the way that Python allows. In practice, I'm not sure how much this matters, since every time ... |
if i were you i'd probably start the project and then only if i needed support for mono buy the product. that way if you dont need it you wont be wasting the $13k. |
I recently introduced Python to my company, which does consulting work for the Post Office. I did this by waiting until there was a project for which I would be the only programmer, then getting permission to do this new project in Python. I then did another small project in Python with similarly impressive results. ... |
It's definitely pythonic. The fact that you can return multiple values from a function the boilerplate you would have in a language like C where you need to define a struct for every combination of types you return somewhere.
However, if you reach the point where you are returning something crazy like 10 values from... |
I once used template metaprogramming in C++ to implement a technique called "symbolic perturbation" for dealing with degenerate input in geometric algorithms. By representing arithmetic expressions as nested templates (i.e. basically by writing out the parse trees by hand) I was able to hand off all the expression a... |
You can do:
select
count(<columnName>)
from
<tableName>
If the count returns 0 that means that all rows in that column all NULL (or there is no rows at all in the table)
can be changed to
select
case(count(<columnName>)) when 0 then 'Nulls Only' else 'Some Values' end
... |
We did this migration recently at work. I strongly suggest:
1. Just add the new code from VSS, take the hit that pre-svn history will have to stay in the old VSS repository.
2. If your VSS repository is still in use after the initial code dump, migrate changes using [Vendor Branches][1]. Ie, assume your VSS repos... |
There are several serialization options in WCF: Data contract, XML Serialization and and raw data payload. Which of these are you trying to use? From the question, it seems you are trying to use something other than objects decorated with datacontact attributes. Is that what you are asking? |
You want to use [IMarkupContainer2::CreateChangeLog][1].
[1]: http://msdn.microsoft.com/en-us/library/aa703624(VS.85).aspx |
Something like this might work:
public static IList<int> GetIdListFromString(string idList)
{
string[] values = idList.Split(',');
List<int> ids = new List<int>(values.Length);
foreach (string s in values)
{
int i;
if (int.TryParse(s, out i))
... |
I also needed a WYSIWYG editor for a Windows Forms project that I was working on. I wrote about the items that I found [here][1]. Eventually, I ended up using something that I found on CodeProject: [A Windows Forms based text editor with HTML output][2]. This does violate (a) above in that it uses the WebBrowser contro... |
@Brad Barker
Clean means to just wipe out build products.
Deleting the working copy deletes everything else too (source and project files etc).
In general it's nice if you're build machine can operate without doing a full delete, as this replicates what a normal developer does. Any conflicts it finds during u... |
@Brad Barker
Clean means to just wipe out build products.
Deleting the working copy deletes everything else too (source and project files etc).
In general it's nice if you're build machine can operate without doing a full delete, as this replicates what a normal developer does. Any conflicts it finds during u... |
Are you sure there are no precompile directives that, say, ignores some really important code in Release mode but allows them in Debug?
Also, have you implemented any logging that might point out to the precise assembly that's throwing the error? |
It's hard to say what the problem might be without carefully inspecting the code. However...
One of the differences between debug and release builds is how the function call stack frame is set up. There are certain classes of bad things you can do (like calling a function with the wrong number of arguments) that are... |
Could be a concurrency problem of two threads. The DEBUG configuration slows the execution down, so the problem does not occur. But, only a guess. |
Interesting problem.. Are you sure you have no conditional compilation code lurking around that is not being compiled in release mode? i.e:
#if (DEBUG)
// Debug Code here
#else
// Release Code here
#endif
Thats the only thing I can really think of.. Never experienced anything like this mys... |
Another option I was considering: rather than writing a native launcher from scratch, Eclipse comes with the source code for its own launcher, and this could perhaps be repurposed for my app.
It's a shame that Sun never included anything similar in the JDK. |
Sync Algorithms |
|algorithm|calendar|synchronization| |
Are there any good references out there for sync algorithms? I'm interested in algorithms that synchronize the following kinds of data between multiple users:
- calendars
- documents
- lists and outlines
I'm not just looking for synchronization of contents of directories _a la_ rsync; I am interested in mergin... |
I have a few fairly simple rules of thumb I follow when designing databases, which I think can be used to help make decisions like this....
1. Favor normalization. Denormalization is a form of optimization, with all the requisite tradeoffs, and as such it should be approached with a [YAGNI][1] attitude.
2. Make sur... |
I've had success with Camtasia / CamStudio. Check out [http://showmedo.com][1] for tutorials. It's a little recursive though - it would be better to capture it from source.
[1]: http://showmedo.com |
I would have thought that looking at any of the open-source source code control applications would give you the right idea - merging changes between files is exactly what they do... |
Dim prTimeInMillis as UInt64
prTimeInMillis = prTime/1000
dim prDateTime as new DateTime(1970, 1, 1)
prDateTime.AddMilliseconds(prTimeInMillis) |
Dim prTimeInMillis as UInt64
prTimeInMillis = prTime/1000
dim prDateTime as new DateTime(1970, 1, 1)
prDateTime = prDateTime.AddMilliseconds(prTimeInMillis) |
One reason is that having many interfaces with a minimal amount of methods for each one makes it easier to implement each interface and to implement them correctly. A large interface can be unruly. Also, using a focused interface in a scenario makes the code more maintanable because you can see which facet of the objec... |
Try something like:
Expect.Call(delegate { _dao.Save(t); }).Do(new EventHandler(delegate(Transaction t2) { t2.CheckInInfo.CheckInMessage = "I drink goats blood"; }));
Note the added EventHandler around the delegate.
EDIT: might not work since the function signatures of EventHandler and the delegate are not... |
There are a lot of links after this [brief overview][1] of what is involved in writing an OS for the X86 platform.
The link that appears to be [most promising][2] is down, so you'll need to poke through the [Archive.org version][3] to read it.
At the end of the day the bootloader takes the machine code of the ker... |
I use the following code. It requires PIL:
def reduceOpacity(im, opacity):
"""Returns an image with reduced opacity."""
assert opacity >= 0 and opacity <= 1
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split(... |
|editor|touch-typing| |
How do I force unix (LF) line endings in Visual Stuido (Express) 2008? |
|visual-studio|unix|editor|formatting|visual-studio-2008| |
Is there a way to *always* have LF line endings in Visual Studio? I can never seem to find it! |
How do I force unix (LF) line endings in Visual Studio (Express) 2008? |
|visual-studio|unix|visual-studio-2008|editor|formatting| |
Code Classic ASP in Linux |
|classicasp|editor|linux| |
What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them. |
|asp-classic|editor|linux| |
|linux|editor|asp-classic| |
What should i use to code Classic ASP under Linux. I have really tried to use Emacs and Vim but I don't have the time to learn them.
What i'm looking for is:
- Syntax highlighting
- Code Browser (Ctags)
- Preferably som sort of code insight
Something like Ultra Edit or E-texteditor. |
|linux|editor|asp-classic| |
Pretty printing XML files on Emacs |
|xml|editor|emacs| |
I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags.
I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way.
Is there a way? Or atleast some editor on linux which ca... |
|xml|emacs|editor| |
What IDE to use for developing in Ruby on Rails on windows? |
|ruby|ruby-on-rails|ide|editor| |
I've generally been doing stuff on Microsoft .Net out of college almost 2 years ago. I just started looking at Ruby on rails. So what editor should I use? I'm using Notepad++ right now but can I get debugging etc. somehow? |
|ruby|ruby-on-rails|ide|editor| |
Is there a Java Console/Editor similar to the GroovyConsole? |
|java|editor|presentations| |
I'm giving a presentation to a Java User's Group on Groovy and I'm going to be doing some coding during the presentation to show some side-by-side Java/Groovy. I really like the GroovyConsole as it's simple and I can resize the text easily.
I'm wondering if there is anything similar for Java? I know I could just... |
I use the following code. It requires PIL:
def reduceOpacity(im, opacity):
"""Returns an image with reduced opacity."""
assert opacity >= 0 and opacity <= 1
if im.mode != 'RGBA':
im = im.convert('RGBA')
else:
im = im.copy()
alpha = im.split(... |
You need a service registry (UDDI??)... If you had a means to catalog these services and their consumers, it would make this job of dependency discovery a lot easier. That is not an easy solution, though. It takes time and documentation to get a catalog in place.
I think the quickest solution would be to query your ... |
Randomize questions, ask a random set of questions from a large bank... time the answers...
Unless you mean hacking your site, which is a different question. |
I have done this for an HTA by using an ActiveX control. It was pretty easy to build the control in VB6 to take the screenshot. I had to use the keybd_event API call because SendKeys can't do PrintScreen. Here's the code for that:
Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byt... |
I have done this for an HTA by using an ActiveX control. It was pretty easy to build the control in VB6 to take the screenshot. I had to use the keybd_event API call because SendKeys can't do PrintScreen. Here's the code for that:
Declare Sub keybd_event Lib "user32" _
(ByVal bVk As Byte, ByVal bScan As Byt... |
You could try setting up a code snippet to make it easy to create those. |
I would also recommend to search for fields which all have the same value, not just NULL.
That is, for each column in each table do the query:
SELECT COUNT(DISTINCT field) FROM tableName
and concentrate on those which return 1 as a result.
|
Both. Have your cake and eat it.
Remember there is nothing special about a primary key, except that it is labelled as such. It is nothing more than a NOT NULL UNIQUE constraint, and a table can have more than one.
If you use a surrogate key, you still want a business key to ensure uniqueness according to the bu... |
so.c in 15 characters:
main(){main();}
Result:
antti@blah:~$ gcc so.c -o so
antti@blah:~$ ./so
Segmentation fault (core dumped)
|
so.c in 15 characters:
main(){main();}
Result:
antti@blah:~$ gcc so.c -o so
antti@blah:~$ ./so
Segmentation fault (core dumped)
so (shell script) in 10 characters including newlines:
#!sh
./so
Result:
antti@blah:~$ ./so
[disconnected]
Can't connect to the serv... |
so.c in 15 characters:
main(){main();}
Result:
antti@blah:~$ gcc so.c -o so
antti@blah:~$ ./so
Segmentation fault (core dumped)
so (shell script) in 10 characters including newlines:
#!sh
./so
Result:
antti@blah:~$ ./so
[disconnected]
Can't connect to the serv... |
You're missing more than a few things! ASP.NET is orders of magnitudes more productive, robust, and maintainable than old-school ASP ever thought about being. Server side controls, third-party controls, master pages, forms authentication, forms validation, an OO model than encourages appropriate application partitionin... |
Short of having the application run completely on the user's machine, I do not believe there is a way to make sure they are not google-ing the answers. Even then it would be difficult to check for all possible loop-holes.
I have taken classes that used web based quiz software and used to work for a small college a... |
I'd probably implement a simple winforms (or WPF) app that hosts a browser control in it -- which is locked in to your site. Then you can remove links to browsers and lock down the workstations so that all they can open is your app.
This assumes you have control over the workstations on which the students are takin... |
I think the way this is generally done is to set the color of the text to gray and prefill it with your hint text.
Then, write handlers for the text field's focus events, modifying the fields contents and color based when focus is gained and lost. Here's some pseudocode (sorry, it's totally not C# code. I have Act... |
Simply put, **no** there is no realistic way to accomplish this if it is an online exam (assuming they are using their own computers to take the exam). |
Will they always take the test on test machines, or will they be able to take the test from any machine on the network? If it will be specific machines, just use the hosts file to prevent them from getting out to the web.
If it is any machine, then I would look at having the testing backend change the firewall rules... |
Here is a good list:
[Open Source Libs for PDF/C#][1]
Most of these are geared toward creating PDFs, but they should have read capability as well.
There is this one as well: [iText][2]
I have only played with iText before. Nothing major.
[1]: http://csharp-source.net/open-source/pdf-libraries
[2]: h... |
I recently introduced Python to my company, which does consulting work for the Post Office. I did this by waiting until there was a project for which I would be the only programmer, then getting permission to do this new project in Python. I then did another small project in Python with similarly impressive results. ... |
I don't recommend Oracle XE. MY co-workers and I have been doing a project in Oracle and got severely tripped up after trying to use XE for our local development instances. The database worked fine until we started running local stress tests, at which point it started dropping connections.
I don't know whether thi... |
I don't recommend Oracle XE. My co-workers and I have been doing a project in Oracle and got severely tripped up after trying to use XE for our local development instances. The database worked fine until we started running local stress tests, at which point it started dropping connections.
I don't know whether thi... |
Best format for displaying rendered time on a webpage |