instruction
stringlengths
0
30k
I'm confused, isn't the best editor for Flash 9 shared objects... Flash? It already has methods for loading, editing and saving them. --- So make the editor and put it on your website. You won't get any security errors from flash, and then just throw a password around it so regular people can't edit their .sol fi...
I'm confused, isn't the best editor for Flash 9 shared objects... Flash? It already has methods for loading, editing and saving them. --- So make the editor and put it on your website. You won't get any security errors from flash, and then just throw a password around it so regular people can't edit their .sol fi...
There are all sorts of "replacements", and have been since before the web existed. The problem with talking about a "replacement" for HTML+JS is that the conversation generally starts out of frustration with one or more specific aspects of the current implementations: - "i hate the lack of presentation-specific t...
In order for sudo to work the way everyone suggest, you need to be in the `admin` group.
There's a programming language called Haskell that has a great parsing library you might try. www.haskell.org and http://legacy.cs.uu.nl/daan/parsec.html for more details
You can create COM+ components using System.EnterpriseServices.ServicedComponent. Consequently, you'll be able to create out-of-proc and in-proc (client) component activation as well as all COM+ benefits of pooling, remoting, run as a windows service etc.
drawing animations at the show of JDialog
|java|user-interface|swing|animation|
What would be the best way to draw a simple animation just before showing a modal JDialog? (i.e. expanding borders from the mouse click point to the dialog location). I thought it would be possible to draw on the glasspane of the parent frame on the setVisible method of the dialog. However since the JDialog is modal to...
You can set the database compatibility level, but there is no guarantee that this will cover all your bases. For example the new data types will be available on the SQL 2008 system, but they won't be available on the SQL 2005 server. The only way to guarantee that everything will work from Dev to Prod is to put SQL...
I guess something like this should do it. It basically writes the content to a new file and replaces the old file with the new file: from tempfile import mkstemp from shutil import move from os import remove, close def replace(file, pattern, subst): #Create temp file fh, ab...
What kind of network traffic? If it's HTTP this will work for you: http://www.charlesproxy.com/
What is the best way to lock cache in asp.net?
|c#|.net|asp.net|caching|
I know in certain circumstances, such as long running processes, it is important to lock ASP.NET cache in order to avoid subsequent requests by another user for that resource from executing the long process again instead of hitting the cache. What is the best way in c# to implement cache locking in ASP.NET?
As lassevk suggests, write out the new file as you go, here is some example code: fin = open("a.txt") fout = open("b.txt", "wt") for line in fin: fout.write( line.replace('foo', 'bar') ) fin.close() fout.close()
You can try to look at the exported functions (through DumpBin or Dependency Walker) and see if the names are mangled.
How about [this tool][1] (network Traffic Generator) ? [1]: http://www.softpedia.com/get/Network-Tools/Network-Testing/Network-Traffic-Generator.shtml
|ruby|ruby-on-rails|
I believe this happens when a transaction times out. You really should be using a "real" database. Something like Drizzle, or MySQL. Any reason why you prefer SQLite over the two prior options?
Apologies in advance for plugging a third party library, and I know it's not free, but I use [FlexCel Studio][1] from TMS Software. If you're looking to do more than just dump data (formatting, dynamic cross-tabs, etc) it works very well. We generate hundreds of reports a week using it. FlexCel accepts strongly-typ...
I maintain an online documentation system for my company. The writers create the documentation in SGML ( an xml like language ). The SGML is then combined with XSLT and transformed into HTML. This allows us to easily make changes to the documentation layout without doing any coding. Its just a matter of changing ...
The Lua code base has following to do this (check in src/luaconf.h from www.lua.org). If you find (SO finds) a faster way, I'm sure they'd be thrilled. Oh, lua_Number means double. :) <pre> /* @@ lua_number2int is a macro to convert lua_Number to int. @@ lua_number2integer is a macro to convert lua_Number to ...
restful_authentication and OpenID
|ruby-on-rails|openid|restful-authentication|
I'm thoroughly confused about current state of the art for using OpenID together with `restful_authentication`. The obvious google search gives several well-known pages which do not make sense taken together (considering their timestamps). What shall I do given that I'm running Rails 2.0 (or 2.1) and I want OpenID...
Check if the input stream is positioned in the begging. Otherwise, as implementation: I do not think that you need to write to the result stream while you are reading, unless you process this exact stream in another thread. Just create a byte array, read the input stream, then create the output stream.
Note that there's an extra, undocumented limitation to the INSERT INTO ... EXEC statement: it cannot be nested. That is, the stored proc that the EXEC calls (or any that it calls in turn) cannot itself do an INSERT INTO ... EXEC. It appears that there's a single scratchpad per process that accumulates the result, and i...
Not being familiar with ocaml or haxe, and not being clever enough to understand the other explanations, I went and looked up the [haxe enum documentation](http://haxe.org/ref/enums) - the 'Enum Type Parameters' bit at the bottom seems to be the relevant part. My understanding based on that is as follows: A 'norm...
CSS layouts are generally much better for accessibility, provided the content comes in a natural order and makes sense without a stylesheet. And it's not just screen readers that struggle with table-based layouts: they also make it much harder for mobile browsers to render a page properly. Also, with a div-based la...
If you're using a javascript framework, there may be a handy method for dealing with this. In Prototype, for example, you can call a method and scope it to a particular "this" object: var myObject = new TestObject(); myObject.firstMethod.bind(myObject); Note: bind() returns a function, so you can also us...
One good way to start learning about how IE happens to be mangling the page is to turn on red borders on different elements with CSS (`border: 1px solid red;`). This will immediately tell you whether it's a margin problem or a padding problem, how wide the element *really* is, etc.
We had a floating div issue that was only evident in a particular version of IE6. It was fixed by downloading the latest service pack.
If you're in SQL Server, then you can use DateParts SELECT * FROM Employees WHERE DATEPART (month, birthday) = DATEPART (month, @Today) and DATEPART (day, birthday) BETWEEN DATEPART (day, @today) AND DATEPART (day, @endDate)
Better, Add the difference in years to the BIRTHDAY date, to make everything this year, and then do your compares SELECT * FROM Employees WHERE DATEADD ( year, YEAR(@Today) - YEAR(@Birthday), birthday) BETWEEN @Today AND @EndDate
how do you define layout bug? the most frustrating layout implementation (i don't know if this should be defined as bug) in IE is we need to always specify *style="display:inline"* in the HTML &lt;form> tag so that a blank line won't appear to disturb the form layout.
I typically watch 'top' and 'tail -f /var/log/auth.log'.
It looks like as of this date, there's no way to do it using the Zend_PDF API's. The Zend_Pdf_Page class has a drawContentStream() which looked promising, but when I checked into it, the method body was empty. Maybe a later release of the API will support it. So, if you want place another PDF inside another dyna...
Don't do that. The reason behind that is as follows: by nature of template metaprogramming, if some part of your logic is done at compile-time, every logic that it is dependent on must be done at compile time as well. Once you start it, do one portion of your logic at compile time, there is no return. The snowball will...
As many as you can afford to, and can then graph/understand/look at the results. Monitoring resources is useful for not only capacity planning, but anomaly detection, and anomaly detection significantly helps your ability to detect security events. You have a decent start with your basic graphs. I'd want to also m...
One way to do it is to have your application listen on a certain port, or socket file, for incoming requests. Then you can write a small client application that connects to that port or socket file and sends commands to the running application. Then you can configure your window manager to bind certain key combin...
Delphi makes good use of virtual constructors in the VCL GUI framework: type TComponent = class public constructor Create(AOwner: TComponent); virtual; // virtual constructor end; TMyEdit = class(TComponent) public constructor Create(AOwner: TComponent)...
|ruby|ruby-on-rails|openid|rubyonrails|restful-authentication|
|ruby|ruby-on-rails|openid|restful-authentication|
If you're pressed for time, you can just use the RemoteObject to hit a compiled DLL (like WebORB - its free for .NET, but you need a VS copy above Express to compile your classes that you want to expose to Flex) and Retrieve the object that way... Obviously your objects should have a DAL in place or be gener...
Personally, what I had to do was make sure that I could use the Vim key-bindings (or at least, close enough) in several applications. Having to completely switch how I edited text whenever I changed editors made it too hard to get the Vim editing style committed to muscle memory. In my case, Viemu + vimperator did t...
If you're merciless enough, the end result of refactoring will be pretty close to what you'd have gotten if you rebuilt from scratch, but you won't have been stuck with a non-working system during the process.
I have VI on Windows, the version I use is listed below, if I am in a console window I always default to VI, then regardless of what OS I am running on I know I can edit the file. Conversely if I am in UI mode, I use Notepad++ go figure. NT VI - Version 0.23 Developed by: Tony Andrews Based on a program by: ...
We've adopted the ethos "Code for people, not machines", based on the assumption that you spend multiple times longer in maintenance mode than on new development. For me, that rules out the argument that the compiler "knows" what type the variable is - sure, you can't write invalid code the first time because the co...
Security and privacy are the main reasons to avoid doing this. Any information that gives away your data structure is more information that a hacker can use to access your database. As mopoke says, you also expose yourself to SQL injection attacks which are fairly common and can be extremely harmful to your database ...
You can download the Professional version of VS2008 for free (if you have a .edu address) via [Microsoft Dreamspark](https://downloads.channel8.msdn.com/). For that matter, the (fully-functional) 90-day trial of both VS2005 and VS2008 Pro... can be "extended"... indefinitely... by setting your system clock back, but...
Not online, but maybe you should take a look at [Compilers: Principles, Techniques, and Tools (2nd Edition)][1] by Aho et al. This is a standard text that has been evolving for 30 years (if you count the 1st [Dragon Book][2], published in 1977 [1]: http://www.amazon.com/Compilers-Principles-Techniques-Tools-2nd...
You could use a dictionary to add them with a key, and when you add them check if the key already exists. <pre><code>string[] myarray = new string[] { "aaa", "bbb", "aaa" }; Dictionary<string, string> mydict = new Dictionary<string, string>(); foreach (string s in myarray) { ...
I would guess that these are in fact two different filenames that "look" the same, as the command file was able to distinguish them when the shell passed the expanded versions of the name in. Try piping ls into od or another hex/octal dump utility to see if they really have the same name, or if there are non-printing ...
Difference between VARCHAR2(11 BYTE) and VARCHAR2(11 CHAR),
|sql|oracle-database|varchar|
In Oracle, what is the difference between : CREATE TABLE CLIENT ( NAME VARCHAR2(11 BYTE), ID_CLIENT NUMBER ) and CREATE TABLE CLIENT ( NAME VARCHAR2(11 CHAR), -- or even VARCHAR2(11) ID_CLIENT NUMBER ) Thank you.
|sql|oracle-database|unicode|varchar|
@imphasing - this is exactly the kind of mindset that causes maintenance nightmares. Why oh why would you ignore declarative referential integrity, where the data can be **guaranteed** to be at least consistent, in favour of so called "software enforcement" which is a weak preventative measure at best.
The browser *is* scrolling the page, its just that part of it is fixed in position. This is done by using the "position: fixed" CSS property on the part that you wish not to scroll.
Use the HashSet class included in .NET 3.5.
You should also have a look at the [nested diagnostic context][1] feature of log4j. Pushing different contexts to the logger for different callers might do the trick for you. [1]: http://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/NDC.html
They've set the side and top elements to have fixed positions via CSS (see line 94 of their style.css file). This holds them in the viewport while the rest scrolls.
Not being familiar with ocaml or haxe, and not being clever enough to understand the other explanations, I went and looked up the [haxe enum documentation](http://haxe.org/ref/enums) - the 'Enum Type Parameters' bit at the bottom seems to be the relevant part. My understanding based on that is as follows: A 'norm...
Dynamically Create a generic type for template
|c#|generics|
I'm programming WCF using the ChannelFactory which expects a type in order to call the CreateChannel method. For example: >IProxy proxy = ChannelFactory&lt;IProxy&gt;.CreateChannel(...); In my case I'm doing routing so I don't know what type my channel factory will be using. I can parse a message header to deter...
A quick google search shows that the same thing has been asked at [blackberry forums][1]. The solution they came up with is a class for loading the font from a [fnt file][2]. There are [programs available][3] to import and edit fnt files. [1]: http://www.blackberryforums.com/developer-forum/100107-using-cu...
You can add the -c option if the config for your app's cluster is elsewhere: mongrel_rails cluster::restart -c /path/to/config
[formerly hackersafe McAfee Secure.][1] [1]: https://www.mcafeesecure.com/
You can use the -nomatch operator to get the lines that don't have the characters you are interested in. Get-Content $FileName | foreach-object { if ($_ -nomatch $arrayofStringsNotInterestedIn) { $) }
In addition to top and auth.log, I often look at mtop, and enable mysql's slowquerylog and watch mysqldumpslow. I also use Nagios to monitor CPU, Memory, and logged in users (on a VPS or dedicated server). That last lets me know when someone other than me has logged in.
The C++ Series of programming books by Deitel and Deitel
Check out <a href="http://www.javadoconline.com/search.jsp?from=main&class=java.util.concurrent&action=search">java.util.concurrent</a> for versions of the standard Collections classes that are engineered to handle concurrency better.
You could try using defensive copying so that modifications to one `List` don't affect others.
I created a project here and used an embedded resource (build action was set to Embedded Resource, rather than just resource). This solution doesn't work with Resource, but you may be able to manipulate it. I put this on the OnIntialized() but it doesn't have to go there. //IconTest = namespace; exclamic.ico =...
Ok, I'm unsure of how you want to go about this. From your example, it looks like WorkerMethod does not create its own thread to execute under, but you want to call that method on another thread. In that case, create a short worker method that calls WorkerMethod then calls SomeOtherMethod, and queue that method up ...
Another thought: Add their age in whole years to their birthday and then compare as you do above. Use DATEPART and DATEADD to do this. http://msdn.microsoft.com/en-us/library/ms186819.aspx Bonus tip: consider using BETWEEN...AND instead of repeating the Birthday operand.
Another thought: Add their age in whole years to their birthday (or one more if their Birthday hasn't happened yet and then compare as you do above. Use DATEPART and DATEADD to do this. http://msdn.microsoft.com/en-us/library/ms186819.aspx The edge case of a range spanning the year would have to have special c...
I have found [CRC cards][1] to be quite effective in learning, teaching and building good OO design. [1]: http://c2.com/doc/oopsla89/paper.html
I think you are on the right track with the overload however the extension of this is obviously a lot longer if (A > B || B > C || C > D) ...
This question I believe has far too much scope. Validate your code, and if pain persists, well, good luck. The only real solutions, as with any other ballpark bug type are to google for a solution, or ask somebody who knows, ( ie: give the exact problem to us here at stackoverflow ). You can use the IE Dev too...
Although catching **all** exceptions without the plan to properly handle them is surely a bad practice, I think that an application should fail in some graceful way. A crash should not scare the user to death, and at least it should display a description of the error, some information to report to the tech support stuf...
It depends on your application. If you think that several of your users will have an email @localhost, and you don't mind. Then go for it.
Make it a configurable option, so people can decide for themselves. I'd *default* it to failure, personally, as I've yet to run into a case - intranet or public internet - where I've had someone use a valid user@localhost type address.
The subset-sum problem, and the slightly more general knapsack problem, are solved with dynamic programming: brute-force enumeration of all combinations is not required. Consult Wikipedia or your favourite algorithms reference. Although the problems are NP-complete, they are very "easy" NP-complete. The algorithmic ...
Well, if you have DNS working for internally you could always just do a DNS lookup. But if this is going to fail with SMTP, then I would suggest making sure you don't include it.
There is a bug in the code. If the size of s is N bytes and the user types a newline as the (N-1)th character, the Nth character will become a '\n' and the (N+1)th character (which is not allocated) will become a '\0'.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists). That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A comp...
Using Yahoo! Pipes
|yahoo-pipes|rss|
Have you used [pipes.yahoo.com][1] to quickly and easily do... anything? I've recently created a quick [mashup of StackOverflow tags][2] (via rss) so that I can browse through new questions in fields I like to follow. This has been around for some time, but I've just recently revisited it and I'm completely impresse...
|rss|yahoo-pipes|
Have you used [pipes.yahoo.com][1] to quickly and easily do... anything? I've recently created a quick [mashup of StackOverflow tags][2] ([via rss][3]) so that I can browse through new questions in fields I like to follow. This has been around for some time, but I've just recently revisited it and I'm completely imp...
Try floating the div's to the left, that will keep them all on the same line - assuming there is enough spacing.
SELECT name FROM options ORDER BY name = "Montreal", name;
SELECT name FROM options ORDER BY name = "Montreal", name;
SELECT name FROM options ORDER BY name = "Montreal", name; Note: This works with MySQL, not SQL 2000 like the OP requested.
In fact it is not the scrolling part that is "doing the job", it is the fixed part of the page. In order to do this, you should use CSS and add `position: fixed;` property (use it with `top`, `bottom`, `left` and/or `right` properties) to the elements that you wish not to scroll. And you should not forget to give...
You can't beat the easy install of the [free Visual SVN Server](http://www.visualsvn.com/) and the VisualSVN plug-in is well worth the money. I paid for that part out of my own pocket.