instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
When I build my project I get a bunch of swz files in the release/debug directory.
What are they?
They are quite big (1 mb in total) i just delete them, my swf works fine without them, so why are they there?
| stackexchange/codereview |
I'm trying to add a png image as a custom map using MKOverlayView. I'm almost there - I am able to get the image lined up in the right place, and I know that the -drawMapRect: method in the subclass of MKOverlayView is being called periodically; I just can't seem to get the image to render properly. It's totally blurry... | stackexchange/codereview |
I have a table called "users" with 4 fields: ID, UNAME, NAME, SHOW_NAME.
I wish to put this data into one view so that if SHOW_NAME is not set, "UNAME" should be selected as "NAME", otherwise "NAME".
My current query:
SELECT id AS id, uname AS name
FROM users
WHERE show_name != 1
UNION
SELECT id AS id, name AS n... | stackexchange/codereview |
I need to perform some logic on all the text nodes of a HTMLDocument. This is how I currently do this:
HTMLDocument pageContent = (HTMLDocument)_webBrowser2.Document;
IHTMLElementCollection myCol = pageContent.all;
foreach (IHTMLDOMNode myElement in myCol)
{
foreach (IHTMLDOMNode child in (IHTMLDOMChildrenCollectio... | stackexchange/codereview |
I need to write a java application that detects a USB device, and can be used to pass commands, similar to adb (Android Debug Bridge).
Since, java does not provide usb support. I intend to use some kind of java wrapper program for utilizing adb functions. Am I thinking rightly ? If yes, how do I proceed ? How do I cre... | stackexchange/codereview |
is it necessary to mention content-type in http header while uploading the file. i tried using c#. i had set it "image/png" while uploading a pdf file and when i downloaded the uploaded file, the pdf file was perfect. it didn't get corrupted.
so what is the role of specifying content-type in http header.
can it be null... | stackexchange/codereview |
I want to make a MySql selection for a period of time. but i didn't figure it out how to make it correctly.
this is what i tried
SELECT * FROM rapoarte WHERE DATE(ziua) BETWEEN 2010-01-12 AND 2011-01-14
Can you please help?
thanks,
Sebastian
| stackexchange/codereview |
I need to loop through an XML document (no problem over there) and check if a value that i find is already in a (a) tag in a div in my XSL document that i am generating, only if the value is not in that (a) tag i should create a new (a) tag for it and put in in the div that i am checking...
Any one knows how to do it d... | stackexchange/codereview |
I cannot connect to remote MS SQL server express 2008 R2. On the server, the external connection is enabled, firewall is turned off.
When my friend tried to connect using python, everything is OK.
I am using Visual C++ and OLE DB under VS 2010.
Error I get is:
[Microsoft][ODBC Driver Manager] Data source name not found... | stackexchange/codereview |
I am new in python...i am trying to read a python log file and make a dictionary. How will it be done with logger?
| stackexchange/codereview |
JUnit @Tests have the useful ability to specify a timeout argument so that a poorly written program gets killed automatically if it takes longer than timeout seconds. The problem is this uses clock time instead of CPU time - so a test will actually run for different amounts of time between runs. For example, a test mig... | stackexchange/codereview |
Hii friends,
i have to create a routemap for a university using maps as i preferred to use Google Maps API to develop it, as it seems easy for me with previous experience with maps API.
Does any Map library available for iPhone beyong google maps?
| stackexchange/codereview |
I am hunting a bug which might be connected to unit initialization order. Is there a way to see which initialization section was executed when? I need to know the order. This is during debugging, so I have the full power of the Delphi IDE, in my case Delphi 2009.
I could set breakpoints, but this is rather tedious when... | stackexchange/codereview |
While attempting to generate a list of subsets that exist within two sets, I am running into an issue with cons. A procedure takes in a list named result and attempts to construct a new list out of result and the car of another set. So far, the set is generated with the correct elements, but they are contained within a... | stackexchange/codereview |
I am developing a Rails 3 application which I intend to use GEO positioning (long,lat).
Both to save the users current position and to use this to find people in the near proximity.
Do you guys know of a good stabile Rails 3 gem that can do GEO stuff?
Thankful for all tips!
| stackexchange/codereview |
I have successfully installed Git and RVM per the instructions at: http://railstutorial.org/book#sec:install_rails
I have followed the install rails instructions to the letter. This is what get:
Rose-MBP:~ roseemmons$ rails -v
/Users/roseemmons/.rvm/gems/ruby-1.9.2-p0@global/specifications/rake-0.8.7.gemspec:27:in `lo... | stackexchange/codereview |
Right now we're using TRUNCATE to clear out the contents of 798 tables in postgres (isolated test runs). Where possible we use transactions. However, in places where it's not possible, we'd like the fastest way to reset the state of the DB.
We're working towards only actually calling truncate on the tables that have ... | stackexchange/codereview |
I have the following multidimensional $array:
Array
(
[0] => Array
(
[domain] => example.tld
[type] => 2
)
[1] => Array
(
[domain] => other.tld
[type] => 2
)
[2] => Array
(
[domain] => blaah.tld
... | stackexchange/codereview |
I've some questions regarding the RIA Services in a Silverlight business application.
In most samples the business logic is really simple. normally you would CRUD an entity. But what if there were a work flow that should meet?
Assume we have a parent entity which on insert it should contain some other entities as chil... | stackexchange/codereview |
Im using netbeans and the framework GWT. Due to the GWT structure, on my browser i can't see the html code with the simple "View Source". How can I see this? Im using Google Chrome.
Bye
| stackexchange/codereview |
I would like to select the value of the first "href" attribute from documents like this using XPath:
<div>
<a href="#a">
<span>foo</span>
</a>
<a href="#b">
<span>bar</span>
</a>
<a href="#c">
<span>baz</span>
</a>
</div>
However, I am only interested in those a elements that govern spans wit... | stackexchange/codereview |
I ran a grep command and found several hundred instances of a string in a large directory of data. This file is 2 MB and has strings that I would like to extract out and put into an Excel file for easy access later. The part that I'm extracting is a path to a data file I need to work on later.
I have been reading abo... | stackexchange/codereview |
I have a requirement where few of my image views form border areas of an application, and the application will be running on many screen sizes.
I'll be creating a uniform image for the smallest size possible, which can be repeated as many times as needed, and still presents the same image.
I want the image view to repl... | stackexchange/codereview |
I need to generate a file that will be read by another system. For this reason, it should be in binary, not text with some encoding.
Here's the code I'm using:
using (FileStream stream = new FileStream(fileName, FileMode.Create))
{
using (BinaryWriter writer = new BinaryWriter(stream))
... | stackexchange/codereview |
I am using Visual Studio 2010 and need to design a master detail form like the following.
http://demos.devexpress.com/ASPxGridViewDemos/MasterDetail/MasterDetail.aspx
Any suggestions/free components or solutions which I can use to develop the similar interface?
thanks
| stackexchange/codereview |
I try deserialize JSON string to observable dictionary. If I use normal generic dictionary from .NET it works good, but if I try use my own observable dictionary i get exception:
The given key was not present in the dictionary.
StackTrace:
at System.Collections.Generic.Dictionary2.get_Item(TKey key)
at Observab... | stackexchange/codereview |
Icon.png - 57x57 pixels application icon for standard resolution iPhone.
Icon@2x.png - 114x114 pixels application icon for high resolution iPhone 4
Icon-Small.png - 29x29 pixels settings icon for standard resolution iPhone.
Icon-Small@2x.png - 58x58 pixels settings icon for high resolution iPhone.
These are ok. But how... | stackexchange/codereview |
I'm using the following code to fetch some images, that are going into a tableview. But it takes ages (5-6 seconds) to get the 30 images in.
Is there a smarter/faster way to do this?
NSString *imageUrl = ......;
NSString *urlStr =
[imageUrl UrlstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSString ... | stackexchange/codereview |
Scenario: Creating an app for learning purposes and am trying to make it database independent.
I have looked at the beerhouse architecture quite a bit where each database has its own dal an a mixture of SqlCommands and DataReaders etc. I no theres not a definite right or wrong, but generally in terms of maintenance, sp... | stackexchange/codereview |
I'm quite new to javascript, but have managed to write a working xml function :)
I was hoping someone could please give me a rundown of how to optimise the function. At present there's a different function for each state's weather, but I was hoping I could simplify this somehow.
Code is pasted here: http://pastie.org/... | stackexchange/codereview |
In my iPhone app, I have a (non-grouped) UITableView which uses all the "bells and whistles," including (a) NSFetchedResultsController to keep it updated, (b) multiple sections, (c) the ability to add and delete items, and (d) the UISearchDisplayController to allow the user to search through the list, which can get to ... | stackexchange/codereview |
The functions below, will do a replace on the content (which is html markup) wrapping bold and em tags around the first two occurrences of the keyword that it finds.
The one case I need to account for though, is if the keyword is already inside of an h1 tag I don't want the callback to occur.
Example:
<h1>this is the ... | stackexchange/codereview |
Let's say I can get XML like this:
<Property Name="Title"/>
<Property Name="Content"/>
<Property Name="Address"/>
<Source properties="Title,Content,Address"/>
How coud I validate the "properties" attribute of "Source", so that any composition of the above listed "Property" items could be checked? (For example: "Titl... | stackexchange/codereview |
We would like to have a OData JSON interface on our Django (Python 2.5.4) website. At the moment of writing there seems to be no library available.
I'm thinking of writing "some" logic to handle this ourselves.
Would it be a good idea to extend the Django JSON serializer?
Where and how to store the URI's related to t... | stackexchange/codereview |
Link: http://www1.qhoach.com/
When you drag, this map is panned... But if you drag on KML features (icon with circle), nothing happens
| stackexchange/codereview |
suppose you've this code:
namespace StighyGames.CarsAttack {
public class CarsAttack
{
public static Channel[] ch = new Channel[30];
...
}
void main {
CarsAttack game = new CarsAttack();
}
}
In another cs file on the same project i declare another Class ...
public class AnotherCl... | stackexchange/codereview |
When I'm trying to use params in an Action delegate...
private Action<string, params object[]> WriteToLogCallBack;
I received this design time error:
Invalid token 'params' in class, struct, or interface member declaration
Any help!
| stackexchange/codereview |
I've a problem with the instance_variable_get method cause it's always returns nil object with one of my object instance.
Here is my code:
logger.info "ASDF: " + @d_tree.inspect
logger.info "ASDF: " + @d_tree.instance_variable_get(:@content);
and the output is:
ASDF: #<DTree id: 11, parent_id: nil, content: "babababab... | stackexchange/codereview |
I have created a projects called rtva to use the media player.
I have taken all files from the APIdemos/media
MediaPlayerDemo_Audio.java (renamed to rtva_Audio.java)
MediaPlayerDemo_Video.java (renamed to rtva_Video.java)
MediaPlayerDemo_Video.java (renamed to rtva.java)
Corresponding layouts have also been copied.
Wh... | stackexchange/codereview |
Previously when covering events I've typed my reports into an html file and ftp'd it to the server. If I lose connectivity or the laptop crashes, I've got the last saved copy.
We just switched our event coverage area to a database holding Textile-formatted entries done via a web form text area.
Is it at all possible to... | stackexchange/codereview |
I have custom redirection implemented in a module. Do I have to modify each config for all sites or is there a more general approach?Also, I have files in App_Data for this module, which would cause replication.
Thank you
| stackexchange/codereview |
Let's propose that I have the following class
Public MyClass{
Date date;
//Mutable getters and setters
public Date getdate(){
retrurn date;
}
public Date setdate(Date date)
{date = date;}
//Now immutable setter and Getters
public Date getImmutableDate{
return new Date(... | stackexchange/codereview |
I have a layout with lots of different imagebuttons on it.
Application is developed in full-touch, so there should be no response to keyboard or keypad on all activities except one, where user can input his name.
Is there a way to achieve that?
I've checked on debug, keypress and keypad press result in onKeyDown even... | stackexchange/codereview |
How to spool, in UTF-8 format, data from an Oracle database into text file with all UTF-8 chars coming out properly, for example Chinese characters.
I am trying to spool data from an Oracle database which is UTF-8 enabled and trying to spool the same data into txt or cvs. Instead of the Chinese characters I am getting... | stackexchange/codereview |
I experimenting with jQuery. As I was trying I found out that I can't use hover event with .bind. And I don't know what is wrong.
$(document).ready(function(){
$('.some-class').bind({
hover: function(e) {
// Hover event handler
alert("hover");
},
click: function(e) {
// Click event handler
alert("clic... | stackexchange/codereview |
I'm trying to Tokenize tweets, but am running into a problem with looping through them.
For example, this works fine:
tweet = """This is an example Tweet!"""
# tokenize the sentence
print text
print list(token[1] for token in tokenize.generate_tokens(cStringIO.StringIO(text).readline)if token[1])
But, this does not... | stackexchange/codereview |
I'm having problem moving from mvc 1 to mvc 2.
In my old project I used Active Record.
Now running on new project where trying to get data from reposetory
public T[] SlicedFindAll(int firstResult, int maxResult, DetachedCriteria criteria)
{
return ActiveRecordMediator<T>.SlicedFindAll(firstResult, maxRes... | stackexchange/codereview |
Even though my question is very similar to this one, it's not a duplicate.
The images shows the stats from Firebug's NET tab, each request is taking a fraction of a second (all requests add up to 2.9 sec), yet the total time adds up to 6 seconds.
How do I figure out which request took the longest time, and where did t... | stackexchange/codereview |
Looking for help compiling my program below. I'm getting a "***Stop. no Targets." error when typing in limit.makefile in the compiler buffer. Ideas?
int main(int argc, char *argv[]) {
struct rlimit limit;
limit.rlim_cur = 60000;
limit.rlim_max = 60000;
if (setrlimit(RLIMIT_FSIZE, &limit) == -1){
perror("Err... | stackexchange/codereview |
I have done a series of transformations using glMultMatrix. How do I multiply a vector (nX, nY, nZ, 1) to the matrix I have from the transformation? How do I get that matrix to multiply with a vector?
pyglet.gl.lib.GLException: invalid operation
I am getting above error if I use glMultMatrix. I need to call this mul... | stackexchange/codereview |
Is there an Objective-C (or C) library (that is compatible with core location) that can tell me the time of sunrise and sunset for any given calendar day?
| stackexchange/codereview |
Example page: http://workshop.grdev.co.nz/mousetime
There are five divs which should respond to mouseover.
A switch (hoverDemo.doAnim) is set to false when the expand animation starts. This is intended to prevent the animation firing repeatedly when the mouse is placed so that the animation alternates between expanding... | stackexchange/codereview |
I was wondering if I could get some insight on how to make the display format for a time stamp say things like "Today, 12:16PM" or "Yesterday, 9:34AM". At the moment it just displays as this "11-03-2010, 12:10PM".
How would I go about making it say "Today" or "Yesterday"
Thanks.
| stackexchange/codereview |
I've been playing around with iOS development and I'm getting to the stage where I want to create something beyond a simple app. However, I'm not confident that I understand how to partition an application correctly.
For the purposes of simplicity, imagine a (very) simple audio player application. Let's say there are t... | stackexchange/codereview |
I have a WPF ContextMenu that looks like this:
<ContextMenu Width="300">
<MenuItem Command="{Binding MainWindowViewModel.NewCommand}">
<MenuItem.Icon>
<Image Source="pack://application:,,,/EAV.UI;component/Resources/Icons/MenuNew.png" Width="32" Height="32"/>
</MenuItem.Icon>
<MenuIt... | stackexchange/codereview |
Anyone knows the trick?
I googled but found no such solution yet.
| stackexchange/codereview |
I'm looking to create an associative array in JavaScript, but use constants defined as part of the class as indices.
The reason I want this is so that users of the class can use the constants (which define events) to trigger actions.
Some code to illustrate:
STATE_NORMAL = 0;
STATE_NEW_TASK_ADDED = 0;
this.curr_state =... | stackexchange/codereview |
I used a spinner and a button inside a tab of my application
but, when I assigned a onClicklistner for my button
the application crashes.
i used
myspinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
@Override
public void onItemSelected(AdapterView adapter, View v,
int i,longln... | stackexchange/codereview |
My coworker wants to use a singleton patttern in javascript to refer to objects which, in our current application, can only be created once.
Conversely, I want to refer to these objects using a namespaced global object.
His argument is that if it is ever allowable to create more than one of these objects, the refacto... | stackexchange/codereview |
Suppose I have a constructor in c++ as:
public class Machine {
public:
Machine(int boltCount, bool failure=false);
};
How do I convert this to an equivalent class in Java?
Thanks,
| stackexchange/codereview |
I am new to MVVM, and I am trying to implement a simple application, following the pattern.
For simplicity, I am breaking the problem down to it's simplest form. If I manage to get this to work, I will have little trouble getting the application made.
The simple application consists of a tabcontrol. It is important tha... | stackexchange/codereview |
In OpenGL (specifically ES 2.0 in this case), what happens if I pass 2 components per vertex, like so:
glVertexAttribPointer( 0, 2, GL_FLOAT, GL_FALSE, sizeof( MyVertexStruct ), pPos );
...but the shader expects three?
It seems to default the third (Z, in this case) component to 0, which is what I want, but I'm hesi... | stackexchange/codereview |
My sortable list is a bunch of links. The links should not fire when the user is sorting the list or after they let go of the mouse to stop sorting. With the following code, the links are being executed when the user lets go of the mouse. Is there a way to prevent this?
$("#applications").sortable({
start: funct... | stackexchange/codereview |
I just deployed my database to my remote server. I am trying to create a connectionstring to the remote server and it won't work. I am using godaddy. I kept having this message: could not establish a connection to the database. Here is the connectionstring for the local server:
<add name="ApplicationServices" connect... | stackexchange/codereview |
Background:
I am using DirectX 9.0 Managed Libraries to transform arrays of 3d points to 2d screen coordinates. For speed I use the UnsafeNativeMethods to do all the transformations.
The Problem:
If my custom line clipping function is used my application dies without throwing any exceptions, it took me a while to fi... | stackexchange/codereview |
I just can't get my head around this today - so your help is much appreciated.
Table Structure
Create Table #trans
(
TransactionId int,
AccountNumber varchar(10),
TransactionAmount money,
TransactionDate DateTime
)
Create Table #payments
(
PaymentId int,
AccountNumber varchar(10),
PaymentAmount money,
PaymentDate
)
E... | stackexchange/codereview |
I'm trying to set up a div which contains 4 divs. I want to set the width of the container and some of the contained divs to set values but they just seem to take the width of the content.
<html>
<head>
<style>
div {
border: 1px solid #888;
}
.container {
width: 300px;
position: relative;
}
.container... | stackexchange/codereview |
Consider this example:
public interface IAccount
{
string GetAccountName(string id);
}
public class BasicAccount : IAccount
{
public string GetAccountName(string id)
{
throw new NotImplementedException();
}
}
public class PremiumAccount : IAccount
{
public string GetAccountName(string id)... | stackexchange/codereview |
If someone here is willing to help me I would really appreciate
how to limit the addition of columns in the following html code, let say only up to 5 only?
<form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="friends"
<table width="100%" cellpadding="10" cellspacing="0" id="my_f... | stackexchange/codereview |
What I need is to populate entity from DB view (non-insertable) and make all entity updates to updatable DB table.
Mapping entity to table and writing custom load SQL from view is not an option since in some cases NHibernate still tries to select from table name (when joining this entity, for example).
Mapping entity ... | stackexchange/codereview |
For a simple command-line todo manager (that is to be implemented in C), this is what I have thought of the design:
The utility would support multiple users by storing the todo's in different files for each
While running the program would hold all the data in memory itself. This would avoid unnecessary IO and is also ... | stackexchange/codereview |
I'm having a strange issue with my modal view. The modal view asks for some user input so the keyboard pops on. When I click the cancel button to dismiss while the keyboard is still active they both dismiss in an animated fashion but the modal jerks to the right first, very strange. What would be my best course of acti... | stackexchange/codereview |
I'm wondering if it is possible to use CUDA in Dev C++, any ideas?
| stackexchange/codereview |
I need add watermark to the photo by special way. I know how to do it, but I don't know, how to do it the same way as in this article.
Here is method to add watermark. How I can change it to get image with watermark such as in article above?
public static Bitmap AddWatermark(this Bitmap originalImage, Bitmap watermarkI... | stackexchange/codereview |
So, I want to use a jQuery function to collect a URL from a link's REL, and pass it to a element.
Collecting the REL and sending it to the is no problem... but what's required to trigger the element's load and play functions, from jQuery?
Here's what I have so far:
$(function(){
$('a.componentLink').click(func... | stackexchange/codereview |
During the past few months, I've been working on a large web application. Repeatedly, we've written code that, according to DOM & JS specifications, should work perfectly, but still manages to completely kill one or more of our test browsers -- recently, we produced pure JavaScript code that should have been harmless b... | stackexchange/codereview |
Good morning everybody,
I'm really struggling during the installation of rpy version 2.1.7 on a windows XP machine.
I put the correct path in the environmental variable (C:\R\R-2.10.0\bin called R_HOME).
The installation process appear to accept the entry and it does not give the message "no R Command in the PATH" and... | stackexchange/codereview |
Is it possible to change the stage's background through actionscript?
How do I do it? (Code please.)
| stackexchange/codereview |
I'm using YUI to reset the browser classes and then I'm bringing in a couple custom stylesheets... I've seen this happen a few times and I don't think that I've ever narrowed down the cause:
the table is pulling in images to make up the squared table with shadowing... but for some reason, it's broken...
Here is my CSS:... | stackexchange/codereview |
Is it possible programmatically find out a song details of iPod library if my app allows playing background iPod music?
some like:
start "My app"
if (iPod music playing)
{
song.details == playing.music.details"
}
I don't even have no idea how to determinate if is any song is playing by iPod.
Any idea?
| stackexchange/codereview |
I have the following link which opens a jquery modal window:
<div id='confirm-dialog'><a href='#' class='confirm'><img src='1.png' /></a></div>
and the following JS code which processes it:
jQuery(function ($) {
$('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
e.preventDef... | stackexchange/codereview |
I'm using GetOpenFileName and setting the lpstrInitialDir member of the OPENFILENAME struct to the directory I want as the initial directory. However on Win7 my app seems to remember what directory the user last opened and it ignores the lpstrInitialDir settings and goes to the last directory.
Apparently this is b... | stackexchange/codereview |
I am writing a simple app which whena buttton is clicked a command is binded and i am doing
{...
newEvent.ExecuteTargets += exacuteNewEvent;
}
void exacuteNewEvent(string message)
{
Window1 w = new Window1();
w.ShowDialog();
}
my problem is how the w invoke my main window to know it... | stackexchange/codereview |
Me Doing "edu.sju.BlackJack" Is not causing updates that are later called to occur.
I reference the layout correctly and the calls that are supposed to update it are correct, so what do I put in for the package name?
I should add that my package name according to the manifest is the above.
This is the code I have now ... | stackexchange/codereview |
I'm learning a lot about the Views in Drupal, but can't figure how to add new View types to the list (node, comment, user, etc).
The Query I'm trying to recreate in a View is something like "SELECT * from Quizz", which is a custom table, and I have already created a new content type named "Quizz" but I would like to be... | stackexchange/codereview |
Can I change the font of my UINavigationController? --> title
| stackexchange/codereview |
I have a for loop, where i check if there is a certain key in a HashMap, if the key is not there, it should put a new association in the HashMap. The problem is that that it puts the association, but by the next iteration of the loop the association is gone! I don't get it!
public void DrawBoard(ArrayList<Integer[]> Bo... | stackexchange/codereview |
I have been roped in to help design a website for a local charity. I am currently a university student that has experience designing sites to good effect (Within university). I am comfortable using the relevant languages and packages. What I am not so sure about is hosting.
If I have a site that has a newsletter, fo... | stackexchange/codereview |
I am implementing a search application.
Corpus is large text documents.
During file process i'm tokenizing all the words and calling Porter Stemmer algorithm
Step1 (http://tartarus.org/~martin/PorterStemmer/csharp2.txt).
Step1 gets rid of plurals and -ed or -ing...
I noticed that a word like 'this' will be stemmed into... | stackexchange/codereview |
If i have my form elements with values in variable data (contains: var data = $(this).serializeArray();)
How can i do change the value of an form element (called recipient), when it's inside data?
So my element with name=recipient have value "mama", how can I change it to "papa" on ajax success
| stackexchange/codereview |
Suppose I have a list of tuples:
x = [(1,2), (3,4), (7,4), (5,4)]
Of all tuples that share the second element, I want to preserve the tuple with the largest first element:
y = [(1,2), (7,4)]
What is the best way to achieve this in Python?
Thanks for the answers.
The tuples could be two-element lists instead, if tha... | stackexchange/codereview |
I want to show an alert when a certain function is run and an if statement in that function finds that the <textarea> has no text in it. I tried:
<textarea rows="10" style="display: block;"id="textLoc" placeholder="Text to test"cols="50"></textarea>
text = document.getElementById('textLoc').value;
if (text == "... | stackexchange/codereview |
I basically want to add arrow if the mousehover my navigation. But two rules should apply:
It has to be the TOP parent (I already resolve that in the code)
It has to have CHILD elements (UL) submenu, etc. (Which is the problem!)
I can not, no matter what I do get it to only show after conditional if to check if it ha... | stackexchange/codereview |
I have the following code, which does not work correctly for some reason that I am trying to figure out:
public static int score(String gene1, String gene2){
char[] a=new char[gene1.length()];
char[] b=new char[gene2.length()];
a=gene1.toCharArray();
b=gene2.toCharArray();
return score(a, b, 0,0);
}... | stackexchange/codereview |
For HTML5 Audio, let's say you have a list of two songs you want to play. Currently I have it set up so that when the current song stops playing, it loads the new song and plays it. I want to have it so that it loads the next song while the current song is finishing, maybe 20 seconds before the current song finishes. I... | stackexchange/codereview |
I had a homework assignment that asked for a function that uses direct recursion to find the index of the left-most, lowest, negative integer in an array. Additional requirements were for the parameters of the function to be the array and the size and that the return value for no valid value was -999.
I came up with t... | stackexchange/codereview |
I have a call to MethodInfo.Invoke() to execute a function through reflection. The call is wrapped in a try/catch block but it still won't catch the exception thrown by the function I'm invoking.
I receive the following message:
Exception was unhandled by the user.
Why does MethodInfo.Invoke() prevent the Exception ... | stackexchange/codereview |
I'd thought I'd post this as I got it to work through guesswork without a real understanding of what's going on and I thought it might be helpful if someone explained it.
I understand how to get at an element of the :params map in a Compojure handler:
(GET "/something" [some_arg] "this is the response body")
or
(GET "... | stackexchange/codereview |
void MethodA()
{
Monitor.Enter(this);
if(someCondition)
{
Monitor.Exit(this);
// This point
MethodB();
}
else
{
// Set some values only
Monitor.Exit(this);
}
}
If I have the above method which can be called in multi threads:
Assume thread 1 is at //This point
Ano... | stackexchange/codereview |
In our ASP.Net web project we seem to have some .refresh files associated with some of the 3rd party Dlls we're using. Any idea what they are and how/when they are created?
| stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.