Just a guess: I make an attribute and make it's type "binary". But in the end, how would I use that? I guess there is an NSData behind the scenes? So that attribute actually takes an NSData?
say ive got a matrix that looks like:
[[0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
how can i make it on seperate lines:
[[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0]]
and then remove commas etc:
0 0 0 0 0
And also to make it blank instead of 0's, so that numbers can be put in later, so in the end it will be like:
_ 1 2 _ 1 _ 1
(spaces not underscores)
thanks
I'm working on a project started in VB9 (VS 2008) and now I've migrated to VS2010 (VB10) but on the production server the IDE is still VS 2008. On my developement enviroment the code compiles fine, but sometimes, - let's say - I forget an _ at the end of the line which causes the VB9 compiler to throw an error.
So the question is, how could I build a project with the VS 2010 IDE but VB9 compiler? Or to force the VB10 compiler into VB9 mode?
In the end, I got this function. I don't know whether it's normal or not.
function user_registration($user_name, $user_email , $user_pass , $address ,
$city , $postalcode , $country , $phone , $mobilephone)
How and why can I improve this?
Looking for code that would run in a browser (Safari) to determine if a certain iphone app was installed on a users device (iphone, ipad or ipod touch). The end goal is dynamically display messaging on a site to instruct the user to go install the app.
Is there a simple way to recursively find all files in a directory hierarchy, that do not end in a list of extensions? E.g. all files that are not *.dll or *.exe
UNIX/GNU find, powerful as it is, doesn't seem to have an exclude mode (or I'm missing it), and I've always found it hard to use regular expressions to find things that don't match a particular expression.
I'm in a Windows environment (using the GnuWin32 port of most GNU tools), so I'm equally open for Windows-only solutions.
I need to read a file in PHP, but I only know the end of the filename, so I need to serch the file in a given directory using wildcards: *filename.wav and then return it to the browser.
Is there a function to do that? or I need to get all the files in the directory and then search one by one?
Thanks for all the comments and help.
I'm trying to do this again an Oracle 10 database:
cursor = connection.cursor()
lOutput = cursor.var(cx_Oracle.STRING)
cursor.execute("""
BEGIN
%(out)s := 'N';
END;""",
{'out' : lOutput})
print lOutput.value
but I'm getting
DatabaseError: ORA-01036: illegal variable name/number
Is it possible to define PL/SQL blocks in cx_Oracle this way?
Hi, it it possible to get the form action of a GET form on submit including all of the get variables added on the end?
The reason being I want to use AJAX to run the script that the form submits to, and then just display a thank you message.
Have produced a short video which redirects to a download page at the end.
The redirect works fine in Firefox
But for some reason I cannot get the redirect to work in IE.
Thanks
Hello,
Suppose I have a path in a string called '/home/user/directory/HelloWorld.txt'. I would like to remove the HelloWorld.txt, and end up with '/home/user/directory'. What regex would I need.
When I use the itemize environment, i.e.
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
The bullet points are ugly bitmap graphics that have harsh (aliased) edges. I'd like it to be a nice, clean font character or vector graphic
I have a class to help me store persistent data across sessions. The problem is I want to store a running sample of the property list or "plist" file in an NSMutableArray throughout the instance of the Persistance class so I can read and edit the values and write them back when I need to.
The problem is, as the methods are publicly defined I cannot seem to access the declared NSMutableDictionary without errors. The particular error I get on compilation is:
warning: 'Persistence' may not respond to '+saveData'
So it kind of renders my entire process unusable until I work out this problem.
Here is my full persistence class (please note, it's unfinished so it's just to show this problem):
Persistence.h
#import <UIKit/UIKit.h>
#define kSaveFilename @"saveData.plist"
@interface Persistence : NSObject {
NSMutableDictionary *saveData;
}
@property (nonatomic, retain) NSMutableDictionary *saveData;
+ (NSString *)dataFilePath;
+ (NSDictionary *)getSaveWithCampaign:(NSUInteger)campaign andLevel:(NSUInteger)level;
+ (void)writeSaveWithCampaign:(NSUInteger)campaign andLevel:(NSUInteger)level withData:(NSDictionary *)saveData;
+ (NSString *)makeCampaign:(NSUInteger)campaign andLevelKey:(NSUInteger)level;
@end
Persistence.m
#import "Persistence.h"
@implementation Persistence
@synthesize saveData;
+ (NSString *)dataFilePath
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return [documentsDirectory stringByAppendingPathComponent:kSaveFilename];
}
+ (NSDictionary *)getSaveWithCampaign:(NSUInteger)campaign andLevel:(NSUInteger)level
{
NSString *filePath = [self dataFilePath];
if([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
NSLog(@"File found");
[[self saveData] setDictionary:[[NSDictionary alloc] initWithContentsOfFile:filePath]]; // This is where the warning "warning: 'Persistence' may not respond to '+saveData'" occurs
NSString *campaignAndLevelKey = [self makeCampaign:campaign andLevelKey:level];
NSDictionary *campaignAndLevelData = [[self saveData] objectForKey:campaignAndLevelKey];
return campaignAndLevelData;
}
else
{
return nil;
}
}
+ (void)writeSaveWithCampaign:(NSUInteger)campaign andLevel:(NSUInteger)level withData:(NSDictionary *)saveData
{
NSString *campaignAndLevelKey = [self makeCampaign:campaign andLevelKey:level];
NSDictionary *saveDataWithKey = [[NSDictionary alloc] initWithObjectsAndKeys:saveData, campaignAndLevelKey, nil];
//[campaignAndLevelKey release];
[saveDataWithKey writeToFile:[self dataFilePath] atomically:YES];
}
+ (NSString *)makeCampaign:(NSUInteger)campaign andLevelKey:(NSUInteger)level
{
return [[NSString stringWithFormat:@"%d - ", campaign+1] stringByAppendingString:[NSString stringWithFormat:@"%d", level+1]];
}
@end
I call this class like any other, by including the header file in my desired location:
@import "Persistence.h"
Then I call the function itself like so:
NSDictionary *tempSaveData = [[NSDictionary alloc] [Persistence getSaveWithCampaign:currentCampaign andLevel:currentLevel]];
I have a table which is some thing like below..
Date ID
2009-07-01 1
2009-07-01 2
2009-07-01 3
2009-08-01 4
2009-08-01 5
2009-08-01 6
2009-09-01 7
2009-09-01 8
2009-10-01 9
2009-10-01 10
2009-11-01 11
....
Now I need to write a query which will show a output like below.
Date Start End
2009-07 1 3
2009-08 4 6
2009-09 7 8
...
How can I do this..
Any help would be highly appreciated
Thanking In Advance
Johnny
I am working in VIM , I just want to know is it possible to delete a word when the
cursor is in the middle of that word ( or some where it is other than the beginning or end )
Thanks in Advance :-)
I have been reading page after page after page about the benefits of using YUM package installer and how NOBODY should built installs from source files (which again makes no sense to me) yet the repositories and source builders always package files in Tarball format, leaving a TON of work (which usually ends up going wrong) to the individual instead of formatting SRPMs for the end user.
Has the world gone mad? I feel like I am taking crazy pills!
The only thing that I found was Manzana but it crashes while I start the test executable. Can someone tell me some library which can I use to copy/delete files from and to iPhone? Or maybe a console tool which I can use as a back-end.
There appears to have been a change in behaviour between versions of the viewer that have changed the default from PDF to the virtually useless (in our scenario) native Crystal Reports format.
Is it possible to specify the default file type to use when the end user clicks the export button in the winforms CrystalReportViewer?
Hi folks,
is it possible to add a dot format / .format to the end of any route in ASP.NET MVC .. with a default being html or something?
and of course the .format is an optional value.
sample routes:-
http://whatever/controller/action.format
http://whatever/controller/action
those goto the same action method.
cheers!
The thing is that I have hundreds of nodes each with 4 to 12 images all of them around the same size in an imagefield but I want to order that so it looks at the end in a grid or something like that.
I know that panels and views are the answer but I think I've seen all of the tutorials available but nothing.
If anyone know where can I find something like I need, I'll be very gratefull.
Hello,
I have a Python script and I want to call it several functions down the script. Example code below:
class Name():
def __init__(self):
self.name = 'John'
self.address = 'Place'
self.age = '100'
def printName(self):
print self.name
def printAddress(self):
print self.address
def printAge(self):
print self.age
if __name__ == '__main__':
Person = Name()
Person.printName()
Person.printAddress()
Person.printage()
I execute this code by entering ./name.py. How could I exectute this code from the function printAddress() down the the end of the script?
Thanks
I have an app that allows a user to use JQuery and Javascript to add images and position them in a div dynamically.
I would like to be able to submit the div with all the HTML to a WebService and receive back an image so we have a bitmap of the result of the end user's work.
I would prefer a solution in .Net as this is what I am most familiar with but am open to pretty much anything?
Is it possible using Eval? If so, can someone post a short fragment to illustrate? My SqlDataSource returns 1 record with 3 fields, I'd like to Format these into a string. eg:
Record
Field 'Name' = 'Jack'
Field 'Amount' = 100
Field 'Date' = 12.02.2010
asp:Label text should end up being:
Welcome Jack, last payment was 100 on 12.02.2010
if another control than asp:Label is appropriate, that would be good to know also.
I've got a scenario where I want to switch on two different tables in an outer join. It goes something like this:-
select mytable.id,
yourtable.id
from mytable
left outer join (case
when mytable.id = 2 then table2
yourtable on table1.id = table2.id
else
table3 yourtable on table1.id = table3.id
end)
...but it doesn't work. Any suggestions?
I'm interested to know whether the user-agent is "Chrome" at the server end using PHP. Is there a reliable regular expression for parsing out the user-agent string from the request header?