instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
UIWebView is fine for displaying HTML, but I'd like to modify the loaded DOM from my Objective-C program. Does anybody know how to do that? This is a third party page, so I can't really include any custom JS to do so...unless I can modify the DOM somehow.
stackexchange/codereview
For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages?
stackexchange/codereview
My company is looking to start distributing some software we developed and would like to be able to let people try the software out before buying. We'd also like to make sure it can't be copied and distributed to our customers' customers. One model we've seen is tying a license to a MAC address so the software will on...
stackexchange/codereview
Does the latest version of the enterprise library (http://msdn.microsoft.com/en-us/library/cc512464.aspx) come with the updater application block?
stackexchange/codereview
Using VC2005, I have 3 projects to build: libA (contains a typelib, results in libA.dll): IDL has a line library libA { ... libB (contains a typelib importing libA, results in libB.dll): IDL has a line importlib( "libA " ); libC (imports libB): one of the source files contains #import <libB.dll> the #import <libB.d...
stackexchange/codereview
I have an assembly, written in C++\CLI, which uses some of enumerations, provided by .Net. It has such kind of properties: property System::ServiceProcess::ServiceControllerStatus ^ Status { ServiceControllerStatus ^ get() { return (ServiceControllerStatus)_status->dwCurrentState; } ...
stackexchange/codereview
Suppose that the ApplicationSettings class is a general repository of settings that apply to my application such as TimeoutPeriod, DefaultUnitOfMeasure, HistoryWindowSize, etc... And let's say MyClass makes use of one of those settings - DefaultUnitOfMeasure. My reading of proper use of Inversion of Control Containers...
stackexchange/codereview
How can you check if a string is a valid GUID in vbscript? Has anyone written an IsGuid method?
stackexchange/codereview
I want to save the objects I generated in a program. After restart the App should load automaticly all Objects in an Array. I want to write them in a file and parse them after restart. Are the other smarter possibilities than do it by hand? Thank you
stackexchange/codereview
This is related to the accepted answer for What’s your #1 way to be careful with a live database? Suppose you create a temp table for backup purpose and make your changes in the original. The changes break the system and you want to restore the backup. In the meantime some other records have also changed in the origina...
stackexchange/codereview
To pop up the UAC dialog in Vista when writing to the HKLM registry hive, we opt to not use the Win32 Registry API, as when Vista permissions are lacking, we'd need to relaunch our entire application with administrator rights. Instead, we do this trick: ShellExecute(hWnd, "runas" /* display UAC prompt on Vista */, wind...
stackexchange/codereview
What role is Spring taking in Struts + Spring + Hibernate?
stackexchange/codereview
I am not new to *nix, however lately I have been spending a lot of time at the prompt. My question is what are the advantages of using KornShell (ksh) or Bash Shell? Where are the pitfalls of using one over the other? Looking to understand from the perspective of a user, rather than purely scripting.
stackexchange/codereview
Typically I use E_ALL to see anything that PHP might say about my code to try and improve it. I just noticed a error constant E_STRICT, but have never used or heard about it, is this a good setting to use for development? The manual says: Run-time notices. Enable to have PHP suggest changes to your code which will ens...
stackexchange/codereview
I am building my first report in BIRT. Very quickly I ran into a problem in which I wanted to display some text or data based on an expression that included data from two different tables (not tables that can/should be joined - (hypothetically example- take a student's ACT score from his record in the student table and...
stackexchange/codereview
I would like to distribute my .NET programs without the .NET framework. Is it possible to compile a .NET program to machine code?
stackexchange/codereview
Does anyone have an idea how long it will take before "almost all" widely used Python libraries work with Python 3.0? I am planning to stay on 2.X for a while because I don't want to start porting stuff over and then find that some library I already rely on or a new library I might start using doesn't work yet with py3...
stackexchange/codereview
On some Microsoft Access queries, I get the following message: Operation must use an updatable query. (Error 3073). I work around it by using temporary tables, but I'm wondering if there's a better way. All the tables involved have a primary key. Here's the code: UPDATE CLOG SET CLOG.NEXTDUE = ( SELECT H1.paidth...
stackexchange/codereview
In this article Jeroen explains an example of using an XML file to remap Java Bean getters and setters to .NET Properties. What would the XML file look like if I wanted to, say, remap a Java method called showDialog() to ShowDialog() in .NET? Has anyone worked with the remapping option before? Any idea where to get inf...
stackexchange/codereview
I have searched the forum, and google for this topic. Most of the articles are talking about using JSON to call the controller/action on the server and do ajax effect on the result. I am trying to use some very basic JQuery features, like the JQuery UI/Tabs, and JQuery UI/Block for a dialog window. I cannot get these s...
stackexchange/codereview
I would like to use the task-list in Visual Studio but it really lacks almost any useful feature a task-list should provide. So I use Todo-List externally, to keep track of the things I need to get done. Would be nice to have it all in one place. So does anyone know of a cool replacement Add-On for the tasklist in Visu...
stackexchange/codereview
At the moment, I am doing a number of searches which include "html" in them, for example "html rearrange". Unfortunately, I get a lot of hits from sites that include "rearrange" on a .html page but have no mention of html in the page itself. Is there a way to prevent search terms from matching urls?
stackexchange/codereview
Most languages (Ruby included) allow number literals to be written in at least three bases: decimal, octal and hexadecimal. Numbers in decimal base is the usual thing and are written as (most) people naturally write numbers, 96 is written as 96. Numbers prefixed by a zero are usually interpreted as octal based: 96 woul...
stackexchange/codereview
I know how to change the schema of a table in SQL server 2005: ALTER SCHEMA NewSchama TRANSFER dbo.Table1 But how can i check and/or alter stored procedures that use the old schema name? Sorry: I mean: There are stored procedures that have the old schema name of the table in the sql of the stored procedure... How can ...
stackexchange/codereview
Does anybody know if there is a feasible way on Windows XP to programmatically create and configure a user account so that after logging in from the console (no terminal services) a specific app is launched and the user is "locked" to that app ? The user should be prevented from doing anything else with the system (e.g...
stackexchange/codereview
Ideally something that will work with Oracle, MS SQL Server, MySQL and Posgress.
stackexchange/codereview
I was trying to remove all the lines of a file except the last line but the following command did not work, although file.txt is not empty. $cat file.txt |tail -1 > file.txt $cat file.txt Why is it so?
stackexchange/codereview
We have a customer requesting data in XML format. Normally this is not required as we usually just hand off an Access database or csv files and that is sufficient. However in this case I need to automate the exporting of proper XML from a dozen tables. If I can do it out of SQL Server 2005, that would be preferred. How...
stackexchange/codereview
This is a sample (edited slightly, but you get the idea) of my XML file: <HostCollection> <ApplicationInfo /> <Hosts> <Host> <Name>Test</Name> <IP>192.168.1.1</IP> </Host> <Host> <Name>Test</Name> <IP>192.168.1.2</IP> </Host> </Hosts> </HostCollection> When my application ...
stackexchange/codereview
How do you manipulate GUID's when doing Windows programming in C or C++?
stackexchange/codereview
In Java you can do File.listFiles() and receive all of the files in a directory. You can then easily recurse through directory trees. Is there an analogous way to do this in Python?
stackexchange/codereview
Let me first say that being able to take 17 million records from a flat file, pushing to a DB on a remote box and having it take 7 minutes is amazing. SSIS truly is fantastic. But now that I have that data up there, how do I remove duplicates? Better yet, I want to take the flat file, remove the duplicates from the fla...
stackexchange/codereview
I have a file that lists filenames, each on it's own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be mshta.dll foobar.dll somethingelse.dll The directory I'm interested in is X:\Windows\System32\, so I want to see if the following files exist: X:\W...
stackexchange/codereview
Any code I've seen that uses Regexes tends to use them as a black box: Put in string Magic Regex Get out string This doesn't seem a particularly good idea to use in production code, as even a small change can often result in a completely different regex. Apart from cases where the standard is permanent and unchanging...
stackexchange/codereview
if I call php's parse_ini_file("foo.ini"), in what paths does it look for foo.ini ? the include path? the function's documentation doesn't mention it.
stackexchange/codereview
Running sp_attach_single_file_db gives this error: The log scan number (10913:125:2) passed to log scan in database 'myDB' is not valid Isn't it supposed to re-create the log file? How else would I be able to attach/repair that .mdf file?
stackexchange/codereview
Since I upgraded to Visual Studio 2008 from vs2005, I have found a very annoying behaviour when debugging large projects. If I attempt to step into inline code, the debugger appears to lock up for tens of seconds. Each time that I step inside such a function, there is a similar pause. Has anyone experienced this and...
stackexchange/codereview
I am writing a web server in Java and I want it to support HTTP 1.1 Keep-Alive connections. But how can I tell when the client is done sending requests for a given connection? (like a double end-of-line or something). Lets see how stackoverflow handles this very obscure question -- answers for which, on Google, are mi...
stackexchange/codereview
I work on an application that uses DCOM to communicate between what are essentially several peers; in the course of normal use, instances on separate machines serve a variety of objects to one another. Historically, for this to work we have used some magic incantations, chief among which is that on every machine the u...
stackexchange/codereview
I'm looking for sources of inspiration and/or design patterns for navigation 'breadcrumbs'. So far I have found the breadcrumb collection on Pattern Tap. Does anyone know of any other sources?
stackexchange/codereview
I need to find out time taken by a function in my application. Application is a MS VIsual Studio 2005 solution, all C code. I used thw windows API GetLocalTime(SYSTEMTIME *) to get the current system time before and after the function call which I want to measure time of. But this has shortcoming that it lowest resolu...
stackexchange/codereview
I have read on Stack Overflow some people that have converting to C#2.0 to C#3, but is it really worth it? I have a project that is done at 75% before going in maintenance phase. I am asking to myself if it is worth it to switch to C#3.0? Update: The project will have a web interface now so before entering the maintena...
stackexchange/codereview
I realize that since UNIX sockets are platform-specific, there has to be some non-Java code involved. Specifically, we're interested in using JDBC to connect to a MySQL instance which only has UNIX domain sockets enabled. It doesn't look like this is supported, but from what I've read it should be at least possible ...
stackexchange/codereview
I have a somewhat messily-formatted Objective-C code base. Is there a way to have Xcode reformat an entire project to conform to a coding standard (i.e., properly indent, spaces v. tabs, etc.)? Are there other tools that might accomplish this?
stackexchange/codereview
Publishing and/or collaborative applications often involve the sharing of access to resources. In a portal a user may be granted access to certain content as a member of a group or because of explicit access. The complete set of content could include public content, group membership content, and private user content. O...
stackexchange/codereview
I am trying to compile my apps (which uses 3rd party libraries) for the x64 platform. However selecting x64 from Build Configuration Manager from my VS2008 Pro doesn't seem to work. The binary does get created but my client wasn't able to get it to run on x64. I wonder if the 3rd party DLLs could be the cause. Anyone ...
stackexchange/codereview
This might sound like a little bit of a crazy question, but how can I find out (hopefully via an API/registry key) the install time and date of Windows? The best I can come up with so far is to look at various files in C:\Windows and try to guess... but that's not exactly a nice solution.
stackexchange/codereview
I use FB1.5.3 and need to eventually add some FK to the database. It happens that if I try to do it while anyone else is connected to the DB I get an exception. Is there a way to add an FK while the system is running?
stackexchange/codereview
This has been an adventure. I started with the looping duplicate query located in my previous question, but each loop would go over all 17 million records, meaning it would take weeks (just running *select count * from MyTable* takes my server 4:30 minutes using MSSQL 2005). I gleamed information from this site and at ...
stackexchange/codereview
How to get the checked option in a group of radio inputs with JavaScript?
stackexchange/codereview
I've found jCache and some other home-grown methods using associative arrays. If you've had experience with jCache, were there any limitations?
stackexchange/codereview
I have a FinalBuilder project where I deploy an ASP.Net website to a remote folder, configured as a website in IIS. As part of my build script, I want to use the FinalBuilder action HTTP Get File to help determine whether my deployment was succesful. I'm having difficulty, because the website is configured (under IIS 6...
stackexchange/codereview
Does anyone know how to resize images proportionally using JavaScript? I have tried to modify the DOM by adding attributes height and width on the fly, but seems did not work on IE6.
stackexchange/codereview
I'm developing an application targeting .NET Framework 2.0 using C# for which I need to be able to find the default application that is used for opening a particular file type. I know that, for example, if you just want to open a file using that application you can use something like: System.Diagnostics.Process.Start( ...
stackexchange/codereview
I am developing a collection of plugins on Eclipse 3.4 (official) on both mac and a PC. At present (I'm aware it is not the best practice) some of my common plugins export all of their packages. The problem is this: many of the listed packages are empty because subpackages are not, for example: prefix.core may be empt...
stackexchange/codereview
Ok I followed the steps for setting up ruby and rails on my Vista machine and I am having a problem connecting to the database. Contents of database.yml development: adapter: sqlserver database: APPS_SETUP Host: WindowsVT06\SQLEXPRESS Username: se Password: paswd Run rake db:migrate from myapp directory ----...
stackexchange/codereview
People also often ask "How can I compile Perl?" while what they really want is to create an executable that can run on machines even if they don't have Perl installed. There are several solutions, I know of: perl2exe of IndigoStar It is commercial. I never tried. Its web site says it can cross compile Win32, Linux, an...
stackexchange/codereview
Let say that I have a website with some information that could be access externally. Those information need to be only change by the respected client. Example: Google Analytic or WordPress API key. How can I create a system that work like that (no matter the programming language)?
stackexchange/codereview
The code is return min + static_cast<int>(static_cast<double>(max - min + 1.0) * (number / (UINT_MAX + 1.0))); number is a random number obtained by rand_s. min and max are ints and represent minimum and maximum values (inclusive). If you provide a solution not using unsigned int as a number, please also explain how...
stackexchange/codereview
I was browsing Scott Hanselman's Developer Interview question list, and ran across this question: What is wrong with DateTime.Parse(myString)? While I know there are inherent risks in parsing a string of unknow format or origin, are there other reasons? Is it to use DateTime.ParseExact instead? Should it be myStrin...
stackexchange/codereview
Can I, using an address found in a map file, use windbg to alter a variable in memory while the app is running? I'm really interested in turning on/off functionality in run-time maybe with a variable. How would you do this? Does it require breaking the app through the debugger?
stackexchange/codereview
Does anyone know of a good example implementation of the Service Location Protocol that can be build/ran on a windows box?
stackexchange/codereview
I am building an application where a page will load user controls (x.ascx) dynamically based on query string. I have a validation summary on the page and want to update it from the User Controls. This will allow me to have multiple controls using one Validation Summary. How can I pass data between controls and pages. ...
stackexchange/codereview
I am writing a page where I need an HTML table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter how many rows are added to the table. Think a mini version of excel. This seems like a simple task but almost every solut...
stackexchange/codereview
That's the question. Give only one reason you think why have OODB failed or why many systems nowadays still use relational databases.
stackexchange/codereview
I would like to update a Windows Forms application to provide the following features: spell checking limited formatting of text: bold, italics, bulleted lists Ideally the formatted text could be accessed in a plain text way for reporting through tools that don't support the formatting, but could also be rendered as H...
stackexchange/codereview
We have recently moved back to InstallShield 2008 from rolling our own install. So, I am still trying to get up the learning curve on it. We are using Firebird and a usb driver, that we couldn't find good msi install solutions. So, we have a cmd line to install firebird silently and the usb driver mostly silently. We ...
stackexchange/codereview
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation fault ruby 1.8.6 (2008-03-03) [x86_64-linux] I am running a 64-bit version of Novell OpenSUSE 11 with DKE4 and Qt
stackexchange/codereview
The FILETIME structure counts from January 1 1601 (presumably the start of that day) according to the Microsoft documentation, but does this include leap seconds?
stackexchange/codereview
I seek an algorithm that will let me represent an incoming sequence of bits as letters ('a' .. 'z' ), in a minimal matter such that the stream of bits can be regenerated from the letters, without ever holding the entire sequence in memory. That is, given an external bit source (each read returns a practically random bi...
stackexchange/codereview
How do they compare to the DevXpress ones or the original MSOffice ones. Are they worth investing time in them (for practical usage now, not academic curiosity which I'll do anyway)?
stackexchange/codereview
If you were the administrator of an Apache web server, what protocol(s) would you prefer to provide, for the web developers to upload static files (html/gif/css/...), with the goal of maximum security ? If you were the web developer/graphic designer, what protocols would you prefer to be available at the Apache server,...
stackexchange/codereview
I have a web site using apache httpd as the server and mysql as the backend. It publishes a "thought for the day" that has gotten so popular that the server is crashing due to the number of requests. Since the same page is been requested (the thought only changes once a day), is it possible to put a caching server in f...
stackexchange/codereview
I'm wondering how you would go about designing a good permgen space string in Java. Based on my research and understanding I've come up with the following: example: JAVA_OPTS='-Xmx512m -XX:MaxPermSize=256m -server -Djava.awt.headless=true' Sorry the example didn't paste when I first posted the question......
stackexchange/codereview
Back in VB6, I wrote a few functions that would let me code without having to care about the difference between null and '' for strings, null and 0 for numbers, etc. Nothing kills my productivity more when coding than having to add special case code for dealing with data that might cause some irrelevant error; 9999/10...
stackexchange/codereview
[NOTE: This questions is similar to but not the same as this one.] Visual Studio defines several dozen "Macros" which are sort of simulated environment variables (completely unrelated to C++ macros) which contain information about the build in progress. Examples: ConfigurationName Release TargetPath ...
stackexchange/codereview
I love writing my own web-based applications, but don't want to succumb to the not invented here syndrome. So before I go write this myself, I'm looking for solutions that either do this, or perhaps frameworks (like Django or Joomla, etc.) that give me a starting point fairly close to what I need. My company produces...
stackexchange/codereview
I've never used CI tools before, but from what I've read, I'm not sure it would provide any benefit to a solo developer that isn't writing code every day. First - what benefits does CI provide to any project? Second - who should use CI? Does it benefit all developers?
stackexchange/codereview
The GoDiagram object model has a GoDocument. GoViews have a reference to a GoDocument. If the user does any modification on the diagramming surface, a GoDocument.Changed event is raised with the relevant information in the event arguments. I would like to be notified when some user-actions happen, so that I can conf...
stackexchange/codereview
Is it possible to create patch installers for web deployment installers generated in VS2005? I have a situation in which it is undesirable to perform a complete uninstall/reinstall of a web site, but in which periodic bug fixes and minor upgrades are made. I've tried following the instructions in various online posts a...
stackexchange/codereview
I've recently come across a problem which requires at least a basic degree of image processing, can I do this in Python, and if so, with what?
stackexchange/codereview
A third-party application reads some Java code from an XML file, and runs it when a certain event happens. In Java, I want to tell a .NET 3.5 application, running on the same machine, that this event occurred. The total data transferred each time is probably a few characters. What is the best way of using Java to tell ...
stackexchange/codereview
Can anyone explain the difference between the "name" property of a display object and the value found by getChildByName("XXX") function? They're the same 90% of the time, until they aren't, and things fall apart. For example, in the code below, I find an object by instance name only by directly examining the child's n...
stackexchange/codereview
I use int.MaxValue as a penalty and sometimes I am computing the penalties together. Is there a function or how would you create one with the most grace and efficiency that does that. ie. 50 + 100 = 150 int.Max + 50 = int.Max and not int.Min + 50
stackexchange/codereview
I have a table of Users that includes a bitmask of roles that the user belongs to. I'd like to select users that belong to one or more of the roles in a bitmask value. For example: select * from [User] where UserRolesBitmask | 22 = 22 This selects all users that have the roles '2', '4' or '16' in their bitmask. Is t...
stackexchange/codereview
I've got a dictionary, something like Dictionary<Foo,String> fooDict I step through everything in the dictionary, e.g. foreach (Foo foo in fooDict.Keys) MessageBox.show(fooDict[foo]); It does that in the order the foos were added to the dictionary, so the first item added is the first foo returned. How can I chan...
stackexchange/codereview
What is the best way to detect if a user leaves a web page? The onunload JavaScript event doesn't work every time (the HTTP request takes longer than the time required to terminate the browser). Creating one will probably be blocked by current browsers.
stackexchange/codereview
This is not a programming question per se, but this is certainly about something which would help increasing my programming productivity. In KDE, one can assign short-cuts to particular windows. This eliminates alt-tabbing completely and, is very very convenient when multiple apps(browser, console, emacs etc) are open....
stackexchange/codereview
I'm trying to get started on what I'm hoping will be a relatively quick web application in Java, yet most of the frameworks I've tried (Apache Wicket, Liftweb) require so much set-up, configuration, and trying to wrap my head around Maven while getting the whole thing to play nice with Eclipse, that I spent the whole w...
stackexchange/codereview
I'm trying to start a service as a user and things work fine, until I try a user that doesn't have a password. Then, it fails to start (due to log-on error). Am I doing something wrong or is this "by design"? The code to register this service: SC_HANDLE schService = CreateService( schSCManager, ...
stackexchange/codereview
I got a program that writes some data to a file using a method like the one below. public void ExportToFile(string filename) { using(FileStream fstream = new FileStream(filename,FileMode.Create)) using (TextWriter writer = new StreamWriter(fstream)) { // try catch block for write permissions ...
stackexchange/codereview
I would like to find out if a particular python datetime object is older than X hours or minutes. I am trying to do something similar to: if (datetime.now() - self.timestamp) > 100 # Where 100 is either seconds or minutes This generates a type error. What is the proper way to do date time comparison in python? I al...
stackexchange/codereview
I am looking for a simple, clean, correct XML parser to use in my C++ project. Should I write my own?
stackexchange/codereview
I've been trying to consider how Row Level Security could be implemented with the Entity Framework. The idea is to have a database agnostic means that would offer methods to restrict the rows coming from the ObjectContext. Some of my inital ideas have involved modifying the partial classes created by the EDMGEN tool a...
stackexchange/codereview
I'm changing my site to show friendly URLs like this: www.example.com/folder/topic Works fine! But when I add a parameter to the URL: www.example.com/folder/topic?page=2 $_GET stops working. It doesn't recognise the parameter at all. Am I missing something? The parameter worked fine before using full URLs.
stackexchange/codereview
I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio. I'd really like to be able to do the streaming and replaying from within...
stackexchange/codereview
We have SOAP web services in production that are relying on SOAP Headers (containing plain client credentials) for the authentication. The WS are used in heterogeneous environments with .NET/Java/PHP/Python/C++ clients both web app or desktop app. We are considering a v2 for those WS and I am wondering what are conside...
stackexchange/codereview
When I try to compile the newest version of Clisp on Ubuntu 8.04 I always get this error after running configure: Configure findings: FFI: no (user requested: default) readline: yes (user requested: yes) libsigsegv: no, consider installing GNU libsigsegv ./configure: libsigsegv was not detected, thus some feat...
stackexchange/codereview
I am trying to figure out a crash in my application. WinDbg tells me the following: (using dashes in place of underscores) LAST-CONTROL-TRANSFER: from 005f5c7e to 6e697474 DEFAULT-BUCKET-ID: BAD_IP BUGCHECK-STR: ACCESS-VIOLATION It is obvious to me that 6e697474 is NOT a valid address. I have three questions: 1) Doe...
stackexchange/codereview
I would like to be able to say things like cd [.fred] and have my default directory go there, and my prompt change to indicate the full path to my current location.
stackexchange/codereview