instruction
stringlengths
0
30k
Ant's <javac> tasks throws StackOverflowException
|java|ant|
I'm trying to compile over 100 java classes from different packages from a clean directory (no incremental compiles) using the following ant tasks: <target name="-main-src-depend"> <depend srcdir="${src.dir}" destdir="${bin.dir}" cache="${cache.dir}" closure="true"/> </target> <target name="compile" depends="-main-src-depend" description="Compiles the project."> <echo>Compiling</echo> <javac target="${javac.target}" source="${javac.source}" debug="${javac.debug}" srcdir="${src.dir}" destdir="${bin.dir}"> <classpath> <path refid="runtime.classpath"/> <path refid="compile.classpath"/> </classpath> </javac> </target> However, the first time a run the compile task I always get a StackOverflowException. If I run the task again the compiler does an incremental build and everything works fine. This is undesirable since we are using [CruiseControl][1] to do an automatic daily build and this is causing false build failures. As a quick-and-dirty solution I have created 2 separate tasks, compiling portions of the project in each. I really don't think this solution will hold as more classes are added in the future, and I don't want to be adding new compile tasks every time we hit the "compile limit". [1]: http://cruisecontrol.sourceforge.net/
G'day, Automatic generation of (M|m)akefiles makes me worry about what you're trying to do here. Do you understand what goes on under the covers when you type make? Or gmake? I'm only asking because if you don't when things break, such as new code changes not being incorporated into the build, you'll have difficulties trying to work what has happened. To start to understand make, can I suggest having a read of "[Managing Projects with GNU Make][1]" by Robert Mecklenberg. The early chapters cover how make is working. Getting your heard around the fact that make is backward chaining is one of the biggest things you can do. If you don't, and your system appears to work, then you'll be, to use The Pragmatic Programmers' term, "[programming by coincidence][2]". (-: BTW Great articles available at their site! And I'm not involved with them. YMMV. Yada-yada... cheers, Rob [1]: http://www.amazon.com/Managing-Projects-Make-Nutshell-Handbooks/dp/0596006101/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1219829161&sr=8-1 [2]: http://www.pragprog.com/the-pragmatic-programmer/extracts/coincidence
AHA! I knew there had to be a cleaner solution... the code I was working on was starting to look something like this: On Error Resume Next strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colProcessList = objWMIService.ExecQuery _ ("Select * from Win32_Process Where Name = 'BackgroundProcess.exe'") For Each objProcess in colProcessList colProperties = objProcess.GetOwner(strNameOfUser,strUserDomain) If strNameOfUser = "SYSTEM" Then objProcess.Terminate() End If Next
When is the problem likely to become a real issue? Given current growth rates, how soon do you expect signed integer overflow to happen in the MS SQL version? Be pessimistic. How long do you expect the application to live? Do you still think the factor of 2 difference is something you should worry about? (I have no idea what the answers are, but I think we should be sure that we really have a problem before searching any harder for a solution)
I agree with Stu, and I don't consider myself an Architect luddite :-). Kind of like a lot of MS frameworks over the years, you are tied to their particular way of thinking, which doesn't always gel with the ideas that come out of the rest of the architecture community at large. Generating stubs, in my opinion, doesn't really add that much value, and the round trip half of the equation has messed up some of my project files and made me have to re-write the things manually.
Oracle provide a utility called tnsping R:\>tnsping someconnection TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:38:07 Copyright (c) 1997 Oracle Corporation. All rights reserved. Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora C:\Oracle92\network\ADMIN\tnsnames.ora TNS-03505: Failed to resolve name R:\> R:\>tnsping entpr01 TNS Ping Utility for 32-bit Windows: Version 9.0.1.3.1 - Production on 27-AUG-20 08 10:39:22 Copyright (c) 1997 Oracle Corporation. All rights reserved. Used parameter files: C:\Oracle92\network\ADMIN\sqlnet.ora C:\Oracle92\network\ADMIN\tnsnames.ora Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (COMMUNITY = **) (PROTOCOL = TCP) (Host = ****) (Port = 1521))) (CONNECT_DATA = (SID = ENTPR0 1))) OK (40 msec) R:\> This should show what file you're using. The utility sits in the oracle bin directory
In your derived class you need to either override (or shadow using *new*) the property in question and then re-apply the default value attribute.
Zend Framework can load and edit existing PDF files. I think it supports revisions too. I use it to create docs in a project, and it works great. Never edited one though. Check out the doc [here][1] [1]: http://framework.zend.com/manual/en/zend.pdf.create.html
Static constructor is guaranteed to be thread safe. Also, check out the discussion on Singleton at DeveloperZen: [http://www.developerzen.com/2007/07/15/whats-wrong-with-this-code-1-discussion/][1] [1]: http://www.developerzen.com/2007/07/15/whats-wrong-with-this-code-1-discussion/
@lomaxx > @Derek & Mark: I wish there was a way to accept 2 answers. I'm going to have to end up going with Wolfbyte's solution because if I split the file into n sections there is the potential for a thread to come across a batch of "slow" transactions, however if I was processing a file where each process was guaranteed to require an equal amount of processing then I really like your solution of just splitting the file into chunks and assigning each chunk to a thread and being done with it. No worries. If clustered "slow" transactions is a issue, then the queuing solution is the way to go. Depending on how fast or slow the average transaction is, you might also want to look at assigning multiple lines at a time to each worker. This will cut down on synchronization overhead. Likewise, you might need to optimize your buffer size. Of course, both of these are optimizations that you should probably only do after profiling. (No point in worrying about synchronization if it's not a bottleneck.)
I second RodeoClown's comment about code reviewing every commit. Once he's done it a fair few times he'll get in the habit of testing stuff. I don't know if you need to block commits like that though. At my workplace everyone has free commit to everything, and all SVN commit messages (with diffs) are emailed to the team. Note: you *really* want the [thunderbird colored-diffs addon](https://addons.mozilla.org/en-US/thunderbird/addon/4268) if you plan on doing this. My boss or myself (the 2 'senior' coders) will end up reading over the commits, and if there's any stuff like "you forgot to add unit tests" we just flick an email or go and chat to the person, explaining why they needed unit tests or whatever. Everyone else is encouraged to read the commits too, as it's a great way of seeing what's going on, but the junior devs don't comment so much. You can help encourage people to get into the habit of this by periodically saying things like "Hey, bob, did you see that commit I did this morning, I found this neat trick where you can do blah blah whatever, read the commit and see how it works!" NB: We have 2 'senior' devs and 3 junior ones. This may not scale, or you might need to adjust the process a bit with more developers.
There's a [pretty good post][1] that I read a while back that outlines some testing and analysis of GPT in a variety of scenarios [1]: http://xtalk.msk.su/~ott/en/writings/prog-checking/GooglePT.html
With Zend Framework: <?php require_once 'Zend/Pdf.php'; $pdf = Zend_Pdf::load('blank.pdf'); $page = $pdf->pages[0]; $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page->setFont($font, 12); $page->drawText('Hello world!', 72, 720); $pdf->save('zend.pdf');
Josh, Is this WebForms or MVC? If it's MVC you could utilize the AntiForgery token. This seems like it's similar to the approach you mention except it uses basically a GUID and sets a cookie with the guid value for that post. For more on that see Steve Sanderson's blog: http://blog.codeville.net/2008/09/01/prevent-cross-site-request-forgery-csrf-using-aspnet-mvcs-antiforgerytoken-helper/ Another thing, have you considered checking the referrer on the postback? This is not bulletproof but it may help. Regards!
Great first question. The short answer: make sure your application is a function from ALL its inputs (including implicit ones) to its outputs. The problem you're describing doesn't seem like global state. At least not mutable state. Rather, what you're describing seems like what is often referred to as "The Configuration Problem", and it has a number of solutions. If you're using Java, you may want to look into light-weight injection frameworks like [Guice][1]. In Scala, this is usually solved with [implicits][2]. In some languages, you will be able to load another program to configure your program at runtime. This is how we used to configure servers written in Smalltalk, and I use a window manager written in Haskell called Xmonad whose configuration file is just another Haskell program. [1]: http://code.google.com/p/google-guice/ [2]: http://www.google.com/search?q=scala+implicits
Google Chrome is *not* using the Vista SDK to achieve this on XP. If you peek into <code>src\chrome\browser\views\frame</code> there are several files to define the browser frame depending on the capabilities of the system. On XP, it looks like <code>OpaqueFrame</code> is used; line 19 has this to say: <pre><code>// OpaqueFrame // // OpaqueFrame is a CustomFrameWindow subclass that in conjunction with // OpaqueNonClientView provides the window frame on Windows XP and on Windows // Vista when DWM desktop compositing is disabled. The window title and // borders are provided with bitmaps.</code></pre> It looks like it's using the resources in <code>src\chrome\app\theme</code> to draw the frame buttons. So it looks like my hopes that there's some kind of cheap way to enable Vista theming on XP are dashed. The only way to do it is to manually draw the non-client area of your window.
Google Chrome is *not* using the Vista SDK to achieve this on XP. If you peek into <code>src\chrome\browser\views\frame</code> there are several files to define the browser frame depending on the capabilities of the system. On XP, it looks like <code>OpaqueFrame</code> is used; line 19 has this to say: <pre><code>// OpaqueFrame // // OpaqueFrame is a CustomFrameWindow subclass that in conjunction with // OpaqueNonClientView provides the window frame on Windows XP and on Windows // Vista when DWM desktop compositing is disabled. The window title and // borders are provided with bitmaps.</code></pre> It looks like it's using the resources in <code>src\chrome\app\theme</code> to draw the frame buttons. So it looks like my hopes that there's some kind of cheap way to enable Vista theming on XP are dashed. The only way to do it is to manually draw the non-client area of your window. I believe <a href="http://geekswithblogs.net/kobush/articles/CustomBorderForms.aspx">something like this</a> is probably the right track, since it lets Windows handle the non-client stuff like moving and resizing the window. Unless someone can find a method to magically enable the Vista theming on XP, this is the answer to the question but I obviously cannot mark my own post as the answer.
I think that you are after this $username = $_SERVER['PHP_AUTH_USER']; $password = $_SERVER['PHP_AUTH_PW'];
Bandwith throttling in IIS 6 by IP Address
|iis|asp.net|
I am writing an application that downloads large files in the background. All clients are logged in locally, or through a VPN. When they are logged in locally, I do not want to throttle downloads. However, I would like to limit downloads to 10 KBps when the user is connected via VPN. I can differentiate between these users by IP Address range. Since this is an AIR Application, I figure I will throttle via server-side since I can do it from either the server itself (IIS 6) or the web service (asp.net / C#). Throttling through IIS 6 seems to work fine, but it seems like it has to be done across the entire web site. Is there anyway to do this via IP? Or will I have to rig this up in .NET? Thanks in advance...
|asp.net|iis|
How about running IE with the HTML favorites file as a parameter? > IExplore file://\\windows\\fav.htm
I think we could also include non-.NET-specific approaches to parallel processing if those are among the best options to consider.
Or you could start throwing critical exceptions. Surely, an access violation exception will _catch_ your users' attention.
Using SMO/DMO, it isn't too difficult to generate a script of your schema. Data is a little more fun, but still doable. In general, I take "Script It" approach, but you might want to consider something along these lines: - Distinguish between Development and Staging, such that you can Develop with a subset of data ... this I would create a tool to simply pull down some production data, or generate fake data where security is concerned. - For team development, each change to the database will have to be coordinated amongst your team members. Schema and data changes can be intermingled, but a single script should enable a given feature. Once all your features are ready, you bundle these up in a single SQL file and run that against a restore of production. - Once your staging has cleared acceptance, you run the single SQL file again on the production machine. I have used the Red Gate tools and they are **great** tools, but if you can't afford it, building the tools and working this way isn't too far from the ideal.
@Larsenal If you want to branch outside of .NET there has been a lot of discussion about Intel's [Threading Building Blocks][1] which is a parallel library for C++. [1]: http://www.threadingbuildingblocks.org/
What is the best way to handle multiple permission types?
|sql|permissions|
I often encounter the following scenario where I need to offer many different types of permissions. I primarily use ASP.NET / VB.NET with SQL Server 2000. **Scenario** I want to offer a dynamic permission system that can work on different parameters. Let's say that I want to give either a department or just a specific person access to an application. And pretend that we have a number of applications that keeps growing. In the past, I have chosen one of the following two ways that I know to do this. 1. Use a single permission table with special columns that are used for determining a how to apply the parameters. The special columns in this example are TypeID and TypeAuxID. The SQL would look something like this. > SELECT COUNT(PermissionID) > FROM application_permissions > WHERE > (TypeID = 1 AND TypeAuxID = @UserID) OR > (TypeID = 2 AND TypeAuxID = @DepartmentID) > AND ApplicationID = 1 2. Use a mapping table for each type of permission, then joining them all together. > SELECT COUNT(perm.PermissionID) > FROM application_permissions perm > LEFT JOIN application_UserPermissions emp ON perm.ApplicationID = emp.ApplicationID > LEFT JOIN application_DepartmentPermissions dept ON perm.ApplicationID = dept.ApplicationID > WHERE q.SectionID=@SectionID > AND (emp.UserID=@UserID OR dept.DeptID=@DeptID OR (emp.UserID IS NULL AND dept.DeptID IS NULL)) > AND ApplicationID = 1 > ORDER BY q.QID ASC **My Thoughts** I hope that the examples make sense. I cobbled them together. The first example requires less work, but neither of them feel like the best answer. Is there a better way to handle this?
For my big apps I just use a incrementing version number id (1.0, 1.1, ...) that i store in a comment of the main file (usually index.php).<Br /> For just websites I usually just have a revision number (1,2,3,...).
Writing a game for the Nintendo Wii
|wii|
I'd like to write a game for the Nintendo Wii (I'm most interested in writing something that uses the wii balance board for the purpose of physiotherapy). How do I go about obtaining an SDK and/or any other tools necessary for writing a game?
I'd like to write a game for the Nintendo Wii. How do I go about obtaining an SDK and/or any other tools necessary for writing a game?
Because you want the *capability* of being able to distribute the layers onto different physical tiers (I always use "tier" for physical, and "layer" for logical), you should think twice before just putting everything into one class because you've got major refactorings to do if or when you do need to start distributing.
You could do that, but if that files are binary you should always put a lock on it before editing. You won't get a conflict (which would be unresolvable).
You can, but you will allways compare the document versions with Word itself. I haven't heard a version control database which can track changes in Word documents. However there are some tools which can compare Word documents, so if you set up your version control client to use these tools for comparison, you can have some fun.
Java return copy
|java|
In Java, say you have a class that wraps an ArrayList (or any collection) of objects. How would you return one of those objects such that the caller will not see any future changes to the object made in the ArrayList? i.e. you want to return a deep copy of the object, but you don't know if it is cloneable.
Default Routes
|networking|tcp|
I use my mobile phone for connection to the internet on my laptop, I also have a wired connection to a LAN which doesn't have internet conectivity, it just has our TFS server on it. The problem is that I can't use the internet (from the phone) with the LAN cable plugged in. Is there a way to set the default route to my phone?
I use my mobile phone for connection to the internet on my laptop, I also have a wired connection to a LAN which doesn't have internet conectivity, it just has our TFS server on it. The problem is that I can't use the internet (from the phone) with the LAN cable plugged in. Is there a way to set the default route to my phone? I'm running Windows XP.
Not necessarily. It depends on how often the new files are committed to the repo. If the files are edited several times before a commit, then you're precisely where you are now. The biggest benefit is if the file becomes corrupted. You can version any file; this is how Time Machine in Mac OS X Leopard works, for example, and there is an interesting article by someone who committed his entire computing environment into CVS and then just maintained working copies on his home and work machines. But "better" and "easier" are specific to your situation, and I'm not sure I completely understand your problem as things stand.
<a href="http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress()"> java.net.NetworkInterface.getHardwareAddress</a> http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress() (stackoverflow keeps breaking the URL) It has to be called on the machine you are interested in - the MAC is not transferred across network boundaries (i.e. LAN and WAN). If you want to make use of it on a website server to interrogate the clients, you'd have to run an applet that would report the result back to you.
<a href="http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress()"> java.net.NetworkInterface.getHardwareAddress</a> (method added in Java 6) http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress() (stackoverflow keeps breaking the URL) It has to be called on the machine you are interested in - the MAC is not transferred across network boundaries (i.e. LAN and WAN). If you want to make use of it on a website server to interrogate the clients, you'd have to run an applet that would report the result back to you. For Java 5 and older I found code <a href="http://forums.sun.com/thread.jspa?messageID=3424868#4204392">parsing output of command line tools on various systems</a>.
<a href="http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress%28%29"> java.net.NetworkInterface.getHardwareAddress</a> (method added in Java 6) It has to be called on the machine you are interested in - the MAC is not transferred across network boundaries (i.e. LAN and WAN). If you want to make use of it on a website server to interrogate the clients, you'd have to run an applet that would report the result back to you. For Java 5 and older I found code <a href="http://forums.sun.com/thread.jspa?messageID=3424868#4204392">parsing output of command line tools on various systems</a>.
It is tremendously rare for a re-write of anything complex to succeed. It's tempting, but a low percentage strategy. Get legacy code under unit tests and refactor it, and/or completely replace small portions of it incrementally when opportune.
It is rare for a re-write of anything complex to succeed. It's tempting, but a low percentage strategy. Get legacy code under unit tests and refactor it, and/or completely replace small portions of it incrementally when opportune.
@levand: > My actual preference, as a user, in these situations is to download a lightweight .exe file that downloads the file for you. That's a dealbreaker for many, many sites. Users either are or *should be* extremely reluctant to download .exe files from websites and run them willy-nilly. Even if they're not always that cautious, incautious behaviour is **not** something we should encourage as responsible developers. If you're working on something along the lines of a company intranet, a .exe is potentially an okay solution, but for the public web? No way. @TonyB: > What is the best way to do this without using FTP. I'm sorry, but I have to ask why the requirement. Your question reads to me along the lines of "what's the best way to cook a steak without any meat or heat source?" FTP was *designed* for this sort of thing.
Can you use memory or a database to maintain *any* information about the user or request at all? If so, then on request for the form, I would include a hidden form field whose contents are a randomly generated number. Save this token to in application context or some sort of store (a database, flat file, etc.) when the request is rendered. When the form is submitted, check the application context or database to see if that randomly generated number is still valid (however you define valid - maybe it can expire after X minutes). If so, remove this token from the list of "allowed tokens". Thus any replayed requests would include this same token which is no longer considered valid on the server.
// generate a random number starting with 5 and less than 15 Random r = new Random(); int num = r.Next(5, 15); For doubles you can replace Next with NextDouble
System.Random r = new System.Random(); double rnd( double a, double b ) { return a + r.NextDouble()*(b-a); }
Custom titlebars/chrome in a WinForms app
|.net|winforms|user-interface|windows-xp|
I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked. Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accomplish this from WinForms would be to create a borderless form and draw the caption bar/buttons yourself, then overriding <code>WndProc</code> to make sure moving, resizing, and button clicks do what they're supposed to do (I'm not clear on the specifics but could probably pull it off given a day to read documentation.) I'm curious if there's a different, easier way that I'm overlooking. Perhaps some API calls or window styles I've overlooked?
I'm almost certain I know the answer to this question, but I'm hoping there's something I've overlooked. Certain applications seem to have the Vista Aero look and feel to their caption bars and buttons even when running on Windows XP. (Google Chrome and Windows Live Photo Gallery come to mind as examples.) I know that one way to accomplish this from WinForms would be to create a borderless form and draw the caption bar/buttons yourself, then overriding <code>WndProc</code> to make sure moving, resizing, and button clicks do what they're supposed to do (I'm not clear on the specifics but could probably pull it off given a day to read documentation.) I'm curious if there's a different, easier way that I'm overlooking. Perhaps some API calls or window styles I've overlooked? I believe Google has answered it for me by using the roll-your-own-window approach with Chrome. I will leave the question open for another day in case someone has new information, but I believe I have answered the question myself.
I'm still researching this option for one of my own projects, but [CouchDB][1] may be worth a look. [1]: http://incubator.apache.org/couchdb/
why are you wasting time emulating something that the filesystem should be able to handle? more storage + grep is your answer.
If you are taking a 'fill in the blank' approach, you can precisely position text anywhere you want on the page. So it's relatively easy (if not a bit tedious) to add the missing text to the document. For example with Zend Framework: <?php require_once 'Zend/Pdf.php'; $pdf = Zend_Pdf::load('blank.pdf'); $page = $pdf->pages[0]; $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page->setFont($font, 12); $page->drawText('Hello world!', 72, 720); $pdf->save('zend.pdf'); If you're trying to replace inline content, such as a "[placeholder string]," it gets much more complicated. While it's technically possible to do, you're likely to mess up the layout of the page. A PDF document is comprised of a set of primitive drawing operations: line here, image here, text chunk there, etc. It does not contain any information about the layout intent of those primitives.
This looks like it may be a good option for you: <http://www.codeplex.com/DotNetZip>. It seems small, has source and has a very open license (MS-PL).
one of my application's emails was constantly being tagged as spam. it was html with a single link, which i sent as html in the body with a text/html content type. my most successful resolution to this problem was to compose the email so it looked like it was generated by an email client. i changed the email to be a multipart/alternative mime document and i now generate both text/plain and text/html parts. the email no longer is detected as junk by outlook.
I wrote a [script](http://pastebin.com/f6f379371) using the built-in [Tokenizer](http://au.php.net/manual/en/ref.tokenizer.php) functions. Its pretty rough but it worked for the code base I was working on. I believe you could also use [CodeSniffer](http://pear.php.net/manual/en/package.php.php-codesniffer.php).
We use Selenium Core, but are switching gradually to Selenium RC which is much nicer and easier to manage. We have written lots of custom code to make the tests run on our Continuous Integration servers, some of them in parallel suites to run faster. One thing you'll find is that Selenium seems to restart the browser for each test (you can set it not to do this, but we got memory problems when we did that). This can be slow in Firefox, but is not too bad in IE (one time I'm thankful for Bill Gates's OS integraion).
We are using QuickTestPro. So far it is effective, but the browser selection is limited. The nicest part is the ability to record your browser's activity, and convert it into a scriptable set of steps. There is also a nice .Net addin so if you have any validation code you need to do for the different stages of your test, you can write methods in an assembly and call them from your script.
What we have done at my work is have a library the provides functions such as checking if the user is logged in. For example: <?php require_once 'Auth.php'; // output some html if (isLoggedIn()) { echo 'html for logged in user'; } // rest of html For pages that only authenicated users should see, the controller checks if they are logged in and if not it redirects them to the login page. <?php public function viewCustomer($customerId) { if (!isLoggedIn()) redirectToLoginPage(); }
What is the best way to draw skinnable "buttons" in XNA game application
|xna|button|skins|
I'm looking for ideas on how to draw a skinnable "button" in a game application. If I use a fixed sprite non-vector image for the button background, then I can't size the button easily. If I write code to draw a resizable button (like Windows buttons are drawn), then the programmer has to get involved -- and it makes skinning difficult. Another option is to break the button into 9 smaller images (3x3) and stretch them all -- kindof like rounded corners are done in HTML. Is there another "easier" way? What's the best approach?
What is the best way to draw skinnable "buttons" in a video game?
@ceejayoz I totally agree but its part of the requirement for our client. There will be FTP access but each user will have the option of downloading via HTTP or FTP. There are some users that will be behind corporate firewalls that don't permit FTP I have seen other sites do this in the past (MSDN, Adobe) so I was hoping there is something out there already instead of having to make one in house (and learning java and/or ActiveX)
I've built my own simple object for this, i get alot or reuse out of it, i can wrap it with a cmdline, web page, webserice, write output to a file, etc--- the commented items contain some rsync examples-- what i'd like to do sometime is embed rsync (and cygwin) into a resource & make a single .net executable out of it-- Here you go: Imports System.IO Namespace cds Public Class proc Public _cmdString As String Public _workingDir As String Public _arg As String Public Function basic() As String Dim sOut As String = "" Try 'Set start information. 'Dim startinfo As New ProcessStartInfo("C:\Program Files\cwRsync\bin\rsync", "-avzrbP 192.168.42.6::cdsERP /cygdrive/s/cdsERP_rsync/gwy") 'Dim startinfo As New ProcessStartInfo("C:\Program Files\cwRsync\bin\rsync", "-avzrbP 10.1.1.6::user /cygdrive/s/cdsERP_rsync/gws/user") 'Dim startinfo As New ProcessStartInfo("C:\windows\system32\cscript", "//NoLogo c:\windows\system32\prnmngr.vbs -l") Dim si As New ProcessStartInfo(_cmdString, _arg) si.UseShellExecute = False si.CreateNoWindow = True si.RedirectStandardOutput = True si.RedirectStandardError = True si.WorkingDirectory = _workingDir ' Make the process and set its start information. Dim p As New Process() p.StartInfo = si ' Start the process. p.Start() ' Attach to stdout and stderr. Dim stdout As StreamReader = p.StandardOutput() Dim stderr As StreamReader = p.StandardError() sOut = stdout.ReadToEnd() & ControlChars.NewLine & stderr.ReadToEnd() 'Dim writer As New StreamWriter("out.txt", FileMode.CreateNew) 'writer.Write(sOut) 'writer.Close() stdout.Close() stderr.Close() p.Close() Catch ex As Exception sOut = ex.Message End Try Return sOut End Function End Class End Namespace
I'm not sure what you mean by disconnected from the database. It appears that you are trying to insert a new row into the LinqEntities table -- is that correct? If that is the case you'll want to do context.LinqEntities.InsertOnSubmit(item); context.Submit();
[TINI][1] is a java ethernet controller, which may have libraries and classes for directly accessing data from ethernet frames to TCP streams. You may be able to find something in there that implements your needed classes. If not, there should be pointers or user groups that will give you a head start. -Adam [1]: http://www.maxim-ic.com/products/microcontrollers/tini/
CREATE DATABASE works
It seems that this is not possible. From the [documentation][1]: > Only one instance of an AIR application is started. When an already running application is invoked again, AIR dispatches a new invoke event to the running instance. It also gives a possible workaround: > It is the responsibility of an AIR to respond to an invoke event and take the appropriate action (such as opening a new document window). There is [already a bug][2] related to this on the bugtracker, but it is marked closed with no explicit resolution given... [1]: http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html [2]: http://bugs.adobe.com/jira/browse/SDK-12915
Security implications of multi-threaded javascript
|javascript|
Reading through [this question][1] on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thread after thread in an attempt to overwhelm the operating system or interpreter and trigger entrance into "undefined behavior land", or is it pretty much a non-issue? Any other ways in which an attack might exploit a hypothetical implementation of javascript that supports threads that a non-threading implementation would be immune to? [1]: http://stackoverflow.com/questions/39879/why-doesnt-javascript-support-multithreading
|javascript|multithreading|
Reading through [this question][1] on multi-threaded javascript, I was wondering if there would be any security implications in allowing javascript to spawn mutliple threads. For example, would there be a risk of a malicious script repeatedly spawning thread after thread in an attempt to overwhelm the operating system or interpreter and trigger entrance into "undefined behavior land", or is it pretty much a non-issue? Any other ways in which an attack might exploit a hypothetical implementation of javascript that supports threads that a non-threading implementation would be immune to? **Update:** Note that locking up a browser isn't the same as creating an undefined behavior exploit. [1]: http://stackoverflow.com/questions/39879/why-doesnt-javascript-support-multithreading
You might want to add a way to do a map but return a new list, instead of working on the list passed in (and returning the list can prove useful to chain other operations)... perhaps an overloaded version with a boolean that indicates if you want to return a new list or not, as such: public static List<T> Transform<T>(this List<T> list, TransformFunction<T> f, params object [] args) { return Transform(list, f, false, args); } public static List<T> Transform<T>(this List<T> list, TransformFunction<T> f, bool create, params object [] args) { // Add code to create if create is true (sorry, // too lazy to actually code this up) foreach(var t in list) f(t,args); return list; }
(hint: formatting in your question) I'm not understanding what's wrong with a mailto link or a formmail-type page.
You do not need to do `button.value = password;` since reading the value does not change it. I'm not sure why it's being cleared, maybe JavaScript does not allow password field values to be modified.
My preference would be to store the document with the metadata. One reason, is relational integrity. You can't easily move the files or modify the files without the action being brokered by the db. I am sure I can handle these problems but it isn't as clean as I would like and my experience has been that most vendors can handle huge amounts of binary data in the database these days. I guess I was wondering if PostgreSQL or MySQL have any obvious advantages in these areas, I am primarily familiar with Oracle. Anyway, thanks for the response, if the DB knows where the external file is it will also be easy to bring the file in at a later date if I want. Another aspect of the question was if either database is easier to work with when using Python. I'm assuming that is a wash.
Hey Re0sless, when you remove those items from the stage do they have any event listeners attached to them, any timers or loaders? Any of those things can make an object stick around in flash's memory and not remove properly. Also on top of just removing the item, perhaps try nulling it as well? Sometimes that helps in clearing out its references so it can be properly destroyed. Of course it could also be something silly like removing the item at one instance doesn't remove the item from future frames as well, but I really don't think that's the case.
Is there a database for your music library? If there is any server code that runs when downloading the mp3 then you can add extra code there to increment the play count. You could also have javascript make a second request to increment the play count, but this could lead to people/robots falsely incrementing counts. I used to work for an internet-radio site and we used separate tables to track the time every song was played. Our streams were powered by a perl script running icecast, so we triggered a database request every time a new track started playing. Then to compute the play count we would run a query to count how many times a song's id was in the play log.
It sounds that you're doing a request to the server on each click, the password box being reset in each page load is typical behavior of the browsers.
You didn't say you were using ASP.NET, but... By design, ASP.NET clears during postback the value of TextBox controls whose Mode is Password. I work around this in a subclass with the following code: <pre> // If the TextMode is "password", the Text property won't work if ( TextMode == System.Web.UI.WebControls.TextBoxMode.Password ) Attributes[ "value" ] = stringValue; </pre>
If everyone in the company uses Outlook, then just using a standard "mailto" link should always open Outlook. It sounds like you're over-engineering this.
Do you want to open an existing E-Mail or create a new one? Perhaps I misunderstand your question, but you can provide a link like mailto:recipient@email.tld?subject=This%20is%20the%20subject&body=Hello%20there! When the user clicks on that a link, a new Outlook-E-Mail will be opened and the recipient is recipient@email-tld, the subject is "This is the subject" and the body is "Hello there!". All these fields are already filled from the link.
Not much of a feature, but **`goto`** is a reserved word that does nothing except prompting javac to poke you in the eye. Just to remind you that you are in OO-land now.
Not really a feature, but it makes me chuckle that **`goto`** is a reserved word that does nothing except prompting javac to poke you in the eye. Just to remind you that you are in OO-land now.
"We don't like the common GUI toolkits or widgets. We want something that has more of the look of a game than of a dialog box." You realize that Trolltech's QT has a style sheet language for widgets? Take a look at their white paper, specifically page 60 http://trolltech.com/pdf/qt43-whitepaper-us.pdf Going over your other requirements: * portable to Linux Yes. Also supports Windows, Mac, and embedded environments. * some sort of "editor" that would allow us to lay out screens without hard-coding locations of elements in code Qt's Designer is a very nice tool. I use it all the time. * animation Qt supports this. * we need to be able to overlay video Qt supports this. * not resource intensive (these terminals don't have a lot of memory or CPU) This might be the fly in the ointment. You could check out Qt's embedded option. I've never used that myself. * we're currently using C++, so management would prefer that, but other languages would be considered Qt is for C++ and works with all major compilers. * We'd prefer a free, open-source solution, but would be willing to buy something if it is not too expensive. (We have a couple dozen developers, and tens of thousands of terminals deployed.) Qt has both open-source and closed source options.
I say click-once installed download manager, similar to msdn. But becoming a CDN without a more optimized protocol for the job is no easy task. I can't imagine a business model that can be worthwhile enough to have such large file downloads as a core competency unless you are doing something like msdn. If you create a thick client, you at least get the chance to get some more face time with the users, for advertising or some other revenue model, since you will probably be paying in the hundreds of thousands of dollars to host such a service.
I've had the best luck with Bazaar, followed by Mercurial. Never could get Git to work correctly. A quick search shows that Git still requires clunky emulation layers like Cygwin/MSYS, and I can't find any integration tools like TortoiseBzr for Git. With Mercurial in Windows, I had several minor issues (insensitive paths, symlinks, ). They were usually fixed eventually, but I felt that the same quality of testing was not applied to running on Windows as for the other platforms. Bazaar also had better documentation for integrating with native applications like Visual C.