Hi,
I found this menu and i like it but the client asks me to keep the current menu open with respect to a sub page. For example, if i go to Link One page, then it should be opened by default.
Quick beginner's question:
Do I have to initialize simple class member variables, or are they guaranteed to get assigned their default values in any case?
Example:
class Foo {
int i;
// is i==0 or do I need the following line for that?
Foo() : i(0) {}
};
Thanks!
Hi,
I have an activity which launches another activity, via a button click. By default, on newer OS versions of android, the OS will animate the new activity sliding in from right to left.
Is there a way to disable this animation? I just want the new activity to appear without any sort of animation.
Thanks
I've been working on a log viewer for a Rails app and have found that I need to read around 200 lines of a log file from bottom to top instead of the default top to bottom.
Log files can get quite large, so I've already tried and ruled out the IO.readlines("log_file.log")[-200..-1] method.
Are there any other ways to go about reading a file backwards in Ruby without the need for a plugin or gem?
I don't want anything incredibly complicated. I am working on a client outside the US, and I just want a basic check to see if someone is accessing his page from the US or not. After that, I am going to default the language in either English or Spanish, after determining where the visitor is from.
Thanks.
I'm looking for a way to rewrite URLs only if the path doesn't exist. This isn't to handle 404s, but to redirect page URLs to a shared PHP file (ie: '/contact-us/' - '/show_page.php?page=contact-us').
The basic redirect is easy enough to achieve, however I want to be able to override the default page by adding '/contact-us/index.php' in the site root.
Is this achievable with mod_rewrite or would I have to do something else?
I want to have something similar to map but while iterating I want them to be in the same order as it is added.
Example
map.insert("one", 1);
map.insert("two", 2);
map.insert("three", 3);
While iterating I want the items to be like "one", ""two", "three"..By default, map doesn't provide this added order. How to get the map elements the way I have added?
Anything with STL is fine or other alternative suggestions also fine
A class has a constructor which takes one parameter:
class C(object):
def __init__(self, v):
self.v = v
...
Somewhere in the code, it is useful for values in a dict to know their keys.
I want to use a defaultdict with the key passed to newborn default values:
d = defaultdict(lambda : C(here_i_wish_the_key_to_be))
Any suggestions?
I want to implement the 1140grid at my site. The layout is pretty simple:
100% header
25% sidebar 75% page
100% footer
see also http://jsfiddle.net/KB5Nq/
the problem is that i would like to change the stack order when the site is in mobile view:
100% header
100% page
100% sidebar
100% footer
however, by default it arranges the blocks in the same order as they appear in the source code: header, sidebar, page, footer.
is there an easy css-only fix for that?
Hi guys. Does anyone know how to position a widget called linkWithin on the page? By default it's putting it below every post. I want to display it in the sidebar though. Any ideas?
Android Code Style Guide defines "Android Code Style Rules".
To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window-Preferences-Java-Formatter) default profile (in Eclipse IDE).
Did anyone managed to configure the formatter to follow the "Android Code Style Rules" already?
PS: I've tried to do this myself but I've found that there are too many formatter options available, and most of them are not mentioned in the Code Style Guide :-(
By default it's like this:
$.fn.ellipsis = function() {
...
return this.each(function(){
//do some operation on each element here to see if it qualifies
}
}
But now I want to return a subset of all, only those qualify in this.each(function() {}),
how to modify the code so that it finally returns only those that qualify?
By default certain programs format their output according to the type of the stream they write to. For example, the output of ls and ls > file looks differently. I'd like to know how this is achieved by a program. Additionally, is there a way by which we can trick such programs as if the output stream is a terminal where it actually is a file (especially when they don't have any options that affect output formatting)?
The default panTo only pans to the edge of the screen.
I like setCenter but would like to pan to that point. Any ideas welcome
map.setCenter(mymarker.getPoint());
GEvent.trigger(mymarker,"click"); //open the info window
I've been trying to clean up my urls with htaccess but I can't seen to get it to work on my localhost.
My website url: localhost/index.html
This is the default htaccess file that's in my www folder.
#------------------------------------------------------------------------------
# To allow execution of cgi scripts in this directory uncomment next two lines.
#------------------------------------------------------------------------------
AddType application/x-httpd-php .html .htm .php
AddHandler cgi-script .pl .cgi
Options +ExecCGI +FollowSymLinks
Every hacker I know uses terminal emacs. Graphical emacs is hideous. The default text is huge and out of place, and the borders are much bigger and blockier than in any other application. Everything I've read about switching the font is confusing and completely different than the font selection used by other applications (I'm on Ubuntu).
Does anyone actually use graphical emacs (vs -nw)? If so, how do you make it bearable?
I started a new project in the new Xcode, and I see that my default the main window is set to 320x548. I'm fine with that, but when I test my app, a view I added to my main xib, which is supposed to be 280x280, looks more like 280x200 when testing on 3.5in devices.
I've tried changing the settings for that view in the xib, but nothing seems to affect it.
How do I ensure background compatibility so that in older devices the view is the same size?
I'm trying to compile a program called hiQlab on OSX 10.8
g++ -g -O2 -I`echo /Users/.../Documents/hiQlab/hiqlab-2006-07-20/tools/`/lua/include -I`echo /Users/.../Documents/hiQlab/hiqlab-2006-07-20/tools/`/tolua++/include -c cscmatrix.cc
cscmatrix.cc:13:12: fatal error: 'umfpack.h' file not found
#include "umfpack.h"
but I just installed SuiteSparse through macports which includes umfpack
and umfpack.h is in fact present in default directory /opt/local/include/
do I need to add the path or something?
Thanks!
How can MVC website benefit from the new parallelism features in .net 4? don't websites support parallelism by default since multiple users access them at the same time? Can someone clarify this?
Hi,
I have a iphone application developed, and now i want to replicate the same iphone application on blackberry.
In the existing application iphone application, we have the plist file, where we maintain certain values like server address, map url etc. All default values are saved in plist.
Please can you give me an alternative similar to plist in blackberry.
Which classes / frameworks must I look at? I don't want to use 3rd party libs, so just plain old, boring default solutions to read / write text files and stuff like that... Is there something like a File IO framework?
I made a UITableViewCell subclass, and now I want that subclass to be "clever". It should align it's contents to the height of the row. But for this, the cell must know what height value was provided for it in this method:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
However, no matter what value I assign here, my cell's frame is 44 px height at initialization time (default style). Is there any way I can get that value from the cell at initialization time?
Hello,
typedef enum testCaseId
{
"TC-HIW-0019" = 0,
"TC-HIW-0020",
"TC-HIW-0021"
} testCaseId;
I need my test cases to be represented in enum. In my test function, I need to switch between the test cases like:
void testfunc(uint8_t no)
{
switch(no)
{
case 0:
case 1:
default:
}
}
So can anyone help on how to use enum to declare strings.