instruction
stringlengths
0
30k
You'll use Swing to develop your application because any other windowing framework is useful only if you have a previous knowledge or the appropriate background. You can rely on http://www.javadocking.com/ to streamline you application. If your application requirements are highly focused on the user interface, maybe you can look in another direction like Adobe Air.
displaying HTML inside a Flex application.
|apache-flex|actionscript-3|
I have some HTML that is generated via a Rich Text Editor outside of my Flex application but would like to display it inside Flex. The HTML is simple HTML tags, things like styles, anchors, and possibly image tags, is there a control that would let me render this HTML in flex or am I going to have to roll up my sleeves and roll my own? Any ideas appreciated...Thanks.
I think the generics in Java are actually pretty good. The reason why `List<Foo>` is different than `List<? extends Foo>` is that when `Foo` is a subtype of `Bar`, `List<Foo>` is not a subtype of `List<Bar>`. If you could treat a `List<Foo>` object as a `List<Bar>`, then you could add `Bar` objects to it, which could break things. Any reasonable type system will require this. Java lets you get away with treating `Foo[]` as a subtype of `Bar[]`, but this forces runtime checks, reducing performance. When you return such an array, this makes it difficult for the compiler to know whether to do a runtime check. I have never needed to use the lower bounds (`List<? super Foo>`), but I would imagine they might be useful for returning generic values. See [covariance and contravariance][1]. On the whole though, I definitely agree with the complaints about overly verbose syntax and confusing error messages. Languages with type inference like OCaml and Haskell will probably make this easier on you, although their error messages can be confusing as well. [1]: http://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)
Local static variables are created and initialized the first time they are used, not at program start up. There's some good reading about that, and statics in general, [here][1]. [1]: http://www.acm.org/crossroads/xrds2-4/ovp.html
The memory for all static variables is allocated at program load. But local static variables are created and initialized the first time they are used, not at program start up. There's some good reading about that, and statics in general, [here][1]. In general I think some of these issues depend on the implementation, especially if you want to know where in memory this stuff will be located. [1]: http://www.acm.org/crossroads/xrds2-4/ovp.html
I've come across similar problems in the past with installation, a customer was using the SYSTEM account to install and this was causing all sorts of permission problems for non-administrative users. MSI log files aren't really going to help if the application doesn't appear "installed", I'd suggest starting with capturing the output of MSIINV.EXE under the system account, that will get you an "Inventory" of the currently installed programs (or what that user sees installed) - <http://blogs.msdn.com/brada/archive/2005/06/24/432209.aspx> I think you probably need to go back to the drawing board and see if you really need the windows service to do the uninstall. You'll probably come across all sorts of Vista UAC issues if you haven't already...
Learning Ruby on Rails
|ruby|ruby-on-rails|ide|
As it stands now I'm a Java and C# developer, but the more and more I look at Ruby on Rails, the more I really want to learn it. What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with linux? Is there an ide that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books? Seriously, any tips/tricks/rants would be awesome.
ASP.Net: If I have the Session ID, Can I get the Session object?
|asp.net|session|
This question is related to [this one](http://stackoverflow.com/questions/43324/can-i-put-an-aspnet-session-id-in-a-hidden-form-field), though I think I was a little too long-winded there to really get a good answer. I'll keep this brief. I'm working on a web handler (ashx) that accepts a form post from an aspx page. When the handler receives this form post, in order to do what it needs to do, it needs to know the user who is logged in (User.Identity.Name), but I can't rely on cookies being sent by the browser. I know I can get the Session.SessionID and place it in a hidden form field, but once my handler receives the form post, how can I use that SessionID to figure out the logged-in user's identity? I'm using the StateServer mode for session state.
The ruby folks have attempted to tackle this with a parser called **Chronic**. - [Chronic RDocs][1] - [Chronic on GitHub][2] I watched an informative video presentation recently on how the author went about solving this problem. When I find the link again I'll update this post (or someone else is welcome to do the same). [1]: http://chronic.rubyforge.org/ [2]: http://github.com/mojombo/chronic/tree/master
Use [Factory Pattern][1] for creation of Generics: Method Sample: public Map<String, Integer> createGenMap(){ return new HashMap<String,Integer>(); } [1]: http://en.wikipedia.org/wiki/Abstract_factory_pattern
I'm going with the Microsoft way; * Delete it * Defer it * Delegate it * Do it It works for me great. You can read about it at [http://www.microsoft.com/atwork/manageinfo/email.mspx][1]. [1]: http://www.microsoft.com/atwork/manageinfo/email.mspx
I switched to gMail and have never been happier. You could also try using a tags plugin like [http://www.taglocity.com/index.html][1] [1]: http://www.taglocity.com/index.html
I'm digging the DejaVu Sans Mono (it's supposed to be the same as Panic Sans) on my Mac.
I invested a lot of time in the aforementioned COM API back in 2002. It was, to put it mildly, "flakey". What we ended up doing instead is having our tasks run every minute. The first thing the task did was check the database to see if it should continue running or not. Then "starting" a scheduled task from SSIS was as simple as changing a database field.
Strategies for keeping a Lucene Index up to date with domain model changes
|
Was looking to get peoples thoughts on keeping a Lucene index up to date as changes are made to the domain model objects of an application. The application in question is a Java/J2EE based web app that uses Hibernate. The way I currently have things working is that the Hibernate mapped model objects all implement a common "Indexable" interface that can return a set of key/value pairs that are recorded in Lucene. Whenever a CRUD operation is performed involving such an object I send it via JMS queue into a message driven bean that records in Lucene the primary key of the object and the key/value pairs returned from the index( ) method of the Indexable object that was provided. My main worries about this scheme is if the MDB gets behind and can't keep up with the indexing operations that are coming in or if some sort of error/exception stops an object from being index. The result is an out-of-date index for either a sort, or long, period of time. Basically I was just wondering what kind of strategies others had come up with for this sort of thing. Not necessarily looking for one correct answer but am imagining a list of "whiteboard" sort of ideas to get my brain thinking about alternatives.
Your problem will be to determine which bitmap you have to display based upon the coordinates the mouse reports in the mouse_move event. You'll need to perform some magic to transform the coordinates and come up with a value that you can use to pick the right image. It doesn't sound too complicated, just a little bit of trial and error in the math. Skizz has already show you how to capture the events.
If you aren't yet committed to Rapid XML, I can recommend some alternative libraries: * Xerces - This is probably the defacto C++ implementation. * XMLite - I've had some luck with this minimal XML implementation. See the article at <http://www.codeproject.com/KB/recipes/xmlite.aspx>
is it still worth to add the log4j library to a Java 5 project just to log let's say some exceptions to a file with some nice rollover settings. Or will the standard util.logging facility do the job as well? What do you think? Thanks for sharing your thoughts! Okami
If I was faced with that problem and couldn't find anything on google I would probably try to do it my self. Some "back-of-an-evelope" stuff to get a feel for where it is going. But it would kinda need me to have an idea of how to do a xml parser. For non algorithmical benchmarks take a look here: - [http://www.xml.com/pub/a/Benchmark/exec.html][1] - [http://www.devx.com/xml/Article/16922][2] - [http://xerces.apache.org/xerces2-j/faq-performance.html][3] [1]: http://www.xml.com/pub/a/Benchmark/exec.html [2]: http://www.devx.com/xml/Article/16922 [3]: http://xerces.apache.org/xerces2-j/faq-performance.html
The CLR cannot directly load modules that contain no manifest. So you can't make an assembly completely private unless you also want to make it unloadable ;) You can however, as Mark noted above, use obfuscation tools to hide the parts you would like to keep truly internal. It's too bad the ***internal*** keyword doesn't exclude that metadata EDIT: it looks like [this question][1] is highly related [1]: http://stackoverflow.com/questions/31637/remove-meta-data-from-net-applications#31653
The CLR cannot directly load modules that contain no manifest. So you can't make an assembly completely private unless you also want to make it unloadable ;) You can however, as Mark noted above, use obfuscation tools to hide the parts you would like to keep truly internal. It's too bad the ***internal*** keyword doesn't exclude that metadata EDIT: it looks like [this question][1] is highly related [1]: http://stackoverflow.com/questions/31637/remove-meta-data-from-net-applications
Under W3C's [Architexture of the World Wide Web, Volume One][1], there is a section on URI aliases ([Section 2.3.1][2]) which states the following: "When a URI alias does become common currency, the URI owner should use protocol techniques such as server-side redirects to relate the two resources. The community benefits when the URI owner supports redirection of an aliased URI to the corresponding "official" URI. For more information on redirection, see section 10.3, Redirection, in [RFC2616][3]. See also [CHIPS][4] for a discussion of some best practices for server administrators." For what it's worth, I would recommend a 302 redirect. [1]: http://www.w3.org/TR/webarch/ [2]: http://www.w3.org/TR/webarch/#uri-aliases [3]: http://www.w3.org/TR/webarch/#RFC2616 [4]: http://www.w3.org/TR/webarch/#CHIPS
XML Schema construct for "Any number of these elements - in any order"
|xml|schema|xsd|
I need to create an XML schema that looks something like this: <xs:element name="wrapperElement"> <xs:complexType> <xs:sequence> <xs:element type="el1"> <xs:element type="el2"> </xs:sequence> <xs:WhatGoesHere?> <xs:element type="el3"> <xs:element type="el4"> <xs:element type="el5"> </xs:WhatGoesHere?> <xs:sequence> <xs:element type="el6"> <xs:element type="el7"> </xs:sequence> </xs:complexType> </xs:element> What I need is a replacement for "WhatGoesHere" such that any number of el3, el4 and el5 can appear in any order. For instance it could contain {el3, el3, el5, el3} Any idea on how to solve this?
What are the alternative's to using the iThenticate service for content comparison?
|search|
What are the alternative's to using the [iThenticate][1] service for content comparison? [1]: http://www.ithenticate.com
|search|drm|plagiarism|
[KingsTools][1] is also a nice collection of macros containing: - Run Doxygen - Insert Doxygen comments - Build Solution stats - Dependency Graph - Inheritance Graph - Swap .h<->.cpp - Colorize - } End of - #region/#endregion for c++ - Search the web [1]: http://www.codeproject.com/KB/macros/kingstools.aspx
Wikipedia page on <a href="http://en.wikipedia.org/wiki/Plagiarism_detection">plagiarism detection</a> has a list of commercial and free services.
I use VS. The way that I do it is that the libraries I need through the references of the project. Which basically just says in what folder to look for a specific library at project load time. I develop my libraries to be as project independent or reusable as possible. Therefore they are all projects of their own. So of the libraries that I need for a specific project, I create a "3rdParty" or "libs" folder at the same level as my "src" folder in my svn folder tree. I tend to only use released libraries, but when I get some unknown issues and want to switch to debug, I manually copy a debug version of the files in the "lib" folder and reload the project. I am unsure wether I should be keeping both debug and released versions in my svn tree. Although since they are projects of their own, keeping them in the svn tree of another project doesn't right. They can be built again without an hitch at any moment. And then I wanted to find a way of making the switch more...hmmm...well basically automatic if you while, but that's not what I really mean. It just feels that switching the files manually between released and debug isn't right. Maybe I haven't found it yet, but what I would like is an option that would do like: For library "stack.dll" look in "..\..\..\3rdParty\" for release and "..\..\..\3rdPartyD\" for debug. Anything that those something like I don't know. What do you suggest? Remember libraries are external projects. There the built files are totally elsewhere. In fact think of it as you have to check out another project, build it, and copy the built library if you want another copy. How would you set that up?
I typically write a function that performs a query using SQL and then puts the results into either a list or dictionary (in Java, I'd use either an ArrayList or a HashMap). If I found myself doing this a lot, I'd probably create a new file to hold all of these queries. Otherwise I'd just make them functions in whatever file they were needed/used. Since we're talking Java specifically, I would certainly not create a new class in a separate file. However, for queries needed in only one class, you could create a private static inner class with only the function(s) needed to generate the query(s) needed by that class.
In addition to the refactoring and source control tools listed here, [AQTime][1] is a great windows profiler. It can run as a plugin or stand-alone and it works with .NET and native code. [1]: http://www.automatedqa.com/products/aqtime/
It seems that this isn't supported, since there wouldn't be a good way to deal with overflows in datetime.time. I know this isn't an answer directly, but maybe someone with more python experience than me can take this a little further. For more info, see this: [http://bugs.python.org/issue3250][1] [1]: http://bugs.python.org/issue3250
I think you'd have to launch the MS Access process under the account you want to use to connect. There are various tools that let you do this, such as [CPAU](http://www.joeware.net/freetools/tools/cpau/index.htm). This tool will let you encrypt the password as well.
Determining the performance consequences of PHP code
|php|performance|
How can you determine the performance consequences of your PHP code if you are not familiar with the internals? Are there ways to figure out how your code is being executed (besides simply load testing it)? I am looking for things like memory usage, execution time for algorithms. Perhaps Joel would say, "learn C, then read the internals", but I really don't have time to learn C right now (though I'd love to, actually).
A persistent layar is the only way to go with php. Either file based solution or database. php natively doesn't provide any mechanism to do application scope variable.
What does it mean when a postgres process is "idle in transaction"?
|postgresql|
On a server that I'm looking at, the output of "ps ax | grep postgres" I see 9 postgres processes that look like the following: postgres: user db 127.0.0.1(55658) idle in transaction Does this mean that some of the processes are hung, waiting for a transaction to be committed? Any pointers to relevant documentation are appreciated.
- **Easy to use**: I have experience developing on Eclipse and I have to say it's not easy to understand its development model. Sure for basic stuff it has some wizards that make easier, but for something a little more complex it's just difficult. I don't know about Netbeans, but I heard its easier. - **Consistent API**: I think Eclipse wins in this aspect. It runs over OSGI (brings some complexity though) and has plugins extensions for pretty much everything. It seems to be the platform of choice for plugin development, so I can assume it's reliable. - **Documentation**: Eclipse wins by far. The help from eclipse site is excelent and the mailing list has plenny of users questions.
Raising Exceptions vs Throwing Exceptions
|ruby|exception|
Ruby has two different exceptions mechanisms: Throw/Catch and Raise/Rescue. Why do we have two? When should you use one and not the other?
What is the simplest way to write web apps in Haskell?
|haskell|
I would like to use Haskell more for my projects, and I think if I can get started using it for web apps, it would really help that cause. I have tried happs once or twice but had trouble getting off the ground. Are there simpler/more conventional (more like lamp) frameworks out there that I can use or should I just give happs another try?
This should do the trick: SELECT sessions_highwater FROM v$license;
**@Hugo regarding threadlocal:** I thought about that solution. However, from experiments I found two problems with that approach: 1. Shared thread (server connections, etc) are problematic. This can be solved though by paying special attention to these thread (they're all under my control and are pretty much isolated from the legacy code). 2. The EDT thread is shared across all applets. I failed to find a way to force the creation of a new EDT thread for each applet. This means that the threadlocal for the EDT would be shared across the applets. This one I have no idea how to solve. Suggestions?
I've used event-based APIs for plugins in the past. You can insert hooks for plugins by dispatching events and providing access to the application state. For example, if you were writing a blogging application, you might want to raise an event just before a new post is saved to the database, and provide the post HTML to the plugin to alter as needed.
I don't get this part here: > This worked okay, but there was no easy way of checking if x[3][24] was supposed to exist or not (so I couldn't raise the season_not_found exception) There is a way to do it - called **in**: >>>x={} >>>x[1]={} >>>x[1][2]={} >>>x {1: {2: {}}} >>> 2 in x[1] True >>> 3 in x[1] False what seems to be the problem with that?
This is generally something that you'll have to expose yourself, so yes, it will be dependent on the language your system is written in (though often it's possible to write wrappers for other languages as well). If, for example, you had a program written in C, for Windows, plugins would be written for your program as DLLs. At runtime, you would manually load these DLLs, and expose some interface to them. For example, the DLLs might expose a `gimme_the_interface()` function which could accept a structure filled with function pointers. These function pointers would allow the DLL to make calls, register callbacks, etc. If you were in C++, you would use the DLL system, except you would probably pass an object pointer instead of a struct, and the object would implement an interface which provided functionality (accomplishing the same thing as the struct, but less ugly). For Java, you would load class files on-demand instead of DLLs, but the basic idea would be the same. In all cases, you'll need to define a standard interface between your code and the plugins, so that you can initialize the plugins, and so the plugins can interact with you.
This is generally something that you'll have to expose yourself, so yes, it will be dependent on the language your system is written in (though often it's possible to write wrappers for other languages as well). If, for example, you had a program written in C, for Windows, plugins would be written for your program as DLLs. At runtime, you would manually load these DLLs, and expose some interface to them. For example, the DLLs might expose a `gimme_the_interface()` function which could accept a structure filled with function pointers. These function pointers would allow the DLL to make calls, register callbacks, etc. If you were in C++, you would use the DLL system, except you would probably pass an object pointer instead of a struct, and the object would implement an interface which provided functionality (accomplishing the same thing as the struct, but less ugly). For Java, you would load class files on-demand instead of DLLs, but the basic idea would be the same. In all cases, you'll need to define a standard interface between your code and the plugins, so that you can initialize the plugins, and so the plugins can interact with you. P.S. If you'd like to see a good example of a C++ plugin system, check out the [foobar2000 SDK](http://foobar2000.com/SDK.html). I haven't used it in quite a while, but it used to be really well done. I assume it still is.
The ruby folks have attempted to tackle this with a parser called **Chronic**. - [Chronic RDocs][1] - [Chronic on GitHub][2] I watched an informative video presentation recently on how the author went about solving this problem. - [Chronic Presentation (San Diego Ruby Brigade)][3] [1]: http://chronic.rubyforge.org/ [2]: http://github.com/mojombo/chronic/tree/master [3]: http://podcast.sdruby.com/2006/10/3/episode-008-chronic
How can I test my web pages in Microsoft Internet Explorer on a Mac?
|testing|macos|internet-explorer|
I want to test the web pages I create in all the modern versions of Internet Explorer (6, 7 and 8 beta) but I work mainly on a Mac and often don't have direct access to a PC.
I don't think there is a problem with padding introduced by having a **multi-dimensional** array. Each element in an array must satisfy the padding requirements imposed by the architecture. An array [N][M] is always going to have the same in memory representation as one of [M*N].
Each array element should be laid out sequentially in memory by the compiler. The two declarations whilst different types are the same underlying memory structure.
I think the most bullet-proof solution is to keep the code inside your SSL document root only. This will ensure that you (or another developer in the future) can't accidentally link to a non-secure version of the form. If you have the form on both HTTP and HTTPS, you might not even notice if the wrong one gets used inadvertently. If this isn't doable, then I would take at least two precautions. Do the Apache URL rewriting, and have a check in your code to make sure the session is encrypted - check the HTTP headers.
Reporting the value for InitialContext.getEnvironment().get(Context.PROVIDER_URL) might be helpful.
Turn off VSS integration. You may not have a choice in using it, but DLLs get "accidentally" renamed all the time... And definitely check your pre-compiled header settings. Bruce Dawson's guide is a bit old, but still *very* good - check it out: <http://www.cygnus-software.com/papers/precompiledheaders.html>
In Linux it is %llu and in Windows it is %I64u Although I have found it doesn't work in Windows 2000, there seems to be a bug there!
Once you've virtualized Windows on your Mac, you can also try the **Mutiple IE** installer to get a variety of flavors of Internet Explorer without having to create separate VM instances. - [Multiple IE Installer][1] If you're just wanting to see a simple screenshot of how the page will render in various browsers, you can try the free service **browsershots** or there are a number of services that will automatically test your pages in multiple browsers. - [browsershots.org][2] [1]: http://tredosoft.com/Multiple_IE [2]: http://browsershots.org/
Instead of thinking in layers, why not try taking vertical slices through the application and converting those to .net. That way you will get entire features coded in .net instead of disjoint parts. What is the business value in replacing perfectly working code without improving the user experience or adding features? You might also consider the trade-off of performance you are going to give up with a Web Service over direct ado calls. Web Services are a good solution to the problem of multiple disjoint applications/teams accessing a common schema; they do not make a single isolated application more maintainable, only slower and more complex.
I'd say you're probably fine with util.logging for the needs you describe. For a good decision tree, have a look at [http://java.sys-con.com/node/48541][1] > Question One : Do you anticipate a need for any of the clever handlers that Log4j has that JUL does not have, such as the SMTPHandler, NTEventLogHandler, or any of the very convenient FileHandlers? > Question Two : Do you see yourself wanting to frequently switch the format of your logging output? Will you need an easy, flexible way to do so? In other words, do you need Log4j's PatternLayout? > Question Three : Do you anticipate a definite need for the ability to change complex logging configurations in your applications, after they are compiled and deployed in a production environment? Does your configuration sound something like, "Severe messages from this class get sent via e-mail to the support guy; severe messages from a subset of classes get logged to a syslog deamon on our server; warning messages from another subset of classes get logged to a file on network drive A; and then all messages from everywhere get logged to a file on network drive B"? And do you see yourself tweaking it every couple of days? > If you can answer yes to any of the above questions, go with Log4j. If you answer a definite no to all of them, JUL will be more than adequate and it's conveniently already included in the SDK. That said, pretty much every project these days seems to wind up including log4j, if only because some other library uses it. [1]: http://java.sys-con.com/node/48541
As a former Test & Commissioning manager, I would strongly argue for a test API. It does not remove the need for User Interface testing, but you will be able to add automated tests and non regression tests. If it's absolutely impossible, I would setup a test proxy, where you will be able to: - Do nothing (transparent proxy). Your app should behave normally. - Spy / Log data traffic. Add a filter mechanism so you don't grab everything - Block specific messages. Your filter system is very useful here - Corrupt specific messages (this is more difficult) If you need some sort of network testing: - Limit general throughput (some libraries do this) - Delay messages (same remark) - Change packet order (quite difficult)
You want `xs:group` with occurrence constraints: <xs:element name="wrapperElement"> <xs:complexType> <xs:sequence> <xs:element name="e11"/> <xs:element name="el2"/> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="el3"/> <xs:element name="el4"/> <xs:element name="el5"/> </xs:choice> <xs:element name="el6"/> <xs:element name="el7"/> </xs:sequence> </xs:complexType> </xs:element>
I would go with log4j. The possibilites with log4j is not obsolete at all!
The pros and cons compared to what? There are a lot of alternatives out there, the most popular being nHibernate, with the new kid 'ADO.NET Entity Framework' on the block. Anyways, there are hundreds of answers depending on your situation and requirements.
^^ as DannySmurf says : Consolidate them. Create a timer service and ask that for the timers. It will only need to keep 1 active timer (for the next due call) and a history of all the timer requests and recalculate this on AddTimer() / RemoveTimer().
I am looking to allow users to control of subdomain of an app I am toying with, much like Basecamp where it is 'customusername.seework.com'. What is required on the DNS end to allow these to be created dynamically and be available instantly. And how do you recommend dealing with this in the logic of the site? Htaccess rule to lookup the subdomain in the DB? thanks
|web-applications|dns|user|account|subdomain|
XSL Dynamic Element Names
|xslt|
I want to transform an XML document. The source XML looks like this: <svc:ElementList> <svc:Element> <Year>2007</Year> </svc:Element> <svc:Element> <Year>2006</Year> </svc:Element> <svc:Element> <Year>2005</Year> </svc:Element> </svc:ElementList> I want to turn that into: <ElementList> <NewTag2007/> <NewTag2006/> <NewTag2005/> </ElementList> The following line of code isn't working: <xsl:element name="{concat('NewTag',Element/Year)}"/> The output is a series of elements that look like this: <b>< NewTag ></b>. (Without the spaces...) <b>"//Element/Year"</b>, <b>"./Element/Year"</b>, and <b>"//svc:Element/Year"</b> don't work either. One complication is that the "Element" tag is in the "svc" namespace while the "Year" tag is in the default namespace. So anyway, am I facing a namespace issue or am I mis-using the "concat()" function?
|xml|xslt|namespace|
|xml|xslt|namespaces|
Reference material for LabVIEW
|tutorials|labview|
I'm supposed to learn how to use [LabVIEW][1] for my new job, and I'm wondering if anybody can recommend some good books or reference/tutorial web sites. I'm a senior developer with lots of Java/C#/C++ experience. I realize that this question is perhaps more vague than is intended on stack overflow, so how about this? Please answer with one book or web site and a brief description. Then people can vote up their favourites. [1]:http://www.ni.com/labview/
|tutorials|labview|programming-languages|
|tutorials|labview|
|tutorials|reference|labview|
Pointer Manipulation Help
|c++|c|arrays|pointer|
I am trying to build a function in C/c++ to sort an array and replace each value with its "score" or rank. It takes in a double pointer array to an array of ints, and sorts the double pointers based on the dereferenced value of the integers. I have tried quite a few times to make it work, but cant get it down. Once again, it must sort the double pointers based on the values they point to. This is what I have: void SortArray( int ** pArray, int ArrayLength ) { int i, j, flag = 1; // set flag to 1 to begin initial pass int * temp; // holding variable orig with no * for(i = 1; (i <= ArrayLength) && flag; i++) { flag = 0; for (j=0; j < (ArrayLength -1); j++) { if (*pArray[j+1] > *pArray[j]) // ascending order simply changes to < { temp = &pArray[j]; // swap elements pArray[j] = &pArray[j+1]; pArray[j+1] = &temp; flag = 1; // indicates that a swap occurred. } } } }; thanks in advance.
<pre> IDE: NetBeans Book: <a href="http://www.pragprog.com/titles/rails2/agile-web-development-with-rails">Agile Web Development With Rails</a> Installation: <a href="http://instantrails.rubyforge.org/wiki/wiki.pl">Instant Rails</a> </pre>
There's a very solid [ongoing series on NETTUTS][1] right now that you may be interested in. [1]: http://nettuts.com/misc/learn-ruby-on-rails-from-scratch-week-1/