Hi,
I need to control some script elements, that's why I want to add class attribute to do it.
But, w3c says that it's invalid. Some effect, if I add rel or id attribute.
Any other ideas how I can access appropriate script tag?
Doctype: XHTML 1.0 Strict
Thanks,
What's the best solution for embedding non-web fonts into a page without using Flash and still maintaining cross-browser support? Has anyone used any JavaScript libraries for this? Thanks.
I have 2 z-index layers in a map application I'm building. I have a problem when I click on the layers to zoom in. The click handler is on the underlying z-index layer and I don't want it to fire when a control in the overlying layer is clicked.
The problem i have is that the event gets raised no matter what but the originalTarget property of the event is not the image in the underlying layer when something on the top layer is clicked. Is there anyway to change this?
I'm in the process of creating an SSIS package on a server (server1) that looks at the data in a sql db on another site (server2) and copies relevant rows across.
The SQL statement required is:
SELECT *
FROM server2.ordersTable
WHERE
OrderID Not In (SELECT OrderID FROM server1.ordersTable
This selects data from server1 which isn't in the table on server2 (based on order id)
I then need to insert the result into a table on server1
How would I approach this? What components do I need etc...?
I'm getting really desperate trying to add a UIImageView to UITableViewCell.backgroundView. All my efforts have resulted in this crappy rendering:
It looks like the cell's label's white background is sitting on top of cell's background and covering portions of it.
I tried setting the label's background color to clear, or some other color and it does not have any event. It is always white.
The reason I know it's the text label's background causing this white area is that if I don't do [cell setText:@"Cell text here"]; the white area is gone and I see just the cell's background image.
Here's the code that I'm using. The table view is added in the .xib file and UITableView is added to UIViewController:
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [myCollection.items count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSUInteger rowIndex = indexPath.row;
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.backgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"darkCellBackground.png"]];
cell.selectedBackgroundView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"darkCellBackground.png"]];
}
[cell setText:@"Cell text here"];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController];
// [anotherViewController release];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
I'm sure I'm doing something wrong but cant quite figure out what.
I have always done this:
mysqldump -hlocalhost -uuser -ppass MYDATABASE > /home/f/db_backup/MYDATABASE.sql
mysql -uuser -ppass MYDATABASE < MYDATABASE.sql
But, if I do this instead...is this safe? Is this identical to the above???
mysqldump -hlocalhost -uuser -ppass MYDATABASE | gzip > /home/f/db_backup/MYDATABASE.sql.gz
zcat MYDATABASE.sql.gz | mysql -uuser -ppass MYDATABASE
I am writing a perl routine that mounts specific drives at startup. However, when the drives are mounted, they appear in "My Computer" with odd names like "dir$ at 'machinename' (H:)".
Is there a way in perl or C to specify this string (or just the 'dir$' part?) at mount-time?
I am designing a web site in which users solve puzzles as quickly as they can. JavaScript is used to time each puzzle, and the number of milliseconds is sent to the server via AJAX when the puzzle is completed. How can I ensure that the time received by the server was not forged by the user?
I don't think a session-based authenticity token (the kind used for forms in Rails) is sufficient because I need to authenticate the source of a value, not just the legitimacy of the request.
Is there a way to cryptographically sign the request? I can't think of anything that couldn't be duplicated by a hacker. Is any JavaScript, by its exposed, client-side nature, subject to tampering? Am I going to have to use something that gets compiled, like Flash? (Yikes.) Or is there some way to hide a secret key? Or something else I haven't thought of?
Update: To clarify, I don't want to penalize people with slow network connections (and network speed should be considered inconsistent), so the timing needs to be 100% client-side (the timer starts only when we know the user can see the puzzle). Also, there is money involved so no amount of "trusting the user" is acceptable.
Hi. This question isn't about popping up an iframe inside a Lightbox; rather, it's about an iframe on a page that can launch its own Lightbox-style box in the page that contains that iframe. I'm thinking this can't be possible, because the iframe contains the contents of the other URL and whatever Lightbox that URL launches has to fit within the iframe. Thanks.
Sometimes user input is not strictly invalid but can be considered problematic.
For example:
A user enters a long sentence in a single-line Name field. He probably should
have used the Description field instead.
A user enters a Name that is very similar to that of an existing entity. Perhaps he's inputting the same entity but didn't realize it already exists, or some concurrent user has just entered it.
Some of these can easily be checked client-side, some require server-side checks.
What's the best way, perhaps something similar to DataAnnotations validation, to provide warnings to the user in such cases? The key here is that the user has to be able to override the warning and still submit the form (or re-submit the form, depending on the implementation).
The most viable solution that comes to mind is to create some attribute, similar to a CustomValidationAttribute, that may make an AJAX call and would display some warning text but doesn't affect the ModelState. The intended usage is this:
[WarningOnFieldLength(MaxLength = 150)]
[WarningOnPossibleDuplicate()]
public string Name { get; set; }
In the view:
@Html.EditorFor(model => model.Name)
@Html.WarningMessageFor(model => model.Name)
@Html.ValidationMessageFor(model => model.Name)
So, any ideas?
I've subclassed MKAnnotation so that i can assign objects to annotations and then assign this object to a view controller like so:
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control {
PlaceDetailView *detailView = [[PlaceDetailView alloc] initWithStyle:UITableViewStyleGrouped];
detailView.place = [view.annotation place];
[self.navigationController pushViewController:detailView animated:YES];
[detailView release];
}
This is working great but i'm having the following issues:
If i try and access the place getter method like so view.annotation.place i recieve an error:
Accessing unknown place getter method
If i acces the place getter method like so [view.annotation place] i receive a warning:
place not found in protocol
From my understanding this is because the place object is not defined in the MKAnnotation protocol, although i'm aware of this i'm not sure how to tell the complier that place does exist and it's not calling it blind.
Not sure if this kind of help is accepted to ask for here, tell me if it isn't.
It has to get done before tomorrow, it's not entirerly finished but it should work somewhat ok by now. I'm trying to use the Eclipse debugger (not very used to it).
I have my top-level or main class, which is Game, in which I have a constructor and a main method. In the main method I create a new "Game", initiating the constructor.
public static void main(String[] args){
Game chess = new Game();
}
public Game(){
Board board = new Board();
That's the first thing the debugger reacts to:
Thread [main] (Suspended)
ClassNotFoundException(Object).<init>() line: 20 [local variables unavailable]
ClassNotFoundException(Throwable).<init>(String, Throwable) line: 217
ClassNotFoundException(Exception).<init>(String, Throwable) line: not available
ClassNotFoundException.<init>(String) line: not available
URLClassLoader$1.run() line: not available
AccessController.doPrivileged(PrivilegedExceptionAction<T>, AccessControlContext) line: not available [native method]
Launcher$ExtClassLoader(URLClassLoader).findClass(String) line: not available
Launcher$ExtClassLoader.findClass(String) line: not available
Launcher$ExtClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String, boolean) line: not available
Launcher$AppClassLoader.loadClass(String, boolean) line: not available
Launcher$AppClassLoader(ClassLoader).loadClass(String) line: not available
Game.<init>() line: 15
Game.main(String[]) line: 11
Line 11 is the one line in my main method, line 15 is the instantiation of "board".
In R, what is the most efficient way to count the length between 2 values. for example, i have vector x , which are all randomly choose from 1 to 100, how can i find out the length between the first"2" and first"40",
x=(1,2,3,4,5,6,7,40,1,2,3,21,4,1,23,4,43,23,4,12,3,43,5,36,3,45,12,31,3,4,23,41,23,5,53,45,3,7,6,36)
for this vector, the answer should be 5 and 6
I am looking for a way to show my own input view (a UITableView) to enter certain keywords in a UITextView faster than typing them, and also be able to type into this text view the normal way. My solution has a button that causes the keyboard to disappear, revealing the table view underneath it.
Problem is I can't figure out how to make the keyboard go away without resigning first responder, and losing the cursor. Has anyone accomplished this before?
Thanks for any help.
Currently, Apple's native binaries and libraries are distributed as fat files, with support for both i386 and x86_64 architectures. The SDK (Xcode 4.4 w/ command line tools) doesn't support cross-compiling powerpc binaries any more, so they can be safely ignored I think, but there doesn't seem to be any specific guidelines or recommendations about which Intel architectures to support.
So, when compiling code for distribution on OS X, do people still cross-compile for the i386 architecture? Or are x86_64 binaries the only architecture worth bothering with nowadays?
The reason I'm asking is because I'm getting NullPointerException.
I now this is very easy but I'm pretty new programming and find this a bit confusing.
So say I have initialized an object in a class and want to access that same object from another class.
Like now for instance I'm working on a small Chess game, in my model Game class I have an instance of Board, an object. Board, in turn, has an array of Squares. Square[][].
Game has board, board has Square[][].
Now if I want to access the Square[][] through the object board (in Game) of type Board.
Do I just declare a variable with the same name and type or do I have to initialize it again?
Board board OR Board board = new Board();
Note, I have already initialized board in the class Game so if I do it again, won't they be two totally different Board objects?
I have recently become the proud owner of two monitors in my workspace. (Ok not owner, but you know what I mean) and I'd like to use both of them at once.
Problem is, I much much prefer to use a Linux Server console over a desktop environment.
The graphics card on the machine is a GTX295 (don't ask why, it's a long story.) so I essentially have two graphics cards. Each has a DVI output. Is there any way I can get the console to stretch across two screens? Or will I have to install a desktop Ubuntu for this to work?
Hey all,
I'm practicing Jquery and I've written this simple Jquery statement:
var someText = $("table tr td").text();
Should this not return all text of td elements found within tr's that are found within tables? How do I fix this? Currently when I run this, it says that table tr td is null, but I have a table on the page I'm testing on.
Thanks!
Usually, when people click on a link, I have onclick bound to it. And then return false.
When people click with "control", they expect a new page to open up. Therefore, I want to ignore the onclick AND/OR detect it. How do I do this?