instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
So I have an external script that will sometimes input something into a sql database throughout the day (usually about 3 times a day, but could potentially update ever minute) I need to find a way to make the html page (that displays the sql entries) refresh automatically when there is a new entry that's added. Any sug...
stackexchange/codereview
I am trying to style a WPF ComboBox so that it matches a black-theme that is being considered for our next project. My problem is that if the ComboBox's background is black, the button doesn't show up (since it is also black). For some reason I have not been able to find any information about how to change it's colour....
stackexchange/codereview
In my TabHost activity, I want to show an ImageView below the selected tab (the ImageView overlaps the tab content). What would be the best solution to do this? I was thinking that creating a custom tab widget that can overlap the child activity layout may be a solution. Thank you in advance!
stackexchange/codereview
I work with a group that is very adamant on keeping the wsdl and xsd that are associated with our web services as private as possible, and only distributing them to customers on a need to know basis. My question is this... Is this overkill? I realize that adds anyone layer of obscurity to any potential attacks, but is ...
stackexchange/codereview
I'm trying to make a pretty-printer for std::vector's of whatever ... doubles, my own custom classes... anything that has a friend std::ostream& operator<<. However, when trying to compile the following function: template <typename T> std::ostream& operator<<(std::ostream& os, std::vector<T> const& list) { std::vect...
stackexchange/codereview
my problem is a simple one. i want to play a looping sound only when a button is pressed. the following are the switch statement and if else approaches i've tried. at best, i can play the sound but it won't pause when the button is no longer pressed. public boolean onTouch(View v, MotionEvent event) { MediaPlaye...
stackexchange/codereview
The code I wrote so far is: void copyInOrder(TNode *orgTree, Tnode *& copyTree){ if(orgTree !=NULL){ copyInOrder(orgTree->left_link); //create leftmost node of tree but how to link to parent copyInOrder(orgTree->right_link); } } I dont know how to link to the parent to the nodes as its ...
stackexchange/codereview
My short code : class A { private B b; public void b(){}; } class B { private void a() { A.b(); } } I can make void b in A static but I has some Controls like this.Controls.Add(); They must be static too, but I don't know how to implement it, can you show me or do we have a better way for this solu...
stackexchange/codereview
I have a asp.net resouce language file in english and I have to translate that resource file into french. how can this be achieved? There are lot of values on the resource file that needs to be translated. is there any sample available on how this can be done by using google language translation or something?
stackexchange/codereview
Note that I posed a very similar question earlier but the requirements have since changed Alphanumeric sort on mixed string value The primary difference in the requirements now is that the source XML can include forms with all alpha chars in the form_name or all integers. The form_name can be open season as letters and...
stackexchange/codereview
I want to do something when 2 document.write() statements have successfully occured. I tried the following but it didn't work: function loadFields() { var load1 = document.write("<input type='text' name='StoreLocation' value='"+storeLocation+"' />"); var load2 = document.write("<input ty...
stackexchange/codereview
Question: is there a simple sh/bash/zsh/fish/... command to print the absolute path of whichever file I feed it? Usage case: I'm in directory /a/b and I'd like to print the full path to file c on the command-line so that I can easily paste it into another program: /a/b/c. Simple, yet a little program to do this could p...
stackexchange/codereview
I'm looking for resources to learn programming in assembler for 8086 processor. Either books or online resource for total beginners in assembly.
stackexchange/codereview
I want to attach scanner to a flex application and read the image using scanner.Does anyone know how to attach scanner to a flex application?.
stackexchange/codereview
Any suggestions on testing a TCP client listener. What I'm looking for is actual network stats like "payload size", "time-out values", "actual payload bytes received from server". public static void tcpConnect() { int port = 12345; IPEndPoint ipep = new IPEndPoint( ...
stackexchange/codereview
I have to change my rail application's default log path because of my company's internal software deployment process: basically my rails app ends up on a read-only location, and I need the log files written in a directory "made for this". With Rails 2.x we used to add some black magic in our FCGI script to force that i...
stackexchange/codereview
This function wont return any value, even though the ajax call goes through correctly Function: function queryData(request) { var ret = null; $.ajax({ url: 'ajax.php', data: 'requestdata='+request, dataType: 'json', type: 'post', success: function (j) { if(j....
stackexchange/codereview
I am trying to run Hierarchy Viewer. developer.android.com says to "Connect your device or launch an emulator. From a terminal, launch hierarchyviewer from your SDK /tools directory." I tried finding the hierarchy viewer in sdk/tools, but couldn't find it. I realize my difficulty may just be the result of me being a to...
stackexchange/codereview
Im trying to align two elements in my xml file. I want to display a TextView called "Description" and a TextView called "Value" on the same line. The Description should right aligned to the center, the Value should be left aligned the center. But the following gravity doesnt seem to affect them. I assume I should avoid...
stackexchange/codereview
What is happening behind the scenes with css3pie that makes it so IE can use css3 features?
stackexchange/codereview
I'm facing an issue on a FTP I would like to know how, and the best option for the below situation. I'm dealing with a process that connects via FTP and gets a file, using JMS on Informatica Powercenter. I would like to know if there is a way to get the log saying that there was a problem on the connection and rerun th...
stackexchange/codereview
Is thit true that all browsers on windows OS work thru winsock? thanks
stackexchange/codereview
I am using static FBML but I am having trouble debugging a form validation problem. I get the dialog which to me seems like it should return false, but the form submits anyway. I am using Firebug and I see a brief message in Red that I have no chance to read. I appreciate the help :-) var txt ='Enter Zipcode'; //... ...
stackexchange/codereview
i'm just struggling through the following situation - there's a datasource added to a grid in axapta 2009, filtered by a querybuildrange. i want to mark a specific dataset by x++ via datasource_DS.findrecord( specificRecord ) this works as intended, removing the filter, but not having the filter active! a workaround ...
stackexchange/codereview
I am trying to create a dynamic background color in a certain range on a td. This color has to be based on the value that is inside the td. For example: <tr> <td>40%</td> <td>70%</td> <td>30%</td> </tr> Let's say the 0% color is: #ff0000 and the 100% color is: #00ff00 For the table cell containing the value of 40% I'd...
stackexchange/codereview
I can't figure out how to get flot.pie to change the pie slice color, just the series color. Is this possible?
stackexchange/codereview
It appears to me that Spring MVC cannot bind properties of primitive wrapper types(e.g. Integer, Boolean, etc). When it tries to bind such properties, it throws the following exception. javax.servlet.ServletException: javax.servlet.jsp.JspException: javax.servlet.jsp.JspException: org.springframework.beans.NotReadableP...
stackexchange/codereview
We have a Flash Builder (which is based on Eclipse) project that pulls source from different locations, included in the source control in which the project is. As per our organization requirements, the source code is present in directories not directly under the project directory. Initially we had the problem that all ...
stackexchange/codereview
I am stuck. I am using uploadify to upload multiple files to my s3 server. I would like to put each file into a folder that has a unique identifier. What I was hoping to do was to use this syntax to accomplish that (note uuid is a jquery plugin to generate uuids): 'onComplete' : function(event,queueId,fileObj,resp...
stackexchange/codereview
Is there standard way to generate Password Hash with Microsoft development tools? Or maybe there is most common way. (I have read that there is MD5, STA1) Unfortunately I don't have server's source code, but have to consume SOAP web-services. The must be some algorithm to generate hash code. I need to implement it usi...
stackexchange/codereview
I have a ListView of TextViews and to highlight one of these, I want to make the TextView bold. This only works if I don't scroll the ListView. After I scroll, the boldness changes to a different position. Does anyone know why, or how I can solve this problem?
stackexchange/codereview
I'm trying to work out the following query: SELECT did_numbers.did_dialstring, netareas.netarea_name, did_numbers.did_size, CASE WHEN (reseller_id < 1) IS NULL THEN 'F' ELSE 'T' END as reseller, COUNT(*) AS aantal FROM did_n...
stackexchange/codereview
If I bind a datagrid and a dataform to the same ItemsSource I assumed that as I select different rows in the datagrid, the selected item would be displayed in the dataform. It appears this only true if the data source is a PagedCollectionView and not an ObservableCollection? Is that correct?
stackexchange/codereview
I have a working EditorGrid panel, where two columns have ComboBox editors. Both ComboBoxes are loaded remotely from database (countryStore and cityStore). I would like to limit the cityComboBox to show only cities in the selected country. I need to reload the cityStore with a filter from database (there are too many c...
stackexchange/codereview
For example I want to change <item id="1"/> to <item code="1"/> thanks.
stackexchange/codereview
If I log in to a website with the same user name and password in different browsers then close one of the windows, will the session still exist?
stackexchange/codereview
I'm in the midst of implementing drag/drop functionality on a table. How it works: User left-clicks on a row; the row gets dimmed and a span is added to the DOM. The span acts as a place-holder for the row and follows the cursor as long as the user holds down the left mouse-button. The headache: When holding down the l...
stackexchange/codereview
I have an array like this: Array ( [0] => Array ( [id] => 9826 [tag] => "php" ) [1] => Array ( [id] => 9680 [tag] => "perl" ) ) I want to pass this to a javascript variable that looks like this: var availableTags = [ "ActionScript", "AppleSc...
stackexchange/codereview
I have a solution that needs to build Silverlight projects on a computer that doesn't have standard editing tools like VS or Expression Blend. From Expressions, I do need the font embedding and media processing capabilities of the Blend SDK. For Silverlight, I need to build for these 3 runtimes - SL3, SL4 and Windows P...
stackexchange/codereview
Possible Duplicate: How, exactly, does the double-stringize trick work? I came across this the other day - can someone tell me how it works? A simple way to stringize a C preprocessor constant, in all compilers conforming to ANSI C (or any C++ compiler). Suppose you have a header file containing a constant...
stackexchange/codereview
Hi guys I dont know if this is something that a new programmer should true or not, but heres my problem. I have a table of 13 columns at at present about 400 rows. yes i nkow this is a large table and unfortunatley it will only be getting bigger. what i am trying to achive with this table, somehow, is to have a functi...
stackexchange/codereview
Does anyone know of a working and well documented implementation of a daemon using python? Please post a link here if you know of a project that fits these two requirements.
stackexchange/codereview
Does NServiceBus automatically attempt to redeliver messages if handling fails? And if it does, is there a limit in the number of times delivery can be attempted?
stackexchange/codereview
I am running SSIS from a C# application. I would like to run the SSIS process using the dtexec utility but without showing the dtexec window when running. I have set the ProcessStartInfo.CreateNoWindow to true yet dtexec still displays the window. I assume this is due to dtexec and not C#, but I cannot find a argume...
stackexchange/codereview
What is the best branching and merging strategy for a small development team making a lot of concurrent development on the same project? We need to be able to easily apply a hotfix to a production release while other developers are working. I was looking at the TFS Branching Guidance guide from codeplex and can't seem...
stackexchange/codereview
I have a CAD and USD gateway accounts for processing credit card payments, both from a payment provider with support for the Authorize.net API. I've successfully configured one using Magento's built-in Authorize.net support... but how can I configure a second Authorize.net Gateway for use in my store?
stackexchange/codereview
I'm pretty new to python and am trying to grab the ropes and decided a fun way to learn would be to make a cheesy MUD type game. My goal for the piece of code I'm going to show is to have three randomly selected enemies(from a list) be presented for the "hero" to fight. The issue I am running into is that python is cop...
stackexchange/codereview
I want to do a 'select' in MySQL using the operator 'LIKE'. But I do not want to use text as a comparison factor. I want to compare text between two fields in same table, like this: SELECT field1,field2 FROM table WHERE field2 LIKE %field1% ; Is it possible?
stackexchange/codereview
OK, I've had a good read through the "Related Questions" section and I haven't found this answer. I'm using an ajax request to force a php download. Things are working fine on the PHP end. Let's say I've got a stream of data called DATA. Now, I want to pop up a "Save as..." dialog. The browser has received a stri...
stackexchange/codereview
Don't understand why #include <Header.h> is not compiling while #include "Header.h" is compiling with Visual Studio 2008. Am I missing something?
stackexchange/codereview
I'm trying to parse a large XML file. I read it using XML::SAX (using Expat, not the perl implementation) and put all the second level and below nodes into my "Node" class: package Node; use Moose; has "name" => ( isa => "Str", reader => 'getName' ); has "text" => ( is => "rw", isa => "Str" ); ...
stackexchange/codereview
After using shoulda it is very clear that shoulda no longer uses macros (They are all deprecated for the preferred matchers) For example: should_allow_custom_test is deprecated for the following: should allow_custom_test However all the documentation I can find is for the former macro setup by placing them in the sho...
stackexchange/codereview
Goal When the user clicks an element (with class="menu"), the default action should not be executed. The user should be presented with a menu with options. When an option has been clicked, then the default action should be executed. Problem It's very problematic to stop the original click event in the first place, beca...
stackexchange/codereview
I have a client who wants me to build a site using PHP and SQL Server. Problem is I do all my PHP development in OS X running Apache. I have one machine running Windows with an SQL Server production environment but I can't seem to connect via "sqlsrv_connect" because I can't install the drivers for sql server on my Mac...
stackexchange/codereview
What I want to do: Write an application that listens to Office events. I want to listen to events from any instance opened on the machine. E.g. if I'm listening to BeforeDocumentSave in Word, then I want my sink for this method to be activated whenever any instance of Word on the host saves a document. Another requir...
stackexchange/codereview
I've read somewhere that the current machine model is not quite fit for functional programming. So what is the limitations of the current machine model? Has a more suitable machine model been developed?
stackexchange/codereview
Given the default classpath: /foo And this directory structure: foo | test | xcom |--A.class |--B.java And these two files: package xcom; public class A { } package xcom; public class B extends A { } Why it doesn't work? javac -cp test xcom\A.java
stackexchange/codereview
I'hv got a problem when I am using foreach in smarty, an array with 2 item was loop in a foreach, but the result is it loop 3 time. I use doctrine to get a list of review by a user from database Doctrine_Core::getTable('review')->findByUser($userId); then I assign it to smarty and loop in foreach: {foreach from=$rev...
stackexchange/codereview
Are cores of OSs (device interaction level) really written in C, or "written in C" means that only most part of OS is written in C and interaction with devices is written in asm? Why I ask that: If core is written in asm - it can't be cross-platform. If it is written is C - I can't imagine how it could be written in C...
stackexchange/codereview
Self-tracking entities do not save original properties values. So all properties are marked as modified when you call ApplyChanges. But I need to log the properties which actually changed. I tried to use ApplyOriginalValues, but in this case AcceptChanges throws an exception as finds entities duplicates. Are there any ...
stackexchange/codereview
I am porting a Grails application from Oracle to MySQL database. The original Oracle version is a legacy database which uses a few complex Views leveraging Oracle's INSTEAD OF INSERT OR UPDATE feature which MySQL doesn't have. As a workaround I have implement Insert and Update methods on the Domain classes which point ...
stackexchange/codereview
I've been trying to tackle this problem for a day and half now and I can't seem to figure out this strange behavior. When I do that live.('click' fn) it behaves like a double click. Well no that's not the true, what happens is that if I click on it once it performs on action, then when I click on it again it files off ...
stackexchange/codereview
What is the difference between varchar and nvarchar in SQLite
stackexchange/codereview
How can I get the text in a text area within a form in browser control? Is there a method?
stackexchange/codereview
I have this problem: Warning: #1265 Data truncated for column I got a form with a value coming from a text field : price. When I put a decimal like : 45,56 ( French format) My MySQL column type is a float. Could someone help please ?
stackexchange/codereview
$line = " TEST: asdas :asd asdasad s"; if ($line =~ /(.*):(.*)/ { print "$1 = $2 " } I was expecting TEST =asdas :asd asdasad s But it's not working. What is issue?
stackexchange/codereview
Here is my issue. I'm trying to learn how to do debugging in assembly with OllyDBG. Usually, when a string is literally in the application, I can find something that points to it, however, this string is from the resource file (when doing WinAPI programming, a resource, .rc, is used). Therefore, given that it is in res...
stackexchange/codereview
I have to make a paypal integration in my website for paying person.I found a simple code <form action="https://www.paypal.com/cgi-bin/webscr" method="POST"> To pay with PayPal now please click on the PayPal icon below: <input type="hidden" name="cmd" value="_xclick"><br> <input type="hidden" name="business" value="y...
stackexchange/codereview
interface TestA { String toString(); } public class Test { public static void main(String[] args) { System.out.println(new TestA() { public String toString() { return "test"; } }); } } What is the result? A. test B. null C. An exception is thrown at...
stackexchange/codereview
The DataTable class has RowChanging as well as RowChanged events, which is convenient (for those of us foolish enough to be using the DataTable class in the first place). Event handlers for these events take a parameter of type DataRowChangeEventArgs, whose properties comprise a DataRowAction (Add, Change, Delete, etc....
stackexchange/codereview
I see the following things in Linux, but what are they? ./configure make make install etc etc.
stackexchange/codereview
Is there a way to make git gui display and show diffs for UTF-16 files somehow? I found some information, but this is mostly referring to the command line rather than the GUI.
stackexchange/codereview
$sql='UPDATE Reg_Stud SET Result=$perc WHERE RegID="$_SESSION['id']"'; Whts wrong with this syntax
stackexchange/codereview
For my assignment I've had to create an ArrayStack, a StackADT, and now I have to make a program to take in a string and output it in reverse. Now this sounds simple, but I have no idea how to push something into the array. I've been googling the shit out of this and can't find an actual answer that makes sense. Specif...
stackexchange/codereview
First I found in cplusplus.com the following quote: The catch format is similar to a regular function that always has at least one parameter. But I tried this: try { int kk3,k4; kk3=3; k4=2; throw (kk3,"hello"); } catch (int param) { cout << "int exception"<<param<<endl; } catch (int param...
stackexchange/codereview
From time to time I have to write some simple summarized reports using Django. First I tried using Django ORM aggregates and interleaving results, but it can get a bit messy and I loose all the ORM laziness - just doesn't feels right. Lately I wrote a generic iterator class that can group/summarize a dataset. In the v...
stackexchange/codereview
I'm trying to create a setup project. On install, I want it to create some registry keys and delete others. On uninstall, I want it to do the opposite. Regarding creation of keys on install and removing them on uninstall - no problem, it's built into the setup project. Problem is with removing keys at install (and add...
stackexchange/codereview
I have a version 1.0.1 that is live right now. I submitted version 1.1.1 which is currently for waiting for review. I have reset the devices that had test 1.1.1 versions and downloaded 1.0.1 from the AppStore from the device. But, test iAds are showing up on live app. Has anyone encountered this issue?
stackexchange/codereview
I have a simple daily hit counter on my site that I want to use Redis as the datastore for. Simply because redis has an expire, I dont have to set up a cron to clear the data down. Plus I want to try it out. I store daily hits on a URL basis. How can I store the daily hits for a url then have them expire at the end of...
stackexchange/codereview
First the code might suck as I'm new with JQuery. I have this html: <select name="numberItems" id="id_numberItems"> <option value="1" selected="selected">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> <fieldset cla...
stackexchange/codereview
I am currently writing an API for a django project, and using django-piston for this. However, I need to customize the way certain base types are serialized. More precisely, my models are subclassed from a special Model class, which inherits from django.db.models.base.ModelBase, but cannot be serialized as regular djan...
stackexchange/codereview
Is there a way to know if your page is opened inside of an IFrame? An idea I had was to see if the window object has a .parent property, but this apparently is also true of standalone windows which are opened by Javascript's window.open() function.
stackexchange/codereview
I need to essentially POST some hidden fields to a page, which i need to load in the browser window. This is for the SagePay forms integration as per page 6: http://www.docstoc.com/docs/10745827/Sage-Pay-Form-Protocol-and-Integration-Guidelines I am already using WebRequest to create the POST but how do I send the 4 hi...
stackexchange/codereview
How do I get at the raw JSON response from a jQuery $.getJSON() request? I just want to print the raw response in an alert() dialogue in my browser?
stackexchange/codereview
Form is not working, does not post to the database though the CFC or seem to be working with the script. When you click on the PostComment button nothing happens. I just spent a day and tried many, many different things. Different buttons and different code, some made things worse and most just cased errors or refreshe...
stackexchange/codereview
So this was a small site that got extremely popular very fast and now and im having major problems with the below sql query. I understand that my DB design is not great. I have text field for subjects and programs witch contains a serialized array and i search it using like. the below query takes about a minute. SELECT...
stackexchange/codereview
How can exceptions be used in Haskell without going through IO? I have the following code for inserting an element in a binary search tree with minimum comparisons and no copying when the element is a member of the tree. I noticed that either is used as catch and Left as throw: insert x t = either (const t) id (insert'...
stackexchange/codereview
I have converted a few of my Processing sketches into Android apps, but they seem to run really slowly in the emulator and on my device. Are there any tips on how to increase the speed and performance of my sketch running as an Android app? Are there things or parts of the Processing API I should avoid?
stackexchange/codereview
I have a simple linq query that unionizes two tables that implement the same interface. For this example, lets say IAnimal. var q = (from d in db.Dogs where d.AnimalID = PetID select d.Name) .Union (from c in db.Cats where c.AnimalID = PetID select c.Name) So if the ...
stackexchange/codereview
my table look like this.. id name count -- ---- ----- 1 Mike 0 2 Duke 2 3 Smith 1 4 Dave 6 5 Rich 3 6 Rozie 8 7 Romeo 0 8 Khan 1 ---------------------- I want to select rows with max(count) limit 5 (TOP 5 Names with maximum count) that would look sumthing like... id name count -- ---- ----- 6 Rozie 8 4 Dave 6 5 Rich 3...
stackexchange/codereview
Assume I have a business object like this, class Employee { public string name; public int id; public string desgination; public int grade; } List<Employee> lstEmp = new List<Employee>() { new Employee() { name="A",desgination="SE",id=1}, new ...
stackexchange/codereview
Given a form class (somewhere deep in your giant Django app).. class ContactForm(forms.Form): name = ... surname = ... And considering you want to add another field to this form without extending or modifying the form class itself, why does not the following approach work? ContactForm.another_field = forms.Ch...
stackexchange/codereview
If I have an Auction record, which has many Bids associated with it, out of the box I can do things like: highest_bid = auction.bids.last(:all, :order => :amount) But if I want to make this clearer (since it's used in multiple areas in the code), where would I define the method: highest_bid = auction.bids.highest_bid ...
stackexchange/codereview
In C++ CodeBlocks project I added the following definitions to the project settings, compiler settings, #define: _DEBUG DATA_DIR=\"/media/Shared/SiX/Data\" This produces the following g++ command line: g++ -Wall -g -fPIC -save-temps -D_DEBUG -DDATA_DIR=\"/media/Shared/SiX/Data\" -I../Includes -c /media/Shared/S...
stackexchange/codereview
I recently stumbled into this this C++/Lua error int function_for_lua( lua_State* L ) { std::string s("Trouble coming!"); /* ... */ return luaL_error(L,"something went wrong"); } The error is that luaL_error use longjmp, so the stack is never unwound and s is never destructed, leaking memory. There are a few ...
stackexchange/codereview
Possible Duplicate: How to find out how many lines of code there are in an Xcode project? I was wondering if there is anyway to count the total number of code lines from an XCode project.
stackexchange/codereview
I have a table with about 30 fields. I current have several stored procedures which access either a (aggregated) view of this table or the table itself. For many of these SPs I would like to assure that the returned records have all the same fields with the same column names. Is there a way to do this where I don't...
stackexchange/codereview
i have many makers (maybe 500) to insert to maps, so i want to Optimization them google.maps.event.addListener(marker, 'visible_changed', function() { alert('ww') }); this code can't alert 'ww', when i zoom in the map(so some marker will not be seen) why can't trigger the 'visible_changed...
stackexchange/codereview
Can you change classes without id when your classes are dynamic and only the parent has an id? I have something like: <div id="number_block"> <div class="one science easy left"></div> <div class="one science easy center"></div> <div class="one science easy right"></div> </div> I only reach this part var number_b...
stackexchange/codereview
I have got a problem with a CLLocation. I wanted to know the distance between two coordinates to show it next to the title of the location in a tableView: static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [...
stackexchange/codereview