instruction stringlengths 0 30k ⌀ |
|---|
|hosting|web-applications| |
I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting compa... |
|web-applications|hosting| |
I am a broke college student. I have built a small web app in PHP5 and MySQL, and I already have a domain. What is an affordable way to get it online? A few people have suggested amazon's cloud services, but that seems equivalent to slitting my wrists and watching money slowly trickle out. So suggestions? Hosting compa... |
Check out [http://www.codeproject.com/KB/vb/vcalendar.aspx][1]
[1]: http://www.codeproject.com/KB/vb/vcalendar.aspx
It doesn't handle the quoted-printable fields like you asked, but the rest of the code is there and can be modified. |
Oracle:
select * from (select foo from bar order by foo) where ROWNUM = x |
Personally I use PDO, but I think that is mainly a question of preference.
PDO has some features that help agains SQL injection ([prepared statements][1]), but if you are careful with your SQL you can achieve that with mysqli, too.
Moving to another database is not so much a reason to use PDO. As long as you don'... |
find orphaned methods in codebase |
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a `$` si... |
|grep|gps|nmea|regex| |
|regex|grep|gps|nmea| |
My GPS logger occassionally leaves "unfinished" lines at the end of the log files. I think they're only at the end, but I want to check all lines just in case.
A sample complete sentence looks like:
$GPRMC,005727.000,A,3751.9418,S,14502.2569,E,0.00,339.17,210808,,,A*76
The line should start with a `$` si... |
# Haskell: Functional
fact 0 = 1
fact n = n * fact (n-1) |
There are already various [classes][1] [available][2] for this so you may wish to look at them before writing your own solution (if indeed writing your own solution is still needed).
[1]: http://www.pear.php.net/package/Crypt_DiffieHellman/docs/latest/Crypt_DiffieHellman/BigInteger/Crypt_DiffieHellman_Math_BigIn... |
What is the best way to interpret Perfmon analysis into application specific observations/data? |
have a look at the [jquery][1] cross browser javascript library for animation (it is what is used on stackoverflow). The reference for it can be found <http://visualjquery.com/1.1.2.html>
Unfortunately with out flash silverlight or another plug in cross system video support is limited.
[1]: http://jquery.com/ |
Yes. I am working on an Editor. It's a XAML-like language (or OpenLaszlo-like, if you prefer) for XNA. So the buttons can be resized by the editor. The buttons might also be resized by a style sheet.
I guess you're right that it's likely that the buttons will all be the same size in a real design. But even in a win... |
You'll get different results for the different methods depending on whether you compile with optimisations on. You basically have a few options:
object o;
//checking with is
o is int
//check type
o.GetType() != typeof( int )
//cast and catch exception
try{ int j = ... |
@lassevk
I found the referenced article, from DDJ: [The Maximal Rectangle Problem][1]
[1]: http://www.ddj.com/184410529 |
i belive there is now a firebug lite that works on other browsers such as ie. |
There is now a [Firebug Lite][1] that works on other browsers such as ie, safari and opera built it does have a limited set of commands and is not as full as the version in firefox.
If you are using asp.net in visual studio 2008 will also debug JavaScript in IE.
[1]: http://getfirebug.com/lite.html |
If the junior programmer, or anyone, doesn't see the value in testing, then it will be hard to get them to do it...period.
I would have made the junior programmer sacrifice their weekend to fix the bug. His actions (or lack there of) are not affecting him directly. Also, make it apparent, that he will not see adva... |
I had to write a basic Gnutella client in C# using Web Services and I think the class notes on the P2P stuff are still available [here][1] and [here][2].
[1]: http://www.cs.virginia.edu/~humphrey/cs451/ClassNotes/CS451_DisSys_0327.pdf
[2]: http://www.cs.virginia.edu/~humphrey/cs451/ClassNotes/CS451_DisSys_032... |
This entirely depends on what varies and what stays the same.
For example, I am working on a (non-OOP) [framework](http://www.seqan.de/) where the find algorithm is different depending both on the type of the needle and the haystack. Apart from the fact that this would require double-dispatch in an object-oriented e... |
Personally, I like the second method. My reasoning is because the major APIs I have worked with use this approach, and I find it makes the most sense.
If you have a list of things (haystack) you would search for (find()) the needle. |
I would say that option 1 is completely out. The code should read in a way that tells you what it does. Option 1 makes me think that this needle is going to go find me a haystack.
Option 2 looks good if a haystack is meant to contain needles. ListCollections are always going to contain ListItems, so doing collect... |
Man, they have VS 2008 project template listed in their [release notes][1]. I guess that doesn't mean they have it integrated with the dialog yet.
I use [MbUnit][2] with [Gallio][3] and everything worked like a charm. I had to install an Alpha of Gallio and MbUnit and when I read the above in the release notes, I ... |
**Turn off the annoying RSS reader**
* Tools, Options, Environment, Startup
**Turn off all the animations**
* Tools, Options, Environment, Animate Environment Tools
**Install the [recent Service Pack][1]**
**Clean out your WebCache**
* AppData\Local\Microsoft\WebSiteCache
[1]: http://msdn.microso... |
Usually actions should be applied to what you are doing the action on... in this case the haystack, so I think option 2 is the most appropriate.
You also have a fourth alternative that I think would be better than alternative 3:
haystack.find(needle, searcher)
In this case, it allows you to provide the man... |
|.net|performance|perfmon| |
Many of us have used Perfmon tool to do performance analysis. Especially with .Net counters, but there are so many variables going on in Perfmon, that it always becomes hard to interpret Perfmon results in to valuable feedback about my application. I want to use perfmon, (not a tool like [Ants Profiler][1] etc) but how... |
Get back to basics. How do I get back into C++? |
|c++| |
I haven't used C++ since college. Even though I've wanted to I haven't needed to do any until I started wanting to write plugins for Launchy. Is there a good book to read to get back into it? My experience since college is mainly C# and recently ruby. I bought some book for C# developers and it ended up being on ho... |
Have you tried the [MySQL Query Browser][1]? Works cross platform and is much nicer than the plain shell.
[1]: http://www.mysql.com/products/tools/query-browser/ |
It's right under your nose:
List<TableItem> myResult = (from t in db.Table select t).ToList();
Now, just cache myResult as you would have cached your old DAL's returned data. |
As far as I can tell, the bcmath extension is the one you'll want. The data in the PHP manual is a little sparse, but you out to be able to set the precision to be exactly what you need by using the bcscale() function, or the optional third parameter in most of the other bcmath functions. Not too sure on the binary s... |
> I traced through the external assembly with Reflector and found no evidence of threading whatsoever.
**You can't find any threading does not mean there is no threading**
.NET has a 'thread pool' which is a set of 'spare' threads that sit around mostly idle. Certain methods cause things to run in one of the thre... |
PostgreSQL also uses MVCC (Multi-Version Concurrency Control), so using the default transaction isolation level (read-committed), you should never block, unless somebody is doing maintainace on th DB (dropping / adding columns / tables / indexes / etc). |
A hard keep like you have is only going to fix the size at initialization but elements could still be added or dropped later, are you trying to guard against this condition? The only way I can think of to guarantee that elements aren't added or dropped later is emitting an event synced on the size != the predetermined... |
**Don't worry about DNS.** You should have there just static entry like:
A *.YOURDOMAIN.COM [IPADDRESS]
Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains (current and future ones) ... |
**Don't worry about DNS and URL rewriting**
Your DNS record will be static, something like:
A *.YOURDOMAIN.COM [IPADDRESS]
Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains (cur... |
**Don't worry about DNS and URL rewriting**
Your DNS record will be static, something like:
A *.YOURDOMAIN.COM [IPADDRESS]
Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains (cur... |
**Don't worry about DNS and URL rewriting**
Your DNS record will be static, something like:
*.YOURDOMAIN.COM A 123.123.123.123
Ask your DNS provider to do it for you (if it's not done already) or do it by yourself if you have control over your DNS records. This will automatically point all your subdomains ... |
|codebase|codesearch|unusedcode| |
I'm sure we've all seen it before...A code base that has been around for a year or two, and as features have been added and bugs fixed, we end up with pieces of code that aren't actually in use anymore. I'm wondering if there is a way (especially in VS.NET with or without a third-party tool) to search the codebase and... |
|visual-studio|refactoring| |
|.net|visual-studio|refactoring| |
For build automation and continuous integration take a look at [TeamCity][1] from [Jetbrains][2].
It has a lot of [features][3] and is really a breeze to set up and use.
If you use Visual Studio 2005/2008 it will build your solution directly without the need for extra scripts (if a build is all you want.)
It w... |
Some of my team's new systems generate RSS feeds that the developers syndicate.
These feeds push out events that interest the developers at certain times and the information is controlled using different loggers. Thus when debugging you can get the debugging feed, when you want to see completed transactions you go to ... |
> Are there any good tutorials on how to integrate OpenId with an ASP.NET site?
[Andrew Arnott's post titled "How to add OpenID to your ASP.NET web site (in C# or VB.NET)"][1]
[1]: http://blog.nerdbank.net/2008/04/how-to-add-openid-to-your-aspnet-web.html |
I do not know whether the above answer does basically the same thing, but some of our systems use the DB connection about once a week and I've seen that we provide a -Otimeout flag or something of that sort to mysql to set the connection timeout. |
But really, isn't all this really just parlor tricks for good database design in the first place? The few times I needed functionality like this it was for a simple one off query to make a quick report. For any real work, using tricks like these is inviting trouble. If selecting a particular row is needed then just ... |
In Sybase SQL Anywhere:
SELECT TOP 1 START AT n * from table ORDER BY whatever
Don't forget the ORDER BY or it's meaningless. |
C and C++ compilers will generate a warning when you compare signed and unsigned types; in your example code, you couldn't make your loop variable unsigned and have the compiler generate code without warnings (assuming said warnings were turned on).
Naturally, you're compiling with warnings turned all the way up, ri... |
The way we do this is to have a 'catch all' for our domain name registered in DNS so that anything.ourdomain.com will point to our server.
With Apache you can set up a similar catch-all for your vhosts. The ServerName must be a single static name but the ServerAlias directive can contain a pattern.
Server... |
I have written a NAnt build file that handles parsing SVN information and creating properties. I then use those property values for a variety of build tasks, including setting the label on the build. I use this target combined with the SVN Revision Labeller mentioned by lubos hasko with great results.
<target na... |
If you don't want to use an installer and you don't want the user to perform any extra steps to allow CHM files over the network, why not fall back to WinHelp? Vista does not include WinHlp32.exe out of the box, but it is [freely available as a download][1] for both Vista and Server 2008.
[1]: http://support.mi... |
How do I setup Public-Key Authentication? |
|linux|ssh| |
How do I setup Public-Key Authentication for SSH? |
Your code worked fine in VB.Net because it implicitly does any casts, while C# has both implicit and explicit ones.
In C# the conversion from decimal to double is explicit as you lose accuracy. For instance 1.1 can't be accurately expressed as a double, but can as a decimal (<a href="http://bizvprog.blogspot.com/200... |
Frankly, if you are having to put *that* much effort into getting him to do something then you may have to come to terms with the thought that he may just not be a good fit for the team, and may need to go. Now, this doesn't necessarily mean firing him... it may mean finding someplace else in the company his skills ar... |
I've noticed that a lot of programmers see the value of testing on a rational level. If you've heard things like "yeah, I know I should test this but I really need to get this done quickly" then you know what I mean. However, on an emotional level they feel that they get something done only when they're writing the rea... |
How can I identify in which Java Applet context I'm running without passing an ID? |
|java|swing|applet| |
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive.
For example, let's say I have a string like this:
fooFOOfOoFoOBARBARbarbarbAr
What if I want to match all occurrences of "foo" regardless of c... |
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive.
For example, let's say I have a string like this:
fooFOOfOoFoOBARBARbarbarbAr
What if I want to match all occurrences of "foo" regardless of c... |
I've seen lots of examples of making an entire regular expression case-insensitive. What I'm wondering about is having just part of the expression be case-insensitive.
For example, let's say I have a string like this:
fooFOOfOoFoOBARBARbarbarbAr
What if I want to match all occurrences of "foo" regardless of c... |
Good strategy for leaving an audit trail/change history for DB applications? |
|database|database-design|postgresql| |
What are some strategies that people have had success with for maintaining a change history for data in a fairly complex database. One of the applications that I frequently use and develop for could really benefit from a more comprehensive way of tracking how records have changed over time. For instance, right now reco... |
I agree that **SSRS** is generally the right choice. But for flashy and embedded in an HTML page, I like [Dundas][1]. Their stuff looks good out of the box, has an easy-to-understand API, and is painless to get up and running.
[1]: http://www.dundas.com/ |
In the past I have used triggers to construct db update/insert/delete logging.
You could insert a record each time one of the above actions is done on a specific table into a logging table that keeps track of the action, what db user did it, timestamp, table it was preformed on, and previous value.
There is pro... |
Unless Apache and PHP have some option to utilize memcached for internal workings (of which I am unaware of), you typically don't "enable" it for such apps. Instead, you would get a [client library][1] to use memcached from within your application, then start up memcached on whatever servers you want to provide memory... |
One strategy you could use is MVCC, Multi-Value Concurrency Control. In this scheme, you never do updates to any of your tables, you just do inserts, maintaining version numbers for each record. This has the advantage of providing an exact snapshot from any point in time, and it also completely sidesteps the update l... |
A language agnostic algorithm would be as follows:
function getNthColumnName(int n) {
let curPower = 1
while curPower < n {
set curPower = curPower * 26
}
let result = ""
while n > 0 {
let temp = n / curPower
let result = result + char(temp... |
Regex to pull out a section of text from a file |
|regex| |
If i have a file like the following:
> Data Data
> Data
> [Start]
> Data i want
> [End]
> Data
Whats the regex to pull out the data between the [start] and [end] tags |
Regex: To pull out a section a substing from a string between two tags |
Link to http://www.whatever.com/hello.ppt**#4** for slide 4 to be opened initially.
[Reference][1]
[1]: http://www.tinyempire.com/shortnotes/files/specific_slide_in_ppt.htm |
\[start\]\s*(((?!\[start\]|\[end\]).)+)\s*\[end\]
This should hopefully drop the [start] and [end] markers as well. |
It sounds like ADO/Access is perfect for your needs. It's baked into the MS stack, well seasoned, and multi-user.
You can programatically create a DB like so:
Dim catalog as New ADOX.Catalog
Catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\path\to\db.mdb")
You can then use standard... |
It sounds like ADO/Access is perfect for your needs. It's baked into the MS stack, well seasoned, and multi-user.
You can programatically create a DB like so:
Dim catalog as New ADOX.Catalog
Catalog.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\server\path\to\db.mdb")
You can then use standar... |
Jeff, your code is nice but could be clearer with constants (as suggested in Code Complete).
const int SECOND = 1;
const int MINUTE = 60 * SECOND;
const int HOUR = 60 * MINUTE;
const int DAY = 24 * HOUR;
const int MONTH = 30 * DAY;
if (delta < 1 * MINUTE)
{
return ts.Se... |
In C#, int is just an alias for System.Int32, string for System.String, double for System.Double etc...
Personally I prefer int, string, double, etc. because they don't require a "using System;" statement :) A silly reason, I know... |
In C#, int is just an ***alias*** for System.Int32, string for System.String, double for System.Double etc...
Personally I prefer int, string, double, etc. because they don't require a "using System;" statement :) A silly reason, I know... |
Lambda comes from the [Lambda Calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and refers to anonymous functions in programming.
Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this.
... |
Lambda comes from the [Lambda Calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and refers to anonymous functions in programming.
Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this.
... |
Lambda comes from the [Lambda Calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and refers to anonymous functions in programming.
Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this.
... |
Lambda comes from the [Lambda Calculus](http://en.wikipedia.org/wiki/Lambda_calculus) and refers to anonymous functions in programming.
Why is this cool? It allows you to write quick throw away functions without naming them. It also provides a nice way to write closures. With that power you can do things like this.
... |
I'm part of a team that develops a pretty big Swing Java Applet. Most of our code is legacy and there are tons of singleton references. We've bunched all of them to a single "application context" singleton. What we now need is to create some way to separate the shared context (shared across all applets currently showin... |
SVN 1.5 introduced the concept of automatic merge tracking, although I thought it required a 1.5 server and client. See [here](http://subversion.tigris.org/svn_1.5_releasenotes.html#merge-tracking) for details. |
The complexities of pointers go beyond what we can easily teach. Having students point to each other and using pieces of paper with house addresses are both great learning tools. They do a great job of introducing the basic concepts. Indeed, learning the basic concepts is *vital* to successfully using pointers. How... |
If your colleague lacks experience writing tests maybe he or she is having difficulty testing beyond simple situations, and that is manifesting itself as inadequate testing. Here's what I would try:
- Spend some time and share testing techniques, like dependency injection, looking for edge cases, and so on with y... |
The comment by Rory that the proxy would have to use a self-signed cert if not stricltly true.
The proxy could be implemented to generate a new cert for each new SSL host it is asked to deal with and sign it with a common root cert. In the OP's scenario of a corportate environment the common signing cert can rather... |
I don't mean this to sound snarky, but it doesn't matter.
Seriously.
Look at the things that are important: your project, your code, your job, your personal life. None of them are going to have their success rest on whether or not you use the "this" keyword to qualify access to fields. The this keyword will not h... |
I don't mean this to sound snarky, but it doesn't matter.
Seriously.
Look at the things that are important: your project, your code, your job, your personal life. None of them are going to have their success rest on whether or not you use the "this" keyword to qualify access to fields. The this keyword will not h... |
Strongly agree that syntactically C# beats Java hands down, so there is really no reason to lament the demise of j#. Now trying to get c# compiling to Java bytecode might be an interesting move as Sun's hotspot jvm is great software.
Or, for a bit of fun with what might well become the next generation of Java, how ... |