instruction
stringlengths
0
30k
There are several key aspects to multi-agent computing, distribution and independence are among them. Multi-agents don't have to be on different machines, they could as @Kyle says, be multiple processes on a single chip or machine, but they act without explicit centralised direction. They might act in concert, so they have certain synchronisation rules - doing their jobs separately before coming together to compare results, for example. Generally though the reasoning behind the segmentation into separate agents is to allow for differing priorities to guide each agent's actions and reactions. Perhaps using an economic model to divide up common resources or because the different functions are physically separated so don't need to interact tightly with each other.
There are several key aspects to multi-agent computing, distribution and independence are among them. Multi-agents don't have to be on different machines, they could as @Kyle says, be multiple processes on a single chip or machine, but they act without explicit centralised direction. They might act in concert, so they have certain synchronisation rules - doing their jobs separately before coming together to compare results, for example. Generally though the reasoning behind the segmentation into separate agents is to allow for differing priorities to guide each agent's actions and reactions. Perhaps using an economic model to divide up common resources or because the different functions are physically separated so don't need to interact tightly with each other. **<sweeping generalisation>** Is it something to ignore? Well it's not really anything in particular so it's a little like "can I ignore the concept of quicksort?" If you don't understand what quicksort is then you're not going to fail to be a developer because most of your life will be totally unaffected. If you have more understanding of different architectures and models, you'll have more knowledge to deploy in new and unpredictable places. **<sweeping generalisation>** Ten years ago, 'multi-agent systems' (MAS) was one of those phrases that appeared everywhere in the academic literature. These days it is less prevalent, but some of the ideas it represents are **really** useful in some places. But totally unnecessary in others. So I hope that's clear ;)
I really like the telerik radgrid. Their product ain't cheap, but you get a lot of controls and features. And the data binding support is pretty good, both in a simple asp.net data source binding way and in a more custom handle-your-own-databinding-events kind of way.
To be honest, in Java there is not really an argument against overriding [equals()][1]. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with [hashCode()][2], and similarly, watch out for the gotchas around the [Comparable][3] interface - in almost all situations you want the *natural ordering* as defined by Comparable to be *consistent with equals* (see the [BigDecimal][4] api doc for the canonical counter example) Creating a new method for deciding equality, quite apart from not working with the existing library classes, flies in the face of Java convention somewhat. [1]: http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object) [2]: http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode() [3]: http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html [4]: http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html
To be honest, in Java there is not really an argument against overriding [equals][1]. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with [hashCode][2], and similarly, watch out for the gotchas around the [Comparable][3] interface - in almost all situations you want the *natural ordering* as defined by Comparable to be *consistent with equals* (see the [BigDecimal][4] api doc for the canonical counter example) Creating a new method for deciding equality, quite apart from not working with the existing library classes, flies in the face of Java convention somewhat. [1]: http://java.sun.com/javase/6/docs/api/java/lang/Object.html#equals(java.lang.Object) [2]: http://java.sun.com/javase/6/docs/api/java/lang/Object.html#hashCode() [3]: http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html [4]: http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html
To be honest, in Java there is not really an argument against overriding *equals*. If you need to compare instances for equality, then that is what you do. As mentioned above, you need to be aware of the contract with *hashCode*, and similarly, watch out for the gotchas around the [Comparable][1] interface - in almost all situations you want the *natural ordering* as defined by Comparable to be *consistent with equals* (see the [BigDecimal][2] api doc for the canonical counter example) Creating a new method for deciding equality, quite apart from not working with the existing library classes, flies in the face of Java convention somewhat. [1]: http://java.sun.com/javase/6/docs/api/java/lang/Comparable.html [2]: http://java.sun.com/javase/6/docs/api/java/math/BigDecimal.html
In our big javascript applications, we write all our code in small separate files - one file per 'class' or functional group, using a kind-of-like-Java namespacing/directory structure. We then have: - A compile-time step that takes all our code and minifies it (using a variant of JSMin) to reduce download size - A compile-time step that takes the classes that are always or almost always needed and concatenates them into a large bundle to reduce round trips to the server - A 'classloader' that loads the remaining classes at runtime on demand.
For Windows, I found Microsoft's own free [XML Notepad 2007][1] to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;) Requires .net 2.0 [1]: http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628&displaylang=en "XML Notepad 2007"
For Windows, I found Microsoft's own free [XML Notepad 2007][1] to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;) Requires .net 2.0 [1]: http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628 "XML Notepad 2007"
For Windows, I found Microsoft's own free [XML Notepad 2007](http://www.microsoft.com/downloads/details.aspx?familyid=72d6aa49-787d-4118-ba5f-4f30fe913628) to be a great simple to use editor with a nice selection of features. Used it for both reviewing my XML output when developing and editing broken iTunes' libraries. ;) Requires .net 2.0
Sql query, count and group by
|sqlquery|
if i have data like this: Key Name 1 Dan 2 Tom 3 Jon 4 Tom 5 Sam 6 Dan What is the sql query to bring back the records where the Name is repeated 2 or more times. So the result i would want is Tom Dan
|sql|
Couldn't be simpler... Select Name From Table Group By Name Having Count(Name) > 1 I hope that answers your question :)
Couldn't be simpler... Select Name, Count(Name) As Count From Table Group By Name Having Count(Name) > 1 Order By Count(Name) Desc This could also be extended to delete duplicates: Delete From Table Where Key In ( Select Max(Key) From Table Group By Name Having Count(Name) > 1)
why massive lookup table? let me come up with some simple example
why massive lookup table? string GetWrittenInteger(int n) { string[] a = new string[] {"One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine" } string[] b = new string[] { "Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen" } string[] c = new string[] {"Twenty", "Thirty", "Forty", "Sixty", "Seventy", "Eighty", "Ninety"}; string[] d = new string[] {"Hundred", "Thousand", "Million"} string s = n.ToString(); for (int i = 0; i < s.Length; i++) { // logic (too lazy but you get the idea) } }
How do you pack a visual studio c++ project for release?
|c++|visual-studio|
I'm wondering how to make a release build that includes all necessary dll files into the .exe so the program can be run on a non-development machine without it having to install the microsoft redistributable on the target machine. Without doing this you get the error message that the application configuration is not correct and to reinstall.
How to convert std::string to LPCWSTR in C++ (Unicode)
|c++|
I'm looking for a method, or a code snippet for converting std::string to LPCWSTR
|c++|winapi|
Have a look at Sharepoint. If cost is an issue, Sharepoint portal sevices can also work for you. [Read this][1] for more info [1]: http://www.isaserver.org/img/upl/spskit/1overview/1overview.htm
There's a very simple way of comparing two arrays using CFML's underlying java. According to a recent blog by Rupesh Kumar of Adobe (http://coldfused.blogspot.com/), ColdFusion arrays are an implementation of java lists (java.util.List). So all the Java list methods are available for CFML arrays. So to compare 2 arrays all you need to do is use the equals method. It returns a YES if the arrays are equal and NO if they are not. <cfset array1 = listToArray("tom,dick,harry,phred")/> <cfset array2 = listToArray("dick,harry,phred") /> <cfset array3 = listToArray("tom,dick,harry,phred")/> <cfoutput> Array2 equals Array1 #array2.equals(array1)# (returns a NO) <br/> Array3 equals Array1 #array3.equals(array1)# (returns a YES) <br/> </cfoutput>
I have used ASP.NET MVC (I even wrote a HTTPModule that lets you define the routes in web.config), and I still get a bitter taste in my mouth about it. It seems like a giant step backwards in organization and productivity. Maybe its not for some, but I've got webforms figured out, and they present no challenge to me as far as making them maintainable. That, and I don't endorse the current "TEST EVERYTHING" fad...
From what I'm seeing, it seems that it's not possible to directly access/ manipulate a Network Place from the command line, be it in PowerShell or the plain ol' command prompt. @slipsec (#13899): Thanks for the suggestion, but PowerShell doesn't support the port number in the destination path any more than the `net use` command does. So the best thing I can figure to do in my particular situation is bite the bullet and buy something like WebDrive to enable drive mapping via WebDAV on non-standard ports, or do some different configuration (e.g. separate web app with a different IP address and host headers) in SharePoint to expose the site via NTLM on a standard port.
Where are you trying to access the property? If you are in onInit, the control may not be loaded yet.
Asp.Net Routing: How do I ignore multiple wildcard routes?
|asp.net|asp.net-mvc|routes|
I'd like to ignore multiple wildcard routes. With asp.net mvc preview 4, they ship with: RouteTable.Routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); I'd also like to add something like: RouteTable.Routes.IgnoreRoute("Content/{*pathInfo}"); but that seems to break some of the helpers that generate urls in my program. Thoughts?
Parameterized queries are your friend, as suggested by Matt. Command = SELECT * FROM PEOPLE WHERE SURNAME=? They will protect you from headaches involved with - Strings with quotes - Querying using dates - SQL Injection
Frankly, I have yet to see the first installer that really allows both per-user and per-app installations. Many installers offer this options in their GUI, but the setting only affects where the shortcuts etc. go -- the binaries always fo to %ProgramFiles%. In fact, it is pretty hard to create Windows Installer packages that allow both kinds of installs, to say the least. With the advent of UAC, I'd say its is impossible: Per user installations must not require elevation, per machine installations have to. But whether an MSI package requires elevation is controlled via a bit in the summary information stream -- there is no way to have user input have impact on that. Whether per-user or per-machine is the better choice greatly deoends on the application. For small packages, I tend to prefer per-user installations. Besides being slightly more user-friendly by not requiring an UAC prompt or runas, they also signalize the user that the setup will not do much harm to the computer (assuming he is a non-admin).
Frankly, I have yet to see the first installer that really allows both per-user and per-machine installations. Many installers offer this option in their GUI, but the setting only affects where the shortcuts etc. go -- the binaries always fo to %ProgramFiles%. In fact, it is pretty hard to create Windows Installer packages that allow both kinds of installs, to say the least. With the advent of UAC, I'd say its is impossible: Per user installations must not require elevation, per machine installations have to. But whether an MSI package requires elevation is controlled via a bit in the summary information stream -- there is no way to have user input have impact on that. Whether per-user or per-machine is the better choice greatly deoends on the application. For small packages, however, I tend to prefer per-user installations. Besides being slightly more user-friendly by not requiring an UAC prompt or runas, they also signalize the user that the setup will not do much harm to the computer (assuming he is a non-admin).
In your src folder of the flexbuilder project you should see the generated classes. For instance, if I use the manager to generate the proxy classes for www.example.com you should see the folders /com/example with the generated proxy classes inside. To consume these webservices in ActionScript use the statement: "import com.example.*;" To consume the webservice in mxml include the .as file using: <mx:Script source="yourscriptname.as"/> To refresh the generated proxy classes, consuming the latest WSDL, simply open the manager and select "update". Also, I found this [article][1] very useful for consuming web services. [1]: http://www.adobe.com/devnet/flex/articles/flex_ws.html I hope that helps, the question was kind of vague about the problem.
In your src folder of the flexbuilder project you should see the generated classes. For instance, if you use the manager to generate the proxy classes for www.example.com you should see the folders /com/example with the generated proxy classes inside. To consume these webservices in ActionScript use the statement: "import com.example.*;" To consume the webservice in mxml include the .as file using: <mx:Script source="yourscriptname.as"/> To refresh the generated proxy classes, consuming the latest WSDL, simply open the manager and select "update". Also, I found this [article][1] very useful for consuming web services. [1]: http://www.adobe.com/devnet/flex/articles/flex_ws.html I hope that helps, the question was kind of vague about the problem.
My favorite Monad tutorial: <http://www.haskell.org/all_about_monads/html/index.html> (out of 170,000 hits on a Google search for "monad tutorial"!) @Stu: The point of monads is to allow you to add (usually) sequential semantics to otherwise pure code; you can even compose monads (using Monad Transformers) and get more interesting and complicated combined semantics, like parsing with error handling, shared state, and logging, for example. All of this is possible in pure code, monads just allow you to abstract it away and reuse it in modular libraries (always good in programming), as well as providing convenient syntax to make it look imperative. Haskell already has operator overloading[1]: it uses type classes much the way one might use interfaces in Java or C# but Haskell just happens to also allow non-alphanumeric tokens like + && and > as infix identifiers. It's only operator overloading in your way of looking at it if you mean "overloading the semicolon" [2]. It sounds like black magic and asking for trouble to "overload the semicolon" (picture enterprising Perl hackers getting wind of this idea) but the point is that without monads <i>there is no semicolon, since purely functional code does not require or allow explicit sequencing.</i> This all sounds much more complicated than it needs to. sigfpe's article is pretty cool but uses Haskell to explain it, which sort of fails to break the chicken and egg problem of understanding Haskell to grok Monads and understanding Monads to grok Haskell. [1] This is a separate issue from monads but monads use Haskell's operator overloading feature. [2] This is also an oversimplification since the operator for chaining monadic actions is >>= (pronounced "bind") but there is syntactic sugar ("do") that lets you use braces and semicolons and/or indentation and newlines.
Is it possible to list named events in Windows?
|windows|events|
I would like to create events for certain resources that are used across various processes and access these events by name. The problem seems to be that the names of the events must be known to all applications referring to them. Is there maybe a way to get a list of names events in the system? I am aware that I might use some standard names, but it seems rather inflexible with regard to future extensibility (all application would require a recompile).
In java I would start with JDepend. .NET NDepend I dont know about c++ though :(
Try to avoid platform-dependent #ifdefs, as they tend to grow exponentially when you add new platforms. Instead, try to organize your source files as a tree with platform-independent code at the root, and platform-dependent code on the "leaves". There is a nice book on the subject, [Multi-Platform Code Management][1]. Sample code in it may look obsolete, but ideas described in the book are still brilliantly vital. [1]: http://oreilly.com/catalog/9781565920590/
Is Python good for big software projects (not web based)?
|python|ide|
Right now I'm developing mostly in C/C++, but I wrote some small utilities in Python to automatize some tasks and I really love it as language (especially the productivity). Except for the performances (a problem that could be sometimes solved thanks to the ease of interfacing Python with C modules), do you think it is proper for production use in the development of stand-alone complex applications (think for example to a word processor or a graphic tool)? What IDE would you suggest? The IDLE provided with Python is not enough even for small projects in my opinion.
Do note that the alt attribute isn't intended to be a tooltip. Alt is for describing the image where the image itself is not available. If you want to use tooltips, use the title attribute instead.
You need at least a decent text editor as a baseline, [emacs with nxml mode][1] as mentioned before is a very good choice. However as the schema becomes larger and larger you may loose the overview, especially when you author an XML Schema document which can be very verbose. You'll need some sort of visualization: XML Spy is ok, Oxygen is great but expensive, but as it turns out, on Windows, you have almost all needed features in [XMLPad][2] which is freeware. When you start editing instance XML documents (and even editing XML Schemas) you need on the fly validation against a schema and if possible auto-completion of attributes and elements. Emacs only supports on the fly validation and auto-completion with a relax NG based schema (but any XSD can be converted to a relax NG schema). If you have any choice in the matter, consider using [Relax NG][3] as your schema syntax, it is much more readable and maintainable. [1]: http://www.emacswiki.org/cgi-bin/wiki/NxmlMode [2]: http://www.wmhelp.com/download.htm [3]: http://relaxng.org/
I'm pretty much writing my own HTML - I'm using the ListView and Masterpages, but not really using the controls much anymore. My ListView laughs at your silly old repeater, by the way. However, bloatware isn't necessarily a bad thing. If I needed a low volume intranet application built, I'd much rather pay a less experienced developer to drag and drop controls than for an HTML twiddler (like you or me) to craft each tag. There's definitely a place for the quick, simple approach. What's the cost of "bloatware" in that scenario, as long as the control based code is written in a maintainable fashion? Often wiring controls together requires less custom code, which means simple maintenance. The one place I have to disagree with you - pretty much regardless of the application - is in crafting your own paging queries. You may like to do that kind of thing, but there's absolutely no business value in it. There are several professional-grade DAL tools which will usually write more maintainable, faster queries than most developers. Even if you lovingly craft the perfect paging query, it won't keep up to date with changes to the schema unless you continue to throw hours after it. I think better use of those hours is to build a lightweight system and put those hours into monitoring and fixing specific bottlenecks, rather than immediately jumping to the "database assembly language" layer.
DBCC CHECKIDENT('TableName', RESEED, 0)
I've actually used GridView extensively for an adminsitrative console. I even created a custom DataFieldControl that sets the field's header text and sort expression based on data field, creates an Insert row in the bottom and automatically collects the values in the row and forwards them to the data source's insert method, and generates a list box if an additional list data source is specified. It's been really useful though a huge time investment to build. I also have another control that will generate a new data form based on the fields' metadata when there are no records (in the EmptyDataTemplate). <asp:GridView ...> <Columns> <my:AutoField HeaderText="Type" DataField="TypeId" ListDataSourceID="TypesDataSource" ListDataTextField="TypeName" /> </Columns> <EmptyDataTemplate> <my:AutoEmptyData runat="server" /> </EmptyDataTemplate> </asp:GridView>
How about:- var noDupes = list.Distinct().ToList(); In .net 3.5?
Is there a way to parse a dependency tree from a build script output?
|c++|gcc|gnu|linker|
I have an inherited project that uses a build script (not make) to build and link the project with various libraries. When it performs a build I would like to parse the build output to determine what and where the actual static libraries being linked into the final executable are and where are they coming from. The script is compiling and linking with GNU tools.
While browsing through the options, I found that I had to set "Position each attribute on a separate line" and "Position first attribute on same line as start tag" under "Tools > Options ... > Text-Editor > XAML > Formatting > Spacing" and reset the Keyboard mappings under "Tools > Options ... > Environment > Keyboard" to "Visual C# 2005". Now the XAML editor reformats the XAML to my taste when pressing Ctrl+E, D.
You can use mutliple classes in the HTML element's class attribute, each providing part of the styling. So you could define your CSS as: .ourColor { color: blue; } .ourBorder { border: 1px solid blue; } .bigText { font-size: 1.5em; } and then combine the classes as required: <h1 class="ourColor">Blue Header</h1> <div class="ourColor bigText">Some big blue text.</div> <div class="ourColor ourBorder">Some blue text with blue border.</div> That allows you to reuse the ourColor class without having to define the colour mulitple times in your CSS. If you change the theme, simply change the rule for ourColour.
Use list comprehensions when the result needs to be iterated over multiple times, or where speed is paramount. Use generator expressions where the range is large or infinite.
Iterating over the generator expression or the list comprehension will do the same thing. However, the list comp will create the entire list in memory first while the generator expression will create the items on the fly, so you are able to use it for very large (and also infinite!) sequences.
It's best to use a combination, and you'll have to use your own judgement. Here's the guidelines I use: * If making a call to external code is part of your code's expected (outward-facing) behavior, this should be tested. Use a mock. * If the call is really an implementation detail which the outside world doesn't care about, prefer stubs. However: * If you're worried that later implementations of the tested code might accidentally go around your stubs, and you want to notice if that happens, use a mock. You're coupling your test to your code, but it's for the sake of noticing that your stub is no longer sufficient and your test needs re-working. The second kind of mock is a sort of necessary evil. Really what's going on here is that whether you use a stub or a mock, in some cases you have to couple to your code more than you'd like. When that happens, it's better to use a mock than a stub only because you'll know when that coupling breaks and your code is no longer written the way your test thought it would be. It's probably best to leave a comment in your test when you do this so that whoever breaks it knows that their code isn't wrong, the test is. And again, this is a code smell and a last resort. If you find you need to do this often, try rethinking the way you write your tests.
MVC or WebForms...it's your choice but if I can offer one piece of advice regarding webforms...I know it'll be tempting to start dropping controls and playing with code, but it will help you A LOT if you don't skip over learning about the request and page lifecycles...a couple weeks later you'll thank yourself for spending the extra time there.
If you're looking for a search plugin specifically for this site, someone will have to write one.
You aren't gonna have a problem running Xcode on an iMac. Any iMac. Any development project can be done on an iMac. They're fast and modern machines. The cheapest iMac has a Dual Core Duo 2 chip with 1 gig RAM. Boost the RAM to 2 if you can (a cheap option - cheaper if you buy 3rd party RAM). Makes a huge difference running OSX.
When you `throw ex`, you're essentially throwing a new exception, and will miss out on the original stack trace information. `throw` is the preferred method.
You pretty much have to keep the left side of your where clause clean. So, normally, you'd do something like: WHERE MyDateTime >= @activityDateMidnight AND MyDateTime < (@activityDateMidnight + 1) (Some folks prefer DATEADD(d, 1, @activityDateMidnight) instead - but it's the same thing). The TimeZone table complicates matter a bit though. It's a little unclear from your snippet, but it looks like t.TheDateInTable is in GMT with a Time Zone identifier, and that you're then adding the offset to compare against @activityDateMidnight - which is in local time. I'm not sure what ds.LocalTimeZone is, though. If that's the case, then you need to get @activityDateMidnight into GMT instead.
A shared SAN with failover is a great solution with a great (high) cost. Are there any similar solutions with failover at a reasonable cost? Perhaps something like DRBD for windows? The problem with a simple shared filesystem is the lack of redundancy (what if the fileserver goes down)?
I can't see how licensing would be any different than for a co-lo provider.
Unfortunately, there's no legal way to run OS X in a virtual machine. For developing iPhone apps you probably don't need a particularly beefy machine, so maybe look into grabbing a [mac mini][1]? They're the cheapest Macs you can get, and should probably be just fine for doing iPhone work. Plus, now you have a mac that you can use for testing other things too! :) [1]: http://store.apple.com/us/browse/home/shop_mac/family/mac_mini?mco=MTE3MTA
The rule of thumb is to avoid Catching and Throwing the basic `Exception` object. This forces you to be a little smarter about exceptions; in other words you should have an explicit catch for a `SqlException` so that your handling code doesn't do something wrong with a `NullReferenceException`. In the real world though, catching *and logging* the base exception is also a good practice, but don't forget to walk the whole thing to get any `InnerExceptions` it might have.
If you throw a new exception with the initial exception you will preserve the initial stack trace too.. try{ } catch(Exception ex){ throw new MoreDescriptiveException("here is what was happening", ex); }
@Mike I recently did a test and this is the code I used. I'm not using policy stuff, but I used WS-Security with plain text authentication. CXF has really good documentation on how to accomplish this stuff. I used wsdl2java and then added this code to use the web service with ws-security. I hope this helps you out. import java.io.IOException; import java.util.HashMap; import java.util.Map; import javax.security.auth.callback.Callback; import javax.security.auth.callback.CallbackHandler; import javax.security.auth.callback.UnsupportedCallbackException; import org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor; import org.apache.ws.security.WSConstants; import org.apache.ws.security.WSPasswordCallback; import org.apache.ws.security.handler.WSHandlerConstants; public class ServiceTest implements CallbackHandler { public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { WSPasswordCallback pc = (WSPasswordCallback) callbacks[0]; // set the password for our message. pc.setPassword("buddah"); } public static void main(String[] args){ PatientServiceImplService locator = new PatientServiceImplService(); PatientService service = locator.getPatientServiceImplPort(); org.apache.cxf.endpoint.Client client = org.apache.cxf.frontend.ClientProxy.getClient(service); org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint(); Map<String, Object> outProps = new HashMap<String, Object>(); outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN + " " + WSHandlerConstants.TIMESTAMP); outProps.put(WSHandlerConstants.USER, "joe"); outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT); // Callback used to retrieve password for given user. outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ServiceTest.class.getName()); WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps); cxfEndpoint.getOutInterceptors().add(wssOut); try { List list = service.getInpatientCensus(); for(Patient p : list){ System.out.println(p.getFirstName() + " " + p.getLastName()); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } } [1]: http://beta.stackoverflow.com/users/1958/mike-sharek
Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser. navigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + "/courses/" + fileName));
Only way I could figure out how to do it without just moving the file and telling the user was to pass it off to the browser. navigateToURL(new URLRequest(File.applicationStorageDirectory.nativePath + "/courses/" + fileName));
That's quite odd, 100 classes really isn't that many. What is the compiler doing when the stack overflows? Is there a useful stack trace generated? What happens if you run `javac` directly on the command line instead of thorugh ant? One possible workaround is to simply increase the size of the stack using the `-Xss` argument to the JVM; either to the JVM running `ant` or by setting `fork="true"` and a `<compilerarg>` on the `<javac>` task. Actually now that I think of it, does the problem go away just putting in the `fork="true"`?
This is part of a solution I use on a local intranet. Some of the variables you will have to collect yourself as I pull them from a database but you may pull them from somewhere else. The only extra but I've got in there is a function called **getMimeType** which connects to the database and pulls back the correct mine type based on file extension. This defaults to application/octet-stream if none is found. // Clear the response buffer incase there is anything already in it. Response.Clear(); Response.Buffer = true; // Read the original file from disk FileStream myFileStream = new FileStream(sPath, FileMode.Open); long FileSize = myFileStream.Length; byte[] Buffer = new byte[(int)FileSize]; myFileStream.Read(Buffer, 0, (int)FileSize); myFileStream.Close(); // Tell the browse stuff about the file Response.AddHeader("Content-Length", FileSize.ToString()); Response.AddHeader("Content-Disposition", "inline; filename=" + sFilename.Replace(" ","_")); Response.ContentType = getMimeType(sExtention, oConnection); // Send the data to the browser Response.BinaryWrite(Buffer); Response.End();
[Eric Meyer](http://meyerweb.com) implemented a very similar thing as a WordPress plugin called [WP-GateKeeper](http://meyerweb.com/eric/tools/wordpress/wp-gatekeeper.html) that asks human-readable questions like "What colour is an orange?". He did have some issues around asking questions that a non-native English speaker would be able to answer simply, though. There are a few posts on [his blog](http://meyerweb.com) about it.
You could try using [Alice](http://www.alice.org/). It's a 3D program designed for use in introductory programming classes. The two biggest obstacles for new programmers are often: * syntax errors * motivation (writing something meaningful and fun rather than contrived) Alice uses a drag and drop interface for constructing programs, avoiding the possibility of syntax errors. Alice lets you construct 3D worlds and have your code control (simple) 3D characters and animation, which is usually a lot more interesting than making a linked list. Experienced programmers may look down at Alice as a toy and scoff at dragging and dropping lines of code, but [research](http://www.alice.org/index.php?page=publications/publications) shows that this approach works. Disclaimer: I worked on Alice.
You could try using [Alice](http://www.alice.org/). It's a 3D program designed for use in introductory programming classes. The two biggest obstacles for new programmers are often: * syntax errors * motivation (writing something meaningful and fun rather than contrived) Alice uses a drag and drop interface for constructing programs, avoiding the possibility of syntax errors. Alice lets you construct 3D worlds and have your code control (simple) 3D characters and animation, which is usually a lot more interesting than implementing linked lists. Experienced programmers may look down at Alice as a toy and scoff at dragging and dropping lines of code, but [research](http://www.alice.org/index.php?page=publications/publications) shows that this approach works. Disclaimer: I worked on Alice.
I use it as well and quite frankly wouldn't want to work without it. I've always had some kind of issue tracker available for the projects I work on and thus am quite used to updating it. With FB6 the process is now even better. Since FB also integrates with Subversion, the source control tool I use for my projects, the process is really good and I have two-way links between the two systems now. I can click on a case number in the Subversion logs and go to the case in FB, or see the revisions bound to a case inside FB.
Can you use CruiseControl to build Cocoa/Objective-C projects?
|cruisecontrol|cruisecontrol.rb|continuiousbuild|testing|build-process|
Has anyone ever set up Cruise Control to build an OS X Cocoa/Objective-C project? If so, is there a preferred flavor of CruiseControl (CruiseControl.rb or just regular CruiseControl) that would be easier to do this with. I currently have a Ruby rake file that has steps for doing building and running tests, and wanted to automate this process after doing a checkin. Also, does CruiseControl have support for git? I couldn't find anything on the website for this.
|testing|build-process|cruisecontrol|cruisecontrol.rb|continuiousbuild|
|testing|build-process|cruisecontrol|cruisecontrol.rb|continuousbuild|
|testing|cocoa|build-process|cruisecontrol|cruisecontrol.rb|
I know of a third party component that can do that. It's called ["*swfupload*"][1] and is free to use and open source, and uses javascript and flash to do the magic. here is a list of the features they offer: (from their site) > - Upload multiple files at once by ctrl/shift-selecting in dialog > - Javascript callbacks on all events > - Get file information before upload starts > - Style upload elements with XHTML and css > - Display information while files are uploading using HTML > - No page reloads necessary > - Works on all platforms/browsers that has Flash support. > - Degrades gracefully to normal HTML upload form if Flash or javascript is > unavailable > - Control filesize before upload starts > - Only display chosen filetypes in dialog > - Queue uploads, remove/add files before starting upload They also have a [demo area][2] where you can play around with their control. That way you can make sure it is exactly what you want. We used it in one of our projects and it has never failed us so far, so I think this is a safe bet. oh and here is the download page: [http://code.google.com/p/swfupload/][3] [1]: http://swfupload.org/ [2]: http://www.swfupload.org/documentation/demonstration [3]: http://code.google.com/p/swfupload/
Here are a few options: - [CodeDrawer][1] - [CC-RIDER][2] - [Doxygen][3] The last one, Doxygen, is more of an automatic documentation tool, but it is capable of generating dependency graphs and inheritance diagrams. It's also licensed under the GPL, unlike the first two which are not free. [1]: http://www.codedrawer.com/index.html [2]: http://www.westernwares.com/ [3]: http://www.stack.nl/~dimitri/doxygen/index.html
@Timbo: You are basically right about it being sort of like an abstract Tree class with three derived classes (Empty, Leaf, and Node), but you would also need to enforce the guarantee that some one using your Tree class can never add any new derived classes, since the strategy for using the Tree datat type is to write code that switches at runtime based on the type of each element in the tree (and adding new derived types would break existing code). You can sort of imagine this getting nasty in C# or C++, but in Haskell, ML, and OCaml, this is central to the language design and syntax so coding style supports it in a much more convenient manner, via pattern matching. ADT (sum types) are also sort of like <a href="http://en.wikipedia.org/wiki/Tagged_union">tagged unions</a> or <a href="http://en.wikipedia.org/wiki/Variant_type">variant types</a> in C or C++.
To set the identity to 100: DBCC CHECKIDENT (MyTable, RESEED, 100) ---------- Aww snap!
Vim is a nice upgrade for Vi, offering decent features and a more usable set of keybindings and default behaviour. However, graphical versions like GVim, KVim and even Cream are extremely lacking in my opinion. I've been using [Geany](http://geany.uvena.de/) a lot lately, but it also has its shortcomings. I just can't find something in the league of Programmers Notepad, Smultron or TextMate on Linux. A shame, since I want to live in an all open source cyberworld, I'm stuck hopping from one almost-right editor to another.
Are you calling msbuild to build? Or are you calling the VS.NET IDE exe to build. We've had no problems with our c#/VB.NET mix using CC.NET and NAnt and do not have to specify referenced assemblies inside of the build files. What we do is using the IDE exe to build solutions that contain the projects we want to build.
I have a poor man's version of this I have used in the past... this requires jquery and firebug... <script type="text/javascript"> $(document).ready(function() { $('*[@id]').each(function() { console.log('#' + this.id + ' {}'); }); $('*[@class]').each(function() { $.each($(this).attr('class').split(" "), function() { console.log('.' + this + ' {}'); }); }); }); </script> it gives you something like this: #spinner {} #log {} #area {} .cards {} .dialog {} .controller {} if you want them in "natural" page order instead... <script type="text/javascript"> $(document).ready(function() { $('*').each(function() { if($(this).is('[@id]')) { console.log('#' + this.id + ' {}'); } if($(this).is('[@class]')) { $.each($(this).attr('class').split(" "), function() { console.log('.' + this + ' {}'); }); } }); }); </script> I just load the page with that script in there, then cut and paste the results out of firebug... then obviously, remove the script :) you'll need to remove the dups manually or just toss in some simple dup checking logic with a map or array or something.. one for IDs and one for classes.
Debug Companion VS plugin seem to be exactly what I was looking for, except that it won't see library project in my solution. Only when I added a console win application to the solution did something appear in that list of projects. The problem with the decompile/compile approach for me was that the code I was debugging wasn't my code. I could have decompiled it anyway but I think there's no way to sign that recompiled assembly so that it gets loaded instead of the original one. With the particular problem I had it turned out that it was enough to just debug it on the assembly language level and get the call stack of the method which was throwing the exception and the parameters with which the method was called.
Tools>Options>General>Multiple Documents
If you don't need to compile one of the code screens, have you thought about just opening Notepad++ or PSPad in your other monitor and viewing the second batch of code that way? They have context sensitive coloring that would assist in reading. I do this all the time.
Where exactly in the code are you attempting to do this? It is possible that you are attempting to access the control too early in the [page lifecycle][1] and it has not been instantiated yet. [1]: http://msdn.microsoft.com/en-us/library/ms178472.aspx
Your solution will not scale unless you add a permanent index to each column, with all of the columns that are returned in the query in the list of included columns (a covering index). These indexes will be very large, and inserts and updates to that table will be a bit slower, but you don't have much of a choice if you are allowing a user to arbitrarily select a search column. How many columns are there? How often does the data get updated? How fast do inserts and updates need to run? There are trade-offs involved, depending on the answers to those questions. Do plenty of experimentation and testing so you know for sure how things will perform. But to your original question, adding and dropping an index for the purpose of a single query is only beneficial if you do more than one select during the query (for example, the select is in a sub-query that gets run for each row returned).
If you created the UserControl during runtime (through ControlCollection.Add), you need to create it on postback too. Another case can be your UserControl does not match the designer.cs page
Asp.Net MVC: How do I enable dashes in my urls?