Hello SOers,
I'm currently using PushbackReader and while waiting for where it 'supposed' to be an EOF, I get the character 65535 and I'm wondering if that's normal.
Where is my EOF?!
Thank you.
Hi,
I am passing the email address as part of the url,
for ex. http://example.com/hello/[email protected]
but, when being passed to the application controller it is changed to " user%40hotmail.com ".
I can't seem to understand this special character escaping; confusion.
please help me explain the problem here, and also what can I do to fix it.
I am using python's "webapp" web application framework.
I'm seeking advice on best practice when submitting a varying amount of POST variables.
Do I use JSON or some character separated list to merge all the values into one field or use a sequence of fields like 'autocomplete1', 'autocomplete2' and so on.
Thanks in advance,
Ben
I need a regex or a function in PHP that will validate a string to be a good XML element name.
Form w3schools:
XML elements must follow these naming
rules:
Names can contain letters, numbers, and other characters
Names cannot start with a number or punctuation character
Names cannot start with the letters xml (or XML, or Xml, etc)
Names cannot contain spaces
I can write a basic regex that will check for rules 1,2 and 4, but it won't account for all punctuation allowed and won't account for 3rd rule
\w[\w0-9-]
Im trying to match punctuations using regular expressions.
Do i have to specify every punctuation character i am searching for or is there is an escape sequence i can use?
Im sitting here smiling to myself that the answers i might get will just be "Yes" or "No", please elaborate.... (that sentence should match the regular expression twice)
My C# project saves files and creates folders with the extended ASCII character "²" (superscript 2). Is this safe to work with internationally? Is this something that could cause any issues with the .NET libraries or Windows functions?
I've got the entire contents of a text file (at least a few KB) in string myStr.
Will the following code create a copy of the string (less the first character) in memory?
myStr = myStr[1:]
I'm hoping it just refers to a different location in the same internal buffer. If not, is there a more efficient way to do this?
Thanks!
Note: I'm using Python 2.5.
How do you usually organize complex web applications that are extremely rich on the client side. I have created a contrived example to indicate the kind of mess it's easy to get into if things are not managed well for big apps. Feel free to modify/extend this example as you wish - http://jsfiddle.net/NHyLC/1/
The example basically mirrors part of the comment posting on SO, and follows the following rules:
Must have 15 characters minimum,
after multiple spaces are trimmed
out to one.
If Add Comment is clicked, but the
size is less than 15 after removing
multiple spaces, then show a popup
with the error.
Indicate amount of characters remaining and
summarize with color coding. Gray indicates a
small comment, brown indicates a
medium comment, orange a large
comment, and red a comment overflow.
One comment can only be submitted
every 15 seconds. If comment is
submitted too soon, show a popup
with appropriate error message.
A couple of issues I noticed with this example.
This should ideally be a widget or some sort of packaged functionality.
Things like a comment per 15 seconds, and minimum 15 character comment belong to some application wide policies rather than being embedded inside each widget.
Too many hard-coded values.
No code organization. Model, Views, Controllers are all bundled together. Not that MVC is the only approach for organizing rich client side web applications, but there is none in this example.
How would you go about cleaning this up? Applying a little MVC/MVP along the way?
Here's some of the relevant functions, but it will make more sense if you saw the entire code on jsfiddle:
/**
* Handle comment change.
* Update character count.
* Indicate progress
*/
function handleCommentUpdate(comment) {
var status = $('.comment-status');
status.text(getStatusText(comment));
status.removeClass('mild spicy hot sizzling');
status.addClass(getStatusClass(comment));
}
/**
* Is the comment valid for submission
*/
function commentSubmittable(comment) {
var notTooSoon = !isTooSoon();
var notEmpty = !isEmpty(comment);
var hasEnoughCharacters = !isTooShort(comment);
return notTooSoon && notEmpty && hasEnoughCharacters;
}
// submit comment
$('.add-comment').click(function() {
var comment = $('.comment-box').val();
// submit comment, fake ajax call
if(commentSubmittable(comment)) {
..
}
// show a popup if comment is mostly spaces
if(isTooShort(comment)) {
if(comment.length < 15) {
// blink status message
}
else {
popup("Comment must be at least 15 characters in length.");
}
}
// show a popup is comment submitted too soon
else if(isTooSoon()) {
popup("Only 1 comment allowed per 15 seconds.");
}
});
I am using textInput within grid using rendrer. I am populating a suggestion box just below the text input field on the basis of typed character and index of text input.Problem is that if i shrink grid column then suggestion box is not populating at the right place so I want global position of cursor in the text input field .
Hi I need a regular expression that'll give me something like this part
./something\", [something.sh
from something like this string
("./something\", [something.sh", ["./something\", [something.sh"], [/* 37 vars */])
is that possible? I'm having real trouble making this since there's that \" escape sequence and also that ',' character, so I cannot simply use match everything instead of these characters.
I'm working on unix so it's also possible to use pipeline of few greps or something like that.
Thanks for advice.
Got this code snippet from some website:
int num = 1;
if(*(char *)&num == 1)
{
printf("\nLittle-Endian\n");
}
else
{
printf("Big-Endian\n");
}
Can anyone explain this step-by-step?
&num - Adress of a
(char *)&num - Type-cast address of a into a string
*(char *)&num - Points to the first character of the string
Am I missing anything here?
I'm currently working on a project where we'd like to allow a user to export their data to CSV. Some of the data we present has multiple values for a single cell, and so we use the standard CSV method of putting each value on its own line:
Column A, Column B, Column C
Value A, "Value B1
Value B2", Value C
Most of the time this works fine, but some people are reporting seeing a small question mark in a box character appear at the end of each line when they load the file in Excel. Why is this happening?
I often need to enter insert mode just to make changes on a specific line, and would like know if there is a way to enter insert mode in a way that when I am done editing on that line, hitting [Return] gets me back to normal mode.
I am aware of the 'r' command for replacing a single character, I guess what I want is something like that but for a line.
I'm using @font-face for some headers.
The replaced typeface is different in dimension and overall character. When the switch happens, the old typeface's rules don't look so good.
Other than writing a conditional Javascript script, is there a way to have a set of CSS rules for @font-face fonts (if the browsers supports it) and CSS rules for the unreplaced default fonts?
Hi,
I have get this exception. but this exception is not reproduced again. I want to get the cause of this
Exception Caught while Checking tag in XMLjava.net.URISyntaxException:
Illegal character in opaque part at index 2:
C:\Documents and Settings\All Users\.SF\config\sd.xml
stacktrace net.sf.saxon.trans.XPathException.
Why this exception occured. How to deal with so it will not reproduce.
I want to put an comment in web.config file, something like this:
<httpRuntime
requestValidationMode="2.0" // require for [ValidateInput(false)] in .net-4.0
requestPathInvalidCharacters="" // include & character in the url
enableVersionHeader="false" // disable X-AspNet-Version header
/>
Is there any way to put comments in this way, using server-side comments like <% %> or something?
Is there any IDE -from the ones supporting R-, that gives access to the command history (at least to the current session's commands)? Or is there a way to get a (character or expression) vector with those commands in R?
For those of you that have been using MATLAB, I mean something like the Command History window there..
Thank you
In Komodo Edit, if I name the file *.django.html it gives me django syntax highlighting BUT it also indents with a tab character (8 spaces) instead of giving me the usual 4 space indent. How can I fix this?
I've tried changing the value in Edit Preferences Editor Indentation Language Settings, but that seems to have no effect on it.
The indentation works as normal (4 spaces) if I'm using any other extension (.py, .html, etc.).
Ideas?
I'm looking to find the equivalent in C# for the equivalent of this regex.
Java:
public static final String expression = "[\s\p{Punct}]";
{Punct} is a reserved character class in Java but I'm not sure how to create the equivalent expression so that the .net regex engine doesn't barf.
I realize that it is a valid part of a variable name, but I've never seen variable names actually use the symbol $ before.
The Java tutorial says this:
Additionally, the dollar sign character, by convention, is never used at all. You may find some situations where auto-generated names will contain the dollar sign, but your variable names should always avoid using it.
However, since this is geared toward Java beginners, I'm wondering if in the distributed world, the $ lives on with a special meaning.
Create a 4K buffer for storing 4 independent FIFO (first-in/first-out) queues of single byte character data. The organization of the FIFO should be as efficient as possible for storing the 4 queues to support dynamic (not fixed) queue size, insuring that no queue will overflow any other queue and given that it is unknown which queues may have the least # of elements and which queues may have the most # of elements.
I went through some of the documentation of mysql but cannot understand the difference in the following ways of partitioning : Key vs Hash vs List vs Range.Can someone explain in pure english?
Also we have the following table: How do we partition by forum_id?
CREATE TABLE IF NOT EXISTS `posts_content` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`post_id` int(11) NOT NULL,
`forum_id` int(11) NOT NULL,
`content` longtext CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=79850 ;
Thanking you
Hi i am using tcpdf in my application and i have two question about that.I am able to get pdf output of a html page when i click specified button.
My first question is:How can i download that html's pdf output when i click that button?($pdf-lastPage() didn'work).
My second question is:How can i set character encoding for Trkish?(I am using dejavusans but some turkish characters appears as question mark)
Thank for advance...
I'm using minidom to parse an xml file and it threw an error indicating that the data is not well formed. I figured out that some of the pages have characters like ไà¸à¹€à¸Ÿà¸¥ &, causing the parser to hiccup. Is there an easy way to clean the file before I start parsing it? Right now I'm using a regular expressing to throw away anything that isn't an alpha numeric character and the </> characters, but it isn't quite working.
Hi,
I have a php script that inserts values into mySQL table
INSERT INTO stories (title) VALUES('$_REQUEST[title]);
I checked the values of my request variables before going into the table and it's fine.
But when I add title=john to the table for example,
I get something like this:
title = "[][][][]john"
and when I extract the value, it's a newline then john.
I have my columns set to utf-8, I tried swedish character set as well.
Note: I don't get this error when inserting values from the phpMyAdmin commandline