instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a join using mysql in php and want to turn that into a pdo query how do i do that? Also how do I get the results of this query and display it. Code is below: $query = "SELECT * FROM pages LEFT JOIN templates ON pages.template_id = templates.template_id WHERE pages.page_Title = '".$getVars['page']."'"; I am ne...
stackexchange/codereview
I'm trying to design a solution in MVC in which a string representation of a class is passed to the controller which should then build a grid with all the data belonging to that class in the DB. (I'm using an ORM to map classes to tables). //A method in the Model that populates the Item Property foreach (Me...
stackexchange/codereview
I am working on this WCF-WPF app. I am frequently getting this error on an asynchronous XamDataGrid. Trying to make a WCF call and populate the Grid. I initially thought this is something to do with the large amounts of data returned from WCF and I made the call return data is much small pieces, by calling only for a c...
stackexchange/codereview
I want to check if any of the array values from example 1 are in example 2 and remove them from example 2 if they are. How would I be able to do this using PHP? Example 1 Array ( [0] => 3 [1] => 5 ) Example 2 Array ( [0] => 3 [1] => 3 [2] => 4 [3] => 4 [4] => 4 [5] => 3 [6] => 3 ...
stackexchange/codereview
Ok So I'm creating a "Windows Forms Application" for some guy using C# and I want to make the UI a bit more interesting for him. The main form looks like a big dial with custom buttons arranged on it. (I'm saying custom buttons since they are actually simple user controls I've created that have a PictureBox and a Label...
stackexchange/codereview
i tried a program comparing C:\Program Files and C://Program Files i checked with compareTo()==0 it comes they are equal. But i doubt if there is any difference between //&\ Is there any difference? what is the difference between c:/program files and //?
stackexchange/codereview
I'm using the phone's camera in an Android app to take a photo. I'm using Intents to use the built-in camera application and I'm using the following code: Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(FILEPATH))); startActivityForResult(...
stackexchange/codereview
i have a Problem using FTP connection on Android 2.2 devices. My app uses AndFTP via intent and loads data from a FTP Server connected via Wifi to the handset. The FTP downloadspeed is only 7kByte/s. I had the same speed on my Windows XP Notebook, then i changed the delayed acknowledge setting. So now my Notebook rea...
stackexchange/codereview
Every now and again I see people on StackOverflow promote the use of autodie. But in the code here and elsewhere in the net I don't see autodie very often. Are there some disadvantages? Do I lose something when using autodie? (I have the idea of getting spoiled, when using autodie)
stackexchange/codereview
I am facing a problem with DataBinding in WPF:::: The below code is working: <TextBox Text="{Binding ProcessStepBlock.ProcessStep[2].ProcessDescription}"></TextBox> <TextBox Text="{Binding ProcessStepBlock.SelectedIndex}" ></TextBox> The below code is not working:It gives me a binding error BindingExpression path er...
stackexchange/codereview
I'm running PHP under Apache and I'd like to send a slow trickle of POST data to the page that will write messages into a database as the POST data arrives. I'm sending the data from a .NET app using WebRequest and I've set SendChunked to true. Unfortunately, it looks like the PHP script doesn't start executing until a...
stackexchange/codereview
I have a table with a datetime field, and I want to pull that time stamp and use PHP to convert it to the nearest largest unit of time. For example, if the entry was made 2 minutes and 36 seconds ago, I want to echo 2 minutes in PHP. If it was 3 hours and 5 minutes ago, I want it to say 3 hours. If it was 6 days and 4 ...
stackexchange/codereview
In the process of porting an iPhone application over to android, I am looking for the best way to communicate within the app. Intents seem to be the way to go, is this the best (only) option? NSUserDefaults seems much lighter weight than Intents do in both performance and coding. I should also add I have an application...
stackexchange/codereview
Google App Engine must have some sort of reverse caching proxy because when I set the response header Cache-Control public, max-age=300 from one of my servlets, subsequent requests to the app engine show up in the logs like this: /testcaching 204 1ms 0cpu_ms 49kb, whereas non-cached requests show up in the logs as: /t...
stackexchange/codereview
I'm using the Process Class to start processes, but don't ever want more than one instance of any program to be running. Looking at the documentation, there are lots of likely-looking properties, but nothing that stands out as the most obvious. What's the best way to determine if a process is running? Edit: John Fisher...
stackexchange/codereview
Basically I've got an update query that runs when you click a submit button. I have an asp:Repeater in my page with a layer inside like this <asp:Repeater id="dgBookings" runat="server" OnItemDataBound="ItemDB"> <itemtemplate> <div class="bookingscontent"> <div class="bookingdetails" id="<%# DataBi...
stackexchange/codereview
I'm using the geom_tile to draw an imagemap and want to clear out the zero level for clarity. #dummy data set.seed(1) tdata <- data.frame(cat1=rep(letters[1:3],4),cat2=sort(rep(LETTERS[1:4],3)),val=rpois(12,1.5)) tdata$val<-tdata$val/max(tdata$val) I have found 2 ways to do this but both have their drawbacks: 1) qplot...
stackexchange/codereview
I've hash of hash like this: $hashtest{ 1 } = { 0 => "A", 1 => "B", 2 => "C" }; For example, how can I take the value of B of hash{ 1 }? $hashtest{'B'}{1}
stackexchange/codereview
I have a method that loops through all the rows of a table where a certain condition is met, and then checks if one of the columns in the row appears in a text. The method is below: public function isRecipeType($ingredients, $type) { $rows = $this->fetchAll($this->select()->where("type = ?", $type)); foreach($...
stackexchange/codereview
I read that threads share the memory address space of it's parent thread. If that is true , why can't a thread function access a local variable belonging to it's parent thread ? void* PrintVar(void* arg){ printf( "%d\n", a); } int main(int argc, char*argv[]) { int a; a = 10; pthread_t thr; pthread_creat...
stackexchange/codereview
I am a newbie to MVC, CodeIgniter and Doctrine, so maybe my question is not that relevant. Pardon me if thats the case. I've been reading the CodeIgniter + Doctrine tutorials on PHPandStuff.com. I really like whatever I have seen of Doctrine and wish to use it for my project. However, since all database related operati...
stackexchange/codereview
I notice that IIS 7 has a custom logging module logcust.dll. It is said this module helps load your own custom logging module. But I can't find any information about how to use it. I opened this DLL and notice that it implements IHttpModule and register to all events but does nothing in event handlers. Same question fo...
stackexchange/codereview
to centralize my address books I'm thinking of doing that via a LDAP service. As I haven't found a free service somewhere, I guess i have to implement this on my own. So the basic idea is to implement a search (which is restricted to contacts only) and a small filtering capability. The search looks the records up in an...
stackexchange/codereview
I am writing a C program that is expected to be compiled with all major compilers. Currently I am developing on GCC on a linux machine and will compile on MSVC before committing the code. To make the cross-compiling easy, I am compiling with -ansi and -pedantic flags. This worked well until I started using snprintf whi...
stackexchange/codereview
I am creating an invoice using the iTextSharp. That displays nicely but sometime, when invoice items are larger in qty, the summary portion (which displays subtotal, tax, discounts, grand total etc) is splitted. Some displayes in current page and some moves to next page. I was thinking to move entire summary portion in...
stackexchange/codereview
I am trying to do a jQuery post the content of a text editor to an asp.net page (asp.net 4.0) from my javascript.The asp.net page will receive it and save it to db.I append the text editor's content in the querystring.When the content is big, I am getting the following exception The length of the query string for this ...
stackexchange/codereview
I put some data access logic in my default construct of ViewModel class. However, whenever try to open xaml designer window, visualstudio try to execute default constructor of ViewModel, then popup error window from this. How can I prevent execution of default constructor in ViewModel class. I know GetIsInDesignModel()...
stackexchange/codereview
I would like to know how to retrieve the file size of a video using AssetLibrary? Can anyone point me in the right direction? or possible some code snippet?
stackexchange/codereview
I still didn't discovered a widely accepted pattern for following situation: In the database, a three-level deep series of tasks exists. Main task: gather data for user X; report data; Sub-task: ensure that all data is fetched and is correct; report success or errors Minimal task: get a piece of data from network, ma...
stackexchange/codereview
I have a very strange problem with UINavigationController on the iphone and I am banging my head against the wall on this. Gist of it is I am executing a call to a server and when that call fails I swap out the current view with a view containing an error message. The code in question is called on the main thread by us...
stackexchange/codereview
I don't think I am being silly here. class Parent { function load($function) { if (method_exists(__CLASS__, $function)) { // Load Function } } } Class Child extends Parent { function foo() { } } $this->Child->load('foo'); The problem is that __CLASS__ is returning 'Parent'. How do I get it to r...
stackexchange/codereview
The OpenSSL library allows to read from an underlying socket with SSL_read and write to it with SSL_write. These functions maybe return with SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE depending on their ssl protocol needs (for example when renegotiating a connection). I don't really understand what the API wants me to...
stackexchange/codereview
So I have this site to which a given set of users have read access. I created two lists--one for a list of available classes, another for sign-ups--and granted the users Contribute access. I created two forms--one to sign up, another to manage sessions--and gave the users Contribute access to both. When I sign in as on...
stackexchange/codereview
Using Hibernate in a struts2 webapp when the application redeploys I get this error when trying to access pages after redeploy. java.lang.IllegalStateException: Timer already cancelled. Just after redeploy tomcat logs the following output which indicates the cause of the problem is that Hibernate is not shutting down ...
stackexchange/codereview
I have a grid and when i change its sorting order i a loading message appear on grid region and block its content like other modal popup but only on grid region is there any available jquery modal popup meet my needs ? can I configure jqueryUI modal to do this ?
stackexchange/codereview
Interfaces (In the assembly named "Interfaces". In project :- Interfaces) namespace Interfaces { public interface IDoSomeWork1 { string DoSomeWork1(); } } namespace Interfaces { public interface IDoSomeWork2 { string DoSomeWork2(); } } Dependencies (In the assembly named "Entit...
stackexchange/codereview
I want to extend TinyMCE Advanced Wordpress Plugin with one of the plugins that is written for original tinymce editor package (http://tinymce.moxiecode.com/). That plugin is imgmap and I can find some steps (www.code.google.com/p/imgmap/wiki/TinyMCE_setup) to setup this plugin with original tinymce editor, but tinymce...
stackexchange/codereview
I'm in need of some help with getting my duplicates from showing more than once in my output. SELECT accountNumber AS 'Member Number', OD.orderdetails AS 'iNum', FirstName AS 'First Name', LastName AS 'Last Name', HGP.email AS 'Email', points AS 'Points -->', '$' + CONVERT(varchar(50),(CONVERT(int...
stackexchange/codereview
What is the sscanf placeholder for uint8_t types? I tried %u, but gcc under OS X doesn't like it.
stackexchange/codereview
Form validation with jQuery is as easy as adding a classname to a field. Form validation with rails is as easy as putting a condition in to your controller (and/or model). I figure there should be a way to write the validations once and have them applied both client and server side. I've always been a fan of writing ...
stackexchange/codereview
Previously I've used the tap Detecting Window technique to detect taps in a UIWebView, but now I've tried to use gesture recognizers instead. The following code is in the viewDidLoad method of a view controller, which has a single UIWebView. This code compiles fine, but the handleTap method is never called. This seems...
stackexchange/codereview
I have a little problem with NSUndoManager. When the user is about to edit some entity A, I stick everything into an undo grouping so that the changes can easily be undone. So far so good. However, while the user is editing entity A, he can also add or edit items of entity B, where A has many B and B belongs to many A....
stackexchange/codereview
In the ActiveMQ KahaDB documentation, it mentions that you can archive KahaDB data files so they can be replayed if needed later. Yet, through some searching and looking through their documentation and the draft copy of ActiveMQ in Action, I can't find any example or clues how to actually do the replay of those files. ...
stackexchange/codereview
My plan is to have lots of boxes (an undefined amount). When show box is clicked under a box, it shows that particular box. I have some unique divs in my html. The div is made unique by: <div id="box-<%=box.id%>"></div> In my application.js, I have $('.show-box > a').click(function(){ $('#box').show(); }); I obviousl...
stackexchange/codereview
I have a form using JQuery validation plugin. <label> <input name="Distribution[]" type="checkbox" id="dist_europe" class="required minlength:1" value="Europe" /> Europe </label> <select name="Europe[]" size="5" multiple id="Europe"> <option value='Albania'>Albania</option> <option value='Andorra'>Andorra<...
stackexchange/codereview
I'm trying to use OpenCV to find the RGB values of a pixel in an image. so far I've tried the following: int blue = ((uchar *)(img->imageData + y*img->widthStep))[x*img->nChannels + 0]; int green = ((uchar *)(img->imageData + y*img->widthStep))[x*img->nChannels + 1]; int red = ((uchar *)(img->imageData + y*img->widthSt...
stackexchange/codereview
I am attempting to move most of my daily working life to a terminal shell. I am a .NET dev so I run on WinXP purely for visual studio (just wait until I get better at Emacs). I would really much like it if I could use an email client within a terminal (either using Console or PowerShell within Console). From my uni da...
stackexchange/codereview
i using PrettyFaces for Pretty URL but i have first problem with PrettyFaces: my mapping in pretty-config.xml <url-mapping id="home"> <pattern value="/" /> <view-id>/faces/index.jsf</view-id> </url-mapping> i have one file index.xhtml when deploy on server url http://localhost/myproject it not found index....
stackexchange/codereview
I have a problem with the inheritance of Doctrine within my fixtures.yml file of Symfony. Imagine the following: NewsAuthor: inheritance: extends: sfGuardUser type: simple Now I want to declare the default guard user User_admin of the fixtures file of the sfDoctrineGuardPlugin to be the author of the first...
stackexchange/codereview
Hi everybody im starting to work with Entity Framework 4.0 and ASP.NET 4.0 i'm trying to make a master detail web page and i'm having problems when i try to add new items to a previously recorded items below is the i made for this: private void guardarOrdenMedicamento() { InventarioSIAIplusEntities SIAplus...
stackexchange/codereview
I'm trying to use Watin for testing. And I need to get a list of elements with specific properties, e.g. all links that have "Go" title. I was trying this: browser.Link(link => link.Text == "Go"); but it returns only one element. Also I was trying this: var links = from link in browser.Elements whe...
stackexchange/codereview
As the title says, what is the equivalent of Python's '%s %s' % (first_string, second_string) in SQLite? I know I can do concatenation like first_string || " " || second_string, but it looks very ugly.
stackexchange/codereview
I've written an extension method for use with WCF services that keeps all the disposal and exception handling logic in one place. The method is as follows: public static TResult CallMethod<TChannel, TResult>( this ClientBase<TChannel> proxy, Func<TResult> func) where TChannel : class { proxy.ThrowIfNull("pr...
stackexchange/codereview
I am using ExtJS, and I have the following component: var AlgoField = [{ bodyStyle: 'padding-right:5px;', id: 'algo_id ', items: [{ xtype: 'fieldset', title: 'Algorithms\' Field', autoHeight: true, collapsed: true, collapsible: true, items: [itemAlgo_1, ...
stackexchange/codereview
public class MyClass { List<MyOtherClass> myInnerList; } Let's say I have the following declared somewhere else: List<MyClass> myOuterlist; How would I quickly generate a list of the myInnerLists in C# using VS2005?
stackexchange/codereview
are pointers of integer or unsigned datatype?
stackexchange/codereview
I'm just trying to use this little trick I saw in one of my web design magazines to make a little image rollover but I'm having just a small bit of trouble. My attempt was a terrible fail lol. I just want to see the top half (42px tall) and then the bottom half on rollover (-42px obviously) width is also 42px. Could so...
stackexchange/codereview
Can anyone offer any advice on how to get the mantissa and exponent from a double in VB.net? I know I can do a string parse and some conversion to ints but I wondered if anyone had a mathematical equivalent formula that would allow me to do this? Many thanks
stackexchange/codereview
simple question, I've got a superview holding multiple sub UIIMageViews that I'd like to move simultaneously. I now about UIIView Animations but not how to launch multiples animation at a time. Any clue about that ? example animations would be : growing, shrinking, alpha changes, moving along different (radom generate...
stackexchange/codereview
I have created a common controller for my application. class CommonController < ApplicationController def index # My stuff end end And in my other controller i am using super to call my index method like this. class Other1Controller < CommonController def index super end end class Other2Controller < C...
stackexchange/codereview
I have a simple log4j.property file and a simple program that use log4j. But when I run my jar I see only this log4j:WARN No appenders could be found for logger (package com.mycompany.hellolog4j). log4j:WARN Please initialize the log4j system properly. log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfi...
stackexchange/codereview
I'm having an issue when I loop through form input text fields. I am trying to loop through multiple text fields labeled 'number' and it's only submitting the very last number field instead of all 'number' fields. Can anyone see what I'm doing wrong here?? for ($i = 0; $i < count($_POST['number']); $i++) { $...
stackexchange/codereview
I have a method doSomething() that has one try catch block, within which I call another method. public void doSomething() { try { doSomethingElse(); } catch { // catch implementation goes here } } In that other method doSomething...
stackexchange/codereview
I need to write contents of a file to another file using File.OpenRead and File.OpenWrite methods. I am unable to figure out how to do it. How can i modify the following code to work for me. using (FileStream stream = File.OpenRead("C:\\file1.txt")) using (FileStream writeStream = File.OpenWrite("D:\\file2.txt")) { ...
stackexchange/codereview
Sorry to double my earlier question, but I thought to ask specific data which would solve the problem. I want this result tuple_of_vars = (item for _, item for zip(tuple_of_vars, new_vals_generator)) as this is not possible a, b, c, d = (val for val in infite_generator) actually then I want to do in single line for v...
stackexchange/codereview
I was reading the book Git Internals and was awestruck by its simplicity. So I thought may be I could try to make a simplistic version of Git (something that can be done withing 4-5 months time period). I understand that Git is a huge project and done by the best of the software engineers. My question is what are ...
stackexchange/codereview
I am using a string as a lock and so want to ensure the object is a new instance. FindBugs complains because it's generally more efficient to define the string directly (with double quotes). My code looks like: /** A lock for the list of inputs. */ @edu.umd.cs.findbugs.annotations.SuppressWarnings("DM_STRING_CTOR") /...
stackexchange/codereview
I need to insert (embed) a file object (.txt file) in MS Excel sheet using Java. The requirement is not to put the contents of .txt file into Excel. Instead I need to put the whole file as an embedded object into Excel. I am using Apache POI jar for this. I have seen all the examples present in poi-3.7-beta1 but was no...
stackexchange/codereview
We have login credentials for our database stored in some config file which checked into codebase repository. Generally we would have development credentials in dev environment and that would be checked in. While deploying in production, one would replace it with production login credentials manually. I wish to know wh...
stackexchange/codereview
We use LINQ to SQL extensively, and one of the biggest performance pitfalls we've run into is situations where a query can't be converted to SQL, and so an entire database table gets loaded into memory and the query performed by .NET. For example, this query Dim Foo = (From c in Db.Contacts Select c Where c.ContactID=M...
stackexchange/codereview
If I have a page that I want to be indexed, and searchable. But I have a certain keyword(s) on my page that I do not want indexed. Is there a way to do that? So that people searching for keywords on my page that I think are assocated with me, will find me. But if people are searching for keywords that happen to be on m...
stackexchange/codereview
I have used to read that varchar (char) is used for storing ASCII characters with 1 bute per character while nvarchar (varchar) uses UNICODE with 2 bytes. But which ASCII? In SSMS 2008 R2 DECLARE @temp VARCHAR(3); --CHAR(3) SET @temp = 'ЮЯç'; --cyryllic + portuguese-specific letters select @temp,datalength(@temp) ...
stackexchange/codereview
I'm trying to write an equals method for objects that compares their fields and return true if they're equal. private int x, y, direction; private Color color; public boolean equals(Ghost other){ if (this.x == other.x && this.y == other.y && this.direction == other.direction && this.color == other.color) ...
stackexchange/codereview
Sorry for the lame question. I am trying to run a simple getting started tablesorter example with no luck. I know my jquery works because I made a 'hello world' alert test. I downloaded the .js files and placed them in my working directory/folder. Firebug "Reponse" window shows me there is actual .js code in the files....
stackexchange/codereview
I am having trouble with this assignment because my of my actionlisteners. Right now the panel has 2 checkboxes to change the font into bold and or italic. I want to add 4 radio buttons that can change what font the "saying" is in. Can anyone tell me what I'm doing wrong with my actionlisteners? Thank you! import ja...
stackexchange/codereview
I'm trying to intercept all kind of form submissions for a specifc form on a web page. It looks to be very simple with jQuery: form.submit(function(e) {…}) and it works beautifully if I click the submit button. However there is also an onChange property on a select field which does this.form.submit() and it looks like ...
stackexchange/codereview
Let's say i have a layout with style: <LinearLAyout ... > <TextView ... style=someStyle /> <ImageView ... style=someImageStyle ... /> </LinearLayout> the style will be defined in an xml in my project. How can i override that style with an external xml ? (i'm asking because i've noticed the View does not have a...
stackexchange/codereview
I am using datasets WriteXml method to write changes on to a local file for persistancy. I am willing to pay the penalty for the I/O but cannot figure if each time that i call WriteXml the whole dataset is rewritten to file. Does anybody know if this is the case? And if so what can i do to just append the latest row?
stackexchange/codereview
I'm using Apache POI to create xls spreadsheets. Is there a way to detect if the data fits in portrait mode or if I have to set the sheet to landscape mode? I know how to set the modes, but I don't know how to find out if the data fits the current print orientation.
stackexchange/codereview
I have been working on a SWT-based project which is intended to be deployed as Java Web Start, and thus be used on multiple platforms. So far I have managed to tackle the exporting problem that arises due to the system-specific libraries SWT depends on (see relevant thread). The resultant jar seems to work start fine ...
stackexchange/codereview
I'm pretty new to Drupal, but I guess I know how things work. I separated the Advanced Search Form from the search page and made a block from it (that was part 1). Woohoo. Part 2 is the pager-from-nowhere in the search results. Drupal search results are paged by tens and I can't seem to find a way to change it. Not a d...
stackexchange/codereview
Greeting Overflowers, I am asked to code an email tracker using PHP. Email clients request my PHP script thinking it is an image (BODY's background). However, the client (namely Outlook 2007) hangs then (showing nothing) until my PHP script reaches its timeout. <?php define("DB_FILE", "sqlite:C:\wamp\www\database.sdb")...
stackexchange/codereview
I recently saw the above operator in a code,I googled for it but found nothing.The code is below.Please describe what actually does this operator do? #include<stdio.h> int main() { unsigned long int i=0; char ch; char name1[20],name2[20]; FILE *fp,*ft; printf("ENTER THE SOURCE FILE:"); gets(nam...
stackexchange/codereview
How does C represent negative integers? Is it by two's complement representation or by using the MSB (most significant bit)? -1 in hexadecimal is ffffffff. So please clarify this for me.
stackexchange/codereview
I use 2 separate database, so i have to use JTA to handle distributed transactions.So either either both db have to commit or both rollback. I use open JPA and JTA.Now to unit test the code using junit ? I get the following error when i try to run my code which handles distributed transcations.I had posted similar q...
stackexchange/codereview
i am doing some changes in application developed in c#.net 3.5 , application using devxpress for reporting , customer has dot matrix printer epson lx 300 + with running paper size (32cm height and 22 cm width). problem is some reports are very large and require every mm of page to print reports so i setup page size a4e...
stackexchange/codereview
I encountered an unexpected behavior while debugging a WinMo 6 program last night, and I wonder if I was dreaming. But first, some context. The program communicates through a serial port with a GPS device. It uses either a physical port with cable, and also tries via Bluetooth. After a suspend or power-off, I don't nee...
stackexchange/codereview
Person Table ID FirstName LastName PersonalWealth 1 Hello Alest $10,000.00 2 Leeds United $20,000.00 3 Middle Brough $30,000.00 4 Arsenal Chelsey $40,000.00 5 Manchester United $50,000.00 6 Peter Mean $60,000.00 7 Hello Coward $60,000.00 Car Table ID CarRego Model ...
stackexchange/codereview
Connection delegate methods not called with background thread, Why ? In program i have created background thread and that thread set connection delegates, by setting ObjNSURLConnection.delegate = AnotherClass, and that AnotherClass contains NSURLConnection delegate methods. But when i debug a code i have found that NS...
stackexchange/codereview
What is the difference between the following ways of handling InterruptedException? What is the best way to do it? try { // ... } catch (InterruptedException e) { Thread.currentThread().interrupt(); } ...or: try { //... } catch (InterruptedException e) { throw new RuntimeException(e); } I'd like to also kno...
stackexchange/codereview
In python I have a complex object hierarchy made of lists and dictionaries. I want to spit it all out to CSV or some other kind of database format. Any answers in Python or Javascript very much appreciated. I understand that one CSV file (or table) can only represent one 'level' of object in my hierarchy, so the soluti...
stackexchange/codereview
I'm trying to redirect an old url to a new one using 301 I need an example of RewriteQueryString for the following 301? http://www .example.com/search/?depId=1&typeCatId=1 to the following http://www.example.com/mens/clothing So when I type in the long URL in the browser, I am redirected to the new, shorter URL Any id...
stackexchange/codereview
Let's say I have a variable called URL and it's assigned a value of http://www.google.com. I can also received the URL via ftp, hence it'll be ftp://ftp.google.com. How can I have it so I grab everything before the :? I'll have an if/else condition afterwards to test the logic.
stackexchange/codereview
I am trying to create a program that reads my mail from Microsoft Outlook so that I can move them into different folders based on thier contents. I am using Microsoft.Office.Interop.Outlook 12.0, which works fine with Outlook 2007. How do I handle scenario where another user uses Outlook 2010?
stackexchange/codereview
I need a FTP TLS Connection for my iPhone-App. A normal FTP-Connection works fine. But I need also a secure TLS connection. I used the code from Apple´s SimpleFTPSample for the iPhone: ftpStream = CFReadStreamCreateWithFTPURL(NULL, (CFURLRef) url); self.networkStream = (NSInputStream *) ftpStream; [self.networkStream ...
stackexchange/codereview
I have two different WCF services doing mostly your basic CRUD operations. For both services, regardless of the client, if the service throws an exception the exception will not be returned to the client. In fact, the only way I can see the actual exception is to turn on tracing in the services and view the trace file....
stackexchange/codereview
I'm working on a SharePoint web application. Since i can add web parts to the SharePoint pages i added two web parts A & B where A uses Ajax extensions 1.0 and B uses 3.5 version of it. If i enable Ajax in the web app i get the web.config entries for the both the versions of the dll System.Web.Extensions (1.0.61025.0 ...
stackexchange/codereview
I'm creating a Bash installer script which compiles and installs some libraries for both OSX and Linux. Because some commands in my script ("make install", "apt-get install", "port install", etc) require sudo, I need the user to supply the password. Currently the user gets asked for the password whenever the first sud...
stackexchange/codereview
I have stripped my getJSON call to the simplest example possible trying to figure out why it's not working but I'm out of ideas. I currently have: public JsonResult MyAction() { return Json(new { status = "OK" }); } $.getJSON('MyController/MyAction', function(result) { alert('worked'); }); The action is called, b...
stackexchange/codereview
$fooValue = 100.68; $cowValue = 100.67; $diffValue = $fooValue - $cowValue; if($diffValue <= 0.01) { echo("success"); } else { echo("error"); } This will show "error". I know what to do in Java. But I'm not good at PHP, especially with this calculate things. Please help me out. I mean how to succeed this?
stackexchange/codereview