Hi Anish Jhaveri,
I want to write a we based application with C# .Net and i need some framework to work with smart card in client-side.
please help me.
Is it possible to develop a web-part in ASP.NET (framework 2.0), to have a sandbox architecture, and deploy those web parts inside Share Point 2010 and/or MOSS 2007
we donot want to use any SharePoint dll reference with web parts we develop.
we refer to the url, section at http://msdn.microsoft.com/en-us/library/ee539417.aspx (section Web Parts in Sandboxed Solutions)
I'm having a problem where the addition of spring's transaction management to an application causes Hibernate to throw the following error:
org.hibernate.HibernateException: A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: org.fstrf.masterpk.domain.ReportCriteriaBean.treatmentArms
org.hibernate.engine.Collections.processDereferencedCollection(Collections.java:96)
org.hibernate.engine.Collections.processUnreachableCollection(Collections.java:39)
org.hibernate.event.def.AbstractFlushingEventListener.flushCollections(AbstractFlushingEventListener.java:218)
org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:77)
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
org.springframework.orm.hibernate3.SpringSessionSynchronization.beforeCommit(SpringSessionSynchronization.java:135)
org.springframework.transaction.support.TransactionSynchronizationUtils.triggerBeforeCommit(TransactionSynchronizationUtils.java:72)
org.springframework.transaction.support.AbstractPlatformTransactionManager.triggerBeforeCommit(AbstractPlatformTransactionManager.java:905)
org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:715)
org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:701)
org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy92.saveNewReportCriteria(Unknown Source)
org.fstrf.masterpk.domain.logic.MasterPkFacade.saveNewReportCriteria(MasterPkFacade.java:134)
org.fstrf.masterpk.controllers.ReportCriteriaController.setupReportType(ReportCriteriaController.java:302)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:585)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:413)
org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:134)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:310)
org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:297)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
I'm using Spring 2.5 and annotations to implement this management. Here is the class containing the saveNewReportCriteria method (which, as can be seen by the stack trace, is causing the error)
@Transactional(
propagation = Propagation.REQUIRED,
isolation = Isolation.DEFAULT,
readOnly = false)
public class HibernateReportCriteriaDao implements ReportCriteriaDao{
private HibernateTemplate hibernateTemplate;
public Integer saveNewReportCriteria(ReportCriteriaBean reportCriteria) {
hibernateTemplate.save(reportCriteria);
List<Integer> maxIdList = hibernateTemplate.find("SELECT max(id) from ReportCriteriaBean");
logger.info("ID of newly saved list is: " + maxIdList.get(0));
return maxIdList.get(0);
}
public void setHibernateTemplate(HibernateTemplate hibernateTemplate) {
this.hibernateTemplate = hibernateTemplate;
}
}
Then I added the following sections to my configuration files to tell spring that I am using annotation driven transaction management:
<bean id="actgDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="jdbc/actg" />
<property name="resourceRef" value="true" />
</bean>
<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="actgDataSource" />
</bean>
<tx:annotation-driven/>
I'm pretty sure that the de-referencing error is being caused due to the proxy class that Spring AOP creates and uses in order to handle transaction management, but I have no idea how I'd go about fixing it.
I have a web app that is using the 3.5 framework. I wanted to know how can I detect what webhost is rendering the page.
If the server is localhost, then send email notification to [email protected]
If the server is QA, then send email to [email protected]
Thanks
Is there any framework or tool to generate web services (WCF) access to all the non transactional tables in my database? something like asp.net dynamic data but with web services, I need to do this for homologation with other systems.
I'd like to provide a browser page to help non-techies run the various tests I've created using the standard django test framework.
The ideal would be for a way to display all the tests found for an application with tick boxes against each one, so the user could choose to run all tests or just a selection.
Output would be displayed in a window/frame for review.
Anyone know of such a thing?
Hello people, this would be my first question after signing up!
Anyway heres my question, I did Java at university and I was always told I am a good programmer. However I never pursued it as a career - I went into support and management instead. Im pretty much bored with my job, I have therefore started to learn Objective C so that I can develop apps for the iphone. I am currently watching several different Videos / Books.
My problem is that when I go through the Apple documentation, although I understand most of it, sometimes I stumble. I believe that because you/we have the Apple documentation (i.e. Framework references) , everything should be clear, and therefore you should have no need to refer to a book or video (in order to learn how to use a particular class). But I alway do refer to a book and video and subsequently feel guilty as I believe the framework reference should be enough. (I therefore feel I am not up to being a programmer)
I also believe that you shouldn't need example code in order to learn how to use a particular class because Apple provides documentation for each class, but AGAIN I find my self googling example code and I find my answer like that - again I feel guilty for doing this.
Am I right in saying that Apple documentation is simply not clear? and that its ok to refer to a video/book or google? or forums for that matter?
I have proffesional programmers who tell me that I am worrying too much and that I should get on with it and use all the resources that I have. I just cant seem to get round this mental block that I have in my head.
When I start a programming project I am able to use the excellent search skills that I have to find the code I need, copy and paste it (yes I do understand it) BUT then I feel guilty telling myself that why didn't you think up the code yourself???? Therefore your not a real programmer, your just good at googling.
Currently I am going through 20+ books so that I can learn most of the frameworks, syntax etc to develop iphone apps. I believe if I do this, then when I think of a project I can make it quickly. Should I read a few books, like 2-3 and then just start a project /app , and if I get stuck just google it and get the code I need?
Can anybody please answer my questions?
How do I Unit Test a MVC redirection?
public ActionResult Create(Product product)
{
_productTask.Save(product);
return RedirectToAction("Success");
}
public ActionResult Success()
{
return View();
}
Is Ayende's approach still the best way to go, with preview 5:
public static void RenderView(this Controller self, string action)
{
typeof(Controller).GetMethod("RenderView").Invoke(self,new object[] { action} );
}
Seems odd to have to do this, especially as the MVC team have said they are writing the framework to be testable.
Does anybody know any good simple youtube search scripts in php that I could use right off the bat? I don't want to use the Zend Framework (not installed), just the basic REST calls.
Thanks
I have read the formal definition of a "concrete domain", but I still don't quite get it.
Could someone explain it to me in simpler terms, preferably with some examples?
The definition is available in
Reasoning in Description Logics with a Concrete Domain in the Framework of Resolution by Ullrich Hustadt, Boris Motik, Ulrike Sattler. Page 1, Definition 1.
Short Version: Using two managed object contexts, and while the context is saving to the store the application bombs when I attempt to merge the two contexts and reload the table view.
Long Version:
Okay, so my application is set up as thus.
3 view controllers, all table views.
Platforms View Controller - Games View Controller (Predicated upon platform selection) - Add Game View Controller
I ran into a problem when Games View Controller was bombing when adding a new entry to the context, because the fetched results contorller wanted to update the view for something that didn't match the predicate.
As a solution, I rebuilt the Add Controller to use a second NSManagedObject Context, called adding context, following the design pattern in the Core Data Books example.
My Games List View Controller is a delegate for the add controller, to handle all the saving, so my addButtonPressed method looks like this
- (IBAction) addButtonPressed: (id) sender {
AddGameTableViewController *addGameVC = [[AddGameTableViewController alloc] initWithNibName:@"AddGameTableViewController" bundle:nil];
NSManagedObjectContext *aAddingContext = [[NSManagedObjectContext alloc] init];
self.addingContext = aAddingContext;
[aAddingContext release];
[addingContext setPersistentStoreCoordinator:[[gameResultsController managedObjectContext] persistentStoreCoordinator]];
addGameVC.context = addingContext;
addGameVC.delegate = self;
addGameVC.newGame = (Game *)[NSEntityDescription insertNewObjectForEntityForName:@"Game" inManagedObjectContext:addingContext];
UINavigationController *addNavCon = [[UINavigationController alloc] initWithRootViewController:addGameVC];
[self presentModalViewController:addNavCon animated:YES];
[addGameVC release];
[addNavCon release];
}
There is also a delegate method which handles the saving. This all works swimmingly. The issue is getting the table view controller in the GameListViewController to update itself.
Per the example, an observer is added to watch for the second context to be saved, and then to merge the addingContext with the primary one.
So I have:
- (void)addViewController:(AddGameTableViewController *)controller didFinishWithSave:(BOOL)save {
if (save) {
NSNotificationCenter *dnc = [NSNotificationCenter defaultCenter];
[dnc addObserver:self selector:@selector(addControllerContextDidSave:) name:NSManagedObjectContextDidSaveNotification object:addingContext];
//snip! Context Save Code
[dnc removeObserver:self name:NSManagedObjectContextDidSaveNotification object:addingContext];
}
self.addingContext = nil;
[self dismissModalViewControllerAnimated:YES];
}
- (void)addControllerContextDidSave:(NSNotification*)saveNotification
{
NSManagedObjectContext *myContext = [gameResultsController managedObjectContext];
[myContext mergeChangesFromContextDidSaveNotification:saveNotification];
}
So now, what happens is after save is pressed, the application hangs for a moment and then crashes. The save is processed, as the new game is present when I relaunch the application, and the application seems to be flowing as appropriate, but it bombs out for reasons that are beyond my understanding.
NSLog of the saveNotification spits out this:
NSConcreteNotification 0x3b557f0 {name = NSManagingContextDidSaveChangesNotification; object = <NSManagedObjectContext: 0x3b4bb90>; userInfo = {
inserted = {(
<Game: 0x3b4f510> (entity: Game; id: 0x3b614e0 <x-coredata://13168366-B8E7-41C8-B384-BAF14A5E08D9/Game/p2> ; data: {
name = "Final Fantasy XIII";
platform = 0x3b66910 <x-coredata://13168366-B8E7-41C8-B384-BAF14A5E08D9/Platform/p20>;
})
)};
updated = {(
<Platform: 0x3b67650> (entity: Platform; id: 0x3b66910 <x-coredata://13168366-B8E7-41C8-B384-BAF14A5E08D9/Platform/p20> ; data: {
games = (
0x3b614e0 <x-coredata://13168366-B8E7-41C8-B384-BAF14A5E08D9/Game/p2>,
0x603a530 <x-coredata://13168366-B8E7-41C8-B384-BAF14A5E08D9/Game/p1>
);
name = "Xbox 360";
})
)};
}}
I've tried both a simple
[self.tableView reloadData];
and the more complicated multi-method table updating structure in the Core Data Books example. Both produce the same result.
If my class has NO destructor, an it goes out of scope.
GC runs at certain time, now will it simply reclaim memory from my class OR will it call its destructor or Finalize () on it ?
And does the .net framework class like SQLConnection implement a destructor? I saw it has a Dispose () implementation but didn't see the destructor using "Go to definition".
I want to read the binary contents of a .lnk file.
As long as the target of the shortcut (lnk file) exists this works fine with IO.File.ReadAllBytes(string file).
BUT
If the target of the shortcut does not exist (believe me I want this) the method only returns zero's. I guess this is because the OS follows the link and if it does not exist it returns zero's
Is there some way to bypass the fact that the framework follows the target of the .lnk before displaying the contents of the .lnk file?
I am trying to populate a UIPickerView with the results of a NSFetchRequest. The results of the NSFetchRequest are then stored in an NSArray. I am using Core Data to interact with the SQLite DB. I have a simple class file that contains a UIPickerView that is associated with a storyboard scene in my project.
The header file for the class looks like the following,
ViewControllerUsers.h
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
@interface ViewControllerUsers : UIViewController <NSFetchedResultsControllerDelegate, UIPickerViewDelegate, UIPickerViewDataSource>
{
NSArray *dictionaries;
}
@property (nonatomic, strong) NSFetchedResultsController *fetchedResultsController;
// Core Data
@property (strong, nonatomic) NSManagedObjectContext *managedObjectContext;
@property (nonatomic, strong) NSArray *users;
@property (strong, nonatomic) IBOutlet UIPickerView *uiPickerViewUsers;
@property (weak, nonatomic) IBOutlet UIBarButtonItem *btnDone;
@property (weak, nonatomic) IBOutlet UIButton *btnChangePin;
// added for testing purposes
@property (nonatomic, strong) NSArray *usernames;
- (IBAction)dismissScene:(id)sender;
- (IBAction)changePin:(id)sender;
@end
The implementation file looks like the following,
ViewControllerUsers.m
#import "ViewControllerUsers.h"
@interface ViewControllerUsers ()
@end
@implementation ViewControllerUsers
// Core Data
@synthesize managedObjectContext = _managedObjectContext;
@synthesize uiPickerViewUsers = _uiPickerViewUsers;
@synthesize usernames = _usernames;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
// Core Data
if (_managedObjectContext == nil)
{
_managedObjectContext = [(AppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext];
NSLog(@"After _managedObjectContext: %@", _managedObjectContext);
}
NSFetchRequest *request = [NSFetchRequest fetchRequestWithEntityName:@"Account"];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Account" inManagedObjectContext:_managedObjectContext];
request.resultType = NSDictionaryResultType;
request.propertiesToFetch = [NSArray arrayWithObject:[[entity propertiesByName] objectForKey:@"username"]];
request.returnsDistinctResults = YES;
_usernames = [_managedObjectContext executeFetchRequest:request error:nil];
NSLog (@"names: %@",_usernames);
}
-(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
//One column
return 1;
}
-(NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component
{
//set number of rows
return _usernames.count;
}
-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
//set item per row
return [_usernames objectAtIndex:row];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)viewDidUnload {
[self setBtnDone:nil];
[self setUiPickerViewUsers:nil];
[self setBtnChangePin:nil];
[super viewDidUnload];
}
- (IBAction)dismissScene:(id)sender {
[self dismissModalViewControllerAnimated:YES];
}
- (IBAction)changePin:(id)sender {
}
@end
The current code is causing the app to crash, but the NSLog is show the results of the NSFetchRequest in the NSArray. I currently think that I am not formatting the results of the NSFetchRequest in the NSArray properly if I had to take a guess.
The crash log looks like the following,
2013-06-26 16:49:24.219 KegCop[41233:c07] names: (
{
username = blah;
},
{
username = chris;
},
{
username = root;
}
)
2013-06-26 16:49:24.223 KegCop[41233:c07] -[NSKnownKeysDictionary1 isEqualToString:]: unrecognized selector sent to instance 0xe54d9a0
2013-06-26 16:49:24.223 KegCop[41233:c07] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSKnownKeysDictionary1 isEqualToString:]: unrecognized selector sent to instance 0xe54d9a0'
First throw call stack:
I'm doing course 3354 (Implementing System Types and Interfaces in the .NET Framework 2.0) and it is said that for simple classes, with members variables and functions, it is better to use a struct than a class because of overhead.
I have never heard of such a thing, what is the validity of this claim?
Hi,
I want to know if there is any open source testing tool for cloud computing. We have built a cloud framework with Xen, Eucalyptus, Hadoop, HBase as different layers. I am not looking at testing each of these tools separately, but i want to test them from the perspective of fitting into a cloud environment (for example scalability of xen hypervisor to handle multiple VMs).
Would be great if you can suggest me some tool (open source) for the above.
I have a server with some asp, asp.net 1.0 and 2.0 running on them. Now I'm planning to host 3.5 apps on them.
Do i have to make any changes to
server other than installing
framework to make it handle all my
previous version apps?
Do i have to install new IIS or i can use same iis for 3.5?
Do i have to install ajax newer version to suport ajax 3.5?
I am a newbie to the web application development. I have to start with a Framework which will make me grow up higher in my career. So please suggest which technology i have to choose? Lot of technologies for web development is articulating in this field like PHP,JSP,Stuts,JSF,Flex,ColdFusion etc.
Give me some suggestions to how to start?
I want to have a seperate project that runs my server communication code in a normal JVM for the purposes of integration testing. This code uses these libraries which are build into the Android Framework...
http://developer.android.com/reference/org/apache/http/client/package-summary.html
Does anybody know what version of Apache HTTP Client this is supposed to be? I want to run it without the Android tests which are painfully slow.
I'm searching for a free component or library that could convert HTML to PostScript ( .ps file format ). I'm using .Net framework 1.1. Any one have experience with situation like this ?
Is there any class in .Net framework that can read/write standard ini files:
[Section]
<keyname>=<value>
...
Delphi have TIniFile component and I am looking if there is anything similar for C#.
Im getting classnotfountexception on Class.forname("com.mysql.jdbc.Driver")
im using:
windows vista 64-bit,
Eclipse Galileo,
GWT framework
i downloaded (mysql-connector-java-5.1.6-bin), but what the exact path i should add to.
im getting this exception while im in gwt-projects, but normal projects working good,
any idea how that should be done???...thanks
I am currently html encoding all user entered text before inserting/updating a db table record. The problem is that on any subsequent updates, the previously encoded string is reencoded. This endless loop is starting to eat up alot of column space in my tables. I am using parameterized queries for all sql statements but am wondering would it be safe to just let the .NET Framework handle this part without the HTML Encoding?