Posts

c++ - How can I use templates to determine the appropriate argument passing method? -

As I understand it, when someone sends an object to a function that is larger than a register, then it It is better to pass (context) context, eg: void foo (const std :: string and bar) {...} It avoids potentially demonic rationality. However, when passing in a way that fits in a register, passing it as a const (context) is the most redundant, and at the slowest speed: void foo (const int & bar) {...} My problem is, I want to know when I am using the best of both worlds Get a template class that needs to be passed around any type: template & lt; Typename T & gt; Square Fu {Public: // Good for a complex type, bad for small types of zero times (CONST T & BAD); // Good for small types, but the complex type of waste will copy void bar2 (T-Baaz); }; Is there a template decision method that allows me to choose the right type? Something like that will let me, zero times (const_nocopy :: type baz); Will choose a better method on that type of basis...

apache - mod_rewrite index.php?p=$1 -

I am trying to rewrite index.php / page / I do not have to work on it can do! This is a work of: Rewrite code% {REQUEST_FILENAME} on rewriting! -f rewrite code% {REQUEST_FILENAME}! -d RecruitArrowout * Index.php? P = $ 1 [PT, L] Please help! back-reference $ 1 your RewriteRule Do not correspond to a group of left hand (groups defined by using parentheses) Try one of the following: RewriteRule * Index.php? P = $ 0 # - or - RewriteRule ^ (. *) $ Index.php? P = $ 1

jquery - Cloning JavaScript Objects. Again :( -

I know that this topic is really annoying to read again before the code digging can be a solution That I did not get the prototype and the object in javascript. . But at this point I think that, I do have the problem: Javascript class (created with prototype), how to clone so that "clone" class When the extension remains untouched and executed later? function clone (obz) {if (obj == faucet} type ob (obje)! = 'Object') change obe; Var temp = new obj.constructor (); For (var key in obj) temp [key] = clon (obj [key]); Return temporary; } Var FOO = function () {var myBAR = clone (bar); MyBAR.prototype = jQuery.extend (true, myBAR.prototype, this); // Double cloning twice and extension with this console.log ("FOO:", this.name); New mieber (); }; FOO.prototype = {name: "FOO"}; Var BAR = function () {console.log ("BAR:", this.name); }; BAR.prototype = {name: "bar"}; New FOO (); // imports FOO: FOO and bar: FOO new bar (); /...

PHP, postfix, sendmail, thunderbird for local dev only -

Hey, I'm trying to work on the php's mail function in my local Dev box in a way where all the mails have been sent using. Mail (regardless of recipient) will remain local and will appear in a Thunderbird account (pop / ipad / etc). I have to send the phm set to use the mail and install the postfix me. But I'm on any damage where to go next. Any hint? Register a user in the postfix, such as testers @ localhost Make sure that the postfix always sends all the emails to testuser @ localhost Make sure that the postfix always deletes all messages that were forwarded Make sure that your SMTP server accepts mail for invalid local address Uncheck 'Do not allow SMTP Relaying of non-local mail' Set up a pop-inbox in Thunderbird for Testuser @ localhost [edit] ] Just for the record, point 4 will ensure that whatever address you can use, when you are testing the system where email is unique (which is very common), then you will not be out of a valid email ...

javascript - PHP Secure Login - Client-side options? -

Right now I'm confused for the authentication I use with Codeigniter to get advice from the user on libraries I am here. I have detected dx_auth and simpleloginsecure (I think I will use it later due to my safe hashing and small footprint). But, what about the hashing of the password on the client side? I have not seen any mention of this in the documentation of libraries. How secure is these libraries, even if there is no need to have some client-side encryption (JS) so that passwords can never be posted in plain text? Or am I missing something and none of these libraries cover it ... thanks Update: However, I was under the assumption that it was PHP The codinator plugin) were in exchange for the SSL (were I completely wrong here)? If I am wrong, then is there a safe way to complete it without SSL? (Previously I used the JavaScript MD5 hash function to encrypt the password before posting it ... but I was expecting more securely). Update 2 is OK - so it seems that I s...

NSLog outputs to console when running on iphone simulator, but not when running on device -

Has anyone heard of someone before? It's making me crazy. It is only in the main app which I am working on. Other apps show NSLog in the Do console when running on the device. I have to reinstall the SDK, reboot the computer, clean up, delete the build folder, try to reboot the phone, one million things I know that the NSOg code is run because the exact project In addition to the SIM, in addition, the application around NSLG code that loads the initial view in the application of AdyLeget does not appear when running on the Destination Launching Device Happens. Runs the right app on the device, but I do not get the Nslog output in the console. If someone can help, it will be greatly appreciated! - Steve Whether you are viewing in the console application, or through the Xcode Organizer in the XCode Console Are available? Used by the pre-simulator, the latter is used for the devices.

decorator - Struts2 Sitemesh not working in WAS 6 server -

I have a string 2-spring application that works fine in JT server, but when I make it 6 decorator (sitemesh )) Not applicable The server log does not show any errors. Is this a known issue? My web XML looks like this & lt; Filter & gt; & Lt; Filter-name & gt; Action 2-cleaning & lt; / Filter-name & gt; & Lt; Filter range & gt; Org.apache.struts2.dispatcher.ActionContextCleanUp & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter & gt; & Lt; Filter-name & gt; Sitemesh & lt; / Filter-name & gt; & Lt; Filter range & gt; Com.opensymphony.module.sitemesh.filter.PageFilter & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter & gt; & Lt; Filter-name & gt; Action 2 & lt; / Filter-name & gt; & Lt; Filter range & gt; Org.apache.struts2.dispatcher.FilterDispatcher & lt; / Filter range & gt; & Lt; / Filter & gt; & Lt; Filter-mapp...