instruction stringlengths 0 30k ⌀ |
|---|
I'm looking for an Access 2007 equivalent to SQL Server's COALESCE function.
In SQL Server you could do something like:
---Person---
John
Steve
Richard
DECLARE @PersonList nvarchar(1024)
SELECT @PersonList = COALESCE(@PersonList + ',','') + Person
FROM PersonTable
... |
|ms-access|vba|coalesce|rows| |
How can I supress the browser's authentication dialog? |
|authentication|ajax|javascript| |
My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens:
1. The web server determines that although the request included a well-formed Authorization header, the credentia... |
My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens:
1. The web server determines that although the request included a well-formed Authorization header, the credentia... |
I don't know the name, but the shortcuts are CTRL-period (.) and ALT-SHIFT-F10. Handy to know :) |
No need to compile. Maybe you want to get something rolling faster than using a compiled language, like a prototype.
...and you can embed the Jython interpreter into your apps. Nice feature, I can't say I've used it, but tis cool nonetheless. |
You can use #defines to help with debugging and unit test scenarios. For example, create special logging variants of the memory functions and create a special memlog_preinclude.h:
#define malloc memlog_malloc
#define calloc memlog calloc
#define free memlog_free
Compile you code using:
gcc -... |
It's called a SmartTag |
Here we go, this is a hairy one:
/\%(\%(.\{-}\)\@<=XXXXXX\zs\)*
(replace XXXXXX with the search word). This will search for everything that does *not* contain XXXXXX. I imagine if you did:
/abc \%(\%(.\{-}\)\@<=defg\zs\)*
This may work like you want it to. Hope this helps a little! |
Well, you can return non-null values by passing * as the parameter for fields you don't wish to use in the current filter. In Access 2003 (and possibly earlier and later versions), if you are using `like [paramName]` as your criterion for a numeric, Text, Date, or Boolean field, an asterisk will display all records (th... |
how to trim leading zeros from alphanumeric text in mysql function |
|mysql| |
What mysql functions are there (if any) to trim leading zeros from an alphanumeric text field?
Field with value "00345ABC" would need to return "345ABC". |
For .NET assemblies, you can store this information in the assembly itself:
[http://www.codinghorror.com/blog/archives/000142.html][1]
I'm not familiar enough with other assembly types to know what they provide.
[1]: http://www.codinghorror.com/blog/archives/000142.html |
In your situation, it doesn't make much sense. But that doesn't mean it never does. For example, if you are developing a product that allows end users to create extensions or plugins, it might be nice for that to be scriptable. |
You can try disabling all your plugins and add them back in one by one.
In `environment.rb` in the Initalizer section, add a line like this one:
config.plugins = [ :exception_notification, :ssl_requirement, :all ]
Start with the minimum set to run your application and add them in one by one. I usually get... |
The option to open or save is a browser selection item, as far as I know it is not possible to override this behavior. |
ASPNET user does not have write access to Temporary ASP.NET Files |
|asp.net|visual-studio-2008|iis-5| |
When I run my Visual Studio 2008 ASP.NET project (start without Debugging) on my XP Professional box, I get the following error:
System.Web.HttpException: The current identity (machinename\ASPNET) does not have write access to 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files'.
How do I r... |
From these answers, I've sort of sifted out a solution. I really like the idea of the link concept. Recurring events could be a linked list, with the tail knowing its recurrence rule. Changing one event would then be easy, because the links stay in place, and deleting an event is easy as well - you just unlink an event... |
I would think that you'd want to stop doing so many evaluations inside of your loops and instead use variables to hold counts, pointers to the col object and to hold your pipe-delim string until you're ready to commit to the query object. If I've done the refactoring correctly, you should notice an improvement if you u... |
if (callback && typeof(callback) == "function)
Note that callback (by itself) evaluates to false if it is undefined, null, 0, or false. Comparing to null is overly specific. |
Determine if a function exists in bash |
|bash|linux|scripting|testing| |
Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined.
I did this previously by grepi... |
|linux|testing|bash|scripting| |
Currently I'm doing some unit tests which are executed from bash. Unit tests are initialized, executed and cleaned up in a bash script. This script usualy contains an init(), execute() and cleanup() functions. But they are not mandatory. I'd like to test if they are or are not defined.
I did this previously by grepi... |
If you are going to be exchanging a lot of data, I would recommend implementing (or finding) a Stream-wrapper that can write and read ints in network-order. But if you really only need to write the length do something like this:
using(Socket socket = ...){
NetworkStream ns = new NetworkStream(socket); ... |
Yes you can. Create the directory as normal then just set the attributes on it. E.g.
DirectoryInfo di = new DirectoryInfo(@"C:\SomeDirectory");
//See if directory has hidden flag, if not, make hidden
if( (di.Attributes & FileAttributes.Hidden) != FileAttributes.Hidden)
{
... |
[Visual Build Pro][1]
[1]: http://www.kinook.com/VBP/ |
There's no proper way of doing it in CSS (although there should be). But here's a method that works for me.
CSS:
#image1, #image1-text, #image1-container {
overflow: hidden;
height: 100px;
width: 100px;
}
#image1 {
top: -100px;
position: relative;
z-index... |
There's no proper way of doing it in CSS (although there should be). But here's a method that works for me.
CSS:
#image1, #image1-text, #image1-container {
overflow: hidden;
height: 100px;
width: 100px;
}
#image1 {
top: -100px;
position: relative;
z-index... |
There's no proper way of doing it in CSS (although there should be). But here's a method that works for me.
CSS:
#image1, #image1-text, #image1-container {
overflow: hidden;
height: 100px;
width: 100px;
}
#image1 {
top: -100px;
position: relative;
z-index... |
given the increasing focus to running dynamic languages (da-vinci vm etc.) on the JVM and the increasing number of dynamic languages that do run on it (JRuby, Grrovy, Jython) i think the usecases are just increasing. Some of the scenarios I found really benifited are
1. **Prototyping**- use RoR or Grails to build qu... |
Unfortunately for massive concurrent programming - unless there is a breakthrough in compilers to help, we will be throwing out a lot of what we know about algorithms (I think Don Knuth even said that). Read about Erlang for a glimpse of this possible future. |
[UnxUtils][1] is the one I use, works perfectly for me...
[1]: http://unxutils.sourceforge.net/ |
DOC files are stored in binary format which there hasn't been any purely php written classes in dealing with them.
RTF files are much easier to parse, being mostly text you can just open them up with fopen and read the contents.
I would suggest using RTF if you can, as there really is not a sound solution for DOC... |
PHP is not half bad.
// given two timestamps: $t1, and $t2:
// find the number of days between two given dates, number of minutes
// between two given minute periods, etc.
$daysBetween = floor(($t2 - $t1) / 86400); // 86400 = 1 day in seconds
$hoursBetween = floor(($t2 - $t1) / 3600)... |
I think it actually does render both data sets, but you can only se one of them because there's only one scale on the y axis. (In other words, 0.10 is too small to show.)
And, you should really be using percentages. 100 is the highest accepted value:
> Where chart data string consists of positive floating point n... |
|javascript|ajax|authentication| |
My web application has a login page that submits authentication credentials via an AJAX call. If the user enters the correct username and password, everything is fine, but if not, the following happens:
1. The web server determines that although the request included a well-formed Authorization header, the credentia... |
[Google Testing Blog][1]
[1]: http://googletesting.blogspot.com/ |
It doesn't exactly document itself. And it may be slow. It's a clever hack, but that's all it is. I'd be tempted to be more obvious in my checking. Either use regex's or write a more obvious test.
public bool IsAlpha(String strToCheck)
{
Regex objAlphaPattern=new Regex("[^a-zA-Z]");
retur... |
It could be many things, but [MySQL Performance Blog][1] mentions bad memory, OS or MySQL bugs that could cause hidden corruption. Also, that and [another article][2] mention several things to keep in mind when doing crash recovery.
[1]: http://www.mysqlperformanceblog.com/2006/06/17/using-myisam-in-production/... |
Usually, it happens when the database is not shut down properly, like a system crash, or hardware problem. |
Your problem is that => is a magic comma that automatically quotes the word in front of it. So what you wrote is equivalent to ('X', 'X').
The simplest way is to just use a comma:
my %x = (X, 'X'); |
Your problem is that => is a magic comma that automatically quotes the word in front of it. So what you wrote is equivalent to ('X', 'X').
The simplest way is to just use a comma:
my %x = (X, 'X');
Or, you can add various punctuation so that you no longer have a simple word in front of the =>:
my %... |
Are you sure this is what you want to do? If you embed the private key in your application (as your approach entails), an attacker can extract it and use it to authenticate their rogue software.
A server cannot authenticate client software. It can only test whether a client possesses some secret. When you embed a pr... |
What is the difference between range and xrange? |
|python|loops| |
Apparently xrange is faster but I have no idea why it's faster (and no proof besides the anecdotal so far that it is faster) or what besides that is different about
for i in range(0, 20):
for i in xrange(0, 20):
|
|python|loops| |
/abc\ [^d][^e][^f][^g]
It's pretty cumbersome for larger words, but works like a charm. |
Not only that, be careful in the naming convention of your namespaces. I've seen cases where namespace names where duplicated in different assemblies. Talk about confusion.
|
If you construct your query like so:
PARAMETERS ParamA Text ( 255 );
SELECT t.id, t.topic_id
FROM SomeTable t
WHERE t.id Like IIf(IsNull([ParamA]),"*",[ParamA])
All records will be selected if the parameter is not filled in.
|
IE Automation Book or Resource?? using MSHTML/ShDocVw VB.Net |
|vb.net|automation|internet-explorer|mshtml|shdocvw| |
Can anyone recommend a book or a website that explains Internet Explorer Automation using VB.NET? I understand that mshtml and ShDocVw.dll can do this, but I need a resource that will explain it to me. I want to read/write values as well as click buttons.
The only book I have come across so far is .Net Test Automati... |
This works in Oracle:
insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
select 8000,0,'Multi 8000',1 from dual
union all select 8001,0,'Multi 8001',1 from dual
The thing to remember here is to use the `from dual` statement. |
This works in Oracle:
insert into pager (PAG_ID,PAG_PARENT,PAG_NAME,PAG_ACTIVE)
select 8000,0,'Multi 8000',1 from dual
union all select 8001,0,'Multi 8001',1 from dual
The thing to remember here is to use the `from dual` statement.
([source][1])
[1]: http://forums.devshed.com/ora... |
Generics are build on the concept of templates in c++ if you are familiar with them.
Its a way to implement an algorithm or data structure but delaying the actual type it is used on.
List<type> can then be assigned with any type of your choice int, string and even custom types the type is assigned on construction... |
Take a look at ZedGraph: http://zedgraph.org/wiki/index.php?title=Main_Page |
What about just using the UniqeID of the processor? |
If you create an overrides target file to import and call it something like TeamBuildOverrides.targets and put it in the same folder in source control where TFSBuild.proj lives for your Build Type, it will be pulled first and be available for import into the TFSBuild.proj file. By default, the TFSBuild.proj file is ad... |
There's a practical concern here that isn't being addressed by most of the existing answers. Encapsulation and the exposure of clean, safe interfaces to outside code is always great, but it's much more important when the code you're writing is intended to be consumed by a spatially- and/or temporally-large "user" base... |
When I make objects meaningful they are **easier** to **use** and easier to **maintain**.
For example: Person.Hand.Grab(howquick, howmuch);
The trick is not to think of members as simple values but objects in themselves. |
1. I cannot believe you would implement your own considering there are so many available commercially and open source.
2. I recommend taking a look at InRule as a great commercial option that is reasonable priced, or NxBRE in the open source space.
|
You might need an actual space immediately following the semi-colon in |
Assuming you mean system properties (-D...; -d picks data model) System.setProperty(...) may do what you want. |
If you're using .NET 3.0 or later, you [can use the Rules Engine of Windows Workflow Foundation][1] without having to acutally use Workflow.
I've done this on a project, and you can use SQL or XML as the backend, and it works great. You can use the IDE that comes with the Workflow examples and put it in your own app... |
I use M-x next-multiframe-window (bound to a key of course). Better IMHO than M-x other-frame (C-x 5 o).
next-multiframe-window steps thorough the windows of each frame. other-frame toggles just steps through the frames (like ALT-TAB) |
Ok, this gives you the results you are looking for, but there are no guarantees that I didn't miss something. Consider it a starting point. I used SQL 2005 to do this, SQL 2000 does not support CTE's
WITH Parent (id, GrandParentId, parentId, Points, Level1Points, Level2Points)
AS
(
-- Find root
... |
I think it's perfectly OK to talk about partial function application
in JavaScript - if it works like partial application, then it must
be one. How else would you name it?
How your *curry* function accomplishes his goal is just an implementation
detail. In a similar way we could have partial application in the EC... |
It shouldn't be possible for this to happen. If the button is created on the same thread as the window, they share a message pump and the Paint handler cannot be interrupted to handle the exit button. The message that the button has been clicked will be queued up on the thread's message queue until the Paint handler re... |
Check out [ServletUnit][1], which is part of HttpUnit. In a nutshell, ServletUnit provides a library of mocks and utilities you can use in ordinary JUnit tests to mock out a servlet container and other servlet-related objects like request and response objects. The link above contains examples.
[1]: http://httpun... |
I'd say it depends on how many active directory objects you need to keep track of. If it's a small number (less than 1000 users) you can probably serialize your state data to disk with little noticable performance hit. If you're dealing with a very large number of objects it might be more efficient to create a simple p... |
It should be pointed out that you don't want to *encrypt* the password, you want to **hash** it.
Encrypted passwords can be decrypted, letting someone see the password. Hashing is a one-way operation so the user's original password is (cryptographically) gone. |
As for connecting to a Blackberry, this is problematic since in most cases the Blackberry won't have a public IP address and will instead be behind a WAP gateway or wireless provider access point server. RIM provides the Mobile Data Server (MDS) to get around this and provide "Push" data which uses ServerSocket semanti... |
As for connecting to a Blackberry, this is problematic since in most cases the Blackberry won't have a public IP address and will instead be behind a WAP gateway or wireless provider access point server. RIM provides the Mobile Data Server (MDS) to get around this and provide "Push" data which uses ServerSocket semanti... |
Have you tried, the aspnet_regiis exe in the framework folder?
|
I have an "info class generator" application that you can use an excel sheet and it will generate the private members and the public get/set methods.
You can download it for free from my [website][1].
[1]: http://iowacomputergurus.com/free-products/info-class-generator.aspx |
How can I make a systray (notification area) icon receive WM_MOUSEWHEEL messages? |
|winapi| |
I want to extend an existing application I made to make it set mixer volume by wheel-scrolling over it's notification area icon.
As far as I know, the notification area doesn't receive any WM_MOUSEWHEEL messages, but still I found an application that does exactly what I want to achieve ([http://www.actualsolution.co... |
what is the best/easiest to use encryption library in python |
|python|encryption| |
I want to encrypt few files using python what is the best way
i can use gpg but are there any standarad/famous python libraries? |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<style type="text/css">
body
,html
{
height: 100%;
margin: 0;
padding:... |
Plain vanilla dvorak is best imho. Yes, it does move 3 or 4 keys such as {}: etc out of the way, but you quickly get used to them in the new position, and after a while it makes no odds at all.
The pay off comes in being able to use any random pc - flick the keyboard layout to standard dvorak (which is on just about... |
[PyCrypto](http://www.pycrypto.org) seems to be the best one around. |
Reading a COBOL DAT file |
|odbc|cobol| |
I have been given a set of COBOL DAT, IDX and KEY files and I need to read the data in them and export it into Access, XLS, CSV, etc. I do not know the version, vendor of the COBOL code as I only have the windows executable that created the files.
I have tried Easysoft and Parkway ODBC drivers but I have not been su... |
About the only time no-bracing seems to be accepted is when parameter checking variables at the start of a method:
public int IndexOf(string haystack, string needle)
{
// check parameters.
if (haystack == null)
throw new ArgumentNullException("haystack");
if (string.I... |
I just found a list of shortcut key symbols w/ definitions under **Bundles** > **HTML** > **Entities** - helpful for me in figuring out the whole short-cut bonanza going on with TextMate. |
look up CPUID for one option. There might be some issues with multi-CPU systems |
Generating a unique machine id |