Posts

php - What is the best way to get the URL of a 404'd file after redirect? -

I am working with a PHP site for which errors must be logged in a database. As such, I have set up an .htaccess file as follows: ErrorDocument 404 / 404.php All logging functions required to log in to 404.php include Database. Here went the content of $ _SERVER Suprglobl array: [HTTP_HOST] => {left} [HTTP_USER_AGENT] => Mozilla / 5.0 (Windows; U; Windows NT 5.1, en-US; RV .: 1.9.1.7) Lizard / 20,091,221 Firefox / 3.5.7 [HTTP_ACCEPT] => text / html, application / xhtml + xml, application / xml; Q = 0.9, * / *; q = 0.8 [HTTP_ACCEPT_LANGUAGE] => en-us, en; q = 0.5 [HTTP_ACCEPT_ENCODING] => gzip, remove air [HTTP_ACCEPT_CHARSET] => ISO-8859-1, utf-8; Q = 0.7, *; q = 0.7 [HTTP_KEEP_ALIVE] => 300 [HTTP_CONNECTION] => keep-alive [path] => / usr / local / bin: / usr / bin: / bin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache / 2.2. 8 (Ubuntu) omitted [SERVER_NAME] => {} [SERVER_ADDR] => {left} [SERVER_PORT] => 80 [REMOTE_ADDR] => {lef...

login - Whats the best way to do user authentication in php? -

I'm just writing 2 cookies, 1 in which the user ID is, and 1/2 of the SH1 hash is password ( Salty) The way it works, it is self-evident. I realized that I was not doing it the safest way. What is a better way to do this? Preferably using a single authentication cookie. Also, is there any point in using "hard to calculate hash"? That means, using bcrypt, or husing 10,000 items with whirlpool each time, it has to do (relatively) slow hash function (less than 1 mS vs. 1 ms only) SHA1? I mean that someone violates your DB and takes the senses ... what's left there to protect it, because all your data is in one DB (unless you have some type of D- Centralized setup is not what I'm not). / P> Store session IDs in the cookie, and log on to the user's status server side (logs) In, user id, ip). To illustrate what you need to store in the session array: Login: A Boolean variable about which user login Yes or No . You can reuse the same cookie for ...

c# - Is there any way to control where the output file of a T4 is generated to? -

I would like to generate the C # code for Silverlight, but I do not have access to some DLL which will make my T4 code even more powerful. Is there any T4 template in any C # Class Library and does it have to generate a file in the Silverlight class library? You can use the T4 toolbox for this, I remember that a few months ago this topic Was coming; Someone successfully used this approach specifically with a silver lighting project. Oleg

c# - asp - Cannot find method 'IsNullOrEmpty(String)' in 'String' -

A string is not empty, so I'm just trying to print, and I am using the code below , But it is coming along with error ... & Lt; Strong> Details: & lt; / Strong> & Lt; BR & gt; & Lt; HR size = "1" & gt; & Lt; Strong & gt; & Lt;% = o_handler.renderDesc ()%> & Lt; / Strong & gt; & Lt; HR size = "1" & gt; & Lt; BR & gt; & Lt;%} Other {%> & Lt;%}% & gt; Also tried: & lt;% if (o_handler.renderDesc ()! = Null) {%> & Lt; Strong> Details: & lt; / Strong> & Lt; BR & gt; & Lt; HR size = "1" & gt; & Lt; Strong & gt; & Lt;% = o_handler.renderDesc ()%> & Lt; / Strong & gt; & Lt; HR size = "1" & gt; & Lt; BR & gt; & Lt;%} Other {%> & Lt;%}% & gt; Here's the error: Compiler Error Message: VJS1223: Can not find 'IsNullOrEmpty (string)' method in 'strin...

ajax - upgraded to jquery 1.4.1 & now getting parse error -

I have tried to upgrade from jQuery 1.2.6 to 1.4.1. A JSON query is now unsuccessful with the error: "Parser, Invalid Label" I have simplified the minimum code. var jsonUrl = "process_01.php"; $ AZ ({type: "post", url: jsonUrl, data: "var = myVar", datatype: "Jason", preceded: function (msg) {}, success: function (msg) {}, error: function , TextStatus, errorThrown) {Warning ("An error has occurred (" + TextStatus + "" + Error + + ")");}}); return false; } The output of the php program is {"foo": "bar", "istru": "true"} I can see it in firebug Ensure that your content type is set to App / Jason. See also, it looks like your problem.

.net - How do you write a consistent UI Automation for MS? MSAA & UI Automation don't seem to overlap -

Work on a common automation tool, consider moving the Win32 message hook up to NIT UI automation, although the UI automation The feature set does not include all of us in Win32 and still does not support all GUI on Windows. One such example is Windows Live Messenger. Windows Live Messenger 2009 is still using the old DirectUIHwnd to attract the GUI. This means that you can not use windows messages to send in control, because the controls do not have its own HWND. This new The new UI also appears to defeat the automation framework, though the documentation appears to be such that it may include in the document. To indicate which MSAA can communicate with the content on which it has been shown. Is there some trick to get the old MSAA technology that is trying to replace UI automation rather than working with UI automation? Unlike Windows Messenger, there are not many solutions in trying to automate the same Windows for windows, where each of these techniques is legitimate and...

Range of python's random.random() from the standard library -

Does the random of Python (raid) ever return 1.0 or does it return only to 0.9999 ..? docs are here: ... random (), Which generates a random boat, evenly in the semi-open range [0.0, 1.0]. So, the return value will be greater than or equal to 0, and less than 1.0.