instruction stringlengths 0 30k ⌀ |
|---|
|.net|build-process|nant| |
Yes you are correct in thinking that C is a non-functional language. C is a procedural language. |
@Konrad
> OOP may be flawed and it certainly is no silver bullet but it makes large-scale applications much simpler because it's a great way to reduce dependencies
That is the dogma. I am not seeing what makes OOP significantly better in this regard than procedural programming of old. Whenever I make a procedure ca... |
Is msbuild worth looking at? |
|nant|msbuild|buildprocess|build-automation| |
I currently use nant, ccnet, svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.
Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier? |
I currently use nant, ccnet, svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.
Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?
**Update: Any compelling features that would ca... |
So, you expect
<font face="Arial">Hi Mom</font>
and
<span style="font-family:Arial;">Hi Mom</span>
to be considered the same?
The output depends very much on the User Agent. Like [Ionut Anghelcovici suggests][1], make an image. Do one for every browser you care about.
[1]: http://stackov... |
This looks like a network issue, unless there's an odd bug in .Net CF that doesn't allow you to traverse subnets in certain situations (I can find no evidence of such a thing from googling).
Can you get any support from the network/IT team? Also, have you tried it from a different subnet? I.e. not the same as the ... |
For .NET, you could use something like [TypeMock][1], which uses the profiling API and allows you to hook into calls to nearly anything.
[1]: http://www.typemock.com/ |
Simplest way to make a Google Map mashup? |
|google-maps|web2.0| |
Given a list of locations such as
<td>El Cerrito, CA</td>
<td>Corvallis, OR</td>
<td>Morganton, NC</td>
<td>New York, NY</td>
<td>San Diego, CA</td>
What's the easiest way to generate a Google Map with pushpins for each location?
|
Given a list of locations such as
<td>El Cerrito, CA</td>
<td>Corvallis, OR</td>
<td>Morganton, NC</td>
<td>New York, NY</td>
<td>San Diego, CA</td>
What's the easiest way to generate a Google Map with pushpins for each location?
|
I've recently started using [Mercurial][1] for some of my work. It's a distributed system like Git but seems easier to use and seems far better supported on Windows, the latter of which was crucial for me.
With distributed source code control every user has a complete local copy of the repository. If you're the on... |
Are there any tools out there to compare the structure of 2 web pages? |
|html|dom|diff|asp.net| |
I receive HTML pages from our creative team, and then use those to build aspx pages. One challenge I frequently face is getting the HTML I spit out to match theirs exactly. I almost always end up screwing up the nesting of <div>s between my page and the master pages.
Does anyone know of a tool that will help ... |
I agree with Jason Cohen though we can be a bit clearer on the reason for needing to delete your pointers with the loop. For every "new" or dynamic memory allocation there needs to be a "delete" a memory de-allocation. Some times the "delete" can be hidden, as with smartpointers but it is still there.
int main(... |
When you create types for 'Use and throw' purposes.
This seems to have come due to LINQ. Seems to be a way to create structures with fields on the fly for a LINQ query. Returning a struct/type with specified fields only. If not for this, you'd have to declare a .Net type for each unique combination of fields you wish... |
I would like to add that you should make sure to point out where they can find language and API references. In java, the API and language specification is at your fingertips online at java.sun.com... with C or C++, it's not quite as simple and easy to find reference documentation.
Whenever I am doing something in C... |
It would be an new shell (but I think it is worth it), but from PowerShell it would be
[int](get-content counter.txt) + 1 | out-file counter.txt |
I downloaded the sample VS2008 project, and am a bit stumped here too. I was able to get past the exceptions however, although probably not in a way that will work will great for you. But here's what I found:
This [mailing list post](http://www.antlr.org:8080/pipermail/antlr-interest/2008-February/026657.html) had... |
Hibernate saveOrUpdate with another object in the session |
|java|orm|hibernate| |
Is there any way to save an object using Hibernate if there is already an object using that identifier loaded into the session?
- Doing session.contains(obj) seems to only return true if the session contains that exact object, not another object with the same ID.
- Using merge(obj) throws an exception if the ob... |
|orm|hibernate| |
Use SQL Server Management Objects (SMO) which understands GO separators. See my blog post here: [http://weblogs.asp.net/jgalloway/archive/2006/11/07/Handling-_2200_GO_2200_-Separators-in-SQL-Scripts-_2D00_-the-easy-way.aspx][1]
Sample code:
public static void Main()
{
string scriptDire... |
How to find keys of a hash? |
|javascript|hash|object|key| |
I know in javascript Objects double as hashes but i have been unable to find a built in function to get the keys
var h = {a:'b',c:'d'};
I want something like
var k = h.keys() ; // k = ['a','c'];
It is simple to write a function myself to iterate over the items and add the keys to an array that I return,... |
|javascript|hash|object|key| |
Read Access File into a DataSet |
|.net|ms-access|dataset| |
Is there an easy way to read an entire Access file (.mdb) into a DataSet in .NET (specifically C# or VB)?
Or at least to get a list of tables from an access file so that I can loop through it and add them one at a time into a DataSet? |
|.net|ms-access|dataset| |
How do I implement license management for on-site installation of webapps (preferably cross-platform)? |
|licensing|web-application| |
I have a web application running on a Gentoo-based LAMP stack. My customers buy the software as a service and I host everything. They can export their data if they want. However, there is some demand for on-site deployment inside the clients' own networks. For some of these scenarios, there would be a requirement for s... |
|web-applications|licensing| |
I have a web application running on a Gentoo-based LAMP stack. My customers buy the software as a service and I host everything. They can export their data if they want. However, there is some demand for on-site deployment inside the clients' own networks. For some of these scenarios, there would be a requirement for s... |
It looks like you've got fewer items in q than you were expecting when you started iterating. Your script may be trying to access q[q.length], i.e. the element after the last element.
Could it be that your successful request has been popped from the queue, and you have a race condition? Are you trying to abort a req... |
Anyone have a diff algorithm for rendered HTML? |
|diff|javascript|html| |
I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the *rendered* HTML. |
|javascript|html|diff| |
I'm interested in seeing a good diff algorithm, possibly in Javascript, for rendering a side-by-side diff of two HTML pages. The idea would be that the diff would show the differences of the *rendered* HTML.
To clarify, I want to be able to see the side-by-side diffs *as* rendered output. So if I delete a paragraph,... |
Differences in Generics |
|generics|java|c#|c++| |
I mostly use Java and generics are relatively new. I keep reading that Java made the wrong decision or that .NET has better implementations etc. etc.
So, what are the main differences between C++, C#, Java in generics? Pros/cons of each? |
|c#|java|c++|generics|templates| |
I occasionally get unexpected 404 errors with GETs objects that are part of a preceeding LIST but new to the bucket, and other misc. errors (eg: 403 on my access id and secret key), but nothing catastrophic.
My code runs server side, so I've put in some robust error handling and logging. I think this is a wise th... |
@Soeren,
You can most definitely embed IE with the Javascript Markdown editor inside a Windows Forms application. |
Have a look at the [Guided tour of WPF][1] by Josh Smith. I also really like Adam's Nathan book WPF Presentation Unleashed.
[1]: http://joshsmithonwpf.wordpress.com/a-guided-tour-of-wpf/ |
The problem with TypeMock is that it excuses bad design. Now, I know that it is often *someone else's* bad design that it's hiding, but permitting it into your development process can lead very easily to permitting your own bad designs.
I think if you're going to use a mocking framework, you should use a traditional... |
If you set the Modifiers property of your components to strict protected makes them accessible without the Components collection. |
If out output XML compliant HTML. Or at least translate your HTML product into XML compliancy, you at least could then XSL your output to remove the content and id tags. Apply the same transformation to their html, and then compare.
|
`<cword>` is the word under the cursor (:help `<cword>`) |
`<cword>` is the word under the cursor (:help `<cword>`).
Sorry, I should have been more complete in this answer.
You can nmap a command to it, or this series of keystrokes for the lazy will work:
b #go to beginning of current word
yw #yank to register
Then, when you are typing in your pattern you ... |
From LINQ in action (page 76 section 2.6.3):
> ... anonymous types [are] a great tool for quick and simple temporary results. We don't need to declare classes to hold temporary results thanks to temporary types.
basically they're useful to hold information in the local scope temporarily. Anything more requires ... |
Implications of Instantiating Objects with Dynamic Variables in PHP |
|php|oop|php4|php5|performance| |
What are the performance, security, or "other" implications of using the following form to declare a new class instance in PHP
<?php
$class_name = 'SomeClassName';
$object = new $class_name;
?>
This is a contrived example, but I've seen this form used in Factories (OOP) to avoid having ... |
|php|performance|oop|php4|php5| |
What are the performance, security, or "other" implications of using the following form to declare a new class instance in PHP
<?php
$class_name = 'SomeClassName';
$object = new $class_name;
?>
This is a contrived example, but I've seen this form used in Factories (OOP) to avoid having ... |
As pointed out by Thomas, you need to Set an object instead of Let. Here's a general function from my library that works for value and object types:
Public Function Exists(ByVal key As Variant, ByRef col As Collection) As Boolean
'Returns True if item with key exists in collection
On Error Resu... |
Do you need to trust the data? If so, be aware that it's trivial to tamper with client-processed data in nasty and malicious ways. If that's the case, you'll want to process info on the server.
Also, be aware that it can be a lot harder to code javascript apps so they are stable, reliable, and bug free. Can you lock... |
Silverlight enabled browser tracking |
|silverlight|tracking|google-analytics| |
I'm trying to get some stats on how many of the visitors to our website have Silverlight enabled browsers.
We currently use Google Analytics for the rest of our stats so ideally we'd like to just add 'Silverlight enabled' tracking in with the rest of our Google Analytics stats. But if it has to get written out ... |
|silverlight|tracking|google-analytics|browser| |
I'm trying to get some stats on how many of the visitors to our website have Silverlight enabled browsers.
We currently use Google Analytics for the rest of our stats so ideally we'd like to just add 'Silverlight enabled' tracking in with the rest of our Google Analytics stats. But if it has to get written out ... |
C++ : What's the easiest library to open video file |
|c++|video|windows| |
I would like to open a small video file and map every frames in memory (to apply some custom filter). I don't want to handle the video codec, I would rather let the library handle that for me.
I've tried to use Direct Show with the SampleGrabber filter ([using this sample][1]), but I only managed to grab some frames... |
I would like to open a small video file and map every frames in memory (to apply some custom filter). I don't want to handle the video codec, I would rather let the library handle that for me.
I've tried to use Direct Show with the SampleGrabber filter ([using this sample][1]), but I only managed to grab some frames... |
|nant|msbuild|build-automation|buildprocess| |
Should I switch from nant to msbuild? |
|buildprocess|msbuild|nant|build-automation| |
I currently use nant, ccnet (cruise control), svn, mbunit. I use msbuild to do my sln build just because it was simpler to shell out.
Are there any merits to switching my whole build script to MSBuild? I need to be able to run tests, watir style tests, xcopy deploy. Is this easier?
**Update: Any compelling featu... |
|build-process|msbuild|nant|build-automation| |
"Even if there is no actual [information architecture], it doesn’t mean we don’t experience or perceive it as such. Zen Buddhists say there is no actual “self” but they still name their kids."-Andrew Hinton
|
Its a programming paradigm.. Designed to make it easier for us mere mortals to break down a problem into smaller, workable pieces..
If you dont find it useful.. Don't use it, don't pay for training and be happy.
I on the other hand do find it useful, so I will :) |
Code Injection With C# |
|codeinjection|c#| |
I just saw [This Question][1] and it made me wonder:
Can you use windows hooks or other methods to do code injection with c#? I've seen lots of things about code injection but all of them are done in C/C++. I don't know either of those languages and have a really hard time translating. Does anyone have any ideas on ... |
|c#|code-injection| |
REALLY Simple Website--How Basic Can You Go? |
|personal-website|newbies| |
Although I've done programming, I'm not a programmer. I've recently agreed to coordinate getting a Website up for a club. The resources are--me, who has done Web content maintenance (putting content into HTML and ColdFusion templates via a gatekeeper to the site itself; doing simple HTML and XML coding); a serious Web ... |
I believe you have to set the option in your connect string to force textual import rather than auto-detecting it.
Provider=Microsoft.ACE.OLEDB.12.0;
Data Source=c:\path\to\myfile.xlsx;
Extended Properties=\"Excel 12.0 Xml;IMEX=1\";
Your milage may vary depending on the version you have inst... |
FindFirstChangeNotification is fine, but for slightly more ultimate power you should be using ReadDirectoryChangesW. (In fact, it's even recommended in the documentation!)
It doesn't require a function pointer, it does require you to manually decode a raw buffer, it uses Unicode file names, but it is generally bette... |
We've had pretty good luck by writing our own malloc and free functions. In production, they just call the standard malloc and free, but in debug, they can do whatever you want. We also have a simple base class that does nothing but override the new and delete operators to use these functions, then any class you write ... |
Encrypting the session value will have zero effect. The session cookie is already an arbitrary value, encrypting it will just generate another arbitrary value that can be sniffed.
The only real solution is HTTPS. If you don't want to do SSL on your whole site (maybe you have performance concerns), you might be able ... |
Stored Procedures are great because they can be changed without a recompile. I would try to use them as often as possible.
I only use ad-hoc for queries that are dynamically generated based on user input. |
A quick and dirty solution is to use <a href="http://perldoc.perl.org/functions/glob.html">glob</a>
@files = glob ('/path/to/dir/*');
|
|php|performance|oop|php5|php4| |
What are the performance, security, or "other" implications of using the following form to declare a new class instance in PHP
<?php
$class_name = 'SomeClassName';
$object = new $class_name;
?>
This is a contrived example, but I've seen this form used in Factories (OOP) to avoid having ... |
Look at the alternate constructor for DatagramSocket:
DatagramSocket(int port, InetAddress laddr)
Creates a datagram socket, bound to the specified local address.
I'm guessing you're only specifying the port. |
Winforms c# - Set focus to first child control of tab page. |