instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I'm getting a hell of a lot of 500 internal server errors on our web application right now. I've been off three weeks and just came back and genuinely have no idea what has caused it. The problem I've got is that this error message is so vague, I have no idea what exactly is going on! On our old server it used to displ...
stackexchange/codereview
Thank you to Yuji for answering another question I had and pointing me to this article about dynamic ivars in Objective-C. However, as explained in my other question the sizeof operator now behaves inconsistently. In short, sizeof will not take into account dynamic ivars from outside the class .m file but will take th...
stackexchange/codereview
I saw in a screencast a while ago (since forgotten which, probably a Kata) where a person was writing out a unit test but wrote something like this: public "return zero for an all gutter game" Then they magically turned it into public returnZeroForAnAllGutterGame Is there a plugin for this or just a simple way to do a...
stackexchange/codereview
Is there a way to have an global settings variable for an android application, which is accessable as well from any help java classes without giving them context?! I try to explain what I mean. I have an application version as string value in strings.xml I can get its value from every android activity, but not from he...
stackexchange/codereview
I've started a new Maven project in NetBeans, accepting all the defaults. The POM, with all the JAR dependencies stripped out, is cut-n-pasted at the bottom of this question. The application reads in various properties files (e.g. logging and config). It also reads in external resources such as fonts, images, and sou...
stackexchange/codereview
I'm fairly new to Django, but I have a good grasp of the basic concepts. I have a good knowledge of Python. I've got an application, and I want to be able to load data into my application periodically (by loading a view, for now). This data comes from an XML API on the web. For simplicity, let's say I only have one mod...
stackexchange/codereview
Possible Duplicate: Classic error, NoClassDefFoundError The previous question was a mistake which I use javac not java, I was able to compile but cannot run the code ...>java -cp xSocket-2.8.14.jar SocketClient produce import org.xsocket.connection.*; import java.io.IOException; public class SocketClient { pu...
stackexchange/codereview
how to make somthing like this Windows Forms Glass Effect, Make ImageBox transparent I use VS 2010
stackexchange/codereview
I'm creating a small iPhone app, when application lauches, it will ask the user to sign up or Login. If they choose sign up safari will open. This part is done. ////button code button = [[UIButton buttonWithType:UIButtonTypeRoundedRect] retain]; button.frame = CGRectMake(10, 150, 300, 50); [button setTitle:@"Lo...
stackexchange/codereview
Can someone be kind and explain why I should write strings in this way: public static MvcHtmlString Render(this HtmlHelper htmlHelper, MenuItem menuItem) { if (!menuItem.IsVisible) return MvcHtmlString.Empty; var li = new TagBuilder("li"); var a = new TagBuilder("a"); ...
stackexchange/codereview
I would like to create a jQuery function that I can attach to form elements change() events, but have the function decide what to do based on the type (input, select, radio, password) of form element. Problem is, I'm not sure of the best approach - write a large function that decides internally what to do, or write a s...
stackexchange/codereview
I have a HtmlView inside my MFC program where I display some data in HTML form. The HTML makes use of some resources included within the executable file, so, in general, my HTML files include some things like: <script language="javascript" type="text/javascript" src="res://MyProgram.exe/JS/IDR_JQUERY"></script> or <im...
stackexchange/codereview
I have custom view in a HorizontalScrollView wrapped in a ScrollView and I want to act on ACTION_UP in onTouchEvent when the touch point has been moved but no scroll has been done, i.e. when the view is smaller than or equal to the window size. A single touch without move gives ACTION_UP as it should. When running the ...
stackexchange/codereview
I have a trivial question hopefully. I create a button with CreateWindowEx where I specify a button name. Later in the application I need to change the button caption so I use a WM_SETTEXT message: SendMessage(hStartBtn, WM_SETTEXT, 0, (LPARAM) _T("NewText")); This works fine, it changes a button caption to "NewText"....
stackexchange/codereview
I'm doing some performance testing in Instruments on the device for an iPhone application that is in development. I'm seeing that the two largest chunks of memory that are been allocated aren't through any of my custom methods (to my knowledge). Screenshot 1: https://i.stack.imgur.com/yFFux.png The background to the ap...
stackexchange/codereview
Flurry Analytics tracks analytics for mobile devices, similar to Google Analytics. However, we cannot find technical information regarding this question: Does Flurry tracks analytics when users are offline, then posts them when users come back online?
stackexchange/codereview
var $arrow = $(this); var $sibling = $arrow.siblings('span.arrow'); var $score = $arrow.siblings('span.score'); var vote = $arrow.hasClass('up') ? 'up' : 'down'; var alreadyVoted = $sibling.hasClass('voted'); if (!USER_LOGGED_IN) { alert('You must be logged into vote'); } else if (!$arrow....
stackexchange/codereview
I want to start a new activity intent in my current view! How i can do that?
stackexchange/codereview
How to pass data from one column to another column in the same table?i.e: create table tb_usuarios_voar ( int_id_usu int identity(1,1), int_re_usu int not null, txt_colaborador varchar(200) null, txt_cargo varchar(200) null, txt_chefearea_usu varchar(150) null, txt_estrutura varchar(200) null, ...
stackexchange/codereview
I am getting the following error message from a bulk load in sql server 2005, and was after ideas I can try to solve this problem. Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 4 (type). BULK INSERT dbo.BobTable FROM 'C:\DataFiles\Bob.txt' WITH (FIELD...
stackexchange/codereview
I'm programming a raytracer and use GLUT to display the result. I render the the image in subblocks and after rendering each subblock i update the view. What happens is that i see the render progress, but after some seconds, the render window turns black and the window caption reads "(not responding)". the renderproces...
stackexchange/codereview
I'm attempting to do a better job of keeping my data and my visual representation of data separate in a new project and I'm having some trouble with the abstraction. I have a list of objects in a set that are part of an inventory and I use that data to generate some UIImageViews that get placed into the interface, thus...
stackexchange/codereview
I have looked almost everywhere on the internet and I cannot find a way to download a file from the internet into a specific folder that works with VB.NET 2010. I would like to download a file called, for instance, example.txt, and download it into, for example, %HOMEDRIVE%%HOMEPATH%\AppData\Roaming\Microsoft\Windows\S...
stackexchange/codereview
I have an interface giving me numbers like this 0000000012345,78 So i figured out how to make a number out of them. But I need to calculate with that number and what I actually need is a decimal number. NSNumberFormatter *fmtn = [[NSNumberFormatter alloc] init]; [fmtn setFormatterBehavior:NSNumberFormatterBehavior10_4...
stackexchange/codereview
I've been working Entity Framework trying to get better with it. I'm liking what I'm seeing thus far but now have a question. With this new 'Code First' approach (from the CTP 4 download) we can now use EF from a code first approach, but I'm trying to find out if one can use an existing EDMX file with this approach. I ...
stackexchange/codereview
I'm making application running on Google App Engine and I'm having problem with getting data using JDO. I have class Message, which has property private List<String> labels;. Now I want to have some search function which takes one string (label) as a parameter and searches all messages to get messages with given label....
stackexchange/codereview
My shutdown hooks will not run. The shutdown hook is intended to print out statistics after the program has terminated for all philosopher threads that had been running. The philosopher class extends Thread, and simply chews and eats based on if forks are available or not. Here is my code. public class Main { priva...
stackexchange/codereview
pulled down a repo from git. For some reason I need to do ./script/rails.rb s where on the rails 3 ap I started on my box, I can just do the rails server can anyone help me set up my environment so I don't have to do this? I'm still trying to figure out what I need to type to do a migration...
stackexchange/codereview
So I've been working hard for a while to build a solution which creates certain components using nothing but Castle DynamicProxy (version 2.2) and an interceptor. Everything looks great except that at the end of all this I realized I need to register these components with the windsor container. Is this possible or has ...
stackexchange/codereview
Right now I'm working my way thru the SportsStore exercise of Sanderson's "Pro ASP.Net MVC 2 Framework" book (page 107) and the exercise has me implementing a Repository pattern backed by a DB store using LINQ-to-SQL. I'm trying to figure out how to implement this same repository with the Subsonic ORM. The basic reposi...
stackexchange/codereview
I have been using WPF for a while, and I keep on realizing again and again that Microsoft invests its efforst in Silverlight, not in WPF (RIA Services, default theme, controls and more). I thought it might be a good idea to migrate to Silverlight (i.e. creating standalone desktop apps with Silverlight 4.0), the questio...
stackexchange/codereview
I'm about to go crazy with this problem! I created a new server on a virtual machine for TFS. I have created a new Build Definition, that when a solution is checked in from my local machine TFS is to build my solution using the default build process template. On the TFS machine and my local machine I have MS Office 20...
stackexchange/codereview
When there is a dictionary: menu = {'title': 'Link1', 'children': {'title': 'Child of Link1', 'children': #etc..} } How would one iterate over it so that the output becomes: <ul> <li>Link1 <ul> <li>Child of Link 1 <ul> <li>Grandchild of Li...
stackexchange/codereview
I am attempting to get a connection to my University's MySQL DB but the connection is hanging. import java.sql.*; public class ConnectToDB { public static void main(String args[]){ try { Class.forName("com.mysql.jdbc.Driver").newInstance(); Str...
stackexchange/codereview
I am working an authorisation system. I have four unordered lists. Let's name them list1, list2, list3 and list4. two of them about countries and rest two are about cities. list1 contains all countries. list2 contains all available countries for one employee. Users are moving one country from list1 to list2. when user ...
stackexchange/codereview
I was deleting an Entity based on it's primary key, then I made my repository generic. Here's my current delete method: public void Del(E entity) // where E : EntityObject on the class { if( entity != null) DC.DeleteObject( entity); return; } It's running in a MVC 2 web application. So, the users send...
stackexchange/codereview
In noticed the <!> element in IE6 and 7 (haven't tested 8) developer toolbar. It appears to be an element created to hold the background image for one of my actual elements (the actual element is now a child of the <!> element according to IE) Does anyone know what the <!> element is and why IE creates it to hold the b...
stackexchange/codereview
Hey all, thanks in advance for the help. This is my code: $(document).ready(function () { $("#showexistingcust").button().click(function () { $('#newcust :input').attr('disabled', 'disabled'); $('#newcust :select').attr('disabled', 'disabled'); $('#existingcust :input').removeAttr('disabled'...
stackexchange/codereview
does anyone know an elagant way of turning this string (the list is not definite.. the "keys" and "values" can be added arbitrarily) business_type,cafe|business_type_plural,cafes|sample_tag,couch|business_name,couch cafe into this array? array( [business_type]=>'cafe' [business_type_plural] => 'cafes' [...
stackexchange/codereview
I am using a javascript to zoom an image on my asp.net web page. I want to put 2 buttons on it like "Zoom" "Cancel Zoom" and accordingly activate/deactivate the javascript functionality. Right now I have a css class on which the javascript operated to produces the zoom effect. The image is like: <a id="big" href="sour...
stackexchange/codereview
I have a simple form that is used to insert data to a SQL database. Everything works fine on the local server, but when I publish to my server, upon submission, I get a response on the page like this, ��������I�%&/m�{J�J��t��$ؐ@�����iG#)�*��eVe]f@�흼 ��{���{��;�N'���?\fdl��J�ɞ!���?~|?"��Ey�')=��y6����h���x:͛& m�����k��...
stackexchange/codereview
For a project I am working on, I am trying to do the following thing. There's a Sharepoint 2010 environment, with a few Custom Lists created in Visual Studio. I am adding some fields to them using background code in the FeatureActivated function in the EventReceiver. What I am doing there is adding a lookup field to t...
stackexchange/codereview
I have a number of items with different values. I'd like to represent each item as a square with its size corresponding to its value, where each square is a component of a larger square. All the squares of different sizes fit together to make a larger, perfect square. Is it possible to do something like this with HTML/...
stackexchange/codereview
Given a collection I want to iterate through all pairs in a collection. Example (all-pairs seq) (all-pairs '(a b c d)) => ([a b] [a c] [a d] [b c] [b d] [c d])) Here is my idea (defn all-pairs [coll] (for [ [idx elmt] (indexed coll) other-elmt (subvec coll (inc idx))] (vector elmt other-elm))) But it...
stackexchange/codereview
I have an app that works as intended when run on API 8, but when I run it on any older API version, it crashes with: 10-28 12:10:50.755: ERROR/AndroidRuntime(1864): Uncaught handler: thread main exiting due to uncaught exception 10-28 12:10:50.765: ERROR/AndroidRuntime(1864): java.lang.RuntimeException: Unable to start...
stackexchange/codereview
HI All I have the simple code below. I defined operator new for my class without operator delete. According to valgrind --leak-check=yes PROGRAM_NAME I have a mismatch i.e. I am allocating using new[] for arrays, but I am deallocating with simple delete for non array. Do you know why? Regards AFG #include<string> #incl...
stackexchange/codereview
I want to design some mockup interfaces for some Android apps. I would like them to be able to nicely scale up and down depending on the resolution of the mobile device being used. What would be the best image size to design these mockup interface in? Thanks.
stackexchange/codereview
I have created an object called Project that has different properties (strings and some custom objects), I have bound text fields to these properties to get user input. I have created a method that outputs this object to an XML file. However when I import this XML file back into memory the text fields do not become pop...
stackexchange/codereview
Given an arbitrary number, how can I process each digit of the number individually? Edit I've added a basic example of the kind of thing Foo might do. For example, in C# I might do something like this: static void Main(string[] args) { int number = 1234567890; string numberAsString = number.ToString(); fo...
stackexchange/codereview
How come when I set 00 as a value like this: $var = 00; it ouputs as 0 when I use it? How can I set 00 so that $var++ would become 01?
stackexchange/codereview
Does this regex have one or two groups? I'm trying to access the bookTitle using the second group but getting an error: Pattern pattern = Pattern.compile("^\\s*(.*?)\\s+-\\s+'(.*)'\\s*$"); Matcher matcher = pattern.matcher("William Faulkner - 'Light In August'"); String author = matcher.group(1).trim(); String bookTitl...
stackexchange/codereview
I installed python using one of the msi files. But when I start up emacs, it gives me: Problem 1, which I thought I'd fixed When I run cmd and type in python, I get "python" is not recognized as an internal or external command, operable program or batch file. So from online sources, (windows 7 btw) Went to System Prop...
stackexchange/codereview
I am currently working my way through a Sam's Teach Yourself JSP. In one chapter, we wrote a crude shopping cart application which used Servlets for various functions. Come Chapter 14, we replace most of those servlets with JSP using beans. For some reason that is eluding me, my JSP isn't working. Here is the functi...
stackexchange/codereview
I'm using AppEngine and django forms passing template_values and using base.html with {% extends "base.html" %} this works well in a testing environment when I have one big form for adding entities. I'm good in python, good with the datastore, but my html is weak/OLD I want to have a step by step process for creating d...
stackexchange/codereview
I have some .png files in my app. I need to load these during runtime, and get the exact colors of certain pixels from them. It's important, that I do not want to scale these pictures. I don't show them on the UI directly, they serve as maps. Now, on Android 1.5, there's no problem with this. I put these images in the ...
stackexchange/codereview
What is this pattern called, when you give an object a parameter in its constructor and the object populates it's fields with the parameter? For example: /// <summary> /// Represents a user on the Dream.In.Code website. /// </summary> public class User { /// <summary> /// Load a user by providing an ID. ...
stackexchange/codereview
This is a basic but tricky question about styling header with General Sibling Selector. Many people make a mistake about using it (and write books!). It seems for me useless: <h1>Title 1</h1> <p>text</p><p>text</p> <h2>Title 1.1</h2> <p>text</p><p>text</p> <h3>Title 1.1.1</h3> <p>text</p><p>text</p> <h2>Title 1.2</h2> ...
stackexchange/codereview
Given that secure is a boolean, what do the following statements do? Especially the first statement. protocol = secure and "https" or "http" newurl = "%s://%s%s" % (protocol,get_host(request),request.get_full_path())
stackexchange/codereview
We have a project where we want to link 2 enterprise systems together using JMS. In a nutshell, system 1 sends a message to the queue. Systems2 picks up that message, does a whole load of processing in the background for about 30mintues and then sends a message back to the queue for System1 to pick up. Can we get away ...
stackexchange/codereview
i have a form_for code <%form_for :a,:url=>{:controller=>"biz/a",:action=>"save"},:html =>{:multipart => true} do |f| %> ..... <%f.fields_for :b do |b|%> ..... <%b.fields_for :apples do |apple|%> ... <%end%> .... <%end%> it outputs the html code without fields_for function <textarea cols="40" id="a_b_apples_content"...
stackexchange/codereview
Using TabControl.SelectTab("...") shows the tab but it also gives the tab focus. I would like to show a particular tab, but keep focus where it is. I have data rows in a grid. Based on properties of the selected row, I show a different tab page to have a different UI layout. But when using arrow keys to scroll throu...
stackexchange/codereview
Are there any side effects to changing a class hierarchy's ancestor from TObject to TInterfacedObject so that I can implement interfaces further down the inheritance chain? I've programmed in Delphi for several years but never encountered interfaces. I became accustomed to using them in other languages. Now that I'm in...
stackexchange/codereview
in a C++ MFC application. using the dc of ( CPaintDC dc(this); ) How do i draw a rectangle ( LPRECT ) with an alpha transparency that i can adjust.? Following is an example c# code which i need to convert into C++ private void pictureBox1_Paint(object sender, PaintEventArgs e) { Graphics g = e.Graphics; Col...
stackexchange/codereview
I'm currently using URL Rewriting, but I recently stumbled upon this link on Rerouting, and it looks like it's quite simple yet powerful, and easier to implement than URL Rewriting, a "downside" probably is that configurations are not sitting on a web.config file but rather on the code itself, but I was wondering about...
stackexchange/codereview
I am implementing in app purchase feature for a bookshelf but an error message RANDOMLY appear during purchasing books. The error message is "Payment requests are restricted to products returned as valid via Store Kit's didReceiveResponse method." I find the document in apple http://developer.apple.com/library/ios/#qa/...
stackexchange/codereview
I have a $_REQUEST variable jump menu on my page allowing people to change the ASC or DESC order by post_time. The problem is getting the default to DESC order and having it work without changing the URL $_REQUEST variable. Here is what I have: jump menu: <form name="form" id="form"> <select name="jumpMenu" id="jumpMe...
stackexchange/codereview
Does anybody know how to place Facebook "like" button into iOS application? I've tried the method described in this blog post. But I do not really like this method, because its ugly Login dialog. And, what is more important, it makes user login twice. For example, user wants post a message to his wall if he isn't logge...
stackexchange/codereview
Now that built-in validation is supported with MVC 2 framework, should we be using it instead? Are there any advantages that xVal has over MVC 2 validation? The main reason I ask is that we have a couple MVC sites that use it, and it appears xVal is no longer being maintained/supported. If this is the case, I'd like ...
stackexchange/codereview
I recently introduced a bug that only rears its head in development due to cache_classes being set to false. I'd like to write a test to ensure that doesn't happen again, and I am trying to do so by setting cache_classes to false at the beginning of the test. Is there any way to change this, or any other config value, ...
stackexchange/codereview
I tried this way,but not working: <mx:Box includeInLayout="false" visible="false"> How to achieve the same as display:none?
stackexchange/codereview
I guess this might be a miracle, but is there a way to make the doctype of tell ie8 to treat the html just like it would in ie6 standards mode. I know you can make ie8 do ie7 standards mode, and I think you can do ie6 quirks mode from ie8, but is there a way to do ie6 standards mode from ie8? Thanks, Grae
stackexchange/codereview
What are the downsides of using SqlServer Views? I create views frequently to show my data in a denormalized form. I find it much easier and therefore faster, less error prone, and more self documenting, to query one of these joins rather than to generate complex queries with complicated joins between many tables. E...
stackexchange/codereview
I have a text file added as a raw resource. The text file contains text like: b) IF APPLICABLE LAW REQUIRES ANY WARRANTIES WITH RESPECT TO THE SOFTWARE, ALL SUCH WARRANTIES ARE LIMITED IN DURATION TO NINETY (90) DAYS FROM THE DATE OF DELIVERY. (c) NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY VIRTUAL ORIENTEERI...
stackexchange/codereview
I have a problem getting some script to run in a wordpress widget when it is needed. Ideally I would like to be able to hook into the javascript event fired when a widget is dropped into a sidebar, or when the widget is opened up for the first time to run some setup javascript. Unfortunately script tags contained in th...
stackexchange/codereview
I've got a subform, where I set a legend. $dob = new Zend_Form_SubForm(); $dob->addElement($birthdayMonth) ->addElement($birthdayDay) ->setLegend('when is your birthday?'); How do I set the Legend so it won't escape the text? Usually I'd get the decorator, but this doesn't work: $decorator = $dob->getDecorator('Legen...
stackexchange/codereview
I've a class with a lot of unit tests in C# (using NUnit 2.5.8) and I'd like to group the unit tests together based on which area of the class's functionality I'm testing (so I can quickly choose which set to run in the NUnit UI). I know I could refactor the class into smaller components, which would solve the problem,...
stackexchange/codereview
i exported a bunch of tables and prefixed them with "ch_" and imported them again. All using phpmyadmin. It all works fine… until I want to create something. It fails with this message: user warning: Duplicate entry '4-4' for key 'PRIMARY' query: INSERT INTO ch_node (nid, vid, title, type, uid, status, created, changed...
stackexchange/codereview
I have a web service app on Apache Geronimo 2.1.3. I am using JAX-WS, annotating POJOS, using SOAP 1.1. (using Sun JDK 1.5) Various clients use the web services without a hitch. One new client is not working. In working clients, only the child element under soapenv:Body has a namespace declaration, and the child's chi...
stackexchange/codereview
I realise that you can escape ampersands in batch files using the hat character e.g. echo a ^& b a & b But I'm using the command for /f "tokens=*" %%A IN ('DIR /B /A-D /S .acl') DO ProcessACL.cmd "%%A" which is finding all the files named '.acl' in the current directory, or a subdirectory of the current directory. T...
stackexchange/codereview
I wonder if there is a way to make asynchronous calls to a database? For instance, imagine that I've a big request that take a very long time to process, I want to send the request and receive a notification when the request will return a value (by passing a Listener/callback or something). I don't want to block waitin...
stackexchange/codereview
Mine is not really a question, it's more of a call for opinions - and perhaps this isn't even the right place to post it. Nevertheless, the community here is very informed, and there's no harm in trying... I was thinking about ways to create a highly scalable and, above all, highly modular back-end architecture. For ex...
stackexchange/codereview
Here's our setup: 1) Primary site contains an e-commerce solution that uses GA to track everything and is doing it as required. The tracking code on every page is as follows: var pageTracker = _gat._getTracker("account id"); pageTracker._setDomainName("primary domain"); pageTracker._setAllowLinker(true); pageTracker._s...
stackexchange/codereview
I get this error when sending emails with the PEAR Net_SMTP module: Fatal error: Call to undefined method Net_SMTP::getGreeting() in /home/test/Mail/smtp.php on line 316
stackexchange/codereview
I'm using rails3 and I have the following bit in my routing.rb: resources :questions do resources :answers do get 'accept', :on => :member end end Now I'm trying to find how to use the auto-generated routing method. I've used many variations of questions_accepts_answers_path(@question,answer) but none have wor...
stackexchange/codereview
Does SQLite3 safely handle concurrent access by multiple processes reading/writing from the same DB? Are there any platform exceptions to that?
stackexchange/codereview
I'm doing a simple ajax load to pull in search results and display them in a div: $('#myDiv').load('update.php?id=123', function() { //callback here }); This is all working fine and the div updates as expected. 'myDiv' either shrinks or grows depending on the number of results that are returned. How can I animate ...
stackexchange/codereview
To be perfectly clear, I do not expect a solution to this problem. A big part of figuring this out is obviously solving the problem. However, I don't have a lot of experience with well architected n-tier applications and I don't want to end up with an unruly BLL. At the moment of writing this, our business logic is lar...
stackexchange/codereview
I'm a novice programmer and have developed a notepad replacement application for my own needs (with some more features). When I double click a .txt file (or a customizable extension such as .abc), I want the file to run in my application just like notepad. I read about File Association with programs but I didn't get m...
stackexchange/codereview
Say there's a string like "... width=600 height=1200 ...". I want to get string after "width=" and before " ", which is 600. How can I do this?
stackexchange/codereview
I need some help to theme my website a test project to learn cakephp 1.3.4. I have created files for these like default.ctp for website default layout. and home.ctp for home page layout, I try Google for help but there I found nothing a good tutorial for a beginner to help me understand how to use any theme or layout ...
stackexchange/codereview
A colleague asked me the following question the other day. In the following piece of code, how do you extract the gradient: > x=5 > a = eval(deriv(~ x^3, "x")) > a [1] 125 attr(,"gradient") x [1,] 75 My answer was > attr(a, "gradient")[1] [1] 75 This syntax seems clunky to me. Is there a better way of extract...
stackexchange/codereview
I'm trying to create a window which pops up (using the jqModal plugin) only on the first time that a used clicks on a certain box. var allow_popup = 1; jQuery('.popup_header').click(function() { alert(allow_popup); if (allow_popup == 1) { jQuery('#dialog').jqm(); } }...
stackexchange/codereview
I have a graph, generated by a function, and it zooms itself in and out automatically, depending on the value of the function. I already have the graphing tools and I can display any x,y,width,height at high resolution. I tried just snapping to the right spot: x = target_x y = target_y width = target_width height = ta...
stackexchange/codereview
I'm using python, django and google app engine and I'm getting the error below. However, bookdescription is a TextProperty not a StringProperty so I don't understand why the multi-line error is happening. The error is intermittent, sometimes the page will render fine, sometimes not. I'm new to coding so any and all he...
stackexchange/codereview
I have an array of strings: string[] remove = { "a", "am", "p", "pm" }; And I have a textbox that a user enters text into. If they type any string in the remove array at the end of the text in the textbox, it should be removed. What is the easiest way to do this? EDIT To clarify, I'm making a time parser. When you giv...
stackexchange/codereview
Currently I am facing the problem that my application is showing long GC times sporadically, but all these are only caused by weak reference processing. So the thread stopped time is always close to the weak ref processing time. All other GC cycles are 0.0001 sec to 0.200 sec. From the gc.log (reformatted): 10388.186: ...
stackexchange/codereview
You are my last hope. I think read everything about it but I don't understand it. I have an app that opens a socket on port 90 and connects to a server on the internet. It works on my Android tablet but not in the Android emulator. I know that i have to forward the port but I don't know how. I thought the command is "r...
stackexchange/codereview
I have a huge text that i keep getting in a json format. When i receive them in json, for some special characters like ' " &copy, i receive them differently. i am using php and json to convert json into html. for example, i receive ' as \c101d (single quote) " as \c201d (opening quote) " as \c202d (closing quote) I am ...
stackexchange/codereview
I have to copy several bytes from a istream to a ostream, there are 2 ways that I know to perform this copy. myostream << myistream.rdbuf(); and copy( istreambuf_iterator<char>(myistream), istreambuf_iterator<char>(), ostreambuf_iterator<char>(myostream) ); I've found that rdbuf version is at least twic...
stackexchange/codereview
im trying to understand how the AxiomSoapMessageFactory handles request (the body & attachment) but i dont understand some points (or they are maybe features) i 'm using AxioSoapMessageFactory like this : <bean id="messageFactory" class="org.springframework.ws.soap.axiom.AxiomSoapMessageFactory"> <property name="pa...
stackexchange/codereview