instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm using pythonbrew to install Python 2.6.6 on Snow Leopard. It failed with a readline error, then a socket error. I installed readline from source, which made the installer happy on the next attempt, but the socket error remains: test_socket test test_socket failed -- Traceback (most recent call last): File "/User...
stackexchange/codereview
I'm writing a class that can take my own RGB images and display them to windows using GTK+-2.2. My Image class stores the images as packed 24-bit RGB bytes, so the conversion should be trivial. I'm using the gdk_draw_rgb(...) method to draw to my window, but nothing gets drawn at all - the window just shows up gray. I...
stackexchange/codereview
What is the purpose of volatile keyword in C#? Where would I need to use this keyword? I saw the following statement, but I am unable to understand why volatile is required here? internal volatile string UserName;
stackexchange/codereview
I am looking at trying to place a hover() method onto each array element. Then when the cursor rolls over the character, it is copied into another div. I am kinda lost. Do you have suggestions? <html> <head> <script type="text/javascript" scr="http://code.jquery.com/jquery.min.js"> </head> <body> <script type="tex...
stackexchange/codereview
I wanna serve my application in ISS to be accessed from many different URL's on my web server. eg. http://example.com/test1 http://example.com/test2 Both these URL's get served by the same application. I do NOT however want to just create new virtual applications to the application, because it stuffs up the user member...
stackexchange/codereview
I tried to load a list of values from a table, but the cursor doesn't find the columns? The Code which is buggy: public final AccessToken[] fetchAccessTokenByServerId(final long serverId) { final Cursor c = db.query( ACCESS_TOKEN_TABLE, new String[] { ACCESS_TOKEN_COL_ID, ACCESS_TOKEN_COL_VA...
stackexchange/codereview
Can anyone show me a query in MySQL that would delete rows from all available columns. I use this to insert rows: $sql = "INSERT INTO " . KEYS . " // KEYS is a constant (key, user_id, time, approved) VALUES ('" . $randkey . "', '" . $user_id . "', '" . $time . "', '0')"; I need the opposite of this now, d...
stackexchange/codereview
I'm trying something like my first comparison App in Obj-C and i'm already running into trouble. Well, there is a textBox with unamebox:(id)unb and a textfield NSTextField* myOut; Well, here was my first try: if ([unb stringValue] == @"hello") { [myOut setStringValue:(NSString *)@"hello dude"]; } else { ...
stackexchange/codereview
<beans> <batch:job id="job1" restartable="false"> <batch:step id="step1" next="step2"> <batch:tasklet> <batch:chunk reader="readerA" writer="writerA" commit-interval="1" /> </batch:tasklet> </batch:step> <batch:step id="step2"> <batch:tasklet ref="tasklet1"/> </batch:step> <batch:listeners> ...
stackexchange/codereview
I wanted to check my JavaScript with JSLint. I am also using jQuery and JSLint seems to be very unhappy about jQuery. So, if I have this code: $(document).ready{ $("a").click(function() { // foo }); }); I am getting a few JSLint messages: Error: Problem at line 1 character 1: '$' was used before it wa...
stackexchange/codereview
I have a fairly complex piece of Javascript that works flawlessly with no errors in Google Chrome, Firefox, Safari, and Opera. However, as tends to always be the endlessly annoying case, it completely fails in Internet Explorer. I have tested in IE7 and IE8 and get the same error: Invalid argument. prototype.js, lin...
stackexchange/codereview
I wrote a solution that involved OpenProcess, EnumProcessModules, GetModuleInformation and GetModuleBaseName, but apparently EnumProcessModules and GetModuleBaseName do not exist in Windows CE! What alternative is there?
stackexchange/codereview
i want to customize my tableview, like the tipulator app for the iphone. And heres my app:
stackexchange/codereview
I have the below code-behind: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } ObservableCollection<int> sampleData = new ObservableCollection<int>(); public ObservableCollection<int> SampleData { g...
stackexchange/codereview
I have a Swing program where work is continuously being done in a non-Swing thread. It often needs to update a JTextPane -- frequently many times per second. I realize that setText() needs to be called from back inside the event-dispatching thread, but I cant figure out how to make this happen smoothly. The following m...
stackexchange/codereview
In visual studio I am creating an addin, in the addin_startup I am setting an Outlook application to app = (Microsoft.Office.Interop.Outlook.ApplicationClass)(Marshal.GetActiveObject("Outlook.Application")); then I am calling a runMacro function which I got from msdn private void RunMacro(object oApp, object[] oRunAr...
stackexchange/codereview
What would be the correct way of having an animated GIF icon for Firefox and a fallback ICO file for other browsers?
stackexchange/codereview
Is there an algorithm that allows to delete multiple nodes in RB or the only algorithm to delete nodes from RB is to do it in a way: 1. Delete one and 2. if necessary fix tree
stackexchange/codereview
I'm really new to Windows Forms programming and not quite sure what's the right way to go about programming. This is my confusion. I have a single form: public partial class ReconcilerConsoleWindow : Form { public ReconcilerConsoleWindow() { InitializeComponent(); SetLogT...
stackexchange/codereview
I need to create a database in SQL Server, which will be able to support English, Hebrew and Arabic. How can I do it? Thanks
stackexchange/codereview
I understand that it is not really how Roo was intended to be used, but I was to knock up a quick demo with Roo to run within a console app. I have created a basic app with the following Roo Script: project --topLevelPackage com.xetius.maths persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY entity ...
stackexchange/codereview
I'm trying to write some code to pull down images from SharePoint Foundation 2010 using the Managed Client Object Model. Specifically, I'm trying to get the image bytes from images stored in the Site Assets Document Library. Can anyone explain how to do this or provide some sample code? Thanks for any help!
stackexchange/codereview
I want to make a tool that can measure angles between two user defined spots on a form. I have no code to do this at the moment, so any code would be appreciated. Thanks UPDATE It needs to be in Degrees and my points are 3 pictureboxes, each with different colours on each of the three points for the angle to be measure...
stackexchange/codereview
EDIT: Is it possible to use Entity Framework with Windows Azure development storage service? and how? Thanks.
stackexchange/codereview
Ok am new to programming so go easy on me. I want to make a program that allows a user to input a name, marital status, sex and residence of 30 students. Here's my code and the only problem is the program is allowing inputs above the expected 120 inputs. #include <stdio.h> char std[30][40]; int x,y; main() { printf...
stackexchange/codereview
Let's say I have the following table in SQL Server 2008: ProfileID int //identity; index: unique, primary key, clustered ClientID int RegionID int ProfileName nvarchar(50) Columns 2 and 3 link to their respective tables via foreign relationships. Let's say my most common query is this: SELECT ProfileI...
stackexchange/codereview
Hi all i am trying to save image in the bundle which i have currently on my view,but the problem is that i can only save one image,if i want to save the another image it replaces the old.I am not getting how to save the multiple images in the bundle then. Here is my code. - (void)writeImageToDocuments:(UIImage*)image ...
stackexchange/codereview
I have a CSV file that I'm totaling up two ways: one using Excel and the other using awk. Here are the totals of my first 8 columns in Excel: 1) 2640502474.00 2) 1272849386284.00 3) 36785.00 4) 5) 107.00 6) 239259.00 7) 0.00 8) 7418570893330.00 And here's my awk output: $ cat /home/jason/import.csv | awk -F "\"*,\"*"...
stackexchange/codereview
I am trying to create a game on the iPhone, however I am running in to some (I hope) simple, yet confusing issues. I am forcing my application to be in UIInterfaceOrientationLandscapeRight mode, this is set in the .plist and each of my UIViewControllers returns this as the only viable orientation for shouldAutorotateTo...
stackexchange/codereview
I'm wondering how to forbid access to the all directories except one using .htaccess file. The construction like <Directory /> Order Deny,Allow Deny from all </Directory> <Directory /folder> Order Deny,Allow Allow from all </Directory> raises Error 500. It can be put only in apache conf file, right? ...
stackexchange/codereview
I've been searching around online for a while now and I can't seem to find any particularly impressive function references for JavaScript. Of course, QuirksMode and w3schools have good information, but they're not as complete for JavaScript as the flash component reference and jQuery API are for flash and jQuery. So do...
stackexchange/codereview
Folks, We are trying to use the strongly typed action link methods that look like this: Html.ActionLink<HomeController> in the Razor view engine. I know we shouldn't use them all the time because it ignores filters, etc., but the fact is we do use them. If I try to use this directly in Razor like so: @Html.ActionLink<...
stackexchange/codereview
I it possible to create a bit map font file from a true type font using java ? Thanks
stackexchange/codereview
I wrote this script to find all files/directories to which $WWWUSER has write permissions. At first I stored the remaining, matching items in a temporary file. I new there must be a way without using files, so this is my "solution". It works, but it's pretty slow. Any tips? Update: On a directory structure containing a...
stackexchange/codereview
How to create communication between Asterisk and my .net application: for example If user dial my asterisk gateway I would like to check his number and return some wave file. when user dial "1" I would like to run some procedure on my app and return other wave file etc. I Use http://www.asteriskwin32.com/ Is there an...
stackexchange/codereview
As an exercise, describe the relationship between string.join(string.split(song)) and song. (they both refer to a string) Are they the same for all strings? When would they be different? I am a little ashamed to ask such a question for a likely simple question but, I don't get it, what is/are the exception(s)? when a...
stackexchange/codereview
How do I put a localized message on the face of a submit button? I am using Wicket, and normally to use a localized message, I'd use something like <wicket:message key="message-key"/> I have an HTML button defined as <input type="submit" value="login"/> I want to localize/internationalize the value 'login' Any ideas?
stackexchange/codereview
I have a database of last names, first names, addresses, etc. I am trying to search by last name, and I have no problem with escapting apostrophes, for example, the data in the table is "O'Malley" and if I search for "O'Malley" I get the intended results. However, I would also like to be able to search for "omalley" ...
stackexchange/codereview
I have an entity that has a CallBackListener registered using postPersist and postUpdate. The listener takes the entity and submits the ID to a JMS queue which perform further processing. The message submission and consumption are so fast that they're occurring before the original session has completed it's transaction...
stackexchange/codereview
Set up: I'm using Zend Framework I have a controller plugin that checks routes against my application settings and redirects to https if required or standard http if not. I based my controller plugin on this blog entry. My forms "pop-up" using Fancybox Issues: If I'm on a non-ssl page when I initiate login, the form...
stackexchange/codereview
I want to set a search configuration for all of my rails (2.3) app's connections like so: "SET default_text_search_config = 'public.my_search_config';" Where is the most correct place to do this? An initializer? monkey-patching the adapter? Examples welcome :)
stackexchange/codereview
I have this homework problem. I'm suppose to write a program that does the following: Sort the letters in the sentence into the ASCII collating sequence (i.e. alphabetically). Print the results and the total number of characters in the sentence. Next, print out a list of the number of times each letter occurred in th...
stackexchange/codereview
I'm trying to make a polynomial operator (sum, rest, multiplication and division of two or more polynomials). The code must be in Java and using linked lists. I was wondering how do calculators or how to validate whether a polynomial is valid or not. I want to construct a polynomial from a String, but I don't know if t...
stackexchange/codereview
I have a listview and I override the onScroll event for it so that I can get the first character of the text on the first visible item of the listview. My code is as follows: @Override public void onScrollStateChanged(AbsListView view, int scrollState) { // } @Override public void onScroll(AbsListView view, int fir...
stackexchange/codereview
SQL Server 2005 and later stores metadata in the sys tables (sys.objects, sys.columns etc.) Using Entity Framework 4 in Visual Studio 2010 is it practical to generate a model on these sys tables as a way of working with the metadata? My intent is to use it read-only.
stackexchange/codereview
I'm not sure how I got to this state, but last time I had to re-install eclipse to fix it, and today it happened again. Running jboss 5.1.0GA, eclipse helios (last time galileo), jdk 1.6.0_17. Basically, after a hot-deploy, running jboss in debug mode is incredibly slow. JVM/Computer/Eclipse restarts do not fix it. R...
stackexchange/codereview
A question about recursion (and tangentially the graphing library networkx): I have an directed graph with node that have edges that have an attribute ["value"] that can be 0 or 1 (effectively edge weights). I want to be able to examine a node's neighbor recursively until a neighbor's node fails a certain threshold. F...
stackexchange/codereview
I am trying to create a custom add page for appointments for telerik scheduler. I want my page to be displayed rather than the add appointment template built in the scheduler. I looked at the Advanced Insert Template but I don't think it allows redirecting to a custom page.
stackexchange/codereview
Hello I've been searching for a web hosting site that enables php frameworks, e.g. yii, cakephp, symfony, or are you forced to have an own server if you want that? Thanks in advance.
stackexchange/codereview
so, all the items in my webshop have timestamps on them. the date is updated every time the item is available and it will not update once the item has become unavailable. so far so good. for example now there is an item that was last available on 2010-09-25 (this is the format of the timestamp). what i want to do now i...
stackexchange/codereview
I can not really figure how to change my home wallpaper from either resource or a URL. Whould really apprieciate if you tell me or send a link to a new developer :) //from me to you
stackexchange/codereview
Anyone know how I can do to when I select the row does not disappear me the background image of the cell that I inserted? Thanks Vert Much! Jero
stackexchange/codereview
I have one remote server that runs apache+mysql and i have developed an appication in my home computer to administrate my database. My application from my home-pc connects to my remote server and i am administrating my database (as i said mysql runs on the same remote machine) from my home pc. The following days, due t...
stackexchange/codereview
i have a stored proc that uses FOR XML and wanted to know how to load the xml in my asp.net c# code?
stackexchange/codereview
When is it appropriate to use pickle, and when is it appropriate to use shelve? That is to say, what do they do differently from each other? From my research, I understood that pickle can turn every Python object into stream of bytes which can be persisted into a file. Then why do we need shelve as well? Isn't pickle f...
stackexchange/codereview
I built a simple ASP.NET website which has a menu with all the page URLs linked to each menu item. when I click on a menu item the page URL appears in address bar like "http://mywebsite/xyz/webform1.aspx". I would like to hide this page url and instead show only URL of the website like "http://mywebsite" for all pages....
stackexchange/codereview
Here's my Code: NSString *js =[NSString stringWithFormat:@"document.getElementsByTagName('body')[0].innerHTML = '<h1>%@</h1>';",s]; [pageView stringByEvaluatingJavaScriptFromString:js]; pageView is a UIWebView already loaded with an html document. I want it to show the NSString s. However, when this function is called...
stackexchange/codereview
I've got a .NET Compact Framework application, which targets a number of different handheld devices, with varying resolutions. At the moment, I've built it for one resolution, and then have checks on loading forms to see what resolution the current device has and then I manually load images for that resolution, handle ...
stackexchange/codereview
I'm working with an existing Service and can't sort out why its not using a custom configuration. My service class looks like this: [ServiceBehavior(Name = "MagicService",Namespace = Namespaces.NS_Magic_ADMIN_SERVICE, ConfigurationName = "MagicServiceConfiguration")] public class MagicService : IMagicService Service...
stackexchange/codereview
Considering the following simple entity association: (EntityA) *-1 (EntityB) made in database with a foreign key in EntityA (entityB_id). The JPA Entities are mapping this relationship unidirectional: @Entity EntityA { @Id @GeneratedValue private long id; @Column(nullable=false,length=250) private ...
stackexchange/codereview
I would like to replace that : $p = new sfWidgetFormI18nChoiceCountry(array('culture' => 'en')); by $p = new sfWidgetFormI18nChoiceCountry(array('culture' => getCulture())); but i'm missing one accessor to use getCulture and i can't remember what. What is the acessor to use getCulture on the form class ? What's your...
stackexchange/codereview
I am curently using the follownig conditions, but they aren't working across browsers or at all: if (typeof (window.innerHeight) == 'number') { //Non-IE: //Perform operation using window.innerWidth/Height } else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.cl...
stackexchange/codereview
I'd like a local process on my machine to be able to trigger javascript in a specific tab in my local Google Chrome browser. The tab is not connecting to localhost, but to another known domain. This may sound a bit weird, but what I'm actually trying to do is allow my in-browser music player to be controlled via globa...
stackexchange/codereview
I've seen this done in a lot of places. I am wondering what the best way to go about implementing this is. Basically what you have is a list of users. The interface shows each user on a line (table?) and has check boxes for options that are displayed as columns. Action buttons on bottom and/or top of the table allow e...
stackexchange/codereview
I'm looking to load a GridView with a generic list and have the columns be auto-generated. I am getting an exception that it does not have the correct properties to allow it to auto-generate the columns. Exception The data source for GridView with id 'GV1' did not have any properties or attributes from which to generat...
stackexchange/codereview
I am new to Spring 3.0 with Annotations. I have added a new attribute which should be referred in the new jsp however it keeps referring to old attribute.
stackexchange/codereview
I'm trying to setup the iPhone Unit Testing framework from google-toolbox-for-mac. I've got a simple unit test created and try and build it and receive the following error. A coworker of mine can use the same project and build successfully on his machine. For the life of me I can't figure out what I might be missing...
stackexchange/codereview
Code has_many :open_invoices, :class_name => "ArInvHeader", :finder_sql => 'SELECT ar_inv_headers.* FROM ar_inv_headers WHERE customer_id = #{id} and orig_amt = (select sum(amount) from ar_inv_actions,ar_inv_headers where ar_inv_actions.ar_inv_header_id = ar_inv_headers.id)' I am getting this error. ActiveRecord::Sta...
stackexchange/codereview
I currently have a POCO class in my ASP.NET MVC project that handles all business logic. There are no references to other projects or third-party assemblies. I am also using AutoMapper in my other projects to facilitate mapping between view models / entities. It is a fantastic tool and saves me considerable time when...
stackexchange/codereview
I have a weird problem. I have a UINavigationController with UITableViewController inside. In a nutshell: UINavigationController + UITableViewController + change device orientation causes: [CALayer release]: message sent to deallocated instance The problem: after fast scrolling table and changing device orientation a ...
stackexchange/codereview
Can someone please explain me the meaning of "For a very simple application it is certainly the case that Core Data adds some overhead (compare a vanilla Cocoa document-based application with a Cocoa Core Data document-based application), however Core Data adds significant functionality." I found this in Core Dat...
stackexchange/codereview
I am writing a shell script that parses a logfile. The important part is this: rx=$(echo "$logfile" | grep -o "rx_value.*" | grep -o "[0-9]\{1,10\}") echo rx=$rx The following is printed to STDOUT (WRONG): rx= If i remove the double qoutes from $logfile like this: rx=$(echo $logfile | grep -o "rx_value.*" | grep -o "...
stackexchange/codereview
Suppose I have a template which takes 3 template parameter. I want the third template parameter to be taken by some another template say "CHECK" that may return any integer in case as CHECK fails else "1". In case of "1" class X is specialized. As shown in following code. How can I achieved it, i.e. how can I force ...
stackexchange/codereview
Problem: I build a project with Flash Builder. I copied everything from the "bin-debug" directory to a server (including all images we use which are under /assets). After I have updated the project, and a few images, i recopy the primary .SWF file (Main.swf) and everything under assets up to the server again. Unfortuna...
stackexchange/codereview
So here's my dilemma. I am familiar with compiling programs from makefiles on the command line. I am more than familiar with compiling programs in Xcode. My question is - Is there a straightforward process for converting a makefile to an Xcode project? Just to be clear, I know how to build an Xcode project with an e...
stackexchange/codereview
I'm creating an application with google maps api with geocoding functionality. Obviously, I want to use the api that is the most accurate. I'm giving the application an address and I need to find it on a map, but I would be ok with just finding the latitude and longitude, and then I can use that to incorporate it into ...
stackexchange/codereview
This string substitution works: "reverse, each word".gsub(/(\w+)/, "\\1a") => "reversea, eacha worda" and like this, which is basically the same thing with single quotes: "reverse, each word".gsub(/(\w+)/, '\1a') => "reversea, eacha worda" but if I try to reverse the string, it fails: "reverse, each word".gsub(/(\w+)...
stackexchange/codereview
Do any developers out there have any experience developing and deploying a .NET Windows Forms application to Japan, using Kanji, Hiragana, and Katakana Japanese language scripts? I am wondering what impacts need to be considered for validating data, inserting/updating, searching and sorting data using SQL Server 2008...
stackexchange/codereview
I'm working on a parser in PHP (which is very new to me) to search through the following source: http://web2.uconn.edu/wdlcalendar/index.php/month/list/2010-11-02/All/All/UConn_Master_Calendar1/ The goal of the parser is to store the desired information in a database on the local machine: we want the date (eg November ...
stackexchange/codereview
I want to create a sortable for files. When an item is dragged a 'new folder' should come up. When an item is dragged there there should be a new folder added to the UL. Maybe it gets clearer on this page I set up on jsFiddle: link text. As soon as a file is dragged to 'new folder' it should be inserted in the list an...
stackexchange/codereview
I'm trying to find out of there is any Speech(or Voice) API(for Android) which can be used for recognition of the speaker. My aim is creating application which is going to recognize the speaker and differentiate it from another person, which can serve like authentication. Thanks in advance, Serhiy.
stackexchange/codereview
After upgrading OpenEJB from 3.1.2 (uses CXF 2.0.9) to OpenEJB 3.1.3 (uses CXF 2.2.10) CXF-based web-services are broken with the following exception on a server side: org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging WARNING: Interceptor for {http://xxxxxx.com/wsdl}ProInfoMgmtWebService has thrown except...
stackexchange/codereview
I have JSON data like shown below. I only included column names once to save data size. Please let me know how do I convert this to C# object list. // JSON { "COLUMNS": [ "id", "country","lastname", "firstname", "email", "category" ], "DATA": [ [43, "USA", "jon", "doe", "doe@gmail.com", "HR...
stackexchange/codereview
I need a very simple(*) image editor made in Flash so the users of my web page can edit pictures and then save them to my server. I'm beginning this project trying to save to a jpg or png the content of a movie clip, but I didn't find any information on Google. Can you give suggestions of how to begin? And if you know ...
stackexchange/codereview
I have overridden the finish call in a sub-activity like so @Override public void finish() { Log.e(this.toString(), "======== finish ========"); if(!this.exiting) { Log.e(this.toString(), "======== set RESULT_OK ========"); // Notify the caller Activity that the user succ...
stackexchange/codereview
I'm learning to use the Glassfish 3 REST interface directly, since the admin web GUI is so damn slow that it's barely usable. So, for example, I do this: curl -s http://localhost:4848/monitoring/domain/server/transaction-service This works fine on my personal instance of Glassfish, which has a blank password for the a...
stackexchange/codereview
I'm using the query_posts for "Page" item rather than "Post". I want to have the ability to make the "featured" page always on the top, we could add a custom field called "featured_product", if it's eq "1" then display the post as the very first one. Here is the basic code for the query. Someone help please!? <?php que...
stackexchange/codereview
I have a nested SQL query : SELECT DISTINCT(topic_id) FROM bb_posts WHERE topic_id NOT IN ( SELECT topic_id FROM bb_posts WHERE poster_id = $user_id AND post_status = 0 ) ORDER BY post_time DESC My webserver runs MySQL 4.0 which doesnt allow nested queries. Can some SQL guru suggest the same query using the JO...
stackexchange/codereview
I am attempting to pull an IQueryable from my DomainService class to my XAML code behind using RIA services. The DomainService pulls from a BLL, which pulls from a DAL, which gets it from EF. I cannot seem to access the foreign table in the XAML, but I can access it just fine in the DomainService method. The DomainServ...
stackexchange/codereview
I've coded my first slightly-complex algorithm, an implementation of the A Star Pathfinding algorithm. I followed some Python.org advice on implementing graphs so a dictionary contains all the nodes each node is linked too. Now, since this is all for a game, each node is really just a tile in a grid of nodes, hence how...
stackexchange/codereview
I have a program that heavily uses std::map. Under Windows, much more memory is used as under Linux. Has anyone an idea why this happens? Linux: Last process took 42.31 s and used not more than 909 MB (RSS 900 MB) of memory Windows: Last process took 75.373 s and used not more than 1394 MB (RSS 1395 MB) of memory I use...
stackexchange/codereview
I am working through some DSP, in regard to writing music related software, and am getting confused by terminology. I am starting to wonder whether these entities are inherently confusing / handwavey / loosely defined... Frequency is clear: Cycles per second, Hz. Pitch, Tone and Note are not clear to me. In addition ...
stackexchange/codereview
I'm writing some views in Django, the are just python functions really. I'm curious as to whether there's a better way for me to arrange my files. It this... import a, b def x(request): return a(request) def y(request): return b(request) Less efficient than putting it in two files? import a def x(request): return a(re...
stackexchange/codereview
OK, my understanding of the mathematical workings of RSA may not be as deep as it should, so feel free to slap me over the head if this is stupid: To generate a private key, we need two random big primes. There is no algorithm that can do that precisely and efficiently, but there are algorithms that can generate big nu...
stackexchange/codereview
I have a TableLayout with 3 TableRows, each TableRow has 3 ImageViews. Each ImageView has fitCenter for Scale type, and a weight and width per this stackoverflow answer. Now all the images scale to fit into the row, but each row is way taller then it needs to be. Here's an excerpt of the xml: <TableLayout android:id="@...
stackexchange/codereview
We're developing a GWT app that makes heavy use of the Google Maps Library. That is, there is always (at least) one MapWidget attached to the DOM. Is it somehow possible to mock out the Google Maps API? We're trying to speed up the loading time of the application in development mode use development mode in situations ...
stackexchange/codereview
I have the below code to display a simple table in a classic asp page inside of a Sharepoint WebPart. There are three cells because they are individually filled with an ADODB recordset. However....there is about a quarter to half an inch of dead white space around the table. I would like the data in the table to sh...
stackexchange/codereview
My application is basically a image viewer. It is opened from both camera and as a separate application. I open the image viewer to view and edit the picture. Each edit operation is implemented using thread. If my application closes due to pressing the home button, the next time I open it with camera. It throws anr. Th...
stackexchange/codereview
If I have an instance of Bifunctor[A,A] bf, a function f : A => A and a Boolean value p: def calc[A, F[_,_]: Bifunctor](p: Boolean, bf: F[A, A], f: A => A): F[A, A] = { val BF = implicitly[Bifunctor[F]] BF.bimap(bf, (a : A) => if (p) f(a) else a, (a : A) => if (!p) f(a) else a) } How can I put this more concisely ...
stackexchange/codereview
Trying to get a handle on how to think in terms of actors instead of threads. I'm a bit stumped on the following use case: Consider a system that has a producer process that creates work (e.g. by reading data from a file), and a number of worker processes that consume the work (e.g. by parsing the data and writing it ...
stackexchange/codereview