Hey,
Im sure I am missing something here but none the less.
foo['bar'] = nil
if(foo['bar'] == nil)
puts "foo bar is nil :("
However, nothing happens? Any thoughts?
Why won't Java let me assign a value to a final variable in a catch block after setting the value in the try block, even if it is not possible for the final value to be written in case of an exception.
Here is an example that demonstrates the problem:
public class FooBar {
private final int foo;
private FooBar() {
try {
…
I'm looking for class that can generate RSS feeds.
I'm thinking of a usage like this.
RssClass foo = new RssClass();
foo.addEntry("title", URL);
foo.Export("myexportpath.rss");
Has anybody seen such a class available for free usage?
I have an ASP.NET control that has an onclick event handler rendered inline on the element. I would like to call that function and have it raise the target control's server side event handler.
<asp:CheckBox ID="Foo"
runat="server"
AutoPostBack="true"
Text="Foo" />
<a href="#"
…
I need this to be a macro. Do not answer about templates. [This is part of a larger system that can not be represented as a template.]
Is it possible to define a macro "foo" so that
foo(a) --> foo1(a);
foo(a, b) --> foo2(a, b);
foo(a, b, c) --> foo3(a, b, c);
Basically, I want this macro to…
We have a product that we need to create an installer for.
It has a number of components which can be installed or not as the situation demands.
When we ship our installation package, we want to be able to have that include any number of additional components to be installed.
For example, Foo…
I've got a managed process (x86) running on a Win Server 2008 (x64).
When i'm talking a dump of the process via the task manager ("Create dump file"), i use correctly SOS on win dbg (it complains about symbols and such even though i have all of the debugging symbols installed).
If i'll create…
i wrote a script for spawing the bc command
package require Expect
proc bc {eq} {
spawn e:/GnuWin32/bc/bin/bc
send "$eq\r"
expect -re "(.*)\r"
return "$expect_out(0,string)"
}
set foo "9487294387234/sqrt(394872394879847293847)"
puts "the valule [bc $foo]"
how to get the…
Update: follow-up to MongoDB Get names of all keys in collection.
As pointed out by Kristina, one can use Mongodb 's map/reduce to list the keys in a collection:
db.things.insert( { type : ['dog', 'cat'] } );
db.things.insert( { egg : ['cat'] } );
db.things.insert( { type : [] }); …
I have a Java class like this:
public class Foo {
public static int counter = 0;
public void bar(int counter) {
Foo.counter = counter;
}
}
FindBugs warns me about writing to the static field counter via the instance method bar. However, if I change the code…
I'm using a library that defines an interface:
template<class desttype>
void connect(desttype* pclass, void (desttype::*pmemfun)());
and I have a small heirarchy
class base {
void foo();
};
class derived: public base { ... };
In a member function of derived, I want…
We'd like to have trivial Java property accessors using a single line syntax, so they take up much much less space, and are more readable (in terms of 'seeing' the set of accessors quickly). But we do want to enforce multi-line method syntax for everything else in our checkstyle…
In HTML5, CSS selectors seem to operate well with data-* attributes. For example:
<style>
div[data-foo='bar'] {
background:#eee;
}
</style>
<div data-foo='bar'>colored</div>
<div>not colored</div>
will properly style the first . But,…
Hi I created two file to switch my forum (Language Chinese and English)
enForum.php
<?php
function foo() {
global $_COOKIES;
setcookie('ForumLangCookie', 'en', time()+3600, '/', '.mysite.com');
echo 'running<br>';
…
I want to forward declare a static member function of a class in another file. What I WANT to do looks like this:
BigMassiveHeader.h:
class foo
{
static void init_foos();
}
Main.cpp:
class foo;
void init_foos();
int main(char** argv, int argc)
{
…
I have an FAQ in HTML (example) in which the questions refer to each other a lot. That means whenever we insert/delete/rearrange the questions, the numbering changes. LaTeX solves this very elegantly with \label and \ref -- you give items simple tags and…
Is anyone having experience working with pycassa I have a doubt with it. How do I get all the keys that are stored in the database?
well in this small snippet we need to give the keys in order to get the associated columns (here the keys are 'foo' and…
I've testing some new CLR 4.0 behavior in method inlining (cross-assembly inlining) and found some strage results:
Assembly ClassLib.dll:
using System.Diagnostics;
using System;
using System.Reflection;
using System.Security;
using…
I have a static method defined in a base class, I want to overwrite this method in its child class, is it possible?
I tried this but it did not work as I expected. When I created an instance of class B and invoke its callMe()…
I have the following aggregate functions (AGG FUNCs):
foo(), foobar(), fredstats(), barneystats().
I want to know if I can use multiple AGG FUNCs in an algebraic expression. This may seem a strange/simplistic question for…
I'm trying to parse an HTTP GET request to determine if the url contains any of a number of file types. If it does, I want to capture the entire request. There is something I don't understand about ORing.
The following…
I love the IDLE. However, sometimes I have 100-200 line scripts and I want to sort of interactively debug/play with say, functions defined in foo.py instead of just calling python foo.py. Is there a way I can trigger IDLE…
Bit of an edge case, but any idea why &&= would behave this way? I'm using 1.9.2.
obj = Object.new
obj.instance_eval {@bar &&= @bar} # => nil, expected
obj.instance_variables # => [], so obj has no…
Hi all
My Delphi app has created a squence called frame_001.png to frame_100.png.
I need that to be compiled into a movie clip. I think perhaps the easiest is to call ffmpeg from the command line, according to their…