instruction
stringlengths 0
30k
⌀ |
---|
I'd like to create a progress bar to indicate the status of an a batch job in Ruby. I've read some [tutorials][1] / [libraries][2] on using ncurses, none of which were particularly helpful in explaining how create an "animated" progress bar in the terminal or using curses with Ruby. I'm already aware of using a separate thread to monitor the progress of a given job, I'm just not sure how to proceed with drawing a progress bar.
----------
**Update**
[ProgressBar][3] class was incredibly straight-forward, perfectly solved my problem.
[1]: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ "NCURSES Programming HOWTO"
[2]: http://ncurses-ruby.berlios.de/ "ncurses-ruby"
[3]: http://0xcc.net/ruby-progressbar/ "ruby-progressbar" |
Why not create a Domain object based approach to this problem:
public class CustomerDownloadInfo
{
private string sku;
private readonly ICustomer customer;
public CustomerDownloadInfo(ICustomer Customer){
customer = Customer;
}
public void AttachSku(string Sku){
sku = Sku;
}
public string Sku{
get { return sku; }
}
public string Link{
get{
// etc... etc...
}
}
}
There are a million variations on this, but once you aggregate this information, wouldn't it be easier to present? |
How to tab focus onto a dropdown field in Mac OSX |
|macos| |
In Windows, in any windows form / web browser, you can use the tab button to switch focus through all of the form fields. It will stop on textboxes, radiobuttons, checkboxes, dropdown menus, etc. However, in Mac OSX, tab skips dropdown menus. Is there anyway to change this behavior, or access them any other way without using a mouse? |
The way I like to do this is using the %x operator, which makes it easy (and readable!) to use quotes in a command, like so:
directorylist = %x[find . -name '*test.rb' | sort]
Which, in this case, will populate file list with all test files under the current directory, which you can process as expected:
directorylist.each do |filename|
filename.chomp!
# work with file
end |
Go to System Preferences > Keyboard and Mouse, then choose Keyboard Shortcuts. At the bottom, ensure Full Keyboard Access is set to "All controls". It's a long time since I turned it on but I think that's all you need to do |
Apple Menu > System Preferences > Keyboard & Mouse > Keyboard Shortcuts:
Change the radio button at the bottom from "Text boxes and lists only" to "All controls."
Edit: Dammit. We're a fast group around here aren't we? :-) |
This is an alternative way (DataReader is faster than this one):
string s = "";
SqlConnection conn = new SqlConnection("Server=192.168.1.1;Database=master;Connect Timeout=30;User ID=foobar;Password=raboof;");
SqlDataAdapter da = new SqlDataAdapter("SELECT TOP 5 name, dbid FROM sysdatabases", conn);
DataTable dt = new DataTable();
da.Fill(dt);
for (int i = 0; i < dt.Rows.Count; i++)
{
s += dt.Rows[i]["name"].ToString() + " -- " + dt.Rows[i]["dbid"].ToString() + "\n";
}
MessageBox.Show(s); |
Step one is to make your "dirty" pieces self contained user controls
Step two is to embed those controls on your consuming page
Step three is to wrap each user control tag in their own Asp:UpdatePanel
Step four is to ensure your control gets the data it needs by having it read from properties which check against the viewstate for pre-existing values. I know this makes your code rely on ugly global variables but it's a fast way to get this done.
Your mileage may vary. |
Check out the [RadAjax][1] control from Telerik - it allows you to avoid using UpdatePanels, and limit the amount of info passed back and forth between server and client by declaring direct relationships between calling controls, and controls that should be "Ajaxified" when the calling controls submit postbacks.
[1]: http://www.telerik.com/products/aspnet-ajax/controls/ajax/overview.aspx |
It's in the System Preferences - [this blog post][1] shows where the setting is.
[1]: http://www.howtogeek.com/howto/apple/why-doesnt-tab-work-for-drop-down-controls-in-firefox-on-os-x/ |
Suggest someone with the reputation to do it revise this question to say, "What good technology podcasts are out there?"
I've got all kinds of audio fiction I could recommend, but then this question really runs off into the weeds. |
Check out this blog post: [Tweaking the ICallbackEventHandler and Viewstate][1]. The author seems to be addressing the very situation that you are experiencing:
> So when using ICallbackEventHandler you have two obstacles to overcome to have updated state management for callbacks. First is the problem of the read-only viewstate. The other is actually registering the changes the user has made to the page before triggering the callback.
See the blog post for his suggestions on how to solve this. Also check out this [forum post][2] which discusses the same problem as well.
[1]: http://www.reimers.dk/blogs/jacob_reimers_weblog/archive/2007/03/23/tweaking-the-icallbackeventhandler-and-viewstate.aspx
[2]: http://forums.asp.net/t/1128218.aspx |
What good Podcasts are out there? |
|podcast| |
Yes, Podcasts, those nice little Audiobooks I can listen to on the way to work. With the current amount of Podcasts, it's like searching a needle in a haystack, except that the haystack happens to be the internet and is filled with too many of these "Hot new Gadgets" stuff :(
Now, even though **I** am mainly a .net Developer nowadays, maybe anyone knows some good Podcasts from people regarding the whole software lifecycle? Unit Testing, Continous Integration, Documentation, Deployment...
Currently, the only two Podcasts i subscribe to are [StackOverflow][1] and [Hanselminutes][2], but [.net Rocks!][3] also sounds interesting.
So - what are you guys listening to?
[1]: http://blog.stackoverflow.com/category/podcasts/
[2]: http://www.hanselminutes.com/
[3]: http://www.dotnetrocks.com/ |
What good technology podcasts are out there? |
I have found the solution else where:
SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', 'HelloWorld')), 3, 32) |
Convert HashBytes to VarChar |
|sql|2005|md5| |
I want to get the MD5 Hash of a string value in SQL Server 2005, I do this with the following command:
SELECT HashBytes('MD5', 'HelloWorld')
However, this returns a VarBinary instead of a VarChar value. If I attempt to convert "0x68E109F0F40CA72A15E05CC22786F8E6" into a VarChar I get "há ðô§*à\Â'†øæ" instead of "68E109F0F40CA72A15E05CC22786F8E6".
Is there any SQL based solution? |
|sql| |
I want to get the MD5 Hash of a string value in SQL Server 2005, I do this with the following command:
SELECT HashBytes('MD5', 'HelloWorld')
However, this returns a VarBinary instead of a VarChar value. If I attempt to convert "0x68E109F0F40CA72A15E05CC22786F8E6" into a VarChar I get "há ðô§*à\Â'†øæ" instead of "68E109F0F40CA72A15E05CC22786F8E6".
Is there any SQL based solution?
**[Yes][1]**
[1]: http://stackoverflow.com/questions/2120/#2382 |
Probably it comes from VB6. Because with [Option Base][1] statement in VB6, you can alter the lower bound of arrays like this:
Option Base 1
[1]: http://msdn.microsoft.com/en-us/library/aa266179(VS.60).aspx |
Probably it comes from VB6. Because with [Option Base][1] statement in VB6, you can alter the lower bound of arrays like this:
Option Base 1
Also in VB6, you can alter the lower bound of a specific array like this:
Dim myArray(4 To 42) As String
[1]: http://msdn.microsoft.com/en-us/library/aa266179(VS.60).aspx |
Read binary file into a struct C# |
|c#| |
I'm trying to read binary data using C#. I have all information about the layout of the data in the files I want to read. I'm able to read the data "chunk by chunk", i.e. getting the first 40 bytes of data converting it to a string, get the next 40 bytes, ...
Since there are at least three slighlty different version of the data, I would like to read the data directly into a struct. It just feels so much more right than by reading it "line by line".
I have tried the following approach but to no avail:
StructType aStruct;
int count = Marshal.SizeOf(typeof(StructType));
byte[] readBuffer = new byte[count];
BinaryReader reader = new BinaryReader(stream);
readBuffer = reader.ReadBytes(count);
GCHandle handle = GCHandle.Alloc(readBuffer, GCHandleType.Pinned);
aStruct = (StructType) Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(StructType));
handle.Free();
The stream is an opened FileStream from which I have began to read from. I get an AccessViolationException when using Marshal.PtrToStructure.
The stream contains more information than I'm trying to read since I'm not interested in data at the end of the file.
The struct is defined like:
[StructLayout(LayoutKind.Explicit)]
struct StructType
{
[FieldOffset(0)]
public string FileDate;
[FieldOffset(8)]
public string FileTime;
[FieldOffset(16)]
public int Id1;
[FieldOffset(20)]
public string Id2;
}
The examples code is changed from original to make this question shorter.
How would I read binary data from a file into a struct? |
All of the tech podcasts I listen to have been mentioned, but as long as we're discussing video I'd like to mention [Hak.5][1]. It is more focused on using existing programs rather than coding, but it has some good hardware segments, and it can often be an excellent source of inspiration.
[1]: http://www.hak5.org/ |
In the StackOverflow podcast [SE-radio][1] was mentioned. Its pretty in depth.
[1]: http://www.se-radio.net/ |
In the StackOverflow podcast [SE-radio][1] was mentioned. It's pretty in depth.
Also if you are an aspiring Javascript developer, the Douglas Crockford "The JavaScript Programming Language" and "Advanced JavaScript" talks on [YUI Developer Theatre][2] are excellent. There are a few other gems on the podcast too.
[1]: http://www.se-radio.net/
[2]: http://developer.yahoo.com/yui/theater/ |
Why not use "For Each"? That way you don't need to care what the LBound and UBound are.
Dim x, y, z
x = Array(1, 2, 3)
For Each y In x
z = DoSomethingWith(y)
Next |
Am I going to be downmodded for suggesting that the StackOverflow podcast is hilariously bad as a podcast? Anywho, you can find it, and a number of not-bad podcasts at:
[itconversations.com][1]
As this question asked for a "good" rather than "exhaustive" list, then this is obviously just my opinion. My opinion bounces between .Net and Java and just geek. And obvious omissions would reflect my opinion on "good". (Ahem, DNR.)
The rest of these are easily found by doing a podcast search in iTunes, or just googling (I'll do some repeating here to condense the list):
- Buzz Out Loud (General Consumer Tech, Daily)
- This Week in Tech (aka TWiT. Weekly Consumer Tech.)
- The Java Posse (Weekly.)
- Google Developer Podcast (which went long fallow, but seems to be coming
back, possible renamed as the Google Code Review. Schedule uncertain, technologies vary.)
- Hanselminutes (Usually, but not always, .Net-related)
- MacBreak Weekly (The Mac version of TWiT)
- Polymorphic Podcast (All .Net, usually ASP.Net)
- Pixel8ed (All .Net, focused on UI. Same guy who does Polymorphic Podcast)
- tech5 (Consumer Tech. Mostly a fun waste of 5 minutes because Dvorak is so... Spolsky.)
[1]: http://itconversations.com |
You should make your choice of server platform based on the environment as a whole, and that includes the admin/management interfaces supplied.
I'm afraid that if you don't like the way Windows implements management of IIS, then that's too bad. Having said that, a bit of delving around in the WMI interfaces will generally yield a solution that you should find usable. I used to do quite a bit of WMI scripting (mostly via PowerShell) in order to have a reliable environment rebuild capability. |
I actually found both of those links you provided, but as noted they are simply describing the problem, not solving it. The author of the blog post suggests a workaround by using a different ViewState provider, but unfortunately that isn't a possibility in this case...I really need to leave the particulars of the ViewState alone and just hook on to what is being done out-of-the-box. |
You search on google or wikipedia for that particular file type. The binary file layout structure information should be included.
For example, <a href = "http://en.wikipedia.org/wiki/MP3#File_structure">MP3 file layout structure</a> |
I'm not sure if there's a general information source for this kind of information. I always just search on google or wikipedia for that particular file type. The binary file layout structure information should be included.
For example, <a href = "http://en.wikipedia.org/wiki/MP3#File_structure">MP3 file layout structure</a> |
Try this:
using (FileStream stream = new FileStream(fileName, FileMode.Open))
{
BinaryFormatter formatter = new BinaryFormatter();
StructType aStruct = (StructType)formatter.Deserialize(filestream);
} |
I have never come across this kind of situation, and to be honest the idea of referencing > 256 tables in a query fils me with a mortal dread.
Your first question should probably by "Why so many?", closely followed by "what bits of information do I _NOT_ need?" I'd be worried that the amount of data being returned from such a query would begin to impact performance of the application quite severely, too. |
I'd like to see that query, but I imagine it's some problem with some sort of iterator, and while I can't think of any situations where its possible, I bet it's from a bad while/case/cursor or a ton of poorly implemented views. |
Are there best practices for testing security in an Agile development shop? |
|security|agile| |
I'm putting together a best practices training program for agile and there are no real good resources for secure design and testing related to Agile (as far as my contextual searching ability has shown). What are the best practices for testing security per release? If it is a monthly release, are there shops doing pen-tests every month? |
Using the example you gave:
<form>
<input type="text" name="field1" /><!-- put your cursor in this field and press Enter -->
<input type="submit" name="prev" value="Previous Page" /> <!-- This is the button that will submit -->
<input type="submit" name="next" value="Next Page" /> <!-- But this is the button that I WANT to submit -->
</form>
If you click on "Previous Page" only the value of "prev" will be submitted. If you click on "Next Page" only the value of "next" will be submitted.
If however, you press enter somewhere on the form, neither "prev" nor "next" will be submitted.
So using pseudo code you could do the following:
If "prev" submitted then
Previous Page was click
Else If "next" submitted then
Next Page was click
Else
No button was click |
@chopeen You could change the way you're calculating these statistics, and instead keep a separate table of all per-product stats.. when an order is placed, loop through the products and update the appropriate records in the stats table. This would shift a lot of the calculation load to the checkout page rather than running everything in one huge query when running a report. Of course there are some stats that aren't going to work as well this way, e.g. tracking customers' next purchases after purchasing a particular product. |
For SQL Server 2005, I'd recommend using table variables and partially building the data as you go.
To do this, create a table variable that represents your final result set you want to send to the user.
Then find your primary table (say the orders table in your example above) and pull that data, plus a bit of supplementary data that is only say one join away (customer name, product name). You can do a SELECT INTO to put this straight into your table variable.
From there, iterate through the table and for each row, do a bunch of small SELECT queries that retrieves all the supplemental data you need for your result set. Insert these into each column as you go.
Once complete, you can then do a simple SELECT * from your table variable and return this result set to the user.
I don't have any hard numbers for this, but there have been three distinct instances that I have worked on to date where doing these smaller queries has actually worked faster than doing one massive select query with a bunch of joins. |
Post the query :D
Also I feel like one of the possible problems could be having a ton (read 200+) of name/value tables which could condensed into a single lookup table. |
How can I tell if a web client is blocking ads? |
|browser| |
I'd like to get some statistics on how many people coming to my site have set their browser to block ads. Any tips on the best way to do this? |
I suppose you could compare the ad prints with the page views on your website (which you can get from your analytics software). |
Since programs like AdBlock actually never request the advert, you would have to look the server logs to see if the same user accessed a webpage but didn't access an advert. This is assuming the advert is on the same server.
If your adverts are on a separate server, then I would suggest it's impossible to do so.
The best way to stop users from blocking adverts, is to have inline text adverts which are generated by the server and dished up inside your html. |
Add the user id to the request for the ad:
<img src="./ads/viagra.jpg?{user.id}"/>
that way you can check what ads are seen by which users. |
You need to think about the different ways that ads are blocked. The first thing to look at is whether they are running noscript, so you could add a script that would check for that.
The next thing is to see if they are blocking flash, a small movie should do that.
If you look at the adblock site, there is some indication of how it does blocking:
<a href="http://adblockplus.org/en/faq_internal#elemhide">http://adblockplus.org/en/faq_internal#elemhide</a>
If you look further down that page, you will see that conventional chrome probing will not work, so you need to try and parse the altered DOM. |
Casting: (NewType) vs. Object as NewType |
|c#|.net| |
What is actually the difference between these two casts?
SomeClass sc = (SomeClass)SomeObject;
SomeClass sc2 = SomeObject as SomeClass;
Normally, they should both be explicit casts to the specified type? |
The former will throw an exception if the source type can't be cast to the target type. The latter will result in sc2 being a null reference, but no exception. |
The parenthetical cast throws an exception if the cast attempt fails. The "as" cast returns null if the cast attempt fails. |
I've honestly never read it myself, but [Concurrent Programming in Java](http://www.amazon.com/Concurrent-Programming-Java-TM-Principles/dp/0201310090/ref=pd_bbs_sr_2?ie=UTF8&s=books&qid=1217951195&sr=8-2) is a book I've heard recommended by several people. |
Alright. From a theoretical point of view, given that the distortion is "arbitrary", and any solution requires you to model this arbitrary distortion, you obviously can't get an "answer". However, any solution is going to involve imposing (usually implicitly) some model of the distortion that may or may not reflect the reality of the situation.
Since you seem to be most interested in models that presume some sort of local continuity of the distortion mapping, the most obvious choice is the one you've already tried: linear interpolaton between the nearest points. Going beyond that is going to require more sophisticated mathematical and numerical analysis knowledge.
You are incorrect, however, in presuming you cannot expand this to more points. You can by using a least-squared error approach. Find the linear answer that minimizes the error of the other points. This is probably the most straight-forward extension. In other words, take the 5 nearest points and try to come up with a linear approximation that minimizes the error of those points. And use that. I would try this next.
If that doesn't work, then the assumption of linearity over the area of N points is broken. At that point you'll need to upgrade to either a quadratic or cubic model. The math is going to get hectic at that point. |
I believe [DB Designer](http://www.fabforce.net/dbdesigner4/) does something like that. And I think they even have a free version.
*edit*
Never mind. Michael's link is much better. |
Try MySQL Workbench, formally DBDesigner 4:
[http://dev.mysql.com/workbench/][1]
This has a "Reverse Engineer Database" mode as far as I remember,
[1]: http://dev.mysql.com/workbench/ |
[http://www.cilk.com/multicore-e-book/][1]
That's a nice general overview of the sitution, if you're looking for tuorials and books it might be best to specify a language as a starting point so you can mess around with some code.
[1]: http://www.cilk.com/multicore-e-book/ |
They'll throw different exceptions. <br>
() : NullReferenceException <br>
as : InvalidCastException <br>
Which could help for debugging.
The "as" keyword attempts to cast the object and if the cast fails, null is returned silently. The () cast operator will throw an exception immediately if the cast fails.
"Only use the C# "as" keyword where you are expecting the cast to fail in a non-exceptional case. If you are counting on a cast to succeed and are unprepared to receive any object that would fail, you should use the () cast operator so that an appropriate and helpful exception is thrown."
For code examples and a further explanation: [http://blog.nerdbank.net/2008/06/when-not-to-use-c-keyword.html][1]
[1]: http://blog.nerdbank.net/2008/06/when-not-to-use-c-keyword.html |
The two self-balancing BSTs I'm most familiar with are red-black and AVL, so I can't say for certain if any other solutions are better, but as I recall, red-black has faster insertion and slower retrieval compared to AVL. So if insertion is a higher priority than retrieval, red-black may be a better solution. |
Most of the people use .NET serialization (there is faster binary and slower XML formatter, they both depend on reflection)
However, if you want the fastest (unsafe) way - go ahead:
Writing:
YourStruct o = new YourStruct();
byte[] buffer = new byte[Marshal.SizeOf(typeof(YourStruct))];
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
Marshal.StructureToPtr(o, handle.AddrOfPinnedObject(), false);
handle.Free();
Reading:
handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
o = (YourStruct)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(YourStruct));
handle.Free(); |
Most of the people use .NET serialization (there is faster binary and slower XML formatter, they both depend on reflection and are version tolerant to certain degree)
However, if you want the fastest (unsafe) way - why not:
Writing:
YourStruct o = new YourStruct();
byte[] buffer = new byte[Marshal.SizeOf(typeof(YourStruct))];
GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
Marshal.StructureToPtr(o, handle.AddrOfPinnedObject(), false);
handle.Free();
Reading:
handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
o = (YourStruct)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(YourStruct));
handle.Free(); |
As you've said
> To me, that seems a bit overkill, since viewing the site without Javascript will probably break most of it.
This isn't progressive enhancement. Progressive enhancement is when the site works perfectly with JavaScript or CSS and then adding these extra technologies/code, you increase the usability and functionality of the website.
The best example I can give is the tag input box on this website. With JavaScript turned off, it would still work allowing you to enter tags separated with a space. With JavaScript turned on, you get a drop down with suggestions of previous entries.
This is progressive enhancement. |
Going at it from the other direction is sometimes referred to as graceful degradation. This is usually needed when the site is built first with the enhanced functionality afforded by the various technologies then modified to degrade gracefully for browsers with those technologies are not available.
It is also graceful degradation when designing to work with older browsers (ancient in the Internets terminology) such as IE 5.5, Netscape, etc...
In my opinion it is much more work to gracefully degrade the application. Progressively enhancing it tends to be much more efficient; however, sometimes the need to take an existing app and make it accessible in these lacking environments arise. |
Small files take up a whole node on the filesystem whatever size that is.
My host tends to report all small files as 4kb in ftp but in a shell gives an accurate size so it might be a 'feature' common to ftp clients. |
[Red-black](http://en.wikipedia.org/wiki/Red-black_tree) is better than AVL for insertion-heavy applications. If you foresee relatively uniform look-up, then Red-black is the way to go. If you foresee a relatively unbalanced look-up where more recently viewed elements are more likely to be viewed again, you want to use [splay trees](http://en.wikipedia.org/wiki/Splay_tree). |
Take a look at Herb Sutter's "[The Free Lunch Is Over][1]" and then his series of articles on [Effective Concurrency][2].
[1]: http://www.gotw.ca/publications/concurrency-ddj.htm
[2]: http://herbsutter.wordpress.com/2008/07/31/effective-concurrency-the-many-faces-of-deadlock/ |
See also [Unobtrusive Javascript][1] which is the bedrock progressive enhancement is built.
[1]: http://en.wikipedia.org/wiki/Unobtrusive_JavaScript |
Behaviour Driven Development seems to focus more on the interaction and communication between Developers and also between Developers and testers.
The Wikipedia Article has an explanation:
[http://en.wikipedia.org/wiki/Behavior_Driven_Development][1]
Not practicing BDD myself though.
[1]: http://en.wikipedia.org/wiki/Behavior_Driven_Development |
The "Reverse Engineer Database" mode in Workbench in only part of the paid version not the free one. |
Adobe Air - Using multiple SQLite databases at once |
|apache-flex|actionscript-3|sqlite|air| |
I have 2 SQLite databases, one downloaded from a server (server.db), and one used as storage on the client (client.db). I need to perform various sync queries on the client database, using data from the server database.
For example, I want to delete all rows in the client.db tRole table, and repopulate with all rows in the server.db tRole table.
Another example, I want to delete all rows in the client.db tFile table where the fileID is not in the server.db tFile table.
In SQL Server you can just prefix the table with the name of the database. Is there anyway to do this in SQLite using Adobe Air? |
It seems to me that BDD is a broader scope. It almost implies TDD is used, that BDD is the encompasing methodology that gathers the information and requirements for using, amongh other things, TDD practices to ensure rapid feedback. |
Also note that you can only use the as keyword with a reference type or a nullable type
ie:
double d = 5.34;
int i = d as int;
will not compile
double d = 5.34;
int i = (int)d;
will compile. |
[The Dragon Book][1] is definitely the "building compilers" book, but if your language isn't quite as complicated as the current generation of languages, you may want to look at the Interpreter pattern from [Design Patterns][2].
The example in the book designs a regular expression-like language and is well thought through, but as they say in the book, it's good for thinking through the process but is effective really only on small languages. However, it is much faster to write an Interpreter for a small language with this pattern than having to learn about all the different types of parsers, yacc and lex, et cetera...
[1]: http://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd/dp/0321486811/
[2]: http://www.amazon.com/Design-Patterns-Object-Oriented-Addison-Wesley-Professional/dp/0201633612/ |
C# Treeview & Context Menus |
|c#|treeview| |
How can I find out which node in a tree list the context menu has been activated for. i.e. right-clicking a node and selecting an option from the menu.
I can't use the TreeViews' SelectedNode because the its only been right-clicked and not selected. |
I have been using smartassembly. Basically, you pick a dll and it returns it obfuscated. It seems to work fine and I've had no problems so far. Very, very easy to use. |
<input type="text" name="foo" **autocomplete="off"**>
doesn't that work on major browsers? |
Use a non-standard name and id for the fields, so rather than "name" have "name_". Browsers will then not see it as being the name field. The best part about it is that you can do this to some but not all fields and it will autocomplete some but not all fields. |
If your looking for a free one you could try DotObfuscator Community Edition that comes with Visual Studio or [Eazfuscator.NET](http://www.foss.kharkov.ua/g1/projects/eazfuscator/dotnet/) |
Just set autocomplete="off". There is a very good reason for doing this: You want to provide your own autocomplete functionality!
I've used this on at least two occasions. |
It sounds like you are probably hitting F5 in Visual Studio when you receive this error?
There are a few things you can try. The easiest is to hit the **Stop** button before hitting F5. Optionally, when you are finished debugging and starting to make changes you can go to the **Debug** menu and choose either **Stop Debugging** or **Terminate All**. |
It sounds like something is eating up your web server's resources. Perhaps you have some resources (file handlers, wcf proxies) that are being opened and not closed? I've had this happen to me specifically when I was not closing WCF client proxy connections.
The problem is not necessarily that you have a debugger attached, but only that the web server is not responding in a timely manner. Note that the message says "This **may** be because another debugger is attached". |
XML/SWF Charts does Chart off XML:
[http://www.maani.us/xml_charts/][1]
[1]: http://www.maani.us/xml_charts/ |
I understand BDD to be more about **specification** than **testing**. It is linked to Domain Driven Design (don't you love these *DD acronyms?).
It is linked with a certain way to write user stories, including high-level tests. An example by [Tom Teh Thij][1]:
Story: User logging in
As a user
I want to login with my details
So that I can get access to the site
Scenario: User uses wrong password
Given a username 'jdoe'
And a password 'letmein'
When the user logs in with username and password
Then the login form should be shown again
(In his article, Tom goes on to directly execute this test specification in Ruby.)
The pope of BDD is [Dan North][2]. You'll find a great introduction in his [Introducing BDD][3] article.
You will find a comparison of BDD and TDD in this [video][4]. Also an opinion about DBB as "TDD done right" by [Jeremy D. Miller][5]
[1]: http://tomtenthij.co.uk/2008/1/25/rspec-plain-text-story-runner-on-a-fresh-rails-app
[2]: http://dannorth.net/
[3]: http://dannorth.net/introducing-bdd
[4]: http://video.google.com/videoplay?docid=8135690990081075324
[5]: http://codebetter.com/blogs/jeremy.miller/archive/2007/09/06/bdd-tdd-and-the-other-double-d-s.aspx |
Here is another article for the [c# programming language][1]
c# passes its arguments **by value** (by default)
private void swap(string a, string b) {
string tmp = a;
a = b;
b = tmp;
}
calling this version of swap will thus have no result:
string x = "foo";
string y = "bar";
swap(x, y);
"output:
x: foo
y: bar"
however, [unlike java][2] c# *does* give the developer the opportunity to pass parameters **by reference**, this is done by using the 'ref' keyword before the type of the parameter:
private void swap(ref string a, ref string b) {
string tmp = a;
a = b;
b = tmp;
}
this swap *will* change the value of the referenced parameter:
string x = "foo";
string y = "bar";
swap(x, y);
"output:
x: bar
y: foo"
c# also has a **out keyword**, and the difference between ref and out is a subtle one.
[from msdn:][3]
> The caller of a method which takes an
> **out parameter** is not required to
> assign to the variable passed as the
> out parameter prior to the call;
> however, the callee is *required to
> assign to the out parameter before
> returning.*
and
> In contrast **ref parameters** are
> *considered initially assigned* by the
> callee. As such, the callee is *not
> required to assign to the ref*
> parameter before use. Ref parameters
> are passed both into and out of a
> method.
a small pitfall is, like in java, that **objects passed by value can still be changed using their inner methods**
**conclusion:**
- c# passes its parameters, by default, **by value**
- but when needed parameters can also be passed **by reference** using the ref keyword
- inner methods from a parameter passed by value **will alter** the object (if that method itself alters some values)
useful links:
- [http://msdn.microsoft.com/en-us/vcsharp/aa336814.aspx][4]
- [http://www.c-sharpcorner.com/UploadFile/saragana/Willswapwork11162005012542AM/Willswapwork.aspx][5]
- [http://en.csharp-online.net/Value_vs_Reference][6]
[1]: http://msdn.microsoft.com/en-us/vcsharp/default.aspx
[2]: http://stackoverflow.com/questions/2027/#2028
[3]: http://msdn.microsoft.com/en-us/vcsharp/aa336814.aspx
[4]: http://msdn.microsoft.com/en-us/vcsharp/aa336814.aspx
[5]: http://www.c-sharpcorner.com/UploadFile/saragana/Willswapwork11162005012542AM/Willswapwork.aspx
[6]: http://en.csharp-online.net/Value_vs_Reference |
I know you said flash, but this is a good silverlight chart api. <http://www.visifire.com/>. Always good to keep your options open right?
Had to plug silverlight, but you can also take a look at [Yahoo!'s YUI charting](http://developer.yahoo.com/yui/charts/) component. |
You can add a mouse click event to the TreeView, then select the correct node using GetNodeAt given the mouse coordinates provided by the MouseEventArgs.
void treeView1MouseUp(object sender, MouseEventArgs e)
{
if(e.Button == MouseButtons.Right)
{
// Select the clicked node
treeView1.SelectedNode = treeView1.GetNodeAt(e.X, e.Y);
if(treeView1.SelectedNode != null)
{
myContextMenuStrip.Show(treeView1, e.Location)
}
}
} |
What's the best online payment processing solution? |
|payment| |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.