instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I have a Postfix mail server, and I want to forward my received emails to my application written in Java and running on a Tomcat web server. As far as I know, it is possible to forward the whole email (head, body, everything) to a port on localhost, where both the mail server and my application is running. But I don't ...
stackexchange/codereview
there are a lot of applications around the web filtering out user contents for scripts. But my question is, have you guys ever experienced a need where allowing javascript in the user input provide rich set of functionalities?
stackexchange/codereview
I'm having trouble serializing a class with a Uri property. System.InvalidOperationException was unhandled Message=There was an error reflecting type 'Foo.Story'. // ... InnerException: System.InvalidOperationException Message=There was an error reflecting property 'MyURI'. I would like this property to b...
stackexchange/codereview
Sorry guys, if this is a stupid question. I have a set of integers which I want be sorted using a function object. But when I try to compile the following code, I get the error "invalid template argument for '_Pr', type expected". class MySortedUser{ vector < user* > & users; public: MySortedUser(vector <...
stackexchange/codereview
I need to call a secured web service (https). using Java (or even any other prog lang). Do I need to do any extra steps rather than the usual steps to create a client for HTTP web service? EDIT: please I need answer to this question too : If not, So how my client do decrypte the encrypted message sent from the web se...
stackexchange/codereview
Given the following two models: class Company < ActiveRecord::Base has_many :departments accepts_nested_attributes_for :departments end class Department < ActiveRecord::Base belongs_to :company end I can now create a company and its departments in one go: @company = Company.create! params[:company] In this exa...
stackexchange/codereview
Just I'm curious. I have created a lot of convinient categories to the Objective-C classes (NSObject, NSDictionary, NSString...), as long as very interesting subclasses that makes a lot of popular task in the iPhone/iPad programming, to be as easy as putting only one line of code or firing a method. I'd like to share ...
stackexchange/codereview
I have a question. The problem is that I have another process which invoked ShowDialog() method, I need to close this dialog from another process but I need to close it with returning DialogResult.OK. So from my .net program(another process) I want to close it successfully. I tried to use winapi to solve this problem, ...
stackexchange/codereview
I'm confused! Today is November 3rd DateTime DateTime = new DateTime(2010,11,3); long shazbot = 1000000000 * DateTime.Day; shazbot comes out to -1294967296 Huh???
stackexchange/codereview
I have a web page that calls a WCF service that makes a sql database call using Integrated Security. I get an error saying, "Login failed for user 'CorpDomain\ServerName01$'". I want it so that it all layers will execute under the user's AD credetials (working in an intranet), ie: "CorpDomain\Albert". On the server (Wi...
stackexchange/codereview
I am creating an array of arrays in the following way: $final_array = array(); for($i = 0; $i < count($elements); $i++) { for($j = 0; $j < count($elements); $j++) { if($i!=$j) $final_array[] = array_intersect($elements[$i], $elements[$j]); } } I am trying to find out the list of elements th...
stackexchange/codereview
can you give me an example of deleting characters from an array of characters in c? I tried too much, but i didn't reach to what i want That is what i did: int i; if(c<max && c>start) // c is the current index, start == 0 as the index of the start, //max is the size of the array { ...
stackexchange/codereview
I'm a beginner in PyQt. I was trying to create a simple app to try some of the toolkit's many features. My question is, how can I hide the app icon from the taskbar? I don't want the user to be able to see the icon in taskbar and to minimize it using this icon. Is there any window flags that I can use to achieve this?...
stackexchange/codereview
Microsoft provides a bunch of standardized error codes for Windows (http://msdn.microsoft.com/en-us/library/ms681381(VS.85).aspx). When applicable I find them useful to reference in my own applications, instead of creating my own. Is there something similar but specific to .NET?
stackexchange/codereview
I'm trying out the mail pear package. It successfully sends an email but give me the following error: Strict Standards: Non-static method Mail::factory() should not be called statically, assuming $this from incompatible context in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\ClientPortal\classes\S...
stackexchange/codereview
I don't get the Base64 encryption. If one can decrypt a Base64 string, what is it's purpose? Why is it being used for HTTP Basic auth? It's like telling to someone my password is reversed into OLLEH. People seeing OLLEH will know the original password was HELLO.
stackexchange/codereview
I´m working with Quality Control Charts - qcc R package. I need to now how to edit shwehart rules. This is, how can I change the default 8 rules? I see the functions rules, Shewhart.rules, but I can't understand it.
stackexchange/codereview
I've been looking at the possibility of reusing some icons of Mac OS X, most notably the green checkmark (similar to the one in Automator). However, I could not find that icon in any of the application packages or on Apple's documentation. While I can create the image myself, I'd rather reuse something that's supposed ...
stackexchange/codereview
Here is the entire code for my class: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Xml.Linq; namespace SharpDIC.Entities { /// <summary> /// Represents a forum on the Dream.In.Code website. /// </summary> public class Forum { ...
stackexchange/codereview
How can I elongate sliders length and also the width if possible. Most importantly, the length. Below is just pieces of codework on Jsliders. slider = new JSlider(0,180); slider.setMajorTickSpacing(30); slider.setMinorTickSpacing(15); slider.setPaintTicks(true); slider.setPaintLabels(true);...
stackexchange/codereview
class.mysql.php has 2 classes: MySQL and MySQLResult class.mysql.php: <?php /** * MySQL Database Connection Class * @access public */ class MySQL { /** * MySQL server hostname * @access private * @var string */ var $host; /** * MySQL username * @access private * @var ...
stackexchange/codereview
I'm looking to take the output of a WPF RichTextBox which is locked down to only allow certain formatting commands (Bold, Underlined and Italic), and parse it to be plaintext with HTML tags denoting the formatting. This is so that the formatting information can be picked up and parsed by an Oracle Publishing interface....
stackexchange/codereview
Lets say I have a record: -record(foo, {bar}). What I would like to do is to be able to pass the record name to a function as a parameter, and get back a new record. The function should be generic so that it should be able to accept any record, something like this. make_record(foo, [bar], ["xyz"]) When implementing s...
stackexchange/codereview
I have a few questions to ask. Currently, I'm self-learning iphone programming, and later maybe for mac. I just need to make sure my apps works accordingly. So do I need a license to test on the iphone simulator? I don't need to test on a real device. I don't intend to put anything up on apps store in the near future. ...
stackexchange/codereview
I use mercurial patches in the following cases:- When I need to pull from a remote repository and have outstanding uncommitted changes. Then I simply create a patch, qpop it, pull from the remote repository, and then import the patch again. When I need to upload patches to reviewboards. I simply make a patch and uploa...
stackexchange/codereview
How can we change Page Orientation to landscape set Reportviewer to Legal Page Size or A4. Thanks
stackexchange/codereview
I use firefox for my web development and I bet most of you guys too. I've been doing a lot of form development recently and this annoying message "To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier." is just beginning to...
stackexchange/codereview
I have two columns, both int's, Wins and Losses. I have a calculated column WinPercentage as a decimal(14,3), I want this to be: WinPercentage = (Wins + Losses) / Wins What's the syntax for that?
stackexchange/codereview
I am a new Mac (Snow Leopard) user and I found that Python is pre-installed in Mac OS X. What is the difference between Mac OS X pre-installed Python and the one from Python.org? If I install the one from Python.org, will it break anything? Will it be redundant? EDIT What would be a good reason to prefer the Python.org...
stackexchange/codereview
I would like to output some specific HTML on the third iteration of a loop in PHP. Here is my code: <?php foreach ($imgArray as $row): ?> <div class="img_grid"><?= $row ?></div> <?php endforeach; ?> On the third iteration of this loop, Instead of displaying: <div class="img_grid"><?= $row ?></div> I would like to ...
stackexchange/codereview
For example.. <% using (Html.BeginForm()) { %> <%= html.textBox(Model.IwantThisField)%> <%using (Ajax.BeginForm("ActionName", new AjaxOptions { fancy ajax options })) %> <%{%> <label for="stringVar">This is sent to Action</label> <input type ="submit" id="button" /> <%}%> <%= html.textBox(Model.IalsoW...
stackexchange/codereview
I faced a weird problem with day light savings. I have a java program scheduled to run on every day on 00:05 AM time, but yesterday it ran on 23:05. I am using Gregorian calendar to schedule this program in java. It has never ran on 23:05 before this unless someone manually ran it. Does anyone know if this is issue wit...
stackexchange/codereview
I'm making a simple script that works on Jinja2 templates. Right now it's just reading files in from disk manually, i.e. no Jinja Loaders. I have 2 strings (A and B), representing 2 templates. I want to make one template (B) inherit from the other (A), i.e. I have {% block body %}{% endblock %} in A, and I want to make...
stackexchange/codereview
I'm having a great deal of difficulty trying to achieve something that should be trivial. I'm using an Implicit Button Style defined in a global XAML resource file. I just want to change the background color of the focused button to red with a ColorAnimation. I've tried a number of different combinations in Storyboard....
stackexchange/codereview
I use pending_intents and a broadcast_receiver for pending events processing. When the broadcast_receiver receives an intent it creates an instance of a ringtone with STREAM_NOTIFICATION and `play()' it. But sounds is late for a few dozen minutes! I have checked that the pending_intens are come in proper time and the b...
stackexchange/codereview
I have a clone_ptr implementation, as was shown in this question and I have a problem where I need to create a clone_ptr from a raw pointer returned from a function. Here is the code: DOMDocument* doc = impl->createDocument( 0, // root element namespace...
stackexchange/codereview
I'm late to the party with regards to using unit testing... trying to figure best practices and the such. My question is, given a class which is responsible for generating a PDF (or Doc/Html/Xml/etc.), how would I go about testing the final output file is correct? I figure a text based file (xml), I could just see if...
stackexchange/codereview
I have the following lines : for (int i=0;i<3;i++) System.out.print("\nA : "+i); // System.out.println(""); // for (int i=0;i<3;i++) System.out.println("B : "+i); The output is : A : 0 A : 1 A : 2A : 2 Why ? I expected this : A : 0 A : 1 A : 2 But if I uncomment the 2nd and 3rd lines [ together or one at a...
stackexchange/codereview
I have created a connection with Mysql and java program via jdbc. Now I want to populate the tables in the mysql database. How do I parse the data into the tables from the java code? I have two input data files.The format of file is like: "AAH196","17:13:00","02:49:00",287,166.03,"Austin","TX","Virginia Beach","VA" "A...
stackexchange/codereview
Possible Duplicate: Check if a number is divisible by 3 Is it true that a binary number is divisible by 3 iff it has an even number of ones? like 11000 is divisible by 3 whereas 1110 is not.
stackexchange/codereview
Hi everyone I am trying to make a camera app. I am doing this as picker.sourceType = UIImagePickerControllerSourceTypeCamera; where picker is the object of UIimagepicker Controller. But when is run the code then the application terminates showing the error. Terminating app due to uncaught exception 'NSInvalidArgument...
stackexchange/codereview
I am mapping my value Object Item as component withthe folowing mapping configuration { Table("Product"); Not.LazyLoad(); Id(x => x.Id, "id"); Map(x => x.Number, "number"); Map(x => x.Name, "name"); Map(x => x.Description, "description"); ...
stackexchange/codereview
Is there way to problematically get individual bracketed shots from iphone 4.1 HDR photo instead of a single HDR'ed photo?
stackexchange/codereview
I'm currently working on a rather big assembly program it's a chatter bot. It spans currently well over 700 lines of code. In my program I've two labels, my program uses these labels to keep track of certain data that gets moved around in a random manner. Let me explain to you what happened. The job the program has to ...
stackexchange/codereview
I have two models like below:- class Food(db.Model): foodname=db.StringProperty() cook=db.StringProperty() class FoodReview(db.Model): thereview=db.StringProperty() reviews=db.ReferenceProperty(Food,collections_name='thefoodreviews') I go ahead and create an entity:- s=Food(foodname='apple',co...
stackexchange/codereview
I have: public class Person { String name { get; set; } String address { get; set; } bool isMarried { get; set; } } My datagrid gets populated with a list of persons. I want to have a custom column where icon-1.jpg is displayed when isMarried is true and icon-2.jpg is displayed when isMarried is false. H...
stackexchange/codereview
I am using HttpClient 3.1 to connect to a different web services. I have set SO_TIMEOUT and ConnectionTimeout to 3 seconds. I am simulating a service that takes more than 3 seconds to respond. However, actual timeout is much longer, up to few minutes and more. In the end, server is out of memory and stalls. What is goi...
stackexchange/codereview
I wrote a script that contains a few method definitions, no classes and some public code. Some of these methods execute some pretty time-consuming shell programs. However, these shell programs only need to be executed the first time the method is invoked. Now in C, I would declare a static variable in each method to ma...
stackexchange/codereview
I was wondering if we could replace our Atom N270 based nettops that are running a Rails (ruby 1.8.6...) webapp with some equivalent ARM based device (we like the fanless setup, power consumption, etc.). The ARM device was XScale-PXA270 @ 520, 128MB (and probably some slower SDRAMs), running linux, there was always eno...
stackexchange/codereview
The following Haskell program prompts the user for a password in the terminal and continues if he has entered the correct one: main = do putStrLn "Password:" password <- getLine case hash password `member` database of False -> putStrLn "Unauthorized use!" True -> do ... U...
stackexchange/codereview
I have a view on my current project which does something like the following(in haml): -@horses.each do |horse| = render :partial => 'main/votingbox', :locals => {:horse => horse} The in the _votingbox.html.haml file I have the following: %div.votingbox %span.name= horse.name %div.genders - if horse.male ...
stackexchange/codereview
I'm looking for a way for a command line program to be able to email its log4net output to a group of users. Right now, I'm reading the log file but I have to call log4net.LogManager.Shutdown() to release the file so I can read it, and I have to either hard code the log file name or parse the log4net configuration for ...
stackexchange/codereview
I'm setting some global configuration variables in the following manner: $yaml = file_exists('config.yml') ? Spyc::YAMLLoad('config.yml') : array(); $defaults = array( 'hostname' => 'localhost', 'base_uri' => '/wag/' ); $config = array_merge($default, $yaml); Now I'd like to define a function base_url($https) th...
stackexchange/codereview
I'm wondering if there are some serious implications I might be creating for myself by using thread locals. I noticed that in the case of Flask, they use thread locals, and mention that it can cause issues with servers that aren't built with threads in mind. Is this an outdated concern? I'm using thread locals with Dja...
stackexchange/codereview
I have a service that monitors a socket connection. When the connection is lost it needs to display a Toast informing the user that it is reconnecting. This works fine the first time. After that I see the enqueueToast in the log but the toast is not displayed. Any ideas are appreciated. I thought this was going to...
stackexchange/codereview
I have below functions def foo_001(para): tmp = para + 2 return tmp def foo_002(para): tmp = para * 2 return tmp def foo_003(para): tmp = para / 2 return tmp def foo_004(para): tmp = para - 2 return tmp those functions only have different in function names while the algorithm line e....
stackexchange/codereview
Write a program in C, C++, or other suitable language (NOT a shell file) that prevents a process from writing a core dump and displays other limitations on what system resources can be used. I need some guidance to understand how to create and solve this problem. My professor says to use the system command getrli...
stackexchange/codereview
I am quite new to Java. I am still developing with a simple text editor to better understand how the inclusion of packages works for Java. I have my file Test.java, whose first two lines are: import java.util.List; import com.google.gson.Gson; I have tried to download the package google-gson and unzip it in the same...
stackexchange/codereview
Let's say I have a template: template <class N, class I> void add(N* element, std::list<N*> & container, I (N::*f)() const, std::string successmsg, std::string exceptmsg) { //... } And I want to call it for a list of Base Class pointers to a derivative class. add(newAirplane, airplanes, &Airplane::getRegistrat...
stackexchange/codereview
I am trying to create a TCP connection from an embedded controller to a Windows Vista server. I am writing the Windows server part of the application. When the controller attempts to connect, it can take many attempts to establish the connection. I have used Wireshark to debug the problem and it appears that the Window...
stackexchange/codereview
I have finally decided to hop up on the train of MVC 2. Now I have been doing a lot of reading lately and following is the architecture which I think will be good enough for most Business Web Applications. Layered Architecture:- Model (layer which communicates with Database). EF4 Repository (Layer which communicates w...
stackexchange/codereview
I would like to call a static method from a class that I'll determine at run-time, but which I know subclasses a given class. So let's say I have these classes class super { public: super(); static super *loadMe (ifstream &is); } class subA : public super { public: subA(); static super *loadMe (i...
stackexchange/codereview
I made some changes to one of my web pages (CSS and HTML) and now Firefox is not rendering this textarea properly. It has a sort of jitter effect happening in the middle of the top line. I'm not sure if it has anything to do with the changes I made, but what could be causing this? <div id="CommentForm"> <form acti...
stackexchange/codereview
I'm writing a WordPress plugin that requires manipulating files in the plugin directory, and I can't figure out how to diagrammatically determine whether PHP has write permissions to a folder. How would I go about achieving this in a relatively simple manner?
stackexchange/codereview
Given 2 documents with the content as follows "I love Lucene" "Lucene is nice" I want to be able to query lucene only for those documents with Lucene in the beginning , i.e , everything that will match the regexp "^Lucene .*". Is there a way to do it , provided that I can't change the index , and it was analyzed us...
stackexchange/codereview
I'm want to create a menu for a status bar item like the one seen in Tapbot's PastebotSync application: Does anyone have any ideas how to achieve the custom area at the top of the menu which is flush with the top? I've tried/thought of a few potential ways of doing it: Standard NSMenuItem with a view - isn't flush wi...
stackexchange/codereview
Earlier on I've implemented a custom C++ server from scratch, something which is nice and fun to do but is very time-consuming. So I've heard about "servlet" of Java which sounds like something I'm looking for for my next project. I'm looking at ASP.NET to be used as a servlet because it's pretty much mature in terms o...
stackexchange/codereview
I have an html file that accepts user inputs then uses Javascript to calculate a value based on those inputs. That result is then displayed in an input box after the program has finished. What I'd like to do is make it so that when you click on the button to run the javascript, the input box that displays the result w...
stackexchange/codereview
I have a List which has information about images I want to display. Each image has 6 entries containing information about it and there are 20 images. 6 x 20 entries in total. listImg[0] = image_name listImg[1] = image_url listImg[2] = other_info listImg[3] = other_info listImg[4] = other_info listImg[5] = other_info N...
stackexchange/codereview
Ok, this is a bit of a pedantic question but I'd like to make sure I'm understanding the definition correctly. Is the closure moniker used to describe anonymous functions that can lift variables in the local scope (Whether they actually do or not) or only when they do lift variables in local scope? In other words if an...
stackexchange/codereview
In MediaWiki, I want to change the user names in the history and recent changes to the "real name" as entered in the user's preferences. For example, in the recent changes I see this: (diff) (hist) . . Somepage‎; 11:03 . . (+285) . . Coolguy123 (Talk | contribs | block) But I want to see this: (diff) (hist) . . Somepa...
stackexchange/codereview
select count(distinct id) from svn where name='ant' and type='Bug' and select count(distinct id) from svn where name='ant' and type='Feature' Is it possible to combine them into a single query that might reduce the execution time compared to running them individually? Thanks for answering.
stackexchange/codereview
I am interested in using the python list object, but with slightly altered functionality. In particular, I would like the list to be 1-indexed instead of 0-indexed. E.g.: >> mylist = MyList() >> mylist.extend([1,2,3,4,5]) >> print mylist[1] output should be: 1 But when I changed the __getitem__() and __setitem__() met...
stackexchange/codereview
Technically not a django question, more a python question. In urls.py I've got the following: urlpatterns = patterns('locate.views', url(r'^', 'index.index'), ) And a directory structure like this: locate/ views/ __init__.py index.py # where there is "def index(request) : ...." What I would like ...
stackexchange/codereview
I am working on a few devices that need to send raw data to an android device wirelessly (wifi). The android devices needs to be able to support multiple devices so I figured a server is best. Is there a way to have the android device act as kind of a router/server access node by producing its own LAN network? Any poin...
stackexchange/codereview
I find myself in a unique scenario -- it has to be, because no searching I do seems to turn up any answers. But maybe there's a MacOS X guru out there that can answer this for me? I'm using PackageMaker to create an install process for my company's application. It's a cross-platform app and my home base is Linux and ...
stackexchange/codereview
hope not to be .. boring. In my video game development (2d, in Sdl.NET), i would like to create some 2d "map" (top-down map, also called flybird i suppose). I would like to create Big Map, for example 4000x4000 px. Obviously, i would like to show only what the user resolution can be. If my user uses 800x600, i must...
stackexchange/codereview
I have an application that has a WinForm(myForm). In that WinForm there are a WPF UserControl(myWPF). In that WPF UserControl there are a WinForm UserControl(myWinCtrl). The myWinCtrl has a custom WinGrid(myWinGrid). myWinGrid does internally a this.FindForm() and.... does not find myForm... Is there a way to override...
stackexchange/codereview
We have a WCF service self-hosted in a Windows Service. Right now we're experiencing a really strange behavior with it, which is that every 23 hours, approximately, the service raises an exception for every call made to it with the following error: Server was unable to process request. ---> The request channel timed o...
stackexchange/codereview
In C++ or any other languages, you can write programs that continuously take input lines from stdin and output the result after each line. Something like: while (true) { readline break if eof print process(line) } I can't seem to get this kind of behavior in Python because it buffers the output (i.e. no prin...
stackexchange/codereview
I have created a small class library using .net 3.5 which builds a DLL that I want to use in an Access 2003 database. I have checked the Register for COM interop in the Compile options. Once the Build is done, there is dll and tlb file created. I now reference the TLB file in my access database and it works with no i...
stackexchange/codereview
Is there a way to modify a UIElement's contents? I have something like this: System.IO.FileStream rdr = System.IO.File.OpenRead(xamlFilePath); System.Windows.UIElement uie = (System.Windows.UIElement)System.Windows.Markup.XamlReader.Load(rdr); And when I run the debugger and add uie to the "Watch" window, it gives me ...
stackexchange/codereview
Related to this I want to know what exactly is a nested name specifier? I looked up in the draft but I could understand the grammar as I haven't taken any Compiler Design classes yet. void S(){} struct S{ S(){cout << 1;} void f(){} static const int x = 0; }; int main(){ struct S *p = new struct ::S; ...
stackexchange/codereview
Since I want to diff all the changes I made since 7 or 10 days ago, without seeing the changes of other team members, so I keep a clone, say c:\dev\proj1 and then I keep another clone that is c:\dev\proj2 so I can change code for proj1, and then in another shell, pull code from it, and merge with other team members, ...
stackexchange/codereview
In an app, I am looking forward to implement server push functionality. I have gathered some information about the technology also, but I am little confused that with which language should I prefer for and what else requirement needed(note: this is going to be a social n/w app)? I have just finished a project based o...
stackexchange/codereview
I've found a scale, Detecto AS-350D (http://cardinal-detecto.centralcarolinascale.com/AS-PC-Computer.htm), that hooks up to a computer. I was hoping someone could help me figure out how to get the information (weight) from it. I've looked around but can't seem to find any information on it. I've never wrote a program...
stackexchange/codereview
While testing application performance, I came across some pretty strange GC behavior. In short, the GC runs even on an empty program without runtime allocations! The following application demonstrates the issue: using System; using System.Collections.Generic; public class Program { // Preallocate strings to avoid ...
stackexchange/codereview
How does the patience algorithm differ from the default git diff algorithm, and when would I want to use it?
stackexchange/codereview
i am working on a calendar interaction module. the calendar shows days reserved. a reservation interval is 7 days. i have set up via javascript that hovering a day adds a class and auto-hovers 3 days before and 3 days after this day too to visualize the 7-day-interval setting that class there too. now i stuck with the ...
stackexchange/codereview
i am using the following code to hide the Actions menu from Discussion Board list. The code is : <script src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.3.2.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function(){ $('.ms-menutoolbar td:lt(4)').hide(); });...
stackexchange/codereview
Somehow my news is pushed down in Internet Explorer 7 (on all other browsers its ok). I want to get rid of the gap between the menu's and the news, so the news will fit to the menu area's. Any idea where I can find the missing link? Website is: http://www.e107webdesign.nl Help would be appreciated.
stackexchange/codereview
I know it is possible to use TelephonyManager to get information like: service state, device ID, Sim Operator, etc... Is it possible to edit some of this information? Couldn't find .set() functions on Android.com documentation but I've found the GSMPhone.java source code which includes functions like .setNumber1Number(...
stackexchange/codereview
I'm trying to have my LaTeX articles print with both the current date and the time. I found a package called datetime which lets me redefine \today to a variety of formats. But it doesn't have an obvious way to modify \today to include the time, and the code is so twisted that I can't figure it out myself. Is there an...
stackexchange/codereview
I'm kinda new to Python, so i'm still lost in the whole namespace thing. I've created a package, with the init file in it and also a classname.py file, with the class, obviously. For instance: from parachute import container, emitter I tried to instance the class Container directly, but it gave me an error, so i had to...
stackexchange/codereview
I have a single Python process which is using a serial port (unique resource) which is managed using an instance of a class A. There exists two different threads initialized using instances of classes B and C, which are constantly using the serial port resource through the objected already created. import threading Cl...
stackexchange/codereview
How can you get the HTTP Referrer when redirected from another website, not when they click on a link since it would work for $_SERVER['HTTP_REFERER'], but it doesn't work when a user has been redirected a website and the referrer would be empty. What will be the method to get the referrer?
stackexchange/codereview
This is just a really novice question on jQuery but I'm just using it to create a simple accordion menu. The HTML ouput is like this: <ul id="nav-sub"> <li class="sub-level-0"><a href="#">Menu Item One</a></li> <li class="parent-here last sub-level-0"><a href="#">Menu Item Two</a> <ul> <li class="here su...
stackexchange/codereview
I am writing and distributed image processing application using hadoop streaming, python, matlab, and elastic map reduce. I have compiled a binary executable of my matlab code using the matlab compiler. I am wondering how I can incorporate this into my workflow so the binary is part of the processing on Amazon's elasti...
stackexchange/codereview
I'm pretty new to this whole Terminal business and had things working nicely on my old laptop with Snow Leopard installed. New laptop with Snow Leopard works differently, however. When using the terminal, when trying to get auto-completion to work, it won't auto-complete for directory names with spaces in them. I know ...
stackexchange/codereview
I am trying to download a zip file that is just less than 22 mb on start. I changed the default BufferedInputStream after these exceptions, but still get an out of memory error. public void downloadFromUrl(String fileName) { //avoid unknown host exception try { InetAddress i = InetAddress...
stackexchange/codereview