I was wondering if there is a nice IF NOT EXISTS for checking columns and indexes in SQLite, or do I need to bring back the entire database schema and validate against that?
Hi there I have a situation where I need to make to call to a normal .aspx page from asp.net mvc web application. How can I make this request and get data back from the page. the data will be returned on on the page_load event of the .aspx page
I have included gwt-html5-geolocation into my GWT project and was disappointed to find that it doubled up on my number of permutations compiled. Apparently if the browser does not support geolocation API then it falls back to use gears to find out your location. Is there a way to NOT compile a permutation for gears similar to the way you can tell GWT to only compile certain browser permutations? (the geolocation stuff is very much a nice-to-have and frankly if the client is running an old browser then I am happy not to get their location)
Thanks
Hi all,
I'm new to php and I need to authenticate to a SSO server.
The SSO server is a .Net one, using a SSL certificate.
When I go back from the SSO server, the response is encoded.
I have the key of the certificate of course, but how could I decrypt the response ?
This is very vague for me, don't hesitate to detail your answer :)
Many thanks in advance for your help,
best regards
Hi all,
What is the best (free or paid for) to read Excel files (XLS and XLSX) using C# and populate a datagrid, I would also like to have any changes made in the datagrid be written back to the file.
This would be used for a commercial application so it would need to be distributable.
Thanks
Lee
I'm designing a simple expander control.
I've derived from UserControl, drawn inner controls, built, run; all ok.
Since an inner Control is a Panel, I'd like to use it as container at design time. Indeed I've used the attributes:
[Designer(typeof(ExpanderControlDesigner))]
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]
Great I say. But it isn't...
The result is that I can use it as container at design time but:
The added controls go back the inner controls already embedded in the user control
Even if I push to top a control added at design time, at runtime it is back again on controls embedded to the user control
I cannot restrict the container area at design time into a Panel area
What am I missing? Here is the code for completeness... why this snippet of code is not working?
[Designer(typeof(ExpanderControlDesigner))]
[Designer("System.Windows.Forms.Design.ParentControlDesigner, System.Design", typeof(IDesigner))]
public partial class ExpanderControl : UserControl
{
public ExpanderControl()
{
InitializeComponent();
....
[System.Security.Permissions.PermissionSet(System.Security.Permissions.SecurityAction.Demand, Name = "FullTrust")]
internal class ExpanderControlDesigner : ControlDesigner
{
private ExpanderControl MyControl;
public override void Initialize(IComponent component)
{
base.Initialize(component);
MyControl = (ExpanderControl)component;
// Hook up events
ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService));
IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService));
s.SelectionChanged += new EventHandler(OnSelectionChanged);
c.ComponentRemoving += new ComponentEventHandler(OnComponentRemoving);
}
private void OnSelectionChanged(object sender, System.EventArgs e)
{
}
private void OnComponentRemoving(object sender, ComponentEventArgs e)
{
}
protected override void Dispose(bool disposing)
{
ISelectionService s = (ISelectionService)GetService(typeof(ISelectionService));
IComponentChangeService c = (IComponentChangeService)GetService(typeof(IComponentChangeService));
// Unhook events
s.SelectionChanged -= new EventHandler(OnSelectionChanged);
c.ComponentRemoving -= new ComponentEventHandler(OnComponentRemoving);
base.Dispose(disposing);
}
public override System.ComponentModel.Design.DesignerVerbCollection Verbs
{
get
{
DesignerVerbCollection v = new DesignerVerbCollection();
v.Add(new DesignerVerb("&asd", new EventHandler(null)));
return v;
}
}
}
I've found many resources (Interaction, designed, limited area), but nothing was usefull for being operative...
Guys,
I'm getting back into Java after a long stint in the Ruby world and I've got a question about JUnit tests and the source I'm testing.
If I've got a package of graphics code for my company, lets call it com.example.graphics, should I include my tests in that package too or should they be included in a seperate package, like com.example.graphics.test?
Thanks,
Joe
Let's say I have a macro called LengthOf(array):
sizeof array / sizeof array[0]
When I make a new array of size 23, shouldn't I get 23 back for LengthOf?
WCHAR* str = new WCHAR[23];
str[22] = '\0';
size_t len = LengthOf(str); // len == 4
Why does len == 4?
UPDATE: I made a typo, it's a WCHAR*, not a WCHAR**.
I have a program with 4 threads.
Within each thread, I do a luaL_newstate();
Each thread only has access to it's own lua instance.
Is there anything I need to worry about? [I.e. is there some hidden state that all lua instances share behind my back?]
Thanks!
Is it possible to reflect an object in actionscript and get the property names back in the order they are positioned in the class?
I have tried the following
var reflectionObject : Object = ObjectUtil.getClassInfo(obj);
var propsArray : Array = reflectionObject.properties;
(orders alphabetically)
var typeInfo:XML = describeType(obj)
(Not sure what order this is)
I want to develop a module to implement such a feature:
when exchange receive emails in the mailbox : [email protected]
the module will be triggered and modify the email's TO Address to /test/@smb.local and save back to mailbox [email protected].
Thanks in advance!
I read that Git mainly add informations about the repository's history, trying to remember every change made, but that there are also commands that make irreversible changes.
What are the commands that I should really pay attention to and avoid to use wrongly because there is not turning back?
I'm calling UK.Elect() but getting a weird result back. I was expecting a value of Enum.ElectoralReform but it seems to be throwing an InfufficientSeatsException
I think I probably need to re-factor the whole PoliticalClass
Any suggestions?
I have installed Symfony2 on a iis 7 server with PHP 5.3.21 and everything works ok ( the php, the symphony demo page ).
I try to create my own helloWorld, as the tutorial says :
php app/console generate:bundle
I go Start-Run-CMD and put that line of code and it gives me back this :
could not open input file : app/console
and before anyone asks i am in the project directory when i perform this command
I put the PHP directory to the System PATH but the problem persists.
I wish to disable loading the plone site if JS is disabled in the browser. Where exactly do I change the code? Which template/skin do I choose? I want to ensure that JS is always enabled while browsing any part of the plone site.
While browsing, if JS is disabled, I can redirect to another page with tag to enable the JS in the browser and give a hlink to the site back if it is enabled. I am using Plone 4.1
Is there an easy way to convert an XMLType to a User Defined Type? I can convert the UDT to XMLType using the below.
select SYS_XMLGEN(pUDT) into param2 from dual;
I can't though, is find a function that takes that and turns it back into that UDT using the same mappings the SYS_XMLGEN used.
I have a table with a bunch of data already in it. I know how to create a partitioned table or alter an already existing partitioned table, but can I add partitions to a table after it has been created, has data in it, without losing the data?
The other option is to dump all the data, recreate the table with the partitions and then insert it all back it. Is that the only way?
Thanks.
Hi
http://msdn.microsoft.com/en-us/library/ms189797.aspx
In this link they are committing a transaction within catch clause IF (XACT_STATE()) = 1, I don't get it, if there is an error why they are committing it? even if the problem in select statement and there is no big deal committing it, why don't just roll it back.
Thanks
In Visual Studio, I always use Ctrl+Tab and Ctrl+Shift+Tab to navigate between documents. I see that Eclipse has Ctrl+F6 to navigate between editors, but this isn't nearly the same behavior. The difference being, pressing it once and then again will get you moving back and forth between two files, whereas in VS, it will cause you to navigate forward based on the tab order in the editor. Any ideas on how I can replicate VS's behavior?
When I tapped into any cell in tableview, blue color that shows us cell state (yes you tapped in!) always lights up and never disappears even if I go back to same table view through navigation. What's the reason ? I did not change anything with cell options ..
i wonder if large web applications like twitter and facebook have admin panels to handle CRUD for users, posts, images, themes and so on just like in CMS like drupal?
so programmers have to code the front for the regular users AND back for the administrators?
if i develop an web application is it recommended that i also code the admin part? or is it unnecessary since i can handle all directly in mysql and by editing php scripts directly?
share your thoughts!
thanks
People use a variety of little shortcuts that make typing code easier and without the hassle of going back to your mouse. For example, when deleting, ctrl + backspace will delete the whole word. I was wondering what types of little nifty tricks you know that you would like to share!
Hi, I have a tabbar with one of the tabs containing a drilldown table.
I am having problems once the user has finished using the drilldown table. If they change to another tab, then change back to the original tab, the original tab is still where I left it (at the bottom of the drill down showing the detail view)
What I want is on moving to an alternative tab the old tab resets
I have tried adding all sorts of stuff to -(void)viewDidDisappear and -(void)viewDidUnload with no success
What do I need to do?
Cheers
When user scrolls to the bottom of the page I want to show some div, with jQuery of course. And if user scrolls back to he top, div fade out.
So how to calculate viewport (or whatever is the right name) :)
Thanks
Im just working on what should be the "finishing touches" of my first iPhone game. For some reason, when I save with NSKeyedArchiver/Unarchiver, the data seems to load once and then gets lost or something. Here's what I've been able to deduce:
When I save in this viewController, pop to the previous one, and then push back into this one, the data is saved and prints as I want it to.
But when I save in this viewController, then push a new one and pop back into this one, the data is lost.
Any idea why this might be happening? Do I have this set up all wrong? I copied it from a book months ago. Here's the methods I use to save and load.
- (void) saveGameData {
NSLog(@"LS:saveGameData");
// SAVE DATA IMMEDIATELY
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *gameStatePath = [documentsDirectory stringByAppendingPathComponent:@"gameState.dat"];
NSMutableData *gameSave= [NSMutableData data];
NSKeyedArchiver *encoder = [[NSKeyedArchiver alloc] initForWritingWithMutableData:gameSave];
[encoder encodeObject:categoryLockStateArray forKey:kCategoryLockStateArray];
[encoder encodeObject:self.levelsPlist forKey:@"levelsPlist"];
[encoder finishEncoding];
[gameSave writeToFile:gameStatePath atomically:YES];
NSLog(@"encoded catLockState:%@",categoryLockStateArray);
}
- (void) loadGameData {
NSLog(@"loadGameData");
// If there is a saved file, perform the load
NSMutableData *gameData = [NSData dataWithContentsOfFile:[[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0] stringByAppendingPathComponent:@"gameState.dat"]];
// LOAD GAME DATA
if (gameData) {
NSLog(@"-Loaded Game Data-");
NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:gameData];
self.levelsPlist = [unarchiver decodeObjectForKey:@"levelsPlist"];
categoryLockStateArray = [unarchiver decodeObjectForKey:kCategoryLockStateArray];
NSLog(@"decoded catLockState:%@",categoryLockStateArray);
}
// CREATE GAME DATA
else {
NSLog(@"-Created Game Data-");
self.levelsPlist = [[NSMutableDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:kLevelsPlist ofType:@"plist"]];
}
if (!categoryLockStateArray) {
NSLog(@"-Created categoryLockStateArray-");
categoryLockStateArray = [[NSMutableArray alloc] initWithCapacity:[[self.levelsPlist allKeys] count]];
for (int i=0; i<[[self.levelsPlist allKeys] count]; i++) {
[categoryLockStateArray insertObject:[NSNumber numberWithBool:FALSE] atIndex:i];
}
}
// set the properties of the categories
self.categoryNames = [self.levelsPlist allKeys];
NUM_CATEGORIES = [self.categoryNames count];
thisCatCopy = [[NSMutableDictionary alloc] initWithDictionary:[[levelsPlist objectForKey:[self.categoryNames objectAtIndex:pageControl.currentPage]] mutableCopy]];
NUM_FINISHED = [[thisCatCopy objectForKey:kNumLevelsBeatenInCategory] intValue];
}