instruction stringlengths 0 30k ⌀ |
|---|
Is it possible to build following SQL query |
|sql|database|mysql| |
The original query looks like this (MySQL):
select * from books where title like "%text%" or description like "%text%" order by date
Would it be possible to rewrite it (without unions or procedures), so that result will look like this:
- list of books where title matches query ordered by date, followed by:
- list... |
I think regardless of whether F# becomes import for Enterprise Software being able to isolate pure functional portions of code in any language will be key to using the potential of multi-core computers. For instance Microsoft's Parallel Extensions for .NET are great, but there is still a lot of room to make mistakes b... |
How to Modify config file on clickonce deployment? |
|clickonce| |
I have a application deployed through clickonce, but How can I modify the config file on the deployment server?. I mean, once the product is tested, it should be deployed in our production server, but need to modify some of the config parameters to consume production resources?. I heard we should use MageUI.exe, but s... |
|.net|clickonce| |
I don't think this is True, if you are using the `Scripting.Runtime` library.
Oldschool VB had some language constructs for file handling. These are evil. Don't use them. |
See my question: [<h3>What is the best subversion client for Linux?</h3>][1]
I also agree, GUI clients in linux suck.
I use [subeclipse][2] in Eclipse and [RapidSVN][3] in gnome.
[1]: http://stackoverflow.com/questions/52105/what-is-the-best-subversion-client-for-linux
[2]: http://subclipse.tigris.org
... |
kdesvn is probably the best you'll find.
<http://www.alwins-world.de/wiki/programs/kdesvn>
Last I checked it may hook in with konqueror, but its been a while, I've moved on to git :)
|
Both forms should be inlined in the exact same way. Inline is implicit for function bodies defined in a class definition. |
No add-ins allowed |
1. Improper use of eval opens up your
code for injection attacks
2. Debugging can be more challenging
(no line numbers, etc.)
3. eval'd code executes more slowly (no opportunity to compile/cache eval'd code) |
The `inline` keyword is essentially a hint to the compiler. Using `inline` doesn't guarantee that your function *will* be inlined, nor does omitting it guarantee that it *won't*. You are just letting the compiler know that it might be a good idea to try harder to inline that particular function. |
Will "cvs history -a -l" get you close? Shows for all users last event per project... |
Visual Source safe has a strict locking policy so that only one person can work on a file at a time....CVS or subversion allows multiple users to work on the same file at the same time. |
This [MSDN document][1] should get you everything you need!
[1]: http://msdn.microsoft.com/en-us/vs2008/products/cc149003.aspx |
Generally I just use the command line for svn, it's the fastest and easiest way to do it to be honest, I'd recommend you try it.
Before you dismiss this, you should probably ask yourself if there is really any feature that you need a GUI for, and whether you would prefer to open up a GUI app and download the files, ... |
|| is a logical or and | is a bit-wise or. |
[Java operators][1]
| is bitwise or, || is logical or.
[1]: http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html |
One thing to be aware of is that this technique will not set padding bytes to zero. For example:
struct foo
{
char c;
int i;
};
foo a = {0);
Is not the same as:
foo a;
memset(&a,0,sizeof(a));
In the first case, pad bytes between c and i are uninitialized. Why... |
One thing to be aware of is that this technique will not set padding bytes to zero. For example:
struct foo
{
char c;
int i;
};
foo a = {0};
Is not the same as:
foo a;
memset(&a,0,sizeof(a));
In the first case, pad bytes between c and i are uninitialized. Why... |
There is 2 ways to get silent installation:
1) [Sign the driver][1] and that can be hard/impossible if you don't have the driver source code.
2) You can write a [co-installer dll][2] using [this][3] api's. The problem that this is not reliable and from our experience there is a lot of workarounds for different... |
Take a look at:
http://java.sun.com/docs/books/tutorial/java/nutsandbolts/operators.html
| is bitwise inclusive OR
|| is logical OR
|
| is a bitwise operator. || is a logical operator.
One will take two bits and or them.
One will determine truth (this OR that) If this is true or that is true, then the answer is true.
Oh, and dang people answer these questions fast. |
While database might be more secure for sessions, you should focus on what you're storing in the session in the first place - it should not really contain anything but an ID to identify the user (and MAYBE a firstname or a temporary variable between pages).
I would suggest simply using the default, cookies. Database... |
Could do with some work but here is some sql
select distinct T.itemid, A.mark as "A.mark", B.mark as "B.mark"
from (select * from A union select * from B) T
left join A on T.itemid = A.itemid
left join B on T.itemid = B.itemid;
This relies on the left join, which returns all the r... |
WPF: How to style or disable the default ContextMenu of a TextBox |
|wpf|.net-3.5|xaml| |
Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background.
I know this works well:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
... |
Apparantly when users right-click in our WPF application, and they use the Windows Classic theme, the default ContextMenu of the TextBox (which contains Copy, Cut and Paste) has a black background.
I know this works well:
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
... |
IE supports VML, but nothing else does and it's ugly. Microsoft claimed that they'd dropped it (with new XAML and all) but it's still part of their Office XML format (it's how Excel .xlsx supports comments, weirdly enough).
FX and loads more support the new Canvas element. Many support SVG, but given the work MS a... |
I don't think SVG is a good choice for the future. From [Wikipedia][1]:
- "The most common IE plugin was produced by Adobe. Adobe, however, are planning to withdraw this product at the beginning of 2009"
- "... Internet Explorer which will also not support SVG in the upcoming version IE8"
- "...all have inco... |
Trouble having a modal YUI dialog to open a secondary dialog |
|javascript|yui| |
I have a modal dialog form which has some "help links" within it which should open other non-modal panels or dialogs on top of it (while keeping the main dialog otherwise modal). However, these always end up behind the mask. YUI seems to be recognizing the highest z-index out there and setting the mask and modal dial... |
Trouble having a modal dialog to open a secondary dialog |
|javascript|yui|jquery-ui| |
I have a modal dialog form which has some "help links" within it which should open other non-modal panels or dialogs on top of it (while keeping the main dialog otherwise modal). However, these always end up behind the mask. YUI seems to be recognizing the highest z-index out there and setting the mask and modal dial... |
Put the service address and port into your application's configuration. It's probably a good idea to do the same thing in the service's config, at least for the port, so that your dev service listens on the right port. This way you don't have to modify your code just to change the server/port you're hitting.
Using... |
What RTOS is best for working on the same PC with Windows? |
|windows|rtos| |
What RTOS is best for working on the same PC with Windows?
I know about RTX and INtime, but have not used them. Are there any others? Which one is your favorite and why? |
Maven would be just fine for what you want to do. Unlike most build tools, maven uses conventions wisely (well, better than many others at least), and it has "plugins" for every area you mentioned:
Unit tests: [maven surefire plugin][1]
Eclipse Integration: [m2eclipse][2]
Deploying WAR file: [WAR plugin][3] an... |
URLSCAN question |
|urlscan| |
I have uriscan installed on my Win2003 server and it is blocking an older ColdFusion script. The log entry has the following--
2008-09-19 00:16:57 66.82.162.13 1416208729 GET /Admin/Uploads/Mountain/Wolf%2520Creek%2520gazeebo.jpg Rejected URL+is+double+escaped URL - -
How do I get uriscan to allow submissions li... |
#FxCop
There is a list of [all warnings in FxCop][1]. You can see that there are warnings from the following areas:
> ##Design Warnings
>
> Warnings that support proper library
> design as specified by the .NET
> Framework Design Guidelines.
>
> ##Globalization Warnings
>
> Warnings that support world-... |
I don't think jQuery implements a timeout function, but plain old javascript does it rather nicely :) |
I would suggest that instead of using <td> to define the columns, that you use CSS instead.
<pre><code>
.collink {
width: 20px;
float: left;
height: 20px;
}
AND
<td style="padding :0px 0px 0px 0px;">
<div class="collink">
<asp:LinkButton ID="lnkEdit" runat="server" ...... |
According to [the docs][1], jQuery.get's arguments are `url, data, callback`, not `url, callback`.
A call to JavaScript's setTimeout function at the end of your callback function should suffice to get this to continually execute.
[1]: http://docs.jquery.com/Ajax/jQuery.get |
Any Metadata driven UI sample code? |
|user-interface|metadata| |
I am in the process of designing a .net windows forms application that uses metadata to drive the UI. Apart from finding http://msdn.microsoft.com/en-us/library/ms954610.aspx, I have nothing much to look forward to. Anyone here worked on metadata driven User interfaces? What are the implications of following this metho... |
I have tracked down a lot of issues with UIs not unloading as expected in WinForms.
Here are some general hints:
- alot of the time, a control will stay in use because controls events are not properly removed (the tooltip provider caused us really large issues here) or the controls are not properly Disposed.
... |
The disadvantage to leaving the logic to the database is then you increase the load on that particular server. Web and application servers are comparatively easy to scale outward, but a database requires special techniques. As a general rule, it's a good idea to put as much of the computational logic into the applica... |
James code forgets to close the connection, should probably be:
try
{
conn.Open();
}
catch(Exception ex)
{
Session["DBException"] = ex;
Response.Redirect("Maintenance.aspx");
}
finally
{
conn.Close();
} |
The [TI MSP430][1] is a great platform for learning how to program microcontrollers. TI has a variety of **[FREE Tools][2]** and some [cheap evaluation boards][3] (starting at $20). Plus, it's a low-power, modern microcontroller.
[1]: http://focus.ti.com/mcu/docs/mcuprodoverview.tsp?sectionId=95&tabId=140&fami... |
Can regex capture and substitution be used with an Apache DirectoryMatch directive? |
|apache|regex| |
Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:
<DirectoryMatch ^/home/www/(.*)>
AuthType Basic
AuthName $1
AuthUserFile /etc/apache2/svn.passwd
Require group $1 admin
</Director... |
|regex|apache| |
Does anyone know if it's possible to use regex capture within Apache's DirectoryMatch directive? I'd like to do something like the following:
<DirectoryMatch ^/home/www/(.*)>
AuthType Basic
AuthName $1
AuthUserFile /etc/apache2/svn.passwd
Require group $1 admin
</Director... |
The Code Access Security attribute that @[Charles Graham][1] mentions is [StrongNameIdentityPermissionAttribute][2]
[1]: http://stackoverflow.com/questions/96624/how-to-prevent-others-from-using-my-net-assembly#96647
[2]: http://msdn.microsoft.com/en-us/library/system.security.permissions.strongnameidentitype... |
Encapsulate the $SESSION array in a Session() Object that allows you to get variables from session, get, and post with a similar (yet dissociable) way, including automatic security filters, flash variables (var that are used once then distroyed), and default value setters.
Have a look to the behaviour of Symfony on ... |
You just need to add the xmlns to your Window, and use that to reference your ValidationRule.
In WPF, the object is perfectly fine to be used from the same assembly.
Since your rule isn't defined in the standard XAML namespace, you have to create a mapping to your clr namespace like so:
<Window ...
... |
You just need to add the xmlns to your Window, and use that to reference your ValidationRule.
In WPF, the object is perfectly fine to be used from the same assembly.
Since your rule isn't defined in the standard XAML namespace, you have to create a mapping to your clr namespace like so:
<Window ...
... |
|| is the logical or operator while | is the bitwise or operator.
boolean a = true;
boolean b = false;
if (a || b) {
}
int a = 0x0001;
a = a | 0x0002; |
its up to v 1.4.6 in Dag's repository.
You can try the one from [Fedora's repo][1] or have a bit of patience for the main repositories to upgrade it.
Making it from source is easy, read the INSTALL file when you download the source package, bear in mind CentOS may have moved where the files get installed. (Use "r... |
Depends on exactly what you want to do.
XSLT may be the way to go, but there is a learning curve. Try [xsltproc][1] and note that you can hand in parameters.
[1]: http://xmlsoft.org/XSLT/xsltproc.html |
Organizing Extension Methods |
|c#|extension-methods|code-organization| |
How do you organize your Extension Methods? Say if I had extensions for the object class and string class I'm tempted to separate these extension methods into classes IE:
public class ObjectExtensions
{
...
}
public class StringExtensions
{
...
}
am I making this t... |
Override the `to_param` method in your model classes so that the default numeric ID is replaced with a meaningful string. For example, this very question uses **best-permalinking-for-rails** in the URL.
Ryan Bates has a [Railscast on this topic][1].
[1]: http://railscasts.com/episodes/63-model-name-in-url |
Is JavaScript really the best we can do for client scripting? |
|javascript| |
This is admittedly a subjective matter, but every time I am forced to get my hands dirty with JavaScript, I feel like... well... I have just gotten my hands dirty. Wouldn't it make more sense to support a set of more popular languages (Java, Python, Ruby, etc.) by way of a standardized VM hosted in the browser instead... |
This is admittedly a subjective matter, but every time I am forced to get my hands dirty with JavaScript, I feel like... well... I have just gotten my hands dirty. Wouldn't it make more sense to support a set of more popular languages (Java, Python, Ruby, etc.) by way of a standardized VM hosted in the browser instead... |
|javascript| |
I'm using acts_as_ferret. It's easy to configure and generally fast. The built-in active record find functionality is quite useful: you can apply any conditions or join other models after your search finds the matching records.
Unlike sphinx, you don't have to re-index ALL of your records when you add new data. ... |
Try [haXe][1].
It can target javascript, actionscript and Neko bytecode. The language is close to Java.
[1]: http://haxe.org/ |
Sutter's Guru of the Week #33 answers some of your questions and more.
http://www.gotw.ca/gotw/033.htm |
You can't use a variable and assign it depending on the type? You could put it in a `build.properties` file. Or you could assign it using a [condition][1].
[1]: http://ant.apache.org/manual/CoreTasks/condition.html |
As others have mentioned: add the IDENTITY attribute to the column, and make it a primary key.
There are, however, differences between MSSQL's IDENTITY and MySQL's AUTO\_INCREMENT:
- MySQL requires that a unique
constraint (often in the form of a
primary key) be defined for the
AUTO\_INCREMENT co... |
In these sort of circumstances, I don't really think it matters what you do. If you have some kind of protection it will stop 90% of your users. The other 10% - if they don't want to pay for your software they'll pretty much find a way around protection no matter what you do.
If you want something a little less obvi... |
There's not much point to doing complicated protection schemes. Basically one of two things will happen:
1. Your app is not popular enough, and nobody cracks it.
2. Your app becomes popular, someone cracks it and releases it, then anybody with zero knowledge can simply download that crack if they want to cheat yo... |
Generally speaking, they're expensive and not worthwhile in PHP.
Since it is a checked expressions language, you MUST catch anything that throws an exception.
When dealing with legacy code that doesn't throw, and new code that does, it only leads to confusion.
Good luck! |
If you are hosting your homepage on a server that you control, you could have the downloadable trial-version of your software automatically compile to a new binary every night. This compile will replace a hardcoded datetime-value in your program for when the software expires. That way the only way to "cheat" is to chan... |
If you are looking for maintainablility, its silverlight, their programming api, is way cleaner.
But, its not only not installed everywhere, its not supported by every browser or client OS.
If you can, do it in both, but if you can't, do it in flash , and port it when you get a chance after the install base is la... |
you need to create a SQL Function that does this transformation for you. |
<?php
$code = 'Here is a <% test %> and <% another test %> for you';
preg_match_all('/(<|<)%\s*(.*?)\s*%(>|>)/', $code, $matches);
print_r($matches[2]);
?>
Result:
Array
(
[0] => test
[1] => another test
)
|
I would suggest to keep an **open mind** when learning. Most of the time in school we don't fully comprehend what/why we are learning a particular subject. But as I've experienced about a million times in life, it turns out to be very useful and at the very least being aware of it helps you. Scheme, believe it or no... |
That article just recommends against overrriding the quality operator, not against override Equals. You should override Equals within your object (reference or value) if equality checks will mean something more than reference checks. If you want a "more complex" interface, you can also implement [IEquatable][1], thou... |
And don't forget: [http://dev.mysql.com/][1]
[1]: http://dev.mysql.com/
This is a good resource to back up anything you find in any videos. I can't recommend any videos as I have no experience with them, sorry. |
When I moved from ASP3 to ASP.NET I finally choosed to use C# instead of VB.NET.
I wrote Basics for years (MS-BAsic, GW-Basic, Quick-Basic, Visual Basic, VBScript) and it was very difficult to use VB.NET because I always try to write things as I used to do with VB6 or VBScript.
So C# was a better choice for me : ... |
A Flex Grid Control will probably do what you want but you will need to write a bit of VBA code, have a look at my Flex Grid Demo program for some examples.
Go to http://www.rogersaccesslibrary.com/forum/forum_posts.asp?TID=180
HTH
Peter Hibbs. |
Perhaps you could try bash -i to force the session to be in interactive mode.
|
Always nice to be able to answer you own questions.
I managed to solve it by casting the table's data provider to ObjectListDataProvider and use the method 'getObject' to get my original object back. |
Relevance.
Just because two variables are of type String does not mean they are closely related to each other.
If the two (or more) variables are closely related by function, rather then variable type, then maybe they could be declared together. i.e. only if it makes sense for a reader of your program to see th... |