I want to print two strings (say "ABC" and "DEF") with 5 space characters before "ABC" and that the second string will start 7 characters after the beginning of the first string.
I want to have a nice little icon that, when clicked will clear the text in the <INPUT> box.
This is to save space rather than having a clear link outside of the input box.
My CSS skills are weak... Here is a screenshot of how the iPhone looks.
How can I use PHP to strip out all characters that are NOT alpha, numeric, space, or puncutation?
I've tried the following, but it strip punctuation.
preg_replace("/[^a-zA-Z0-9\s]/", "", $str);
I have jdk1.6.0_13 installed, but when I try to find a javax.servlet package, or press ctrl+space in Eclipse after Servlet I cannot get anything. Where can I download this package, and why isn't it included in standard distribution for developers?
EDIT: It seems like this problem is called "Cutting stock problem"
I need an algorithm that gives me the (space-)optimal arrangement of chunks in bins. One way would be put the bigger chunks in first. But see how that algorithm fails in this example:
Chunks Bins
-----------------------------
AAA BBB CC DD ( ) ( )
Algorithm Result
-----------------------------
biggest first (AAABBB ) (CC )
optimal (AAACCDD) (BBB)
"Biggest first" can't fit in DD. Maybe it helps to build a table like this:
Size 1: ---
Size 2: CC, DD
Size 3: AAA, BBB
Size 4: CCDD
Size 5: AAACC, AAADD, BBBCC, BBBDD
Size 6: AAABBB
Size 7: AAACCDD, BBBCCDD
Size 8: AAABBBCC, AAABBBDD
Size 10: AAABBBCCDD
Hi,
Does anyone know a great jquery horizontal newsticker?
Like:
http://www.gcmingati.net/wordpress/wp-content/lab/jquery/newsticker/jq-liscroll/scrollanimate.html
But without the white space.. Like an endless loop. And it should be possible for it to run very slowly.
Best regards.
I need to develop a geometry library in python, describing points, lines and planes in 3d space, and various geometry operations. Related to my previous question.
The main issue in the design is if these entities should have identity or not. I was wondering if there's a similar library out there (developed in another language) to take inspiration from, what is the chosen design, and in particular the reason for one choice vs. the other.
I understand with dashes once can search for keywords in different order.
What if my keyword has a space in it like real estate or New York
Should I use underscores in this case?
If I do a Google search for New_York Google hints me:
Did you mean: New York
There is clearly a difference.
Even capitals seems to make a difference, looking at the search results..
Hi there,
I'd like to somehow hook into the local system's network stack to capture outgoing network packets without using Winpcap. Unfortunately it tends to crash my system every now and then.
Is there a way to "sniff" outgoing traffic of the local system from a user space process written in a .NET language?
Thanks a lot!
Hendrik
Basically, I know how to create graph data structures and use Dijkstra's algorithm in programming languages where side effects are allowed. Typically, graph algorithms use a structure to mark certain nodes as 'visited', but this has side effects, which I'm trying to avoid.
I can think of one way to implement this in a functional language, but it basically requires passing around large amounts of state to different functions, and I'm wondering if there is a more space-efficient solution.
My text editor of choice for PHP work is Panic's Coda. But for Ruby on Rails, it's autocomplete feature is continuously in my way and ROR's standardization on 2 space tabs does not play well with Coda's settings. I've been going back to TextMate for ROR work, but was wondering if there were better options.
Can the xdpi and ydpi settings be relied upon to accurately represent the physical pixels in once inch of screen space? I need this to be accurate for some display code I'm writing. I realize the documention says that this is the case, but I need to know if individual handsets get this right MOST OF THE TIME.
I know I can alternately use "densitiy" which will give me 120, 160, 240 steps of DPI, but an exact dpi would be much better.
Thanks!
Is there any Informix documentation for optimizing any operating system where an ifx engine is running? For example, in Linux, strip-down to a bare minimum all unnecessary binaries, daemons, utilities, tune kernel parameters, optimize raw and cooked devices (hdparm), place swap space on beginning tracks of a disk, etc. Someday, maybe, Informix can create its own proprietary and dedicated PICK-like O/S to provide the most optimized environment for a standalone ifx server? The general idea is for the OS where ifx sits on have the smallest footprint and lowest overhead impact.
Does anyone know of a project that will allow the editing of a language (any language) within a web-page itself (via HTML-5) with content assist (ctrl+space)?
Hello,
I have a big file with thousands of lines of thousands of characters.
I move the cursor to 3000th character.
If I use PageDown or <CTRL>-D, the file will scroll but the cursor will come back to the first no-space character.
There's is an option to set to keep the cursor in the same column after a such scroll ?
I have the behavior with gvim on Window, vim on OpenVMS and Cygwin.
Regards
I'd like to export plotting symbols form R as a png graphic. But I haven't found a perfect way yet.
Using
png("symbol.png",width=20, height=20, bg="transparent")
par(mar=c(0,0,0,0))
plot.new()
symbols(1, 1, circles=0.3, bg=2, inches=FALSE, lwd=2, bty="n")
dev.off()
creates a little border around the symbol (I'd like it to be transparent) and the symbol isn't filling the whole space.
Is there a more specific way of doing this ?
I am using three buttons along with the list view.These three buttons are added to the layout using the TableRow.The first button takes more space on content, so the other two becomes smaller in size than first one. When the application runs, it doesn't even show the two other buttons.
How can I make the size of three buttons equal and display all of them when application runs?
The first few fields of 'cat /proc/bus/pci/devices' are understandable.
Field 1 - BusDevFunc
Field 2 - Vendor Id + Device Id
Field 3 - Interrupt Line
Field 4 - BAR 0
and the rest of the BAR registers (0 - 5) after that.
After the BAR registers are printed out, what are the other fields? Specifically, what PCI configuration space registers(offsets) are printed out?
Hello,
I would like a select list that does the following:
When the select list is open, display the list of descriptions.
When the user selects an item, the select list will close an only the value will be displayed.
The reason for this is to conserve space as the values will be much shorter. I'm hoping that there's an answer in jQuery.
Thanks.
Any tips or best practices for unit testing Google Wave robots written in Java? I'm expecting to deploy on AppEngine, if that helps. I'm a fan of TDD but new to both Wave Robots and AppEngine, so I'm hoping to use TDD to help me explore the design space.
I wanted to take character array from console and it also include white spaces, the only method i know in C is scanf, but it miss stop taking input once it hit with white space. What i should do?
Here is what i am doing.
char address[100];
scanf("%s", address);
How do I check if a String contains only letters in java? I want to write an if statement that will return false if there is a white space, a number, a symbol or anything else other than a-z A-Z. My string must contain ONLY letters.
I thought I could do it this way, but I'm doing it wrong:
if( ereg("[a-zA-Z]+", $myString))
return true;
else
return false;
For my application I customized slightly the way WMD behaves so when user enters empty lines, these are reflected in HTML output as <br />'s. Now I came to a point when I should store it somewhere at backend and so after going thru SO posts for a while I'm not sure what is the best way to do it. I have few options and if you could point out which their pros/cons that would be much appreciated.
send to server and store as markdown rather than HTML. To me obvious advantage would be keeping exactly same formatting as user originally entered. But then how can I convert it back to HTML for display to a client?
It seems very troublesome to convert it on client side as even if it would be possible what would happen if JS would be disabled? If I wanted to do it on the server, then standard server side implementations of markup to HTML might be resource expensive. Would that be an issue in your opinion? Even if it wouldn't be the case then as I mentioned my WMD implementation is customised and those server side solutions wouldn't probably do the right conversion to markdown anyway and there always would be a risk that something would convert wrong.
Send to server as converted HTML. Same as above.. conversion on client side would be difficult, server side same with possibility of getting it wrong.
send original markdown and converted HTML and store both. No performance issues related to converting markdown to HTML on client side, nor on server side. Users would have always same markdown they originally entered and same HTML they originally saw in preview (possibly sanitized in php though). It would have to take twice that much storage space though and that is my biggest worry.
I tend to lean towards 3rd solution as it seems simplest, but there is a worry of doubled storage space needed for this solution. Please bear in mind that my implementation of WMD is slightly modified and also I'm going with PHP/MySql server side implementation.
So apart from 3 options I listed above, are there any other possible solutions to my problem? Did I miss anything important that would make one of the options above better then the rest? And what other pros/cons would apply to each solution I listed? Also how is it implemented on SO? I read somwhere that they using option 3, and so if its good enough for SO would be good enough for me :) but not sure if its true anyway, so how is it done?
Also please forgive me, but at least for once I got to say that StackOverflow IS THE BEST DAMN RESOURCE ON THE WEB and I truly appreciate all the people trying to help others here! The site and users here are simply amazing!
I have a form with a subform on it. If subform contains no records, it's visible property is false. In that case, I'd like the outer form to shrink so that there isn't a big empty space where the subform was.
The long way to do this would be by setting the position for all the controls on the form based on whether the subform is visible. However, is there an easier way to do this (maybe with the can grow/ can shrink property)?
Hi, Could someone help me with the following RegEx query: based on the following rules:
1) 1 letter followed by 4 letters or numbers, then
2) 5 letters or numbers, then
3) 3 letters or numbers followed by a number and one of the following signs: ! & @ ?
You will have to allow customers to input the fidelity card code as a 15-character string, or as 3 groups of 5 chars, separated by one space.