instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
How do I check if a variable is False using Django template syntax?
{% if myvar == False %}
Doesn't seem to work.
Note that I very specifically want to check if it has the Python value False. This variable could be an empty array too, which is not what I want to check for.
| stackexchange/codereview |
I've a got an Asp.Net site that is using Forms authentication, I've also got custom errors configured in the web.config. One of these is a special error page for 403's (access denied). My question is how do I get Forms authentication to work smarter?
I would like Forms authentication to send users to login page only i... | stackexchange/codereview |
can anybody help me how to find the values that sent and respond? i am working on WCF services.
| stackexchange/codereview |
I am using sql server database.it has fields Isactive and created date...say created date=09/11/2010 5.00pm and its intial status=false by 10/11/2010 5.00pm it Isactive should be true.
How to acheive this
| stackexchange/codereview |
I can use both HttpWebRequest to send an HTTP request and get an HTTP response without a WebClient.
When should you use HttpWebRequest and when should you use WebClient?
| stackexchange/codereview |
I'm using Syntastic plugin. I have some files with some errors (Warnings) that I can't change. When I have a file opened with error messages, and I quit the file(buffer) pressing :q, the error messages are still visible(another buffer), so I have to press :q twice to completely exit when editing a file.
So, how do I pr... | stackexchange/codereview |
I've been reading up a bit on Application Domains and Threading, and I came across this statement:
"A particular thread is not confined to a single application domain. That is, threads are free to cross application domain boundaries; a new thread is not created for each application domain."
Now that's all well and good... | stackexchange/codereview |
I have two QTreeViews in a QHBoxLayout.
<layout class="QHBoxLayout" name="lay_disk_content">
<item>
<widget class="QTreeView" name="lay_disk_tvA">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
</widget>
</item>
<item>
<widget class="QTreeView" name="lay_disk... | stackexchange/codereview |
Hello there im trying to setup chive on nginx, can someone help me convert htaccess for it ?
Options +FollowSymLinks
IndexIgnore */*
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{R... | stackexchange/codereview |
I want that a user only enters numeric data into the textbox in a windows form. How can I achieve this?
| stackexchange/codereview |
I have a table <table></table> and also a CSS Rule *{margin:0;padding:0;}
Now I want to nullify the effect of "margin:0" (the universal rule) over the above mentioned table. How can i achieve that?
| stackexchange/codereview |
Environment here is C#/.Net 4.
In my MS Unit Test unit test project I'm testing a piece of code which uses a COM dll for some date conversion calculations (this in turn uses some other COM DLLs so in all three COM DLLs are involved).
When running in a normal application/service set-up, I have no problem getting the sid... | stackexchange/codereview |
I have a problem here in WCF.
I have my WCF service which is exposed in web and multiple sites are consuming the same WCF.
I wanted to identify URL's (not the IP's) of these sites with in the service itself.
Can some body share me your thoughts....
Thanks,
Kiran
| stackexchange/codereview |
For simplicity sake, I have two fields within a table:
Date 1 (YYYY-MM-DD format)
Day (single or two digit day format, 1-31)
I want to be able to update Date 1 using the value within Day but I DO NOT want to make multiple calls to do so (first a select, fetch results, then update with the result from the same table).... | stackexchange/codereview |
I have a GridView where one of the cells holds a TextBox with a CalendarExtender attached to it. Another cell holds a button that triggers the CalendarExtender. After a date is selected, a checkDate function is triggered on the client side where at the end of it I want to trigger the server side event of the button. My... | stackexchange/codereview |
I'm currently using the Silverlight Unit Test Framework, but I'd prefer to run tests directly in VS2010. I'm curious to know what approaches and tools everyone else uses.
I'm using Silverlight 4 with Prism and the MVVM pattern, and I'm specifically interested in integrated Silverlight unit test support in VS 2010 that... | stackexchange/codereview |
I want to check if a certain element in an array has been initilized, how can I do this?
| stackexchange/codereview |
My program (server) connects to a client through some middle-ware.
I made a midle-ware initialize function in my program.
init_middleware()
{
if (middle-ware can not started) // then middle-ware throw exception
return exception;
else
return success;
}
How can I unit test the init_middleware function?
I thi... | stackexchange/codereview |
I'm getting a constraint failed exception in my Android project, and I can't quite figure out where it's coming from. My helper class looks like this:
public static final String WORDS_TABLE = "words";
public static final String ATT_WORD = "word";
public static final String ATT_T1 = "T1";
public static final String ... | stackexchange/codereview |
Now I am make video player. and try to make video screen size change.
I find
MediaPlayer.OnVideoSizeChangedListener mSizeChangedListener =
new MediaPlayer.OnVideoSizeChangedListener() {
but this is callback function. not direct call function.
How to change video screen size?
| stackexchange/codereview |
I'm looking for the way how to add a checkbox on the header that support checked or unchecked all my checkbox column of my girdview.
<table class="grid">
<th><input type="checkbox" name="chkall"/></th>
<th>Name</th>
<tr>
<td>
<input type="checkbox" id="chkItem_1"/>
... | stackexchange/codereview |
I want to monitor the system scope's printing jobs through a standalone program using the Windows Spooler API, but only the print job's name can be fetched. How do I get the original file with full path.
| stackexchange/codereview |
How to assign Click event in this? I want to do something when mouse click on this window.
It's doesn't have Click properties in both Window and Canvas
<Window Loaded="Window_Loaded"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="I... | stackexchange/codereview |
I use smart pointer from Boost library. Suppose I have this object:
boost::shared_ptr<A> a(new A);
a->fileName = "/temp";
In the class B, I have:
bool open(A *a);
and
private: boost::shared_ptr<A> myA;
Then I declare an object B:
boost::shared_ptr<B> b(new B());
b->open(a.get());
bool B::open(A *a)
{
*B::myA = ... | stackexchange/codereview |
I'm not a MySQL expert, it's late and my eyes are batty. Now, with that out of the way... Something's going screwy on this server and I'm wondering if maybe it's the fact that there are two versions of MySQL on it and the old one (which is supposed to be dormant) is somehow coming back to life.
I'm not sure I'm readin... | stackexchange/codereview |
hey guyz i am having an issue with the infopath forms in sharepoint. can anybody help me how to deploy an infopath form with code behind it on to the sharepoint server. I dont have the access to the server as an administrator. can anybody tell me how many ways can i publish the infopath form so that i can view it on a ... | stackexchange/codereview |
I'm trying to use a timer to repeat a function periodically. Now I have to pass inputs to the function, but I get the error "activity is not abstract and does not override abstract method run() in java.util.timertask".
What is the correct practice to pass values to the nested functions called by the timer? Examples onl... | stackexchange/codereview |
I am having difficulty trying to get this regex to work. All I am trying to do is remove block comments. This is what I have so far but I can't get rid of the final */.
$string = 'this is a test /*asdfa */ ok then';
$pattern = '/\/\*([^\*\/]*)/i';
$replacement = '';
echo preg_replace($pattern, $replacement, $string... | stackexchange/codereview |
When writing code in X++ you sometimes need to reference this.functionYouWant() and sometimes it is element.FunctionYouWant(). Sometimes both are in scope. I often try one and if the function I want isn't there I try the other. Is there a rule that explains when to use this and when to use element?
| stackexchange/codereview |
Good night,
I have been working with fuzzy string matching for some time now, and using C with some pointers I could write a very fast (for my needs) implementation of the Levenshtein distance between two strings. I tried to port the code to C# using unsafe code and the fixed keyword, but the performance was way slower... | stackexchange/codereview |
I am new to JQuery....
Recently i was working on a project and i faced the following problem:
I have two ul (say: gallery(LHS) and trash(RHS)) .
In gallery i have 8 li's and they are draggable and sortable.
I can drag and drop the li's to trash. I can even sort them in trash.
the problem i am facing is with the placeme... | stackexchange/codereview |
I need to include a graph editor (users should be able to place elements from a list in the graph and link them with other ones, much like an organizational chart) in my Silverlight application but have no idea how to do so. None of the controls in the SDK or the Toolkit seem to be made for such a scenario and using on... | stackexchange/codereview |
SELECT COUNT(w.invoiceId) AS '10 Days' FROM tbl_Invoice w
WHERE w.invoiceId NOT IN(
SELECT inv.invoiceId FROM tbl_InvoiceAllocation inv)
AND w.invoiceDate < DATE_SUB(curdate(), INTERVAL 10 DAY)
It works fine and returns a count of all the invoices that have a date of more than 10 days ago. I now want to return counts ... | stackexchange/codereview |
I am using CodeIgniter on Windows 7 along with wamp. I generated a self-signed certificate and all the other things that are needed to run a website under https. My website is working perfectly in SSL mode. The problem is I only want my login and registration page to be in SSL mode. In CI, we can only configure one url... | stackexchange/codereview |
I have a master collection of items with unique ID's.
At some point I have a subset of IDs from the master list that belong to some sub grouping if you will. The subset is just a reference of IDs of items that exist in the master list. Is there a way I can ask the master list for just the items that match the IDs in my... | stackexchange/codereview |
I have a script which builds my application, uploads it to a remote machine, runs a performance test there and captures some metrics that I care about. The script creates a patch file for the local modifications I make in my workspace and shows it along with the performance numbers. This helps me compare the effect of ... | stackexchange/codereview |
I am trying to create a GtkNotebook where each page displays information after the program has run out. I don't wish to edit it and just want that it displays itself.
The trouble is that gtk_text_buffer_insert () asks for a const gchar string . I have been storing all the information to be displayed in the files.
How c... | stackexchange/codereview |
Like I have this validator on a TextBox:
<asp:RequiredFieldValidator ID="rfvtxtAdd" ValidationGroup="Update" ErrorMessage="*"
SetFocusOnError="true" ControlToValidate="txtAdd" runat="server" />
I want to turn off this validation check in code behind. How do you do it?
| stackexchange/codereview |
If no JavaScript is enabled, I want my body to have overflow:hidden (no scrollbars).
How can I solve this? Is it possible to use a noscript tag inside of <head> and set specific styles inside of it?
| stackexchange/codereview |
I am engaged in preparing an application regarding reading the .epub files in iPhone. Where can I get the reference for sample applications for unzipping and parsing the files? Can anyone guide me with a best link? Thank you in advance.
| stackexchange/codereview |
My application is crashing when trying to parse a large XML file using SAXParser.
I found a question in SO regarding it here unanswered.
It is working as intended when i reduce the size of the XML
Here is my LogCat output.
11-26 12:08:45.099: WARN/dalvikvm(218): threadid=17: thread exiting with uncaught exception (gr... | stackexchange/codereview |
I have a strange problem. I want to check if .ASPXAUTH cookie exists with javascript. I do it like this:
authx = document.cookie.indexOf(".ASPXAUTH" + "=");
and the 'authx' value is always -1. But if I tray to find some other cookie like:
foo = document.cookie.indexOf("bar" + "=");
it works. Is there some restr... | stackexchange/codereview |
I am trying to copy the memory value of int into the char buffer. The code looks like below,
#define CPYINT(a, b) memcpy(a, &b, 4)
............
char str1[4];
int i = 1;
CPYINT(str1, i);
printf("%s",s);
...........
When I print str1 it’s blank. Please clarify.
| stackexchange/codereview |
I'm trying to convert a GUI program that uses .png images into an .exe using py2exe. It uses PIL to display these images. However, I'm having trouble with it converting. For some reason the .exe it makes wont run. Any ideas?
Edit
Error:
Traceback (most recent call last):
File "GUI1.2.8.py", line 454, in <module>
... | stackexchange/codereview |
Anyone can help? When i write this code and run. The program show me error stated "There is already an open DataReader associated with this Command which must be closed first".
This is my code.
Parallel.For(0, MthRange, i => {
PSUpfrontFeeForMonth[i] = CommissionSummary
.Where(s => s.TransDate == oReportCom... | stackexchange/codereview |
I'd really like to know whether there's a comprehensive list of cross-browser support for the various HTTP status codes (particularly the ones in the 300s).
Does someone here know of a good write-up on that matter or maybe wants to share his knowledge?
| stackexchange/codereview |
We're just trying to optimise our SEO procedures and have read about Google pageranking not being a factor these days.
But does that mean that a link from a site with a pagerank of 0 is going have the same impact as a link from a site with a pagerank of 3?
| stackexchange/codereview |
I'm using asp.net to build an ipad webapp. I know that using input type="email" will cause the keyboard layout on the ipad to change to handle email input more easily than the default. The problem is I'm using a server side text box control. Does anyone know how to make a server side control do this?
| stackexchange/codereview |
I have a totally thread-safe FIFO structure( TaskList ) to store task classes, multiple number of threads, some of which creates and stores task and the others processes the tasks. TaskList class has a pop_front() method which returns the first task if there is at least one. Otherwise it returns NULL.
Here is an exampl... | stackexchange/codereview |
I have created a list activity calles as Category List to show a list of category dynamically from web by parsing an XML file. The XML file contains values "ID"(id of the particular category) and "title"(category name). So what I've done is, I've parsed the XML file and collected the ID and title to an ArrayList called... | stackexchange/codereview |
I am new to Java(learning) and i'm trying to create web service client from the wsdl url in netbeans 6.8. I could import all the request by following a tutorial described in this url http://netbeans2.org/kb/docs/websvc/client.html. But, when I run a main project I am getting the following exception:
com.sun.xml.interna... | stackexchange/codereview |
I've a viewcontroller "ResultsViewController" with a button called emailbutton. when this button is pressed, i want a function to be called from another view called "Illusions_AppViewController" (both these viewcontrollers are not linked).
Therefore i defined a protocol in the "ResultsViewController.h":
@protocol Res... | stackexchange/codereview |
since several days I have this problem:
For a few days it has worked and now I can't do it works again. I setup a rails server on ubuntu with apache-2. I used a git repository to get all new change. After I run
sudo rake db:migrate RAILS_ENV=production
But after have restart apache server I can see that... | stackexchange/codereview |
Working on a currency conversion service, using Bloomberg to get live rates of currencies (using USD as base rate). I can get all of the rates from bloomberg no problem, just when inserting them into the database (for cache and retrieving later) it spits out the error
Warning: mysqli_fetch_array() expects parameter 1 ... | stackexchange/codereview |
I have a problem with element which is both draggable and also has a click event.
$('.drag').mousedown(function() {
//...
});
$('.class').click(function() {
//...
)};
<div class="drag class"></div>
When I drag and drop the element, the click event gets fired, too. How to prevent that?
| stackexchange/codereview |
i have made a widget which display images from sd card and then
navigate through it. Now i want to animate the image while i navigate
through it.I need to achieve following animation.
1step : default galleryView motion
2step : perspective galleryView motion
hope to hear soon from some one. any link will be much helpf... | stackexchange/codereview |
How should I implement a full-featured grace period or N-uses scheme to maximise sales of my small $5 social network Windows application, while encouraging continued use of a limited version by users who are never (not yet?) going to pay for it?
Grace-period options:
Use-limited. After 20 uses, cripple it.
Calendar da... | stackexchange/codereview |
I have a command line program that wants to pickle things when I send it a ctrl-C via the terminal. I have a some questions and concerns:
How do I perform this handling? Do I check for a KeyboardInterrupt? Is there a way to implement an exit function?
What if the program is halted in the middle of a write to a struc... | stackexchange/codereview |
I want to parse the HTML code from a webpage with PHP Curl, but there is an error msg that I can't access the site without JavaScript.
Can I enable JavaScript with PHP Curl?
| stackexchange/codereview |
Using GDI+ to draw various colors:
brush = new SolidBrush(color);
graphics.FillRectangle(brush, x, y, width, height);
You'll notice that no opaque color shows properly on glass:
How do i draw solid colors on glass?
You'll also notice that a fully opaque color is handled differently depending on what color it is:
op... | stackexchange/codereview |
I'm having one of those pull-my-hair-out moments that has become an all consuming obsession at work and I can't figure it out for the life of me.
I'm working on a site where I have a repeating background image (gradient of blue) and I need to put another image on top of that which goes beneath my "container" div. The ... | stackexchange/codereview |
I'm developing an ant script which is calling another ant script using the <ant> task. This ant script is an installer a Java product and is to be used by our customers, who will have ant installed separately.
The script being called uses the antlr task <antlr:ant-antlr3>. To do this I must place the ant-antlr3.jar fil... | stackexchange/codereview |
Howdy,
I have a project in VisualStudio which contains a folder 'xmlfiles' below the root node. This folder contains a file 'mensen.xml' which I try to open ...
However when I try to open that very file the debugger steps in and throws an exception.
I tried it with
if(File.Exists(@"/xmlfiles/mensen.xml") )... | stackexchange/codereview |
I have this HTML:
<form id='myform'>
<input name='title' value='foo'/>
</form>
And I create an object array from it like this:
var dataArray = $("#myform").serializeArray();
Now how do I access 'title' in dataArray? This does not work:
alert(dataArray['title']);
alert(dataArray['title'].val());
| stackexchange/codereview |
I'm creating my own PHP class. I want to have constant references within that class of instances of that class, like an enumeration.
I keep getting 2 errors:
1. Constants cannot be arrays
2. parse error at line 11 (see below)
What's wrong? Can I seriously not have a constant array? I'm from a Java background...
Here is... | stackexchange/codereview |
How I can restore the database from another database ?
When i do from file restore i do like this:
Restore sqlRestore = new Restore();
BackupDeviceItem deviceItem = new BackupDeviceItem(filePath, DeviceType.File);
sqlRestore.Devices.Add(deviceItem);
sqlRestore.Database = databaseName;
ServerConnection con... | stackexchange/codereview |
I want to send an sms message containing current location of user. How do I make the sending function wait till the location is calculated?
| stackexchange/codereview |
I'm making a roulette widget using jQuery widget factory (see it at http://stuff.manisto.dk/roulette/). To make it easier for people to use, I specify some default options, such as the elements.
The problem is, when I specify an element array that is smaller than the default options (see http://stuff.manisto.dk/roulett... | stackexchange/codereview |
We noticed one interesting issue regarding memory management in VB that we do not understand. If anyone could help us with this one, please do.
We have a simple class with one single event. We create and destroy 5000 instances of this class and before we run a test we read the process memory usage. At the end we force ... | stackexchange/codereview |
To limit the number of records fetched, I plan to add more records when we reach the end of the data in an EditorTreeGrid . I have tried the following code
myTree.addListener(Events.BodyScroll,new Listener() {
@Override
public void handleEvent(GridEvent be) {
//I need to check if the s... | stackexchange/codereview |
I am currently developing a system where data access is of key. I have optimized the database so my objects only populate ids and lazily gets additional info on request. The database contains a few million records and I need to improve the data access to a few milliseconds on each query. I was wondering is it possible ... | stackexchange/codereview |
I am looking for a simple bash command to open a client socket, read everything from the socket, and then close the socket. Something like wget or curl for sockets.
Is there a command in Bash to do this? Of do I need to write a bash script?
| stackexchange/codereview |
I have a tree of objects that represent a 3D-model (a scene graph). The tree nodes are of different types (implemented as derived classes from a common base class). For example, there is a node representing a polygon, or a node which applies a coordinate transformation (rotation, translation) to its child nodes. It is ... | stackexchange/codereview |
I want to ask, what is the best way to authenticate user with his Google account already configured on the phone.
I have looked at the ClientLogin first, but it's not what I want because it requires users to enter login/password in my application.
I can do it with OAuth but there I should ask user to enter his credenti... | stackexchange/codereview |
I am trying to get one of the webforms in my application to link to another website, outside of my application. I can get the page to load as a new webpage in my browser easily but I need to keep my masterpage in view.
Can this even be done?
TIA
| stackexchange/codereview |
I'm using a BasicHttpBinding with a service host of http://networkip:5678 and I'm just trying to host stand alone, I'm not using IIS...
let host = new ServiceHost(typeof<MyService>, [|new Uri("http://192.168.100.131:5678/")|])
let behavior = new ServiceMetadataBehavior()
behavior.HttpGetEnabled <- true
host.Descripti... | stackexchange/codereview |
I'm planning a Social Network with an Artificial Intelligence . that means that the SN will take the conversations (in english) .. and analyse them in order to extract the general opinion about a subject. This helps to collect information and build statistics, which will be sent then to the appropriate user.
My questio... | stackexchange/codereview |
I have developed a WCF service that uses BasicHttpBinding with TransportWithMessageCredentials and custom username and password validation. I have a client who needs to interface with my service, but the client uses Java. Not being a Java programmer myself, I can't help him much. So I thought I would extend the questio... | stackexchange/codereview |
I've read this before "filter input, escape output" but is filtering input really needed when I use PDO with PHP? I thought with PDO I don't need to filter input because the prepared statement takes care of sql injections. I think "escape output" is still valid, but is "filter input" still valid?
| stackexchange/codereview |
Is it possible to use both composite component facelet (xhtml, cc.attrs and etc. ) and component class ( extended from UIComponent) in one component?
| stackexchange/codereview |
So I have this project that im working on, and now im stuck :(
My problem is, when I drag and drop my item, I need to get/set its position relative to a container, not the entire body, so from what I understand I should use position(). I do this using
var pos=$(ui.helper).position();
objName = "#leaf"+counter++
$(objNa... | stackexchange/codereview |
I want to run awk on several files. I have the filenames and a path to the files, but I can't seem to connect the two. Here's what I have tried:
files=(a b c)
directory=/my/dir
awk $my_script "$directory/${files[@]}"
It awks the first file and leaves the rest alone. I'd rather not have to add the full path in m... | stackexchange/codereview |
When building my VS2008 C# project on windows 7, I get this output:
------ Build started: Project: C:\...\OutsideWeb\, Configuration: Debug Any CPU ------
Validating Web Site
Building directory '/OutsideWeb/js/'.
Building directory '/OutsideWeb/'.
Validation Complete
------ Build started: Project: C:\...\InsideWeb\, C... | stackexchange/codereview |
I am writing a multithreaded socket server and I need to know for sure.
Articles about threads say that I should wait for the thread to return, instead of killing it. In some cases though, the user's thread i want to kick/ban, will not be able to return properly (for example, I started to send a big block of data and s... | stackexchange/codereview |
i have a button to close my app with this code:
finish();
the problem is that this button doesn't exit of my app... it simply closes the current intent ant returns to the previous intent (window) of my app....
how i can do a real exit/close button?
i tryed with this:
Intent intent = new Intent(Intent.ACTION_MAIN);
int... | stackexchange/codereview |
I have installed the jquery grid in an mvc project and hooked it up to the jquery ui. Initial load is fine and see the calls to the action in the controller and the results are displayed as expected. If I click on any of the headers to sort - nothing happens and the action is not called in the controller. I don't have ... | stackexchange/codereview |
I have to write an application in C# that listens to any keys being pressed. In actuality I have a bar code scanner sending the "key pressed" event, and I need to listen it... what it does from there is beyond the scope of my question.
My security requirements are that there is not allowed to be any sign-on to the mac... | stackexchange/codereview |
It is possible to declare a class without defining it (forward declaration) as long as it is defined later on within the translation unit. In the case of functions, one can declare a function without defining it within the translation unit, and the linker will link it to its definition in a different translation unit. ... | stackexchange/codereview |
We've been recently implementing Scrum and one of the things we often wonder is the granularity of tasks within stories.
A few people inside our company state that ideally those tasks should be very finely grained, that is, every little part that contributes to delivering a story should represent a task. They argument ... | stackexchange/codereview |
Many iOS apps have a "scroll up to refresh" feature, such as the Twitter app. If you scroll up beyond the beginning of the page or table, you'll get a message explaining how to use the feature.
That controller is not from Apple but many apps seem to use it. I was told it was released for public use by a programmer, but... | stackexchange/codereview |
Hi I am using Spring MVC 3 with annotations.
How do I use multiple ModelAttributes in one Spring <form:form> tag?
It all works perfectly to use one ModelAttribute, but nesting them and using two doesn't work. Is there a way to do this? Or how would I send a ModelAttribute and a RequestParameter in the same POST request... | stackexchange/codereview |
I'm trying to add an Oracle server as a linked server to SQL Server. I've downloaded and installed Oracle's instant client and ODAC software. However, OraOLEDB.Oracle does not show up in the list of providers in SSMS. My machine is running Windows 7 (64 bit) and MSSQL Server 2008 R2.
| stackexchange/codereview |
Pretty simple question, but i can't make it work...
I have this struct:
struct Rand48
{
// strided iteration constants (48-bit, distributed on 2x 24-bit)
uint2 A, C;
// CUDA array -- random numbers for all threads
uint2 *state;
// random number for a single thread (used by CUDA device functions onl... | stackexchange/codereview |
I have some png files that I am applying a color to. The color changes depending on a user selection. I change the color via 3 RGB values set from another method. The png files are a random shape with full transparency outside the shape. I don't want to modify the transparency, only the RGB value. Currently, I'm s... | stackexchange/codereview |
I am PHP dev and at the moment I am learning Rails (3) and of course - Ruby. I don't want to believe in magic and so I try to understand as much as I can about things that happen "behind" Rails. What I found interesting are the method calls like has_one or belongs_to in ActiveRecord models.
I tried to reproduce that, a... | stackexchange/codereview |
I'm not understanding why this is giving me a EXC_BAD_ACCESS. Basic background, im collecting and processing some information, and then using a modal view to let the user confirm if he want to continue.
I have a button on the navigation bar called continue, that calls my data prepare function.
- (void)viewDidLoad {
... | stackexchange/codereview |
My code works prefectly on Firefox, but not on Chrome. Is there a problem with jQuery .load() on Google Chrome?
| stackexchange/codereview |
I have one asp.net page which seems to return a very big content (5,648,733 bytes and that is
mostly consumed by VIEWSTATE) ending with a 504 Gateway timeout error. I am tracking the http
request/response by using Fiddler.
And basically, when I post-back the same page -by clicking a button- the post-back fails with t... | stackexchange/codereview |
Let
f[x_,y_,z_] := Sqrt[3x+1]+Sqrt[3y+1]+Sqrt[3z+1]
I want to get the minimum of f for x>=0&&y>=0&&z>=0&&x+y+z==1 using mathematica.
PS: I do know how to get the minimum by math method:
Since 0<=x<=1,0<=y<=1,0<=z<=1, we have
0<=x^2<=x,0<=y^2<=y,0<=z^2<=z.
Hence,
3a+1 >= a^2 + 2a + 1 = (a+1)^2, where a in {x,y,z}.
Cons... | stackexchange/codereview |
I am programming an expectation-maximization algorithm with R. In order to speed-up the computation, I would like to vectorize this bottleneck. I know that N is about a hundred times k.
MyLoglik = 0
for (i in c(1:N))
{
for (j in c(1:k))
{
MyLoglik = MyLoglik + MyTau[i,j]*log(MyP[j]*MyF(MyD[i,], MyMu[j,], MyS[[j]]))... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.