instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I have a piece of code which seems to take an unusual amount of time to execute. I'm in need of reducing the execution speed as much as possible.
Essentially, the code does the following. I create an array of objects size[10][10][10]. The object contains a list of numbers as follows:
class MyClass{
ArrayList<Integer>... | stackexchange/codereview |
I'm trying to allow users to vote a record up/down with Ajax. I'm using the vote_fu plugin for the voting functionality, and everything works fine without Ajax. I'm now trying to figure out the best way to implement the asynchronous functionality with unobtrusive javascript.
What I'm doing now is having two buttons, "U... | stackexchange/codereview |
I have a DOS batch file that performs an action for files beginning with text "SP", as follows:
FOR /F "tokens=*" %%A IN ( 'DIR SP*.sql /s /b' ) DO ECHO .compile_file = "%%A" >> output.txt
The key bit here is obviously:
DIR SP*.sql /s /b
I need to do a similar thing before the "FOR" line above, but for all other file... | stackexchange/codereview |
We have 2 tables. One holds measurements, the other one holds timestamps (one for every minute)
every measurement holds a FK to a timestamp.
We have 8M (million) measurements, and 2M timestamps.
We are creating a report database via replication, and my first solution was this: when a new measurement was received via th... | stackexchange/codereview |
using app engine - yes i know all about django templates and other template engines.
Lets say i have a dictionary or a simple object, i dont know its structure and i want to serialize it into html.
so if i had
{'data':{'id':1,'title':'home','address':{'street':'some road','city':'anycity','postal':'somepostal'}}}
want... | stackexchange/codereview |
i have following program to calculate size of file
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
string line;
ifstream myfile ("C:\\Users\\7\\Desktop\\example\\text.txt",ios::in | ios::out |ios::binary);
if (!myfile){
cout<<"cannot open file";
e... | stackexchange/codereview |
I have a moderately large rails ERP application having around 80 tables . I use MySQL . I recently received a client requirement which needs me to deploy the same application for roughly 10,000 offices(an instance for each office). The central office(superadmin office) must be able to view details from all these office... | stackexchange/codereview |
I'm developing a question game and I want to change the answer button pressed background color to green if the answer is correct or to red if the answer is wrong just in the moment the user press the button.
Actually I have a custom_button.xml which I assign to the buttons in the layout:
<Button
androi... | stackexchange/codereview |
I am using Eclipse to create a Dynamic Web Project. My eclipse is in
/home/pc/eclipse
and My project is in /home/pc/workspace/MyWebProj
Now I placed the files in the above Project Directory. When I want to read any File from my code, It always searches the files in /home/pc/eclipse folder instead of /home/pc/worksp... | stackexchange/codereview |
I've overridden an NSOpenGLView to handle keyboard events. The event detection is working fine, but every time I press a key I hear and annoying bump sound. How can I tell my view to chill out?
Here's what my keyUp: method looks like:
-(void) keyUp:(NSEvent *)theEvent
{
NSString *characters = [theEvent characters... | stackexchange/codereview |
I have a grid in GXT, something like this:
List<ColumnConfig> configs = new ArrayList<ColumnConfig>();
ColumnConfig config = new ColumnConfig();
config.setId("type");
config.setHeader("Type");
config.setWidth(50);
configs.add(config);
config = new ColumnConfig();
config.setId("text");
config.setHeader("Info");
config.s... | stackexchange/codereview |
As the title suggests, how can i get the coordinates of the cursor in the EditText ? im not trying to get the cursor position here but the screen coordinates of the cursor.
im trying to show a popup relative to that cursor, therefore i need to determine the cursor coordinates first.
| stackexchange/codereview |
I use htmlparser 1.6 to parse web sites.
The problem is that when I parse pdf web sites, I obtain in the output file strange characters like
ØÇÁÖÜ/:?ÖQØ?WÕWÏ
This is a fragment of my code :
try {
parser = new Parser ();
if (1 < args.length)
filter = new TagNameFilter (args[1]);
else
{
... | stackexchange/codereview |
I'd like to redirect a website from http:// domain.com & http:// www.domain.com to http://v2.domain.com, while maintaining access to http:// (www.)domain.com/images/*
I've tried several methods but somehow I can no longer access the /images folder anymore.
P.S: both subdomain & root has different content/CMS. Any idea... | stackexchange/codereview |
I'm writing a Java application for real-time image processing. I'd like to be able to validate the algorithms used or present data I acquire in the Java app with Matlab afterwards. In the Java app I'm using java.awt.image.BufferedImage's to process data internally. The program usually runs about 1-2 minutes and grabs d... | stackexchange/codereview |
I am trying to learn log4Net, however, I do not have Visual Studio installed in my PC (due to lack of Administrative Privileges). And so, I am trying out my code by writing them in good old Notepad of Windows XP. In this, if I want to add a reference to log4net.dll, how do I do it?
Sorry for being .NET naive. I am just... | stackexchange/codereview |
I have content that is going to be the exact same between the mobile and web site. The only thing i want to change is the base template. One base template for the mobile HTML, and one for the website HTML.
One solution is to wrap the render_to_response and determine which HTML to render, but I'd still have two files.
I... | stackexchange/codereview |
For a user I have the following as an example:
[#<Permission id: 1, project_id: 3, role_id: 1, user_id: 1>, #<Permission id: 43, project_id: 2, role_id: 1, user_id: 1>, #<Permission id: 44, project_id: 4, role_id: 1, user_id: 1>, #<Permission id: 45, project_id: 5, role_id: 2, user_id: 1>, #<Permission id: 46, project_... | stackexchange/codereview |
I am trying to deploy a Rails app via Capistrano but am having problems. The messages that get returned in Terminal are as follows:
victor$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@github.com:v... | stackexchange/codereview |
I have a ruby (on rails) class:
class User < ActiveRecord::Base
# relationships
belongs_to :current_shipping_address, :class_name => "Address"
belongs_to :subscription
# Validators
validates_presence_of :subscription
validates_presence_of :current_shipping_address
end
I do this in a controller:
subscripti... | stackexchange/codereview |
Preface:
If you hang out in #rubyonrails on freenode this may sound like an echo to you as i asked it in there 2 days ago. After spending a number of hours researching AR associations, following my discussions in #rubyonrails, i still feel lost so I'm asking here. :)
Goal
I host a number of blogs. My intent is to cre... | stackexchange/codereview |
the document
http://developer.android.com/guide/topics/data/data-storage.html
shows that there are multiple ways to save data, I need to do this in a widget and everytime I try to save i get errors...
for instance
SharedPreferences settings = getSharedPreferences("NAME", 0);
SharedPreferences.Editor editor... | stackexchange/codereview |
I have a action/view named: join
And I post the the 'create' action.
What should my create action look like, I want to pre-populate some fields if the creation process had an error in it (like say the email address).
So far I have:
def create
@user = User.new(params[:user])
if @user.save
end
en... | stackexchange/codereview |
I need to merge two NSDictionarys into one provided that if there are dictionaries within the dictionaries, they are also merged.
More or less like jQuery's extend function.
| stackexchange/codereview |
Let's imaging there are 2 pages on the web site: quick and slow. Requests to slow page are executed for a 1 minute, request to quick 5 seconds.
Whole my development career I thought that if 1st started request is slow: he will do a (synchronous) call to DB... wait answer... If during this time request to quick page wil... | stackexchange/codereview |
I've downloaded the latest version of Orchard (0.5) and I've looked at the initial layout of the site. Looks good. But, it only allows me to edit different parts of it and not the actual layout of the page.... or does it? If so, how do I go about changing this?
| stackexchange/codereview |
I am using jqgrid for a website i am developing and can't seem to find the problems in ie8. In ff everything works fine, but in ie8 i get the "Out of memory at line 12" message followed by a list of "Object doesn't support this property or method"
Here is the list with all the js files i include:
<script src="js/jque... | stackexchange/codereview |
I have an custom home page in my site. I want to add 3 custom post ares to update images, text and links. How it can be done in wordpress 3.1?
| stackexchange/codereview |
I downloaded the silverlight 4 socket application from the book "Pro silverlight 4 with c#" which is basically just a silverlight socket client and server application. The server is a console application and the client is a silverlight web applcation.
I can run the server and client fine on ONE computer, it shows th... | stackexchange/codereview |
I'm trying to add some sort of a superglobal in my app. It will only store a small integer, but I need it to be accessible from anywhere in my app.
I know you can use the delegate for this, but wouldn't it be easier if you could just set a superglobal in your application (of course it has to be alterable)?
So, what is ... | stackexchange/codereview |
what methods are there for a CronTrigger to modify its CronExpression? I've tried to set it in the CronExpressionString but that doesn't seem to update it, and I can't convert my string to a CronExpression to use in the CronExpression method.
| stackexchange/codereview |
I've followed Railscast #235 to try and set up a minimal Facebook authentication.
I've first set up a Twitter authentication, as done by Ryan himself. That worked flawlessly.
I then moved on to adding a Facebook login. However, after authorizing the app the redirect to /auth/facebook/callback fails with:
SSL_connect re... | stackexchange/codereview |
lately i've faced a problem which gets me so confused ,
the problem is :
i want to compress a sequence so no information is lost , for example :
a,a,a,b --> a,b
a,b,a,a,c --> a,b,a,a,c (it can't be compressed to a,b,a,c because in this way we lose a,a)
Is there any algorithm to do such a thing ? what is name of this ... | stackexchange/codereview |
I have a dictionary. The keys are dates (datetime). I need to sort the dictionary so that the values in the dictionary are sorted by date - so that by iterating through the dictionary, I am processing items in the desired chronological (i.e. date/time) order.
How may I sort such a dictionary by date?
Example:
mydict = ... | stackexchange/codereview |
What's the equivalent of relative_url_root in ActionMailer?
I've tried setting it up in default_url_options, but it appends the parameter in the query string.
Adding :skip_relative_url_root = false doesn't work either.
Using :host = 'somehost.com/subdir' does work, but is that appropriate?
Thanks!
| stackexchange/codereview |
I'm in the process of designing a web application and I'm thinking about incorporating some barcode reading to facilitate data input. Let's suppose I have a list of tasks a courier needs to do. I would like to print something similar to the following page:
+------------------------------------------------------------... | stackexchange/codereview |
I am trying to migrate deployment from 4.0.3sp1 to 5.1. I just copied the file under /opt/jboss/server to jboss 5.1 directory.
At first, it prompt failed to access server/conf/bootstrap.xml, etc, I copied them from /opt/jboss/server/default/conf/*.xml, then it come to the error:
14:27:19,785 ERROR [ScopedProfileServi... | stackexchange/codereview |
How to autoSize table cells which was generated by seam pdf plugin (via iText)
| stackexchange/codereview |
Hi i have a problem in mailing in the C#.net. I want to mail to the email address but i do not want to open the Outlook. Is there any procedure to do this. Please help to mail in c#.net.
| stackexchange/codereview |
We can set breakpoint at a func, hence gdb knows the entrance and exit address of a certain function. But how does it get this information? Does it uses DWARF or readelf for the executable, if yes, how?
Thanks
| stackexchange/codereview |
Out of curiosity. I've been thinking about the different access models often seen in *nix and the one seen in windows nt based systems.
Is there any command or api to check if a file is readable, executable etc for a user different than the logged in user. For instance something like:
http://www.php.net/manual/en/func... | stackexchange/codereview |
I have a table with about 200 records, each record has a date, adzone, revenue, clicks, cpm.
What is the proper sqlite statement total count of how many records where grouped in the same statement?
select SUM(revenue), SUM(clicks), adzone
from mytable
where date='12345'
group by adzone
| stackexchange/codereview |
I'm on OS X, and in objective-c I'm trying to convert
for example,
"Bobateagreenapple"
into
"Bob ate a green apple"
Is there any way to do this efficiently? Would something involving a spell checker work?
EDIT: Just some extra information:
I'm attempting to build something that takes some misformatted text (for exam... | stackexchange/codereview |
I am building up a site in PHP which takes input of more than 20 fields from user. Hardly 3-4 field values are compulsory, rest can be left blank. I want to display a custom error message instead of blank or zero or null while displaying these values. How can this be done? I am using MySQL as backend.
| stackexchange/codereview |
I just had a look at the docs on sleep().
Where would you use this function?
Is it there to give the CPU a break in an expensive function?
Any common pitfalls?
| stackexchange/codereview |
Iam new to developing HTML5 applications. In this I want to insert 1000's of records into sqlite database using HTML5. This process is very slow. How to use BEGIN/COMMIT before inserting records. In this way to speed up the insertions. Please guide me anybody. Thanks in advance. Please run this example in chrome browse... | stackexchange/codereview |
I have a UITableView which I need to update about 2-3 times a second via NSTimer. The cells in this table have UIButtons which respond to touchupinside. The problem is that this created extreme sensitivity. I could not press the button for too long otherwise it wouldn't register.
That issue was solved in
UIButton overs... | stackexchange/codereview |
I have a PHP app and I need to delete a client-side file. How can I achieve that?
I'm new to PHP. Hope someone can help me.
| stackexchange/codereview |
I'm new to JavaScript. New as far as all I've really done with it is tweaked existing code and wrote small bits of jQuery.
Now I'm attempting to write a "class" with attributes and methods, but I'm having trouble with the methods. My code:
function Request(destination, stay_open) {
this.state = "ready";
this.x... | stackexchange/codereview |
I was reading something a few months ago that would take something like:
SELECT first, last FROM contacts where status = 'active'
and turn it into:
SELECT first, last FROM active_contacts
It's definitely not a stored procedure and I'm pretty sure it's not a prepared statement. I'm also positive what I was reading did... | stackexchange/codereview |
I have a complex form (like Ryan B's Complex Form Railscasts) where I have a few levels of database tables being altered at the same time.
The code for this dropdown box works in that it delivers the correct integer to the database. But, despite numerous attempts I cannot get it to correctly reflect the database's CURR... | stackexchange/codereview |
I don't know if I'm doing something wrong, but I'm 100% sure it's the python script brings down my Internet connection.
I wrote a python script to scrape thousands of files header info, mainly for Content-Length to get the exact size of each file, using HEAD request.
Sample code:
class HeadRequest(urllib2.Request):
... | stackexchange/codereview |
I am new to iPhone app development. I have an app created in XCode 3.1.3 and need to do 2 things;
1. Test it on my iPod touch (Latest OS: 4.1)
2. Submit it to the app store.
My question is, can I do both these things given that I have XCode 3.1.3 OR do I have to upgrade?
Also in case I need to upgrade, is it possible t... | stackexchange/codereview |
I was wondering if anybody know hows to modify the existing category widget to only display the categories within the selected parent category.
Example:
If my categories are structured like:
Computers
Laptops
Desktops
Software
Electronics
Cameras
Audio/Video
If somebody is viewing posts in the Computers category ... | stackexchange/codereview |
In a current project we are hosting a WCF 3.5 service on IIS7 and expose the methods through basicHttpBinding to an Adobe AIR/Flex4-client. Luckily Flash Builder 4 has integrated support for SOAP, so that a service-proxy can be generated easily.
Unfortunately, we are not able to find any elegant solution to enable user... | stackexchange/codereview |
I'm trying to open a PDF file from Vim using the commands
let openpdfname = "!open " . expand("%:t:r") . ".pdf"
map <F6> :silent execute openpdfname<CR> | redraw!
The PDF opens up in Preview and all is well, except that the Vim screen is not repainted. I use vim 7.2.108 (shipped standard with OSX 10.6) from the termin... | stackexchange/codereview |
I've created a custom ListView by extending SimpleCursorAdapter.
The result is IMAGE + CheckedTextView (Text + Checkbox).
When I long click an Item, everything works fine - I get the right ID and details of the clicked Item.
The problem occurs when I try to mark an Item as checked but it checks the wrong checkbox.
For ... | stackexchange/codereview |
How do I get "mymessage.gif" to show over "bread_wine.jpg".
mymessage.gif has a transparent background.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>overlap images</title>
<style type="text/css">
<!--
#navbar {
font-size: 18px;
font-weight: bold;
text-align: ... | stackexchange/codereview |
So I recently discovered that the log4* package was available for PHP and upon seeing this eagerly downloaded the latest from the log4php website and followed the installation instructions. The instructions indicate that one is to download the tar package, untar, and place the following directory in a place of one's c... | stackexchange/codereview |
Up to now, when doing join operation in LINQ, I have no idea how to decide which list must come first and which list must come after. Assume I have two list, List<Product> and List<Order>.
Edit:
My confusion is to decide
List<Product>.Join(List<Order>, ...)
or
List<Order>.Join(List<Product>, ...)
?
| stackexchange/codereview |
When using a serial port via POSIX, it's recommended to save the original attributes using tcgetattr() before changing them with tcsetattr(), and then restore them before closing the port. What about when a program is terminated by pressing control-C or when the program receives SIGINT? I haven't seen this covered in a... | stackexchange/codereview |
I know that Esc + . gives you the last argument of the last command.
But I'm interested in first argument of the last command.
Is there a key binding to do so?
On the same lines, is there a generic way of getting the nth argument from the last command?
I know that in a bash script, you can use $0, $1 etc., but these do... | stackexchange/codereview |
Many times I encounter a site, and would like to know - how did they do this?
Moreover, I'm looking at a the work of someone else in my own (web) project, and want to understand what exactly did he do?
What are the parts of the page? Which scripting manipulations are being performed? Which requests are being sent to th... | stackexchange/codereview |
I am trying to write some code that will loop through a list and add like terms. I'm trying to cons the cdr of the input list to a null list and then just compare the car of the list to the car of the new list and traverse down the list but my code just isn't working. What am I doing wrong here?
(define loop-add
(l... | stackexchange/codereview |
The class below (my implementation of UserDetailsService) gets tied to the session and the session gets serialized (in google apps engine).
I watched a Spring 3 presentation recently that said that beans, such as userDao, shown below, are loaded by a proxy which doesn't serialize the bean, but stores only the name and... | stackexchange/codereview |
This compiles:
public class A<T> {
public void test() {
var a = typeof (A<>);
}
}
This does not:
public class A<T,S> {
public void test() {
var a = typeof (A<>);
}
}
I get the error: Using the generic type 'A' requires 2 type arguments
How do I get a reference to the type of this gener... | stackexchange/codereview |
I have a model, called Book, that has the fields title and filename (and other fields but they are unrelated). I'd like that the filename field was automatically created using the title, thus in my Book.rb:
class Book < ActiveRecord::Base
# ...
def title=(title)
self.filename = sanitize_filename(title)
sel... | stackexchange/codereview |
I'm using Spring's ObjectFactoryCreatingFactoryBean to retrieve a prototype scoped bean, as described in the Spring Documentation. Below is my applicationContext.
<bean id="exportFactory" class="org.springframework.beans.factory.config.ObjectFactoryCreatingFactoryBean">
<property name="targetBeanName">
<idr... | stackexchange/codereview |
With normal PHP string you can do this:
$str = "Hello ";
$str .= "world";
$str .= "bla bla bla";
$str .= "bla bla bla...";
But can you do the same with heredoc string..?
$str = <<<EOD
Hello
world
EOD;
$str .= <<<EOD
bla bla bla";
bla bla bla...";
EOD;
| stackexchange/codereview |
Hi guys
I want to print in awk line and character ' after the line, but awk put the character in the middle of the line. Here is my code :
awk -v d="'" {print $0 d}
i am using bash2
thanks for help
| stackexchange/codereview |
I am trying to play some videos in a UIWebView and required to get some feedback when the video playback is finished, without any user interaction. I am looking for something similar to MPMoviePlayerPlaybackDidFinishNotification, but in UIWebView. Appreciate if anyone can share a work around.
| stackexchange/codereview |
I have a canvas and within it I have many Thumbs..
when I make a hit test on the canvas so as to find the thumbs near my mouse I get the wrong
expected result which I get the border of the thumb not the thumb itself..
Please I want the solution!!
| stackexchange/codereview |
You see I have a set of entries to be ordered alphabetically. Though some of the entries starts with "The". What I want is to ignore "The" and start sorting from the next word. For example:
$titles->order_by("name", "ASC")->find_all() // Sample query
Abraham
Panorama
The Malevolent
What I want:
Abraham
The Malevole... | stackexchange/codereview |
I'm using Fluent NHibernate to generate a database schema from .Net entity classes. I have two classes User and Permission with a many to many relationship, and Fluent NHibernate is correctly generating a junction table UsersToPermissions in the database.
As expected the junction table is storing the primary keys UserI... | stackexchange/codereview |
is there any way to use google document translator application in my website? i did it like they do it, but i cannot access to their server. i got this message:
Forbidden
Your client does not have permission to get URL /translate_f from this server.
does someone know if it's possible to do this? if not, is there anoth... | stackexchange/codereview |
i have content i need to display above my listview and below, so much that a scrollview would be great to use if you could use scrollviews and listviews together. Since thats not the best solution, i've been trying to do a couple of things to add footer content to my listview,
here the pic below shows what happens whe... | stackexchange/codereview |
I have a 2D array of integers in Java.
I want to take this and output a bitmap image file where the red value of each pixel is the corresponding value in the array (blue and green values are 0).
Does anyone know how to do this? Thanks.
| stackexchange/codereview |
This is part of a homework assignment so my goal is to understand why this is wrong. As I mentioned before I'm using Moscow ML.
fun filter pred = let
fun f ([], a) = []
| f ([], a) = a
| f (e::L, a) = if pred e then (f L (e::a) ) else (f L a)
in
f
end
The error I get is:
| f (e::L, a) = if pred e then (f L (e::... | stackexchange/codereview |
I'm generating a WCF service using the message contract model.
I have created a generic request message contract like so:
[MessageContract]
public Request<T>
{
[MessageBodyMember]
public T Details { get; set; }
}
I'm used to using [DataContract(Name="Contract{0}")] to produce readable names for generic data co... | stackexchange/codereview |
I am trying to update the database dynamically.But if i enter the same string twice...it is poped twice i m trying to replace it but still not working.Can anyone help me out...
| stackexchange/codereview |
I'm building a web site from the old one and i need to show a lot of .pdf files.
I need users to get authenficated before the can't see any of my .pdf but i don't know how (and i can't put my pdf in my database).
I'm using Pylons with Python.
Thank for you help.
If you have any question, ask me! :)
| stackexchange/codereview |
I need to define a template struct such that:
element<T>::type
is of type:
T::element_type
if T contains a (public) typedef named element_type, otherwise (if it does not contain such typedef)
element<T>::type
is of type
T::value_type
if T is mutable and of type
const T::value_type
if T is constant.
I am really s... | stackexchange/codereview |
I'm part of a small team that want to move to using TFS for source control and build management for a SQL Server 2008 database. For our product, it is possible to have customers that are running different versions of the product/database. One issue I need to resolve is how to manage complex upgrade-scripts for situatio... | stackexchange/codereview |
How do you find a roman numeral equivalent of an integer. Is there a java library which provides this capability?
I did find a similar question, but I would prefer an out of the box API abstraction for this issue. Its just painful to handle all possible combinations in your code.
| stackexchange/codereview |
Can you please post a small explanation of the prerequisites of using Windows Authentication?
I know that you have to turn Windows Authentication on from web.config or IIS and define domain.
Does the web server have to be connected to the Active Directory server or not, and how to get user info from Active Directory l... | stackexchange/codereview |
I am trying to get the functionality of SQL servers MERGE statement in Entity Framework.
At a WCF service, I am receiving a list of records from a client app.
I want to compare a particular field in ALL the records in the list against a database table.
-Should there be a matching record in the db, I need to update the ... | stackexchange/codereview |
Below is draft number 5 for my C# Homework this week. I wrote the program out using Linq first, and it worked fine. Unfortunately, the directions state that I must create my own method instead of using the wonderful Sum() method already found in Linq. The major problem with this source code is that the method overload ... | stackexchange/codereview |
While using a UIActionSheet in an iphone app, the typical methods of matching actions to buttons seem very fragile and aesthetically unpleasant. Perhaps its due to my minimal C/C++ background (more Perl, Java, Lisp and others). Matching on button indexes just seems like too many magic numbers and too disconnected to ... | stackexchange/codereview |
Hi i have an uiwebview, I have prepare the htmlstring format of data to load in webview.
I am using this line to load htmlstring in uiwebview.
[webView loadHTMLString:htmlstring baseURL:[NSURL URLWithString:[NSString stringWithFormat:@"file:/%@//",imagePath]]];
In the html formated string we have an one image but... | stackexchange/codereview |
I have a relative or absolute url in a string. I first need to know whether it is absolute or relative. How do I do this? I then want to determine if the domain of the url is in an allow list.
Here is my allow list, as an example:
string[] Allowed =
{
"google.com",
"yahoo.com",
"espn.com"
}
Once I know whe... | stackexchange/codereview |
I'm close to giving up on this mvc app for today!!
I'm following the Mvc Music Store Tutorial and I'm stuck on page 54.
this is the error I'm getting:
System.NullReferenceException: Object
reference not set to an instance of an
object.
The error occurs in the third paragraph block (dropdownlist) in the following... | stackexchange/codereview |
I have two models, Posts and Tags. Posts HasAndBelongsToMany Tags.
Let's say a Post 1 has the tags world, news, and paper.
Now in the joining table, I want to remove the association between the Tag "paper" and Post 1, but the Tag "paper" should not be deleted from the tags table. Only the association in the joining t... | stackexchange/codereview |
I want to choose 10 random integers from 0 to 99. I know I can use:
random.randint(a, b)
But how to tell the randint() that I only want different integers.
Do I have to just check after each random generation to see if the integer has already been generated and call the method again? That does not seem like an optimal... | stackexchange/codereview |
My tableView consists of 5-10 cells, each of which contains a scrollview of images. The problem is that when a cell goes off screen, it removes all the images and then reloads them when the cell comes back on screen. I know this is done for performance reasons, but in this case it just looks bad. Is there a way to prev... | stackexchange/codereview |
I have very little experience in web development, so this may be a very basic question.
It's just, from the limited experience I do have (a little PHP, and a little Ruby on Rails), it seems that the way dynamically generated HTML is formatted just "doesn't matter"; it ends up ugly, with weird indentation, and nobody ca... | stackexchange/codereview |
I have a QWebView which loads some webpage, but the problem when mouse is pressed and dragged it selectes everything which comes in its way.
Is there any way I can get rid of this?? I dont want text and other items to be selected.,
If I restrict mouseMove and mousePress then it other functionality with these event also... | stackexchange/codereview |
I have the following snippet:
CONVERT(varchar, FLOOR(ROUND((DATEDIFF(minute, shiftStart.timeEntered, shiftEnd.timeEntered) - DATEDIFF(minute,
lunchStart.timeEntered, lunchEnd.timeEntered)) * 1.0 / 60, 2, 1))) + ':' + CONVERT(varchar, ROUND(ROUND(DATEDIFF(minute, shiftStart.timeEntered,
... | stackexchange/codereview |
I'm working on a project where Subversion is used to maintain version control. I use TortoiseSVN to access the project repository.
Some changes were made between two revisions on a project (let's call them rev1 and rev2), and I want to be able to apply these changes to a working copy somewhere that temporarily does not... | stackexchange/codereview |
I am trying to have a view that has four buttons on the top: a picture button, video button, audio button, and text button and an imageView below the buttons. If you click on the picture button, the imageView displays the picture. but if I click the video button i want the imageView to display a picture of the video th... | stackexchange/codereview |
I have getElementText as follows which works pretty well with [0] as the XML that I'm working on doesn't have the duplicate tag.
from xml.dom import minidom
def getElementText(element, tagName):
return str(element.getElementsByTagName(tagName)[0].firstChild.data)
doc = minidom.parse("/Users/smcho/Desktop/hello.x... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.