Take the standard return statement for a controller:
return View("Index");
is there a way to make this thing compile time safe? using static reflection or some other trick?
Hi,
I did a Mod rewrite for my website so the URLs looks like this :
http://www.mydomain.com/health/54856
http://www.mydomain.com/economy/strategy/911025/
http://www.mydomain.com/tags/obama/new
So, the problem is that i make AJAX calls to a file here : http://www.mydomain.com/login.php
And i don't want to write the FULL url or even use ../ trick because there isn't a fixed number of folders.
So, what i want now, is something worked for my code to access the login.php from the root whatever the domain name is :
$.ajax({
type: "POST",
url: "http://www.mydomain.com/login.php"
});
I have the following code on my page:
<p align="justify" style="font-size:10pt;display:block;height:200px;vertical-align:middle;">
Content
</p>
I want the text to be vertically aligned in the center of the p tag, but vertical-align:middle doesn't seem to be doing the trick. Is there a way to do this?
Is there a way to create custom collapsable code regions in Xcode similar to how Visual Studio can fold around #region/#endregion blocks?
It would be nice to throw all autogenerated content into a region that I can fold away until I need to look at it. #pragma mark doesn't seem to do the trick.
I have a VBScript that is running through a list of actions in IE, and at one point the site displays an Alert box with "OK" and "Cancel" as options. 'OK' is focused when the alert box appears, however SendKeys "{ENTER}" isn't doing the trick. I think perhaps the browser window still has the focus of the VBS. How can I tell the VBS to 'OK' the alert box and continue with the routines?
In gawk I know two ways to test if a string contains a number. Which is best?
Method one: using regular expressions:
function method1(x) {
return x ~ /^[+-]?([0-9]+[.]?[0-9]*|[.][0-9]+)([eE][+-]?[0-9]+)?$/
}
Method two: the coercion trick (simpler):
function method2(x) {
return (x != "") && (x+0 == x)
}
Is there any reason to favor the more complex method1 over the simpler method2?
I've got this plain HTML:
"Many things are in my room: a bed, a desk, and a computer."
And these phrases:
"things are"
"are in my room"
"room: a bed"
In JQuery, is there some way to loop through the phrase list, and highlight the phrases as they appear in the text, and have the overlap delineated by color, or border, etc?
I know there are simple highlighters but that won't do the trick. Maybe something with overlaying opacities? Thanks!
Hello,
I want to encode passwords for UNIX accounts using the crypt function. I'm using pharo 1.0. I tried to install the crypto package from squeakmap, but it gaves me an error and the package seem to get partially installed (categories without class).
How can I get my password crypted? I'm willing to invoke external code, if it is required (and there's a package in SqueakMap that makes the trick in pharo).
Thanks.
I'm using the following command to auto replace some code (adding a new code segment after an existing segment)
%s/my_pattern/\0, \r some_other_text_i_want_to_insert/
The problem is that with the \r, some_other_text_i_want_to_insert gets inserted right after the new line:
mycode(
some_random_text my_pattern
)
would become
mycode(
some_random_text my_pattern
some_other_text_i_want_to_insert <--- this line is NOT indented
)
instead of
mycode(
some_random_text my_pattern
some_other_text_i_want_to_insert <--- this line is now indented
)
i.e. the new inserted line is not indented.
Is there any option in vim or trick that I can make the newly inserted line indented?
Thanks.
I am porting code from Matlab to Python and am having trouble finding a replacement for the firls( ) routine. It is used for, least-squares linear-phase Finite Impulse Response (FIR) filter design.
I looked at scipy.signal and nothing there looked like it would do the trick. Of course I was able to replace my remez and freqz algorithsm, so that's good.
On one blog I found an algorithm that implemented this filter without weighting, but I need one with weights.
Thanks, David
I am cleaning up my machine and found cannot uninstall MSDN Library - January 2002 due to an error. It takes 1.3G disk space. I want to remove it. any idea where it is and how to manually remove it? or any free tool can do the trick for me? I am plan to install Visual Studio 2008 professional. I am using Windows XP.
thanks,
I would like to develop a trick taking card game. The game is between four players, one of which is a human and the other three hands are played by the computer.
Where can I read up about developing the AI for such games?
Are there some drawbacks of such implementation of copy-constructor?
Foo::Foo(const Foo& i_foo)
{
*this = i_foo;
}
As I remember, it was recommend in some book to call copy constructor from assignment operator and use well-known swap trick, but I don't remember, why...
One of my (my team's) biggest peeves with VS2008 is the slow speed in which ascx load. It could take up to a couple minutes to do something as simple as a text or style change simply because of the time it takes to load an ascx page into the visual studio text editor. Half the time I'm tempted to check out the file, edit it in notepad, then check it back in.
Is there any trick to speeding this up?
I'm using Netbeans to add a JToolbar to my window which also has a JMenuBar. Here is the design-time look:
.. but during run-time I get this:
With the toolbar seemingly partially hidden under the menu names. This is on the Mac, btw. Is there something stupid I've forgotten to do or some layout trick I should be using?
EDIT: I'll add that the area below the toolbar is a SplitContainer.
Need to store values from foreach loop into an array, need help doing that. Code below does not work, only stores the last value, tried $items .= ..., but that is not doing the trick either, any help will be appreciated.
<?php
foreach($group_membership as $i => $username) {
$items = array($username);
}
print_r($items);
?>
Hello,
Is there any Spring 3 feature to execute some methods when the application starts for the first time? I know that I can do the trick of setting a method with @Scheduled annotation and it executes just after the startup, but then it will execute periodically.
Thanks.
Currently I'm leveraging http://developer.yahoo.com/search/content/V1/termExtraction.html which isn't ideal for performance and quality reasons. Before I embark on spending time on writing a system I wanted to see if there are any other available options that can do the trick.
There is a bug in Grails preventing me from using removeFrom* when the node I'm trying to remove is extending the collection type. Removing the node directly from the association won't update the second level cache.
A hasMany B
Is there any way to manually invalidate or force a reload on an association cache? Invoking refresh() on the many side didn't do the trick.
You can determine with git merge-base if a fast forward is possible, but is there some git trick to determine if two branches will merge cleanly with some strategy without actually doing the merge? I know about "git merge --no-commit --no-ff $BRANCH" but that affects the working directory, which I'd like to avoid since this is part of a webservice.
I have this line ( it's a single line, SO makes it seem like 2 ):
/Od /D "WIN32" /D "_DEBUG" /FD /EHa /MDd /Fo"Debug" /Fd"Debug\vc80.pdb" /W3 /c /Zi /clr /TP .\main.cpp"
And I want to extract the .\main.cpp. I thought the following would do the trick:
if($string =~ /.*\s+(.*)$/i) {
print "matched ",$1,"\n";
}
because this same regex works in Ruby, and extracts the string I required. How can I get it working?
In some cases killing a single tab/process doesn't do it and I need to close Chrome entirely. Since Chrome has multiple processes, how can I close all of them at once?
I know that...
pgrep chrome returns all the pids, can someone tell me a trick that would allow me to close all of them by feeding them to another command or merging them to a csv or something?