instruction_seed stringlengths 1 35.8k | _source stringclasses 1
value |
|---|---|
I am using the Scala 2.8 default parameters on a constructor, and for Java compatibility reasons, I wanted a no-arg constructor that uses the default parameters.
This doesn't work for very sensible reasons:
class MyClass(field1: String = "foo", field2: String = "bar") {
def this() = {
this() // <-- Does not... | stackexchange/codereview |
I have a problem with teamsite 6 - I create new category under templatedata with single type
Like categoyX/typeY
TypeY contains datacapture.cfg as well as data and presentation folder (presentation folder has one template)
Now I try to run content creation form but see message: "Unable to create a new form of type cate... | stackexchange/codereview |
Is there a function in PHP that takes in a string, a number (i), and a character (x), then replaces the character at position (i) with (x)?
If not, can somebody help me in implementing a function which can replace or insert a substring?
| stackexchange/codereview |
Recently I came across following grep command:
/usr/xpg4/bin/grep -Ff grep.txt input.txt > output.txt
which as per my understanding means that from input.txt, grep the matter contained in grep.txt and output it to output.txt.
I want to do something similar for sed i.e. I want to keep the sed commands in a separate fil... | stackexchange/codereview |
I have the following command which works fine on Linux Console. But to get the result to a cpp file I have to store it to file and then read it. But is there a way I can directly execute this command in C++.
/usr/bin/sqlite3 /etc/myDB/db/share.db "select path from folder_info where ftp='YES'"
| stackexchange/codereview |
I am able to print a chart from my c# project using:
chart1.Printing.PrintDocument.DocumentName = "Graph of data";
But is it possible to add a title to this? I was hoping the document name would achieve this, but apparently not!
| stackexchange/codereview |
I have one generic interface in c#, and almost always I use it with one of the types. I want to create a non-generic interface for that type and use it.
Let's say, I've the following code:
public interface IMyGenericList<out T> where T : IItem
{
IEnumerable<T> GetList();
}
public class MyList<T> : IMyGenericList<T... | stackexchange/codereview |
I try to get the visible text of the avalonedit control, but the VisualLines[] only handles wordwrap with TextLines[] and I dont know how to check if a TextLine is in the visible area or not.
The problem also would be solved if I can get the start- and endoffset (or length) of the visible text in the textview but I did... | stackexchange/codereview |
Followup on an answer from last night - I was hoping more comments would answer this for me but no dice.
Is there a way to achieve this without inheritance that does not require the cumbersome usage in the penultimate line of code below, which writes the value to cout?
struct A {
enum E {
X, Y, Z
};
};
... | stackexchange/codereview |
I am attempting to get RCov to work with my RSpec and Shoulda test for a rails 3 app. It seems to work fine with my RSpec after using the Rake task below but all of the shoulda tests fail and I cant seem to find any documentation on getting these to work. They all run fine under autotest(rspec and shoulda).
namespace... | stackexchange/codereview |
How can i use tabs to switch between activities? For example i have some tabs, one of them includes google map and i want each tab to have its own activity with its own .xml file. How can i do it?
| stackexchange/codereview |
I'm using NLog to record my logging, everything is working fine, but now I have installed the application on to a WebService in IIS 6, it is not logging to the EventLog, all other logs are working okay.
What do I need to configure to get this working on the Server?
| stackexchange/codereview |
I have instance of the my class. I want to save implementation of class with instance's pickle copy in file. After, I want to use this instance to another computer where there is no implementation of the my class. I don't want to save text of implementation manually.
How can I do this?
| stackexchange/codereview |
I create a winform
I´m adding a datagridview by dragging a table from data sources
the result: I´ve got a winform with a datagridview and a bindingnavigator
I´m adding a second datagridview to the same winform by dragging another table from data sources
the result: same as bullet 3, but now with two datagridviews; a s... | stackexchange/codereview |
i am having a application in which java script is must. but i am facing problem when at any client browser has java script disabled. i want a code using which i can check the browsers java script enabled/ disabled property so that the user cannot login until he enables javascript. can anyone help me in this code
| stackexchange/codereview |
Today I just learned that Adobe Air has a local SQL database, which is great; however, we had been creating XML and JSON files to handle mostly everything. Rather than re-architect our application to gain a few new features, it would seem useful to simply index our existing data files, using an embedded document-orient... | stackexchange/codereview |
I've recently begun experimenting with a mediaPlayer instance in my Android app. I implemented a couple different beeps for feedback to the user. Now, when I implemented an audioTrack (for a completely different purpose), I discovered that it pretty much sets itself up as a separate thread automatically (as far as I ... | stackexchange/codereview |
Is there a way to get list of open or visible NSWindow from mac desktop?
| stackexchange/codereview |
Is there a good way to loop over a string with sscanf?
Let's say I have a string that looks like this:
char line[] = "100 185 400 11 1000";
and I'd like to print the sum. What I'd really like to write is this:
int n, sum = 0;
while (1 == sscanf(line, " %d", &n)) {
sum += n;
line += <number of bytes consumed by ss... | stackexchange/codereview |
I will be serving 3rd party content to other sites through an iframe. The content will be presented in a table. Is there any way to use internal style sheets where the defintions are defined within the iframe?? I have read that internal style sheets should only be defined in the head section. External css is not an... | stackexchange/codereview |
I have created a user "couchdb" and installed couchdb 1.0.1 from source, I have also given permission for the user "couchdb" as given in http://chrismckee.co.uk/setting-up-couchdb-on-ubuntu/. Also rather than installing couchdb in the default location i used prefix option to change the location. Now when i start the ... | stackexchange/codereview |
I have an app that often crashes on the device (iPad), but not on the simulator, so any simulator debug tactics (MallocStackLogging for example) are not an option. What I usually get in the console is this:
Received memory warning. Level=1
Received memory warning. Level=2
Program received signal: “0”.
Data Formatters ... | stackexchange/codereview |
I'm trying to add a JavaScript function to show all selected items from a ListBox as concatentated strings in a Label on the page. It's needed because AutoPostBack="true" will cause the ListBox to scroll all the way back to the first selected item.
So this code works:
<script type="text/javascript">
function Updat... | stackexchange/codereview |
I have two models in cakephp, Link and Vote.
I want to have the sum of the votes for every link in my Link model.
Here is a print of my findAll function :
[1] => Array
(
[Link] => Array
(
[id] => 1
[url] => http://www.google.com
[date_added] => 201... | stackexchange/codereview |
ValidateInputAttribute, ValidateInput, httpRuntime requestValidationMode="2.0" in web.config (system.web) all do not fix, also the "ValidateRequest="false"" in my view. I'm using MVC 2, Visual Studio 2010, .NET 4.0, and I'm still getting the following error:
A potentially dangerous Request.Form value was detected from... | stackexchange/codereview |
Does anyone know of another good game SDK/Engine for the ipad or iphone other than CORONA?
| stackexchange/codereview |
On the publish tab of My Project the correct current version is there, 1.1.0.0 and in Programs and Features under Control Panel it shows 1.1.0.0 but when I reference Application.ProductVersion I get 1.0.0.0.
What am I doing wrong or what am I missing here?
Thanks.
| stackexchange/codereview |
I want to play an audio when someone speaks in the iPhone's mic. This code works perfectly in iPhone 2G(OS 3.1.3), but when it is tested in iPhone 4, it doesnt work. I checked for API and method differences, but could not find any.
- (void)viewDidLoad {
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"... | stackexchange/codereview |
Is it possible to get tinymce working inside Adobe air? I found this tut but it is out of date and no longer works with current versions.
Normal tinymce produces these errors:
1. TypeError: Result of expression 'g.base_uri' [undefined] is not an object.
2. TypeError: Result of expression 'tinyMCE.init' [undefined] is n... | stackexchange/codereview |
Possible Duplicate:
Is there a conditional ternary operator in VB.NET?
C# has a shortcut like this:
cmd.Parameters.Add(new SqlParameter("@p2", ((supplierID > 0) ? (object)supplierID : DBNull.Value)));
Just curious if VB .Net has something like that too?
| stackexchange/codereview |
I know this isn't programming-related, but I'm curious what this community thinks about the subject. My understanding is that JavaScript is what the language is named. Lately, it seems to have become trendy to write it Javascript. Who are we to rename the language? I'm interested to hear if there is a cogent argument f... | stackexchange/codereview |
Suppose I have entity Person with properties typeid and salary. I build a business rule for this two properties like:
public static partial class MyRules
{
public static ValidationResult Rule1(Person p, ValidationContext context)
{
if ((p.typeid == 1) && ((p.salary == null))
... | stackexchange/codereview |
How to define a function that takes a string (sentence) and inserts an extra space after a period if the period is directly followed by a letter.
sent = "This is a test.Start testing!"
def normal(sent):
list_of_words = sent.split()
...
This should print out
"This is a test. Start testing!"
I suppose I shoul... | stackexchange/codereview |
I was trying to modify a HTTP Header using C#. I tried to manipulate the Request.Headers on Page preinit event. But when i try to set anything to the Headers, i get PlatformNotSupportedException. Since We can not set a new NameValueCollection to Reqeust.Headers, I tried to set the value using following code:
Request.He... | stackexchange/codereview |
I am looking for a way out in cross tab, so that if the columns exceed in cross tab, they shouldnt go on next page..rather a new cross-tab should repeat after the first one.
For example, two columns are displayed in a cross tab :
Now if a new column is added, and assuming that it could not be accomodated within the gi... | stackexchange/codereview |
I have an exe that is continuously running. Instead of having an open window all the time, Can it be minimized to the system tray?
| stackexchange/codereview |
I am trying to dynamically create a table with radiobuttons, textboxes and buttons on each rows uniquely depending on the question to the left of the TableRow with two TableCells.
So far, I was able to add the questions to the left of the TableRow. Now, I am having a hard time filling out the right side of it.
Can some... | stackexchange/codereview |
I want to encrypt a string, but the standard Java libraries are too complicated for me.
So I turned to Jasypt labriry. It's pretty simple to use and understan. However when I import the library to Eclipse 3.6 and when I try encrypt a string like "Hello" with the password "123", it always comes up with an error. I'm not... | stackexchange/codereview |
I'm trying to use inflate while using ViewFlipper to access to the data inside my view. I've done sample project that crashes.
main.xml
<?xml version="1.0" encoding="utf-8"?>
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/RelativeLayout"
android:layout_width="wra... | stackexchange/codereview |
I'm using GNU Make to run scientific data analysis, where we have a bunch of Matlab scripts that ponder some input data and then spit out several files. It does this in a fairly complex way, so I've had to do some nasty Makefile tricks when trying to describe its function to Make. Here's an example:
seg_cams_nozero :... | stackexchange/codereview |
Having a string containing the following raw Json data (simplified for the sake of the question):
var MyString = "{ 'val': 'apple' }";
How can I create a JsonResult object representing MyString?
I tried to use the Json(object) method. but it handles the raw json data as an string -logically :P-. So the returned HTT... | stackexchange/codereview |
I have a jQueryUI dialog box that loads its content the moment someone opens it using the "open" event to initiate the $('#dialogDiv').load() call.
Works great except the dialog box grows extremely tall if there's a lot of content being loaded. What I want is to limit the height. The maxHeight jQueryUI dialog option ... | stackexchange/codereview |
Is there any way of adding sections to an already-linked executable?
I'm trying to code-sign an OS X executable, based on the Apple instructions. These include the instruction to create a suitable section in the binary to be signed, by adding arguments to the linker options:
-sectcreate __TEXT __info_plist Info.plist_... | stackexchange/codereview |
I'm trying to figure out how to load a simple javascript client-side library while using node.js and express. Any ideas? See below.
HAML:
%script{type: 'text/javascript', src: '/jquery-1.4.3.js'}
%script{type: 'text/javascript', src: '/client.js'}
app.js:
app.get('/*.js', function(req, res) {
res.render(req.params... | stackexchange/codereview |
I have an aspx page with 5 user controls. I have $(document).ready() in each of these user controls and then one in the main aspx page.
Is this the right approach or I should consider of side effects?
| stackexchange/codereview |
I am having some trouble with an if, else and is_dir; I am trying to create a small script that tells me if the input is a folder or a file, I have looked at: https://www.php.net/manual/en/function.is-dir.php for a few examples, and none of them seemed to resemble mine, I read a bit on if and else as well, and it looks... | stackexchange/codereview |
I am using Pervasive and I would like to know what kind of data a column contains. However, the only overload of PsqlDataReader.GetFieldType accepts an int index. But I want to know using the column name. I guess I could just loop through all the columns and find the one with the specified name, but I do not want to do... | stackexchange/codereview |
When you send a private message to someone on FB in the TO field when typing the first letter a suggestion appears then it becomes a little box with the name of the user you selected which can be deleted, anyone got a tutorial on this?
thanks
| stackexchange/codereview |
I want to implement windows Authentication in silver light, How to do that ?
| stackexchange/codereview |
In my web application i want to redirect to login page, which is in the same folder[admin folder], when i type like
"xxx.com/admin" it is redirect to login.aspx page which is in admin folder.
for this i place one index.html page and write meta tag code, even though it is not redirect to loginpage. it is going to index... | stackexchange/codereview |
Curious to know the reason behind not allowing updating UI elements from background thread in Android.
Will main thread does something more (probably interacting with framework) after updating the UI elements so that changes can be seen on the screen.?
Is it the same case with other GUI tool kits?
| stackexchange/codereview |
Can you control the size of the text and it's alignment on the action sheet? Also, Can you decide the order in which the destructivebutton and otherbuttons will appear on the action sheet? The screenshot like screen is what I am trying to create.
Thanks in advance
| stackexchange/codereview |
As a followup to my question about unavailable branches after svn to git migration, I have a different problem: I'm unable to push new branches to my central Git repository.
$ git clone ssh://server/opt/git/our_app.git
$ cd our_app
$ git branch my-test-branch
$ git checkout my-test-branch
$ echo test > test.txt
$ git a... | stackexchange/codereview |
I've got a class FruitViewModel. It describes ViewModels for ListBox items.
<ListBox ItemsSource="{Binding Fruits}">
And I've got
class BananaViewModel : FruitViewModel
and
class AppleViewModel : FruitViewModel
Fruits contains BananaViewModels and AppleViewModels which is bound to ItemsSource.
How can I make differe... | stackexchange/codereview |
I have an ASP.NET MVC2 application that supports visualization plug-ins/providers. The IVisualization interface is defined in a common assembly which is referenced by both the ASP.NET MVC2 app, and any visualization providers.
In the Visualization controller, I have a method which returns all the applicable visualizati... | stackexchange/codereview |
Is there a way to make all columns on a grid NOT sortable other than adding sortable:false to each column? I know you can set global options at the grid level but didn't know if you could do it at the colModel level.
| stackexchange/codereview |
I am attempting to de-dupe an NSArray of NSDictionaries based on specific keys in the dictionaries. What I have looks something like this:
NSDictionary *person1 = [NSDictionary dictionaryWithObjectsAndKeys:@"John", @"firstName", @"Smith", "lastName", @"7898", @"employeeID"];
NSDictionary *person2 = [NSDictionary dictio... | stackexchange/codereview |
I'm trying to create a custom view for my UITableView footerView that has a button in it. I can see it there, but when I touch it, nothing happens... can you see what's wrong here:
- (void)viewDidLoad {
[super viewDidLoad];
if(self.tableView.tableFooterView == nil) {
//allocate the view if it doesn't ... | stackexchange/codereview |
I'm using the customErrors attribute of the web.config file to present custom errors pages:
<customErrors mode="On" defaultRedirect="/errorpage.aspx">
<error statusCode="404" redirect="/404Page.aspx"/>
<error statusCode="403" redirect="/403page.aspx"/>
</customErrors>
Nothing too fancy. Now what I want to do ... | stackexchange/codereview |
I need display data from a web page in a ListView, for example if I were to send a request to a time server for the U.S. time zone's times and the web server responded with an HTML web page that contained the current time's of each zone and a small icon image of each geographic region time zone, what steps would I need... | stackexchange/codereview |
What are the differences between DTO pattern(by Fowler) and Memento pattern(by GoF) in motivation and implementation aspect? Can it be the same classes? If yes, how can I name them (xxxDTO or xxxMemento)? Do they have any principal difference in implementation? Where are their place in MVP architecture?
Thanks.
| stackexchange/codereview |
Is it possible to change the background image of the home screen from an app?
If so how?
| stackexchange/codereview |
I am writing some video files under Windows from a camera.
I need the data unaltered - not MP4's 'uncompressed' ie. no YUV, no color interpolation - just the raw camera sensor bytestream.
At the moment I am writing this direct to disk and re-reading it later to recode into a usable video. But with no header I have to k... | stackexchange/codereview |
<ItemsPanelTemplate x:Key="lbWrapPanelItemsPanelTemplate">
<wp:WrapPanel Margin="2" Background="Beige" HorizontalAlignment="Stretch">
</wp:WrapPanel>
</ItemsPanelTemplate>
.....
<Grid Background="LightCoral" MinWidth="500" MinHeight="500">
<Grid.ColumnDefinitions>
<ColumnDefinition ... | stackexchange/codereview |
I have written this function which will set
val=max or min (if val comes null)
or val=val (val comes as an Integer or "max" or "min")
while calling i am probably sending checkValue(val,"min") or checkValue(val,"max")
public String checkValue(String val,String valType)
{
System.out.println("outside if val="+val);... | stackexchange/codereview |
I have vector<unsigned char> filed with binary data. I need to take, lets say, 2 items from vector(2 bytes) and convert it to integer. How this could be done not in C style?
| stackexchange/codereview |
I'm looking for ways to create JPEG(or PDF) graphs/charts using JAVA. Any suggestions?
Ultimately I want to make a PDF report, but I figured that even if I get the graph in JPEG then I can use a JPEG to PDF converter to make it a PDF.
Thanks.
| stackexchange/codereview |
I am migrating an application from Struts2 to JSF2. In struts2 I had mapped most of the actions so that the same action returned different locale content depending on the URL. For example:
http://site.com/en/content.action
http://site.com/es/content.action
The action returned the same JSP which showed spanish or engli... | stackexchange/codereview |
I have inherited a database that is throwing me for a loop. Each user in this database has a "Password" and a "HashedPassword". I changed my password to "Testing" and discovered that the database stores the password like the following:
Original: "Testing"
Password Field: 21121605808705211719707901901800702014722903908... | stackexchange/codereview |
Hey everbody, I'm getting some trouble with TBXML and While.
I'm trying to parse a couple of nodes of XML. My XML is this:
<teste>
1
2
3
But when I set while, my app just crashes.
itemsList = [[NSMutableArray alloc] init];
TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localho... | stackexchange/codereview |
I am testing chardet in one of my scripts. I wanted to identify the encoding type of a result variable and chardet seems to do fine here.
So this is what I am doing:
myvar1 <-- gets its value from other functions
myvar2 = chardet.detect(myvar1) <-- to detect
the encoding type of myvar1
Now when I do a print myvar2, I... | stackexchange/codereview |
Possible Duplicates:
Use of var keyword in C#
Use of “var” type in variable declaration
Hello everybody,
"Var keywork it require explicitly type casting Avoid boxing and unboxing value types where possible."
Is it advisable to use var keyword instead of explicit datatype?
| stackexchange/codereview |
My question is sure a simple one for anybody familiar with C++ syntax. I'm learning C++ and this is some sort of homework.
template<typename Iter>
void quickSort(Iter begin, Iter end)
{
//..
auto pivot = * ( begin + (end - begin)/2 );
//..
}
pivot is supposed to contain the value from the center of... | stackexchange/codereview |
I need to aggregate RSS content from roughly 500 URL's, while I'm trying to get content from those URL's time out/memory exhausted error occurred(I am trying with SimplePie library).
Is there any method/idea to pull out content fast from bulk sources?
How do I get fresh contents every time?
<?php
require_once('include/... | stackexchange/codereview |
I have some general purpose classes in one project that I would like to branch to another unrelated project in another TFS folder that I have mapped to a different workspace. I would prefer branching to plain copying to keep the change history and be able to merge back any changes.
However, when I try to branch the fil... | stackexchange/codereview |
I want to install the Google Maps app when installing my application.
| stackexchange/codereview |
int x;
Is this a declaration or a definition?
As I write the following code,
#include <stdio.h>
int main(void)
{
int x;
printf("%p",&x);
return 0;
}
it prints some address. So as memory is allocated, int x; can't be just a declaration. So is it a definition?
| stackexchange/codereview |
A customer asked me for a web app, written in ASP.NET, that can use an editable grid (that works with a SqlServer DB) in a similar manner as Excel works. I can use gridView with Edit link in every row but I wanted to know if there are better solutions (possibly free) that I can use.
Thanks in advance!
| stackexchange/codereview |
I am unable to find something like this in documentation provided for Propel Criteria in Symfony 1.4
The criteria, by default, is:
$this->Merchantss = MerchantsPeer::doSelect(new Criteria());
However, this selects all the fields in the table for 'Merchants'. I would only like to select a couple, lets say: id, name, ca... | stackexchange/codereview |
Hey I got a quick question:
I have got a chrome extension that adds a popup page to the toolbar. It accepts input from the user then calls a NPAPI dll which generates an XML file. I would like to be able to, after the NPAPI dll finishes its work, create a new tab which would open to the newly generated XML page.
Can an... | stackexchange/codereview |
I've tried using both the JavaScript and PHP SDKs, but I can't solve this simple problem.
My FQL looks like:
SELECT count FROM comments_info WHERE xid="..."
When I attempt the request through PHP, I get the following error:
Uncaught Exception: 604: No valid app_id
PHP:
$facebook = new Facebook(array(
'appId' => '... | stackexchange/codereview |
I have a very odd problem, hopefully easily solved.
I am drawing a quad as a triangle strip. It simply has 2 triangles in the strip and I apply a texture containing an alpha channel to it.
For one of the triangles it seems the alpha is fine and exactly as I want it however for the first triangle it looks as though the... | stackexchange/codereview |
i need to get a set of values after certain 14 length of a string and before the last 5 stringss.
eg:
Theboyisgoingt9123holdi: so i need to get the value 9123
iamfullofmeats89holdi: i need to extract value 89
so the algorithm here is, i am trying to extract the values that comes after the 14th length of the string and ... | stackexchange/codereview |
How to make a custom item renderer in flex 4 without extending the ItemRenderer class?
I need this because I want to use a custom class that is extended in all my components. as this item renderer for me is like a component, i would like to extend that custom class. Thanks ;)
Now im having something like this:
imageLis... | stackexchange/codereview |
The Class Library is an Microsoft Studio extension that generates a file from saving running a custom tool on a template file, following the module from this example I found from Microsoft: http://code.msdn.microsoft.com/SingleFileGenerator/Release/ProjectReleases.aspx?ReleaseId=4138.
I can not figure out how I'm gonn... | stackexchange/codereview |
maybe the answer is easy, but I'm unable to find information about the topic on google.
I've downloaded the MacWidgets Library from http://code.google.com/p/macwidgets/.
On the site you can also find the javadocs and I would like to integrate this into Netbeans to provide me with information about classes / methods whi... | stackexchange/codereview |
The "goatse operator" or the =()= idiom in Perl causes an expression to be evaluated in list context.
An example is:
my $str = "5 and 4 and a 3 and 2 1 BLAST OFF!!!";
my $count =()= $str =~ /\d/g; # 5 matches...
print "There are $count numbers in your countdown...\n\n";
As I interprete the use, this is what happens:
... | stackexchange/codereview |
How can I display an Integer value in TextView?
When I try, I get an error android.content.res.Resources$NotFoundException: String resource ID
| stackexchange/codereview |
Im maintaining this Drupal Site which is using Slideshow Views for displaying the featured posts. Its using Slideshow Thumbnailhover SlideShows contribution of 'Views Slideshow' http://drupal.org/project/views_slideshow Module for Drupal. However, even after scanning through the code and browsing though all settings, I... | stackexchange/codereview |
Sometimes i'm facing problems, trying to get sizes of an HTML element in question.
I'm tracing JavaScript code and see, that width and height of this element are returned as 0.
When i do the same piece of code in browser's console, correct sizes are returned.
Example code, that demonstrates this problem is following:
<... | stackexchange/codereview |
I have data :- 31-May-07
Its in a calculated column of the list. The method I used to get it :- =IF(FDate="","",TEXT(FDate,"dd-mmm-yy")) {FDate is a DateTime type of column. The returned value is stored in a "Single Line of Text" column type.}
I am now unable to sort that column as its Text now and sorting is done on b... | stackexchange/codereview |
Does anybody why I can write this:
ruby-1.8.7-p302 > a = %w( a b c)
=> ["a", "b", "c"]
ruby-1.8.7-p302 > while (i = a.shift) do; puts i ; end
a
b
c
=> nil
Which looks like passing a block to while.
And not:
while(i = a.shift) { puts i; }
Is it because the "do" of the while syntax is just syntaxic sugar and as not... | stackexchange/codereview |
I would like to filter out particular columns with a regex and discard others. For example, if I had the following column names:
date
mem_total
cpu.usagemhz.average_0
cpu.usagemhz.average_1
cpu.usagemhz.average_2
I would like to capture only columns that begin with "cpu.usage.mhz.average"
Is their a particular funct... | stackexchange/codereview |
Has anyone been able to get the jquery-html5-upload plugin to work with Rails 3 + PaperClip + S3? Know of any tutorials?
http://code.google.com/p/jquery-html5-upload/
Thanks
| stackexchange/codereview |
I want to allow people to put in simple text search terms, run a pig job (if that's best? it's what I know best) and output the results (the tsv file results?) so I can show them in a web interface.
Is there anything that approaches this problem?
Anything known to link a few disjointed pieces of the flow I am going for... | stackexchange/codereview |
Let's say I'm working in the Python shell and I'm given a function f. How can I access the string containing its source code? (From the shell, not by manually opening the code file.)
I want this to work even for lambda functions defined inside other functions.
| stackexchange/codereview |
I'm working on a project where we're gonna fetch data from a DB2 database.
I've been testing with both the ibm provider and simple odbc and with both approaches the connection open method is very very slow.
If I try doing the same thing with Java and the IBM jdbc driver, it is a lot faster.
Does anyone have any tips ... | stackexchange/codereview |
All sources are on windows OS, and destination backup is on Unix system (we are using Samba).
My source repository is similar to :
-Repository
--Folder1
---Files
--Folder2
---Files
etc...
I would like to get a destination similar to :
-Repository
--Folder1.zip
--Folder2.zip
etc...
After first backup, I only backu... | stackexchange/codereview |
Is there any way to call methods of external objects (for example resource objects) directly from xaml?
I mean something like this:
<Grid xmlns:dm="clr-namespace:MyNameSpace;assembly=MyAssembly">
<Grid.Resources>
<dm:TimeSource x:Key="timesource1"/>
</Grid.Resources>
<Button Click="timesource_updade"... | stackexchange/codereview |
I have external script (sh), i would like to do something like this:
arg1 = 'some string'
arg2 = 'some string2'
arg3 = ''
cmd = ['/usr/local/bin/myscript', 'arg1', 'arg2', 'arg3']
Popen(cmd, shell=False, stdin=PIPE, stdout=PIPE, stderr=PIPE)
I seems, that if "arg3" is empty, my script i called only with two arguments... | stackexchange/codereview |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.