How would I do something like below?
[
'foo'
['bar', 'baz'],
[
'one',
['two', 'three']
]
].each { |word| puts word }
# I want this to return:
foo
bar
baz
one
two
three
The user will be able to search for some document in the local machine and i want to show user, a progress bar during my program searches. To be more clear, i have foreach loop for which i want to tie up my progress bar to show the progress. my foreach loop and progress should work simultaneously. Is this possible to do ?
I have a simple model named Foo.
Foo has two columns, bar and foobar.
Doing a simple Foo.find_by_bar("a") is returning nil. There is a record in the table where bar contains a. Also, what's even more troubling, is I don't see the query even happening in the development log.
A simple Foo.find(1) works though.
On a standard linux set up, where can I add a directory to the @INC variable?
In the /etc/profile file, I added:
export PERLLIB=$PERLLIB:/foo/bar
export PERL5LIB=$PERL5LIB:/foo/bar
Thanks
Hi,
I'm trying to print arguments passed to a ./configure script. Calling 'echo' on $BASH_ARGV will just print the last set of arguments. For example if I run:
./configure --enable-foo --enable-bar
echo $BASH_ARGV will print only "--enable-bar"
How do I print all the arguments? Thanks!
Is there any Application for Windows to do next think:
I click url in Skype or html file in Explorer.
Application is default "fake" browser, i.e. registered as default browser. Application shows several buttons. Each button represents installed or running browser. I can choose real browser, click it and specific url opened in chosen real browser .
Quick search not revealed such Application.
Context:
I work in environment where some sites work in specific browsers.
I get clickable urls from different applications.
Sometimes I want to launch specific browser to use specific addin of it against url provided.
I have specific portable "secured" browser I want to launch only for trusted sites.
I want to write a SessionExtension that fires a 'Foo-created' event or 'Bar-created' event every time a new Foo or new Bar is committed to the database. However, once inside the after_commit method, I don't know where to find which entities have been committed. Where do I get this information?
I have
class Foo():
function bar():
pass
function foobar():
pass
Rather than executing each function one by one as follows:
x = Foo()
x.bar()
x.foobar()
is there a built-in way to loop through and execute each function in the sequence in which they are written in the class? It doesn't matter whether the solution is to add code to the class Foo(), or to do something to x.
Hi,
when the user enters text in a uitextview I would that the title of the navigation bar changed dynamically like it happens in the Notes app.
How can I achieve this?
I think a label is used, don't I?
Thanks
Fran
EDIT: I know how change the title of a navigation bar, but how do this in a such way that the textview is tied to the title, so while user enters the first line of text in the same moment the title changes (letter by letter)?
I have a regular input box (no onchange attribute).
<input type="text" id="bar" name="bar" />
For some reason, IE6+ does returns [object], while FF and Chrome returns null.
if ((elem.getAttributeNode('onchange')) != null)
elem.onchange();
I did also try as:
if (typeof(elem.onchange) !== 'undefined')
elem.onchange();
What would be the proper cross-browser way to check if the element has the attribute?
Thanks
Hi all,I am trying to display a progress bar with some informations in it,say for example am reading files ..I want to display the progress bar progressing with the filename that is being read etc..I am doing this in an win 32 application.I know that we should do it using thread but am not quite familiar with that,check the below picture example,thats what i need it exactly.
I have the following interface in Java
public interface IFoo
{
public abstract void foo();
public void bar();
}
What is the difference between foo() and bar()?
When should I use abstract?
Both seem to accomplish what I want unless I'm missing something subtle?
Update Duplicate of Why would one declare a Java interface method as abstract?
Using jQuery what provides for faster object construction:
With the HTML code
$('<dd class="foo baz" id="bar"> foobar </dd>')
Or with the pure object/method variant
$('</dd>').addClass('foo').addClass('baz').id('bar').text('foobar')
I'm not sure how the internals work, feel free to supply a high level summary.
I display a mail composer view upon a tool bar button click event.
At present, I can display the email composer view but when it display it hides the tool bar. I need the toolbar to remain visible.
I have seen other apps display the email composer without hiding a toolbar but I can't figure out how they did so.
I am new to iphone development. Please help me out.Thanks.
I have a situation where i have a class
class Foo
{
Foo Bar()
{
return new Foo();
}
}
Now i wan tot create an interface for it
class IFoo
{
??? Bar();
}
What should be in place of the question marks? Each class should return it's own type, not Foo
How does a member set inside an action...
$this->foo = 'bar';
...become a variable accessible from a template...
echo $foo; // bar
I would like to know how it is achieved at a framework level.
There is a lot of documentation on how to use Symfony, but I've not managed to find much about how it all fits together behind the scenes (class structure/inheritance etc).
Thanks in advance for your help!
I have a ListBox of constant size 4
I can Add n number of ListBoxItems,Once size exceeds 4 I have enabled scroll bar,
Problem:when scroll is enabled(more than 4 items), whenever i delete last item, there is a white patch in place of deleted Item.
Patch goes off only when I touch the scroll bar.
I tried ListBox.Invalidate(), But no use
Hi folks.
I'm just putting together a simple nav bar using something similar to this tutorial:
http://www.cssnewbie.com/horizontal-dropdown-menus/
The thing is, that I'd like to have the children lists first item to line up directly below the parent. Right now, they just go wherever I float them. Is there a way to do this without absolute positioning?
I'd like to achieve something similar to what these guys have in their top nav bar:
http://michaelfranti.com/
Should my multithreaded application with read only properties require locking? Since nothing is being written I assume there is no need for locks, but I would like to make sure. Would the answer to this question be language agnostic?
Without Lock:
Private m_strFoo as new String = "Foo"
Public ReadOnly Property Foo() As String
Get
return m_strFoo.copy()
End Get
End Property
With Lock:
Private m_strBar as new String = "Bar"
Public ReadOnly Property Bar() As String
Get
SyncLock (me)
return m_strBar.copy()
End Synclock
End Get
End Property
Using JavaScript, is there a way to update window.location.hash without scrolling the web page?
I have clickable title elements that toggle the visibility of a div directly beneath them. I want the /foo#bar in the history when clicking titles but don't want the page scrolling about. So when navigating away from /foo#bar I'll be able to use the back button and have the div whose ID is in window.location.hash be visible upon return.
Is this behavior possible?
I plan to make a replacement for the Windows 7 start menu, and I would like to know if that's even possible. I understand that the start menu is part of explorer.exe but I do not intend to replace explorer.exe.
Is it possible to launch the replacement start menu by clicking the native start orb?
Is it also possible to launch the replacement by pressing the Windows key or ctrl+esc ?
Is the Windows key a macro for ctrl+esc ? or is it two different hotkeys that do the same thing?
May I know if there is any software that do any one of these things?
Hi
I have view controller, into the view i have put a table view, and a search bar into the table's header... the search bar is not showing up, just the empty table view.
Do i need to do something additional? I'm pretty sure its to do with the view outlet of the UIViewController, set to View...
Thanks
Hi All,
I have a problem in my project.I want to implement Tab bar function under a drop down selection and when once tab bar is clicked it has to be navigated to a data grid.Can any body suggest me the proper direction to implement it.
Thanks,
Brenda