instruction_seed
stringlengths
1
35.8k
_source
stringclasses
1 value
I downloaded everything described as in pygtk for installation. Everything went fine until when I tried to type "import gtk", it threw an ImportError as follows: from gtk import _gtk ImportError: DLL load failed: ...(something unreadable) Then I re-install the pygtk-2.22.0 again, the same problem existed. So wha...
stackexchange/codereview
I'm a little confused here. I have my POCO classes created with the entity framework modeled from the datbase. Obviously, I'd like to use these classes in the client too (and any bookkeeping on them would be nice if I'd like to send them back and re-attach) I looked through the classes generated for the WCF service r...
stackexchange/codereview
I'm looking to add some custom functionality to a VB installation, but I can't for the life of me find any place to drop code into the VB structure. I know most of the code is pulled from the database, but where can I find a template file, etc where I could add my own code module {like if I wanted to add, say, an open ...
stackexchange/codereview
Currently I have a navigation based application and obviously the RootViewController is a UITableView. However, I deemed it necessary to create a UIToolbar that floats above the UITableView. Currently I do this like this. - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; //Initialize the too...
stackexchange/codereview
I have an app that only ever loads a full view one time. My reason for doing this is not important. What is important is that the rest of the content is only ever going to come back in partial views. In addition to some content I have some JSON objects I'd like to pass back and forth to and from the server with each AJ...
stackexchange/codereview
Can anyone please tell me how can I find the longest substring of a given string which matches a given Regex?
stackexchange/codereview
I have a problem trying to use 'shoulda' with 'factory_girl' for creating a functional test for 'create' in a Rails application. I created a simple project, scaffolded user, added 'shoulda' (current gem version on my system 2.11.3 ) and 'factory_girl' in test_helper.rb. Creating the user manually works fine. Foll...
stackexchange/codereview
I wrote a pretty simple function that reads in possible player names and stores them in a map for later use. Basically in the file, each line is a new possible player name, but for some reason it seems like all but the last name has some invisible new line character after it. My print out is showing it like this... nam...
stackexchange/codereview
Currently, I have a std::map <DWORD, DWORD> table and I'm looking for a key value matching a specific range. For example: Find a key value from map whose value should be either less than < 50 or greater than > 50 from the searched key value. If the searched key value was 20 then I would want a key value of range from m...
stackexchange/codereview
How to implement Radix sort on multi-GPU – same way as on single GPU i.e. by splitting the data then building histograms on separate GPUs and then use merge data back (like bunch of cards)?
stackexchange/codereview
I want a subdomain to mirror the root-domain (ex: sub.root.com mirroring root.com) and I want to accomplish this via .htaccess or php, with .htaccess prefered.
stackexchange/codereview
When I run this code in irb: File.open('j1.txt','w') {|f| f.write("doc1223423")} it works successfully. But when I do the same in a method in my controller, it gives the following error: Errno::ENOENT (No such file or directory - file location as specified ) Why does it do that and how do I fix it?
stackexchange/codereview
I have a program where I am trying to select a combobox entry and populate into the listview. However I can only get one of the combo box entries to show(which is the last). I am having a problem storing each individual record from a text file. Can someone show me someideas on how to do this? Imports System.IO Public C...
stackexchange/codereview
I am trying to understand the OpenGL coordinate system. However, some tutorials say the default coordinate system is left handed (see http://www.c-sharpcorner.com/UploadFile/jeradus/OpenGLBasics11172005014307AM/OpenGLBasics.aspx) and others say it is right handed (see http://www.falloutsoftware.com/tutorials/gl/gl0.htm...
stackexchange/codereview
I'm looking for the fastest way to serialize and deserialize .NET objects. Here is what I have so far: public class TD { public List<CT> CTs { get; set; } public List<TE> TEs { get; set; } public string Code { get; set; } public string Message { get; set; } public DateTime StartDate { get; set; } ...
stackexchange/codereview
My Rails server worked well through normal development scripting and I planned to use Netbeans for Rails. When I started my existing project with Netbeans and restarted my Webrick server, It shows error RuntimeError (Please install the jdbcmysql adapter: gem install activerecord-jdbcmysql-adapter (no such file to load ...
stackexchange/codereview
I am trying to scrape HTML tables in my .NET application, however I came across tables that are aggressively using colspan and rowspan attributes on cells causing me headache. I was wondering if there is a library available that can convert a table into an array of strings and taking care of colspan e.g if colspan=5 o...
stackexchange/codereview
I am creating a game using java, and I'm not quite understanding how to lay out buttons in windows. I wants seven columns of buttons, 10 high. Each button showing a single digit number, or grayed out. jbutton buttons[] 0-70 To the right, three squares that can show a red X (strikes) that remain visable while empty. ...
stackexchange/codereview
I want to learn some language from Lisp family. It may be CL or Scheme and try to use it for web programming. Just for fun. I have significant C++ experience (prefessional development). But I want my choice be modern language without legacy (in language itself and library), because I want learn good design patterns fro...
stackexchange/codereview
I have zip file and I want to know which library can handle it? Is there built-in method in the.netframework can unzip zip file?
stackexchange/codereview
Just met with a customer who have huge memory leak issues in their Ajax webapp. So I decided to create the following testcase to demonstrate the problem: I have used drip / Sieve for memory profiling in the example below (http://home.orange.nl/jsrosman/) The case is simple: I have the following javascript: <html> ...
stackexchange/codereview
I have such section in my ~/.hgrc config file [auth] repo.prefix = ssh://hguser@192.168.132.72/repos repo.key = /home/zerkms/.ssh/mercurial-repo/id_rsa But when I write: hg clone ssh://hguser@192.168.132.72/repos/rps . mercurial still requires password to enter. What have I done wrong? To prevent obvious questions: Y...
stackexchange/codereview
I really like the CTRL-W key in Vim insert mode, but I also need something like CTRL-Del in normal editing. Any idea if this exist, or how to implement it? Also, how about a similar thing for CTRL-H?! I mean something exactly like Del key, but as easy as CTRL-H.
stackexchange/codereview
I have the following code: @Override public Iterator retrieve() throws SQLException { List<PasalBean> pasalObject = new ArrayList<PasalBean>(); try { Class.forName(dbDriver); con = DriverManager.getConnection(url); ps = con.createStatement(); rs = ps.executeQuery("se...
stackexchange/codereview
In my wpf application I have a button. I want the button like to be background have an image and forground also have the image. How to do this? Thanks in advance, Karn
stackexchange/codereview
In which situations a MFMailComposeViewController wouldn't work on iOS 4? For example, does it work when the user hasn't set up an account in Apple's Mail app? And is there any other situation where it won't work, because a user complained it didn't work and he had iOS 4. Thanks.
stackexchange/codereview
I have a UIWebView and one page has an AJAX component whose content changes when the user clicks a button. How can I know when the content has loaded inside the UIWebView?
stackexchange/codereview
Using C# and Linq how would i return the List<....> with the largest size / count?
stackexchange/codereview
I am using ruby-aaws to return Amazon Products and I want to enter them into my DB. I have created a model Amazonproduct and I have created a method get_amazon_data to return an array with all the product information. When i define the specific element in the array ( e.g. to_a[0] ) and then use ruby-aaws item_attribute...
stackexchange/codereview
Does Doctrine2 have a features similar to ActiveRecord's named scopes?
stackexchange/codereview
Numeric literals have a polymorphic type: *Main> :t 3 3 :: (Num t) => t But if I bind a variable to such a literal, the polymorphism is lost: x = 3 ... *Main> :t x x :: Integer If I define a function, on the other hand, it is of course polymorphic: f x = 3 ... *Main> :t f f :: (Num t1) => t -> t1 I could provide a t...
stackexchange/codereview
Intro to problem: I am given recipes how to craft items. Recipe is in format : {element that is being crafter}: {list of elements, that is needed}. Before I can craft element x, I need to know how to craft elements it's made of. So I want to find in what order do I have to learn recipes. For valid input, like followin...
stackexchange/codereview
I have a method that validates a field. If it cannot be validated the field gets cleared and marked red. I also would like a ToolTip to pop up over the box with a message for the user that the value is invalid. Is there a way to do this and maybe control how long the ToolTip shows? How can I make it pop up on it's own ...
stackexchange/codereview
I have this linq statement. var sum = from l in list select new { Sum = (l.sum + .005) * 1000 }; this line won't work: Sum = (l.sum + .005) * 1000 because sum is a decimal. I would like to use System.Data.Objects.SqlClient.SqlFunctions but there is no Convert or Cast... Is there any way i can do this?
stackexchange/codereview
I have noticed a little confusion when looking at various bits of code both in books and on the web when it comes to implementing dealloc. My question is when using @property which of the following should I be using. Up until now I have been using VERSION_001. @property(nonatomic, retain) NSString *name; @property(nona...
stackexchange/codereview
I'm trying to rotate a drawable inside a view by touching it and moving the finger. I've come up with several solutions, but none of them feels natural on the device. Here's my first approach: Depending on where the user touched the screen and in which direction the finger was moved, I'm changing the drawable's rotatio...
stackexchange/codereview
I've got a table view with many sections, the title for these sections is just A-Z and # just like in the iPhone address book App. I have implemented sectionIndexTitlesForTableView to have the quick move to particular letter and basically just return an array of Letters A - Z and #. This would work if my list always c...
stackexchange/codereview
I'm doing an automated download of a number of images using an html frame source. So fra, so good, Sed, wget. Example of the frame source: <td width="25%" align="center" valign="top"><a href="images/display.htm?concept_Core.jpg"><img border="1" src="t_core.gif" width="120" height="90"><font size="1" face="Verdana"><br>...
stackexchange/codereview
How can I use IN OUT parameter in a procedure. I want to give a parameter as both input and get the same out put? can i have an example for this?
stackexchange/codereview
I have a Timer which executes a TimerTask every 30 seconds. I only want the timer to launch a new TimerTask if the Activity is displayed i.e. if the user receives a phone call or launches a new activity the Timer will stop. I then need the Timer to restart when the Activity is re-launched and comes into focus. Now this...
stackexchange/codereview
does somebody know how it is possible to change the document root for windows azure web application to a sub folder? Thx
stackexchange/codereview
I have a framework which is being used by several projects (which includes several samples to show how the framework works). The framework has components such as the core, graphics, physics, gui etc. Each one is a separate library. There are several configurations as well. A main solution file compiles the complete pr...
stackexchange/codereview
The apache java xerces xml parser has a number of features (http://xerces.apache.org/xerces-j/features.html) that control the behavior of the parser. Is there a way to turn these on or off by setting a java System Property?
stackexchange/codereview
How are the messages encoded or sent/received by peers? If there is a message have: <len=0005><id=4><piece index> How is this sent(in binary,how is it translated to binary?) and received? Is there a specific order in which the messages are sent to peers? I have read the specification but it leaves me with questio...
stackexchange/codereview
If you have seen my previous questions, you're aware that I'm in the process of updating some existing ASP pages, in an effort to move them from a Windows 2000 environment to a Windows server 2008 R2 environment. One of the pages offers the end-user the ability to upload a file to be processed later. I re-wrote the or...
stackexchange/codereview
I'm trying to access the TargetPlatform property value (which you can set in a Deployment project) from the condition within a "Launch Condition". Basically I'm trying to tell the application not to install itself as a 32bit app if a 64bit version of Office is installed on that computer. Therefore I need to somehow ge...
stackexchange/codereview
For business reasons the project I'm working on has the requirement to determine which country's itunes store an app has been purchased from. Knowing where the user is at the time of purchase (via location services etc) is not suitable and they would prefer to have 1 universal binary rather than having to have a separa...
stackexchange/codereview
My Apache module launches a helper subprocess which does, for example, but not limited by, the following things: It sets up a socket so that it can communicate with Apache. Reads and writes files in a temporary location that is deleted when Apache exits. These files are used e.g. for storing large amounts of data rece...
stackexchange/codereview
static void Main() { AppHelper helper = new AppHelper(); // more stuff } The above compiles fine using csc.exe but throws NullReferenceException at runtime: Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. at AppHelper..ctor() public class AppHelper {...
stackexchange/codereview
Below is the source code of a program. Can anyone help me to figure out the working of a program. <?php session_start(); ?> <?php $aCaptcha = array ( array(), array('crocodile'), array('panda', 'panda bear', 'giant panda'), array('pig'), array('tiger'), array('zebra'), ...
stackexchange/codereview
I have a problem with removing the animation of a property in WPF. When the storyboards are started using a DataTrigger I cannot remove the animation from the property as one would in other cases. No matter what I try or where: the OrientationProperty is locked to the endvalue of the animation. You can see this in this...
stackexchange/codereview
I have the following: domain = email.split("@").last Which takes an EMAIL like (steve.jobs@apple.com) and returns apple.com I would like to know how to get just apple just the domain name, without the extension. Ideas?
stackexchange/codereview
I would like to execute an action after the user has logged in. I need something like: after_filter :log_login The method should be called as soon as the user has logged in.
stackexchange/codereview
Could someone share the benchmarks of Radix sort on GTX 580?
stackexchange/codereview
I am trying to check items of a uitableview but I am having two difficulties: 1. I cannot select the first item 2. if I select the 2nd and 3rd item for instance, this will also place a check mark near the 5th and 7th, and 9th and 10th etc etc The following is my code: #pragma mark - #pragma mark Table View Data Source...
stackexchange/codereview
We're developing .Net Application using asp.net and C# and .Net Framework 3.5. We are using windows form message box in a .Net application. This windows form works great on the debug mode but once we publish the application this message box won’t work. We are referencing System.Windows.Form.dll in order to use the mes...
stackexchange/codereview
i'm trying to display a list of tweets in a stackpanel and i want the message to wrap within the available screen width (in both landscape and portrait) i've put the following stackpanel within a listbox itemtemplates datatemplate <StackPanel> <Image Source="{Binding ImageSource}" Height="73" Width="73" VerticalAlignm...
stackexchange/codereview
I have this string: computers,cars,movies,sports,etc... $cars = explode(',', $cars) How can i echo lets say 25 chars from the string?
stackexchange/codereview
I'm working on an android app and I'm stuck. Here's the scenario that I have: The user picks a contact to call The user presses the dialer button to call that contact Android's native dial screen pops up i.e. Dialing Contact screen Here's what I want to do: After pressing the dialer button, is there any way for my ap...
stackexchange/codereview
Possible Duplicate: What does $$ (dollar dollar or double dollar) mean in PHP? I found myself using this kind of code in one of my controllers: foreach(get_object_vars($this->view) as $property=>$value){ $$property = $value; } Is there any problem with using the $$property to "localize" view properties into simpl...
stackexchange/codereview
I have searched how to send e-mail using adobe air.. But i didn't find a good one. They only show for adobe flax... There some codes that included some library. I don't understand how to use it.. Anybody could help?
stackexchange/codereview
dear all.. i have a DB which built use Mysql. for this case, i want to access another server PC which have DB in firebird. i want to take some data inside that. Both of DB always connected, because i must get data every time. This is a scheduling data, so i must always connected to firebird from mysql. But i have no ex...
stackexchange/codereview
when I read the API documentation of Java I see a field with the name "Field Summary". What this Part is used for?. What is the use of the constant and classes in this field?. thanks.
stackexchange/codereview
I am trying to dynamically pass a value in h:outputText tag. The scenario being, I have a properties file with key/value pairs and I m fetching the data from properties file: Eg: roles.properites admin=Administrator user=User visitor=Visitor I now access the code this way <h:outputText value="#{myRoles.admin}"/> will d...
stackexchange/codereview
I have a doubt, Do I need to delete a background thread when the execute is done? Or the thread is automatically clean and deleted?
stackexchange/codereview
I want to read this form of a php script using Ruby/Mechanize: <form name="editevent" method="post" action="/index.php" enctype="multipart/form-data"> <input type="text" name="veranstaltung"> <select name='ortid'> <option value='2'>Kaminwerk</option> <option value='3'>Pitú</option> <option value...
stackexchange/codereview
timer =[NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(onTimer) userInfo:nil repeats:YES]; Can I change the scheduledTimerWithTimeInt...
stackexchange/codereview
When accessing a member of some class, I can use e.g.: this->myVar = 10 or I can just write: myVar = 10 I like to use this-> because it explicitly declares that the variable is a member of this class, but does it cause any overhead in comparison to just using the variable name by itself? As an alternative I could ma...
stackexchange/codereview
Given a list of Func<string, string>, is it possible to write a statement that iterates through the list and returns the result like so: string result = f1(f2(f..(input)); I have the following code (that works), but I'm not satisfied with the temporary variable. public static string WrapEachElementWith<T> ( thi...
stackexchange/codereview
Thanks in advance for any assistance anyone can provide with this torturous issue. I have an ASP.NET website built against framework 3.5SP1 in VS2010. This (essentially the) same website has been deployed several times on several servers without this issue - however they were built with VS2008. The server is 2003 IIS 6...
stackexchange/codereview
Hey guys, what function could I use to say, if this radio button is checked show this 'div'. Thanks in advance.
stackexchange/codereview
I have an ImageView, and I want it to be clickable. The image itself is only 32x32 pixels, but I want the clickable region to be larger so it's easier to hit. I was hoping I could set the layout margin values to increase the size of the imageview's clickable area: <ImageView layout_width="32dip" layout_height="32...
stackexchange/codereview
I've came across a code of couple projects from the Rails Rumble 2010 hosted on Github. But this is just a tiny percent of total amount of projects. Is it possible to have a read-only copy of git repositories from all(or best) projects from Rails Rumble 2010? P.S. I really tried to find an answer on official website
stackexchange/codereview
I have an uiimageview in my uittableviewcell in my uitableview. What I want to accomplish is rotate all the uiimageviews of each cell using a timer. I know how the nstimer and rotating concept goes about, but I do not know how to rotate ALL the images in EACH cell in the UITableView. Is there a way to have access to th...
stackexchange/codereview
Hi recently I have been installing many of numerical software in Ubuntu. Of the many software that I have installed manually using the make file provided, I have often seen that the compilation phase generates a number of warnings. Are such compiler warning to be ignored? Many people tell me that warning don't really ...
stackexchange/codereview
I have the following dictionary: Dim idQueuedJobs As IDictionary(Of Int32, KeyValuePair(Of String, Int32)) = New Dictionary(Of Int32, KeyValuePair(Of String, Int32)) Why duplicate KeyValue pair? This is because the first Int32 is just a normal index, and the String followed by another Int32 contains systemnames and th...
stackexchange/codereview
I am new to xml. I have to read all the elements of xml file without using a parser. please help me.I can make use of string functions with regular expressions.but i am not familiar with them. so please help me to give me a code to read atleast 2 xml elements one is root and other one is child.
stackexchange/codereview
If I want to embed the current time in JAR manifest using ant is there an ant property I can use for "now" and which manifest attribute is the best to put this information? I currently have the following <manifest> <attribute name="Signature-Title" value="${project.name}"/> <attribute name="Signature-Version"...
stackexchange/codereview
I have three variables of int32 data type in C++. I want to generate unique number for combination of three int32 numbers in C++. For example I have int iVal1, int iVal2, and int iVal3. Is there any algorithm to do this? In order to avoid confusion in question I will rephrase the question. Basically I want to generate ...
stackexchange/codereview
Is it possible to instantiate an object and pass a reference to that new object itself as one of the parameters without modifying the code in the class? Example: SuperObject obj = new SuperObject(<"pointer to this new SuperObject">); Thanks! edit:EMPHASIS: I do not want to modify the code inside the class. The this op...
stackexchange/codereview
I'm working on excel with VBA and access and i need my system to save its data to an Access database and whenever any new records added, deleted or modified the database should update. I would like to link my spreadsheet and database using ADO but i couldn't find any online resources to help me with that. Can you pleas...
stackexchange/codereview
I am trying to hardwire an on-the-fly created form to send JSON using the encoding type "application/json". in jQuery, I would set this as 'contentType' in an $.ajax or a $.post - however for certain reasons, I need to be doing this manually. I have the following code, but it just doesn't work. It still defaults the e...
stackexchange/codereview
Sorry for the question title, but I couldn't figure out a better one. I'm using JSF 2.0 (MyFaces 2.0.2) and added RichFaces 4 (4.0.0.20101004-M3) to my project. I found an example with RichFaces 4 (http://java.sys-con.com/node/1098139) and created a xhtml-page with the following code: <ui:define name="webpage_main_body...
stackexchange/codereview
Hi i want to create a web crawler in java in which i want to retrive some data like title, description from the web page and store the datas in database
stackexchange/codereview
+1 for each piece of information that helps to complete the whole picture. You don't need to know the whole answer. I'll appreciate individual pieces of the puzzle just as much. Thanks. I am about to attempt my first cross-compilation. I have searched both SO and the web and found many pieces of information, but I don'...
stackexchange/codereview
I am running into problems with drawing my treeview. design goals: Level 0 should work just like default with out checkboxes Level 1 should have check boxes Level 2 should not have check boxes I have for the most part been able to create this behaiviour but I am not able to get ome parts to redraw properly: On level-0...
stackexchange/codereview
I need some help with types in Haskell... Here's the code I'm working on: loadManyPeople :: [FilePath] → IO [Person] loadManyPeople fs = do return $ concat $ map loadPeople fs loadPeople :: FilePath → IO [Person] loadPeople file = do lines ← getLines file return $ map parsePerson lines loadPeople is fine....
stackexchange/codereview
i've been trying to find where and how the reference counting for Qt is implemented. The QBasicAtomicInt and QAtomicInt use the ref() and deref() functions which provide an efficient reference counting API. These functions atomically increment and decrement the value but where are these functions implemented in the lib...
stackexchange/codereview
Yesterday, I decided to convert my application from LINQ-to-SQL to EF4 to take advantage of the code-first feature. I created my POCOs, a DbContext class, implemented new repositories classes and all was fine. At some later point, I noticed that there was a typo in the filename EF used to create the SqlExpress MDF fil...
stackexchange/codereview
I need to do a javascript form validation. I would like to validate each field as the user clicks or tabs to the next field. (onBlur ?) I have to validate the email for the correct form. As with Address and Phone. I'm not sure where to put the validation code in the HTML form. Validation needs to be done on the browse...
stackexchange/codereview
Can Rest Client do NTLM authentication? I didn't see any options in the documentation for authentication types: require 'rest_client' resource = RestClient::Resource.new 'http://website', :auth_type => 'ntlm', :user => 'USERNAME', :password => 'PASSWORD' results = resource.get :auth_type => 'ntlm' doesn't work, and ...
stackexchange/codereview
phpMyID is deprecated. Is there another option? I'd like to authenticate just one user on my site as simply as possible, but I don't want to use delegation. Thank you!
stackexchange/codereview
In Clojure I do this (println (cond false "don't care" "otherwise" "otherwise")) In Common LISP this would be (print (cond (nil "don't care") ("otherwise") )) Is there a way to get this kind of simplified cond in Clojure?
stackexchange/codereview
I'm trying to use Treetop to parse an ERB file. I need to be able to handle lines like the following: <% ruby_code_here %> <%= other_ruby_code %> Since Treetop is written in Ruby, and you write Treetop grammars in Ruby, is there already some existing way in Treetop to say "hey, look for Ruby code here, and give me it...
stackexchange/codereview
How to send HTML email in drupal 6 using drupal_mail ? How can I change HTML header to show email contents in HTML.
stackexchange/codereview
i've been dancing with a tambourine for a while, but still don't know what's the reason for that error. I've got a tableView with history of user queries data from sqlite base. I'm new to iPhone developing, so my code may be a bit excessive. The hierarchy is: HistoryModel model-object with some init methods HistoryDat...
stackexchange/codereview
I'm using the latest stable build of Fluent NHibernate ver 1.1. Now in the application I'm also using castle.core for dependency injection. Now the problem is using them together. In Visual Studio castle.core says ver. 2.5.1.0 but in Windows Explorer "details" for the same DLL file it says 2.5.1.2121. I have tried both...
stackexchange/codereview
I have two models: class Production(models.Model): gallery = models.ManyToManyField(Gallery) class Gallery(models.Model): name = models.CharField() I have the m2m relationship in my productions admin, but I want that functionality that when I create a new Production, a default gallery is created and the relat...
stackexchange/codereview
I hava a Rails application, I need to integrate Facebook. User can login with Facebook account and get his reviews in facebook and so on, how to deal with this case in rails? thanks!
stackexchange/codereview
I try to get the iPhone4 to monitor regions and notify me by call didEnterRegion or didExitRegion. I can't get it to work. I was reading probably all related enries here, plus a couple more articles on the web....iOS just don't call my CLLocationManagerDelegate methods. What did I do: I have a simple AppDelegate which ...
stackexchange/codereview