Question: RPM does not receive print jobs from the Windows Standard TCP/IP Port unless the LPR Byte Counting Enabled option is selected. What is "LPR byte counting" and why must it be selected?
Answer: The simple answer is this: if Microsoft implemented their LPR to send zero as the number of bytes, then RPM would be able to handle that correctly. As it is Microsoft sends an impossibly huge number, instead of the actual size of the file in bytes.
The LPR/LPD protocol allows for zero as the file size though sending the actual size is typical. There are a few LPR clients in the world which handle this correctly, and RPM works as you would expect in either case.
The longer answer follows.
"LPR byte counting" forces Windows to count the number of bytes in the file and send this value in the Receive data file subcommand. To understand why this does not work, you must first understand the steps in sending a print job using the LPR/LPD protocol.
When LPR byte counting enabled is turned off, Microsoft sets the <file size> to a size much larger than the actual size. It is set neither to 0 nor the actual file size. When RPM receives a file much smaller than the specified file size, RPM believes that the entire file was not sent, deletes the "incomplete" file, and waits for the file to be sent again.
RFC1179 states that you may set the size of the data file to 0, however, it does not discuss how the LPD Server should handle this "unknown length file". RPM handles the "unknown length file" situation by receiving all data from the request to send the data file until the connection is closed by the LPR client.
RPM can also handle the opposite situation, in which the file is actually 0 bytes. You tell RPM to close the connection after a specified amount of time.
To do this, follow these instructions.
Method 1
Nb if you have the word version save as web filtered html
Method 2
You can change the file extension on the file from ".mht" to read ".uue".
You can then open the ".uue" file up in a zip program such as WinZip.
You can then extract one or all the files contained in the renamed .mht file
using the WinZip program interface.
Of course, you will have to change the file extensions on the extracted
files because the extracted .html file will have a .txt file extension when
extracted. For instance, when you are viewing the .uue file in WinZip the
.html file will have the name 0001.txt and will also have that name and
extension when it's extracted. So once it's extracted just change the name
of the file from 0001.txt to myfile.html for example. Likewise, image
files contained in the .uue file will contain extensions such as .001, 002,
etc... and will have to be renamed with thier proper extension once they've
been extracted.
I have a file on my computer that will not delete.
Method 1
Method 2
Attachment size exceeds the allowable limit" error when you add a large attachment to an email message in Outlook 2010
Internet email account (POP3, IMAP, HTTP)
To modify the default attachment limit size in Outlook 2010 for an Internet email account, follow these steps:
Original Article Here
Here’s how to disable FireFox’s browser cache completely.
network.http.use-cache, and double click it to set it to false. Double clicking it again will set it to true and re-enable the cache…and then you’re done.
To forcibly reload a page and all its dependencies, direct from source, ignoring local and proxy caches hold the shift key and hit reload. This applies not only to FireFox but also IE6/7 and Safari (maybe others too). I have a feeling this may be a ratified standard.
This has also been suggested
I set browser.cache.disk.enable and browser.cache.memory.enable both to false.
That was all I had to do to disable caching.
Windows Setup gives an error message that the Product Key is not valid (invalid) if you attempt an upgrade or repair Microsoft Windows XP Media Center Edition with Microsoft Windows XP Home Edition or with Microsoft Windows XP Professional.
Programmable Key Restrictor
This script blocks the input of characters by using a Javascript function attached an input box which is called with the event onkeydown="" . This allows me to prevent input issues with end users because they cannot enter the wrong charcters in the first place. This script is standalone but works well with HTML5 input box validation rules.
I wrote this after I could not get any scripts I found online to work reliable across browsers. I also wanted to be able to make it programmable to account for different types of key restriction I wanted to do. I have use the onkeydown="" event because I believe the the onkeypress="" event only handles printable characters.
The following validators are basically the same with different options and can be programmed for any type of character validation you want including special characters. This script is using the new standard of event.key which with a few tweaks is usable across all of the different browsers. event.key outputs the character that is pressed on the keyboard and not some charcode which varies from browser to browser and platform to platform. event.key is the recommended way of getting key presses in browsers.
As you can see I have used feeder functions to supply the event, you do not need to use them you can create your own and the process is very straight forward. Allowed Characters and whether space is allowed. This prevents a lot of duplicate code as the common function is quite long. You could use the function as a stndalone is you remove the feeder functions and replace them with variables as needed.
Function Call in HTML
<input class="olotd5" value="123456" name="zip" type="text" onkeydown="return onlyAlphaNumeric(event);"/>
The Script
/** Key Input Restrictions - Using event.key **/
// Allows Only Letters
function onlyAlpha(e) {
return keyRestriction(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", true);
}
// Allow Only Numbers and Letters
function onlyAlphaNumeric(e) {
return keyRestriction(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", true);
}
// Allow Only Numbers and Letters - Including Comma, Backslash, Minus, Single Quote
function onlyAlphaNumericExtra(e) {
return keyRestriction(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,/-'", true);
}
// Allows Only Numbers
function onlyNumbers(e) {
return keyRestriction(e, "0123456789", false);
}
// Allows Only Numbers and Period
function onlyNumbersPeriod(e) {
return keyRestriction(e, "0123456789.", false);
}
// Allow Only Phone Numbers - Including Period, Brackets, Plus, Minus
function onlyPhoneNumber(e) {
return keyRestriction(e, "0123456789.()-+", true);
}
// Allow Only valid characters for URL
function onlyURL(e) {
return keyRestriction(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~:/?#[]@!$&'()*+,;=`%", false);
}
// Allow Only valid characters for Email
function onlyEmail(e) {
return keyRestriction(e, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@", false);
}
// Common Function for Key Input Restriction
function keyRestriction(e, allowedCharacters, spacesAllowed) {
// Grab the character from the pressed key
var key = e.key;
// Are Spaces Allowed?
if (key === ' ' && spacesAllowed === true)
return true;
// Are Spaces Allowed (IE fix)
if (key === 'Spacebar' && spacesAllowed === true)
return true;
// Control Keys (Backspace, End, Home, Left Arrow, Up Arrow, Right Arrow, Down Arrow, Delete)
if (key === 'Backspace' || key === 'End' || key === 'Home' || key === 'ArrowLeft' || key === 'ArrowUp' || key === 'ArrowRight' || key === 'ArrowDown' || key === 'Delete')
return true;
// Control Keys (IE and Edge fix)
if (key === 'Left' || key === 'Up' || key === 'Right' || key === 'Down' || key === 'Del')
return true;
// Allowed Characters
else if (allowedCharacters.indexOf(key) > -1)
return true;
else
return false;
}
Notes
These javascript events have different roles and can have different outcomes with different browsers. In newer browsers the behavious seems a lot more standard.
Links
These are some basic key restrictors that some people use but they are not very cross browser compatible. According to Mottie (CSS-TRICKS) e.which and e.keycode are getting discontinued. I have included these here for reference to see how it was done in the past.
Function Call in HTML
<input class="olotd5" value="123456" name="zip" type="text" onkeydown="return onlyAlphaNumeric(event);"/>
Allows Only Uppercase and Lowercase Letters to be entered - Including Space
// Allows Only Uppercase and Lowercase Letters to be entered - Including Space
function onlyAlpha(e) {
var charCode = e.which || e.keyCode;
if ((charCode === 32 || charCode >= 65 && charCode <= 90) || (charCode >= 97 && charCode <= 122)){
return true;
}
return false;
}
Allows Only Numbers to be entered - Including Backspace and some other keys
// Allows Only Numbers to be entered - Including Backspace and some other keys
function onlyNumbers(e) {
var charCode = e.which || e.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57)){
return false;
}
return true;
}
Links
use single quotes unless escaping characters
Article 1
I don’t write about PHP very often — this is the first time since the launch one year ago. However, I do quite a lot of work with PHP and relational databases such as MySQL. Almost every single time I review someone else’s work a common error related to using strings in PHP is made. Misunderstanding the way of defining strings in PHP is often the cause of many hours of debugging as well. If you are relatively new to programming and PHP you’ll most likely recognize this situation.
PHP lets you define strings using single quote, double quotes or heredoc. There’s a crucial difference between the first two and for some reason many people new to PHP start using double quotes. Hopefully the following explanation will save a couple of hours debugging for the starters among us.
The most important difference between the two is that a string enclosed in double quotes is parsed by PHP. This means that any variable in it will be expanded.
echo $var; // Results in the value of $var being printed
echo '$var'; // Results in the word '$var'
echo "$var"; // Results in the value of $var being printed
This means that concatenating strings can be done in two different ways as well.
$var = 'Ipsum';
echo 'Lorem ' . $var; // Results in 'Lorem Ipsum'
echo "Lorem $var"; // Results in 'Lorem Ipsum'
This possibly isn’t anything new to you, but if you are working with HTML you can output valid markup while keeping your code readable. Using double quotes in a string enclosed with single quotes requires no escaping and vica versa. Using a double quote in a string enclosed in double quotes (idem for single quotes) does require escaping, which —in my opinion— degrades readability tremendously.
$text = 'Lorem Ipsum';
$uri = 'http://www.lipsum.com';
echo '<a href="' . $uri . '">' . $text . '</a>';
echo "<a href=\"$uri\">$text</a>";
Personally, I always stick to using single quotes and the dot syntax to concatenate strings, unless I need special characters such as new lines. Whatever you use is up to you, but hopefully this heads-up cleared a lot of confusion and puts an end to unreadible code and markup using single quotes.
Not to mention... using " " where not needed, is just wasting processing, potentially even slowing down your website, if it's as big as say deviantART =P, since PHP has to try to parse something that does not need parsing...
Using single quotes where possible results in nominally faster execution, but we're talking fractions of milliseconds.
As with double quotes, you can escape single quotes in a string enclosed in single quotes as well. I agree that backlashes make it unreadable, but in a rare occassion I use it.
echo 'Hi, how are you? I\'m fine.'; // Single quotes
echo "Hi, how are you? I'm fine."; // Double quotes
Depending on the situation I might deviate and opt to use double quotes instead.
Article 2
The advantage to using single quotes is that you don't need to escape any double quotes in your code, which makes it neater.
However, using double quotes would allow you to place variables inside without having to escape them.
$variable = 'moo'; // This will work. echo "Double Quotes. $variable"; // This wont. echo 'Single Quotes. $variable';
I prefer using single quotes, as it makes echo'd HTML (the php code) look neater. My opinion, of course. :P
$var = $_POST['name'];
is 7 times faster than
$var = $_POST[name];
Which method you choose is entirely personal, but I use 'apostrophes' to mark my strings instead of "quotes". The downside is that I must break my string in order to include a variable in it.
I do this for two reason. First, my code editor makes variables inserted in a string bold only if I break the string around them. This makes them easier to spot when I'm troubleshooting or testing. Secondly, it allows me to paste properly validated HTML into my echos and prints without having to escape all of the quotations.
You face a small inconvenience either way, but with my method, they are fewer in number.
Single quotes versus double quotes is a huge issue in PHP. Nobody seems to understand what sort of problems they run in to using double-quotes when they arn't needed.
When you use double quotes, you are asking PHP to parse through the string and search for possible variable matches and escaping characters (like \n).
This is obviously a slow process. Do you think it'd be faster to read a book looking for a secret clue in every 4 words, or to simply read it straight through? Same difference.
If you arn't using escaping characters, it is pointless to use double quotes unless your goal is to make your application slower. Here are a few examples to demonstrate:
$wtf = 'is'; $output = "My name $wtf monokrome"; // This is SLOW. $output = 'My name ' . $wtf . ' monokrome'; // This is much more efficient. $wtf = 'google'; // This is the only sort of time where you ever really need double quoted strings. $output = '<a href="http://google.com">' . $wtf . "</a>\n"; // Notice the newline(\n)?
As for the array keys being used as $_POST[name], of course that's slow. When you do that, PHP is trying to determine name as a keyword. Since that keyword doesn't exist, it automatically assumes that you are wanting 'name'. Obviously it's faster to not make PHP make that assumption.
Generally, for most scripts, you aren't going to see the script running slower with double quotes. However, when you get to the point where your code is getting more advanced and doing more things, or if you're deploying the script in a real world environment, that is when you need to cut back on double quotes.
Personally I use single quotes everywhere. Using single quotes plus concatenation is faster than double quotes every time.
This applies to xampp-1.5.3a:
(don’t know about other versions since I only have this one. It works also for xampplite)
Yes, after a fresh install of a xampp program you are welcomed with a xampp pseudo website which is located in <path of xampp installation>/htdocs/xampp/. Clicking security you are given some important points to secure your website. That includes changing the root password. But alas, after changing it you’ll not be given a chance to use the ever-friendly phpMyAdmin.
Find <path of xampp installation>/htdocs/xampp/phpmyadmin/config.inc.php
$cfg['Servers'][$i]['password'] = ”; // MySQL password
Change this so that it’ll reflect your current mysql password.
$cfg['Servers'][$i]['password'] = ‘your_password_here‘; // MySQL password
Don’t forget to save it aight?!
Date created: ~1999
There are several strategies you can use to insert page breaks within an HTML document, thus ensuring that the printed document does not break over lines, graphics, etc. There are limitations, however, and these are listed below.
Limitations
When you paste from Microsoft Word 2010 page break are represented by
<br style="page-break-before: always;" />
<style>
.break { page-break-before: always; }
</style>
<body>
content on page 1...
<h1 class="break">text of Heading 1 on page 2</h1>
content on page 2...
<h1 class="break">text of Heading 1 on page 3</h1>
content on page 3...
<p class="break">content on top of page 4</p>
content on page 4...
</body>
Notes about Strategy 1
This example can be part of an external (CSS) or internal style.
Using a class such as .break and not prefacing it with any form of formatting, means that you can add the information wherever you want a page break to occur - including the middle of the text.
Examples:
<style>
h6 {page-break-before: always;}
</style>
Notes about Strategy 2
The reason I used H6 here is that it is a little-used heading for most web pages. By emulating a H1 in font, font size, etc., then adding this code to H6 in addition to the page break information, you can substitute H6 for H1 wherever you want a page break to occur. You can still keep H1 for sections where you don't want to force a page break. Naturally if you want to force a page break at EVERY H1, then you would include the page break information within the H1 style. This strategy can be used with both CSS and internal styles.
<div style="page-break-before: always">blah blah</div>
Notes about Strategy 3
Make sure you include some text between the <div> opening and closing tags, otherwise this may not work.
<p style="page-break-before: always">blah blah</p>
<style>
p.page { page-break-after: always; }
</style>
<body>
content on page 1
<p class="page"></p>
content on page 2
</body>
Notes about Strategy 5
This example can be part of an external (CSS) or internal style.
...... </tr> </table> </center> </div> <p class="break"><!--Appendix 2 (continued)--></p> <div align="center"><center> [start next table here...]
Notes about Strategy 6
Tables need to be broken in order to force a page break.
In the code in this example, the table has been "chopped" where the break is to occur, a <p> tag inserted with the class attribute added, then the table restarted.
A comment has also been added to alert anybody dealing with the code at a later date that the table is continued.