The UniqueID of a control is delemited with the '$', is it possble that the delimiter can change, and if so, is there a property somewhere that contains the delimiting character?
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 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 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.
ess-mode is "Emacs speaks statistics." This mode is useful for editing programs for R or Splus (two separate statistics packages).
In my buffer, when ever I type '_' the character is replaced with "<-" which is very frustrating. Is there a emacs lisp statement to turn off this behavior?
Thanks,
SetJmp
emacs: 22.1.1
ess-mode release (unknown)
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
Hi all,
I'm using the following code for my search on my table:
- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope
{
[searchParent removeAllObjects];
for(NSString *a in parent)
{
NSComparisonResult result = [a compare:searchText options:(NSCaseInsensitiveSearch) range:NSMakeRange(0, [searchText length])];
if(result == NSOrderedSame){
[searchParent addObject:a];
}
}
}
It's working fine, however, only for one character.
I get the following in the console:
*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0)'
Any help is appreciated greatly!
Thanks
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
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!
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 have a shell script with this code:
var=`hg st -R "$path"`
if [ -n "$var" ]; then
echo $var
fi
But the conditional code always executes because hg st always prints at least one newline character.
Is there a simple way to strip whitespace from $var (like trim() in php)?
or
Is there a standard way of dealing with this issue?
I could use sed or awk, but I'd like to think there is a more elegant solution to this problem.
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 implemented an as-you-type-searching (text search on single attribute) by fetching with performFetch: after each given character by the user. The performFetch: is running in a background thread to avoid keyboard freezes.
But while typing many useless fetches are started. A NSOperationQueue might be an option, but I wonder if there are other approaches for this quite usual search behavior.
What's best practice to notice when fetching is done and the table view is updated with the previous fetch to start a new fetch?
In Java, is there a simple method to convert the format of a given string? For example, I have the string "test22". I'd like the binary value and hex value. As well as possibly the ascii values of each character?
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.
Works:
awk '{print $$1"\t&\t"$$2"\t\\\\"}' .file > file.tex
Does not work, why?
awk '{printf %.2f"\t&\t"\.2f"\t\\\\",$$1,$$2}' .file > file.tex
Error:
awk: {printf %.2f"\t&\t"\.2f"\t\\\\",$1,$2}
awk: ^ backslash not last character on line
Why isn't RAISERROR spelled RAISEERROR? Where is the second E? I could understand if it were some ancient keyword length constraint, but I wouldn't expect it to be a nine-character limit.
Is RAIS or RROR a technical word such that "raise-error" is just a mis-reading? Are its (immediate) origins in a different language?
I've searched Google but not finding much on the subject.
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?
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.
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.
Can somebody please provide some sample code to strip diacritical marks (i.e., replace characters having accents, umlauts, etc., with their unaccented, unumlauted, etc., character equivalents, e.g., every accented é would become a plain ASCII e) from a UnicodeString using the ICU library in C++? E.g.:
UnicodeString strip_diacritics( UnicodeString const &s ) {
UnicodeString result;
// ...
return result;
}
Assume that s has already been normalized. Thanks.
Is there an easy way to generate a labeled bitmap image for each glyph contained in a given bitmap font file?
I'm trying to convert a collection of Japanese .bdf fonts into a format usable in MATLAB and C++, where each glyph is used as the OCR classification key for the character it represents.
I have a dropdownlist that holds all of the TimeZone.Displayname
All of these display names come out as:
(GMT +09:00) Seoul, (GMT -06:00) Central Time (US & Canada), etc.
Is there a way to have a keypress event that would search through the first letter after the ")"? Right now it only recognizes the first character of the combobox string which is "("
EDIT
Changed title because timezones don't really have to do with the issue.
I want to create a TreeMap in Java with a custom sort order. The sorted keys which are string need to be sorted according to the second character. The values are also string.
Sample Hash:
Za,FOO
Ab,Bar