Search Results

Search found 568 results on 23 pages for 'stefan mai'.

Page 16/23 | < Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >

  • AssertionFailure: "null identifier" - FluentNH + SQLServerCE

    - by Stefan
    The code fails at session.Save(employee); with AssertionFailure "null identifier". What am I doing wrong? using FluentNHibernate.Cfg; using FluentNHibernate.Cfg.Db; using FluentNHibernate.Mapping; using NHibernate; using NHibernate.Cfg; using NHibernate.Tool.hbm2ddl; namespace FNHTest { public class Employee { public virtual int Id { get; private set; } public virtual string Name { get; set; } public virtual string Surname { get; set; } } public class EmployeeMap : ClassMap { public EmployeeMap() { Id(e = e.Id); Map(e = e.Name); Map(e = e.Surname); } } public class DB { private static ISessionFactory mySessionFactory = null; private static ISessionFactory SessionFactory { get { if (mySessionFactory == null) { mySessionFactory = Fluently.Configure() .Database(MsSqlCeConfiguration.Standard .ConnectionString("Data Source=MyDB.sdf")) .Mappings(m = m.FluentMappings.AddFromAssemblyOf()) .ExposeConfiguration(BuildSchema) .BuildSessionFactory(); } return mySessionFactory; } } private static void BuildSchema(Configuration configuration) { SchemaExport schemaExport = new SchemaExport(configuration); schemaExport.Execute(false, true, false); } public static ISession OpenSession() { return SessionFactory.OpenSession(); } } public class Program { public static void Main(string[] args) { var employee = new Employee { Name = "John", Surname = "Smith" }; using (ISession session = DB.OpenSession()) { session.Save(employee); } } } }

    Read the article

  • iPhone: custom UITableViewCell with Interface Builder -> how to release cell objects?

    - by Stefan Klumpp
    The official documentation tells me I've to do these 3 things in order to manage the my memory for "nib objects" correctly. @property (nonatomic, retain) IBOutlet UIUserInterfaceElementClass *anOutlet; "You should then either synthesize the corresponding accessor methods, or implement them according to the declaration, and (in iPhone OS) release the corresponding variable in dealloc." - (void)viewDidUnload { self.anOutlet = nil; [super viewDidUnload]; } That makes sense for a normal view. However, how am I gonna do that for a UITableView with custom UITableViewCells loaded through a .nib-file? There the IBOutlets are in MyCustomCell.h (inherited from UITableViewCell), but that is not the place where I load the nib and apply it to the cell instances, because that happens in MyTableView.m So do I still release the IBOutlets in the dealloc of MyCustomCell.m or do I have to do something in MyTableView.m? Also MyCustomCell.m doesn't have a - (void)viewDidUnload {} where I can set my IBOutlets to nil, while my MyTableView.m does.

    Read the article

  • Executing php with crontab

    - by Stefan Konno
    Hi everyone. I'm trying to run a php-script on a scheduled basis. So I'd thought crontab was a good idea. The server I'm using is on Linux which I'm not that familiar with. So the problem I'm having is, I don't know how make the script executable from php. I need to reference the script, or put it into a folder that can run php from the command line. So I don't know what path to give my crontab, for example: 5 * * * * var/www/some/path/script.php I found some vague information about this php executable being found in /usr/bin/php But I can't find any php file in there, maybe I don't have it installed? My php5 and apache installation is in: /etc/php5 So my question becomes, is there anyway to execute a php-script with crontab in any other folder, or do I just lack the php executable in usr/bin/php?

    Read the article

  • iPhone: fast hash function for storing web images (url) as files (hashed filenames)

    - by Stefan Klumpp
    What is a fast hash function available for the iPhone to hash web urls (images)? I'd like to store the cached web image as a file with a hash as the filename, because I suppose the raw web url could contain strange characters that could cause problems on the file system. The hash function doesn't need to be cryptographic, but it definitely needs to be fast. Example: Input: http://www.calumetphoto.com/files/iccprofiles/icc-test-image.jpg Output: 3573ed9c4d3a5b093355b2d8a1468509 This was done by using MD5(), but since I don't know much about that topic I don't know if it is overkill (- slow).

    Read the article

  • Sql Server Backup and move backup file: How to cope with file permissions?

    - by Stefan Steinegger
    With our product we have a simple backup tool for the sql server database. This tool should just make a full backup and restore to and from any folder. Of course, the user (usually an administrator) needs permission to write to the target folder. To avoid the problem of not being able to perform a backup to a network drive, I write the backup to a temp file in the Sql Server backup directory. Then I move it to the target folder. This requires permission to delete the temporary file from the sql servers backup folder. Restore is the same in the other direction. This seemed to work fine until someone tested it on vista, where the user does not have write access to the backup folder by default. So there are many solutions to solve this, but none of them seemed to be really nice. One solution would be to find another folder for the temporary file. Both the sql server user as well as the administrator performing the backup need read and write permissions. Is there such a directory? Any other ideas? Thanks a lot.

    Read the article

  • What do the square brackets in LaTeX logs mean?

    - by stefan-majewsky
    I'm currently working on a parser that reads complete LaTeX logs. Most of the log format is, though weird, easy to figure out, but these square brackets are puzzling me. Here's an example from near the end of one of my logs: Overfull \hbox (10.88788pt too wide) in paragraph at lines 40--40 []$[]$ [] [102]) [103] Kapitel 14. (./Thermo-141-GrenzenFundamentalpostulat.tex [104 ]) (./Thermo-142-Mastergleichung.tex [105]) (./Thermo-143-HTheorem.tex [106pdfTeX warning (ext4): destination with the same identifier (name{equation.14.3.3}) ha s been already used, duplicate ignored Can anybody give me a hint what these square brackets mean? I can't see any structure in them. I have the suspicion that lines 2/3 above are some kind of ASCII art representing the box layout, though I know too less about badboxes to justify this or identify the meaning of the single characters. Then, the "[104" etc. seem to correspond to the page numbers, but I am still not seeing the reason why there is sometimes something inbetween the square brackets (like the pdfTeX warning above), and sometimes not.

    Read the article

  • commons-exec: Executing a program on the system PATH?

    - by Stefan Kendall
    I'm trying to execute a program (convert from ImageMagick, to be specific) whose parent folder exists on the path. Ergo, when I run convert from the command line, it runs the command. The following, however, fails: String command = "convert" CommandLine commandLine = CommandLine.parse(command); commandLine.addArgument(...) ... int exitValue = executor.execute(commandLine); If I specify the full path of the convert executable (C:\Program files\...) then this code works. If I don't do this, I get an exception thrown with exit value 4. How do I get commons-exec to recognize the system path?

    Read the article

  • Statusbar overlaps ViewController

    - by Stefan
    Hi, I in my AppDelegate, I use: ActivitiesViewController *acController = [[ActivitiesViewController alloc] initWithNibName:@"ActivitiesView" bundle:[NSBundle mainBundle]]; UINavigationController *acNavController = [[UINavigationController alloc] initWithRootViewController:acController]; [self.tabBarController setSelectedIndex:0]; [self.tabBarController setSelectedViewController:acNavController]; To switch the views in my TabBarController. The result is to close to the window top: How do I get my view to correct position? Regards

    Read the article

  • Using views as a data interface between modules in a database

    - by Stefan
    Hello, I am working on the database layout of a straighforward small database in Mysql. We want to modularize this system in order to have more flexiblity for different implementations we are going to make. Now, the idea was to have one module in the database (simple a group of tables with constraints between them) pass its data to the next module via views. In this way, changes in one module would not affect the other ones, as we can make sure in the view that the right data is present there at any time, although the underlying structure of tables might be different. The structure of the App handling the database would likewise be modularized. Is this something that is sometimes done? On a technical side, as I understand views can't have primary keys - how would I then adress such a view? What other issues should be considered?

    Read the article

  • java question: Is it a method?

    - by Stefan
    Hello, I'm no Java guy, so I ask myself what this means: public Button(Light light) { this.light = light; } Is Button a method? I ask myself, because it takes an input parameter light. But if it was a method, why would it begin with a capital letter and has no return data type? Here comes the full example: public class Button { private Light light; public Button(Light light) { this.light = light; } public void press() { light.turnOn(); } } I know, this question is really trivial. However, I have nothing to do with Java and haven't found a description for the Button thing above. I'm just interested.

    Read the article

  • Canvas element covering the entire screen?

    - by Stefan Kendall
    I'm trying to use <canvas> in iPhone Safari, and if I place the element in the body, there are unused pixels to the left and top of the element. I tried specifying margin:0;padding:0 with CSS to no avail. What's going on here? <html> <head> $(document).ready(function() { $('#screen').attr("height", $(window).height() ); $('#screen').attr("width", $(window).width() ); //prevent scrolling $(document).bind('touchstart touchmove', function(e) { e.preventDefault(); }); }); </script> </head> <body> <canvas id = "screen"> </canvas> </body> </html>

    Read the article

  • Handing over FaceBook SessionKey from iPhone to PHP

    - by Stefan Mayr
    Hi! Users authenticate normally on my iPhone app, and the permission for publish_stream is requested correctly. When the user want to post something on his wall, the text is transmitted to my backend and the backend posts it (with the transmitted session key) to the users facebook wall. The first post is always possible but at the second, the response is: "The user hasn't authorized the application to perform this action" But I was already able to post some seconds ago. What is wrong? Best Steve

    Read the article

  • Remote MySQL connection fails (10060)

    - by Stefan Åstrand
    When I am trying to connect to a MySQL database from a remote computer I get a prompt saying: Connection Failed: [HY000] [MySQL][ODBC 5.1 Driver]Can't Connect to MySQL server on 'XXX.XXX.XX.XX' (10060) I have created a user account in the MySQL Administrator and added a host to enable remote access, I have also made an exception for my Windows Firewall on port 3306 but the connection still fails. What is the problem? Thanks!

    Read the article

  • initialising a 2-dim Array in Scala

    - by Stefan W.
    (Scala 2.7.7:) I don't get used to 2d-Arrays. Arrays are mutable, but how do I specify a 2d-Array which is - let's say of size 3x4. The dimension (2D) is fixed, but the size per dimension shall be initializable. I tried this: class Field (val rows: Int, val cols: Int, sc: java.util.Scanner) { var field = new Array [Char](rows)(cols) for (r <- (1 to rows)) { val line = sc.nextLine () val spl = line.split (" ") field (r) = spl.map (_.charAt (0)) } def put (val rows: Int, val cols: Int, c: Char) = todo () } I get this error: :11: error: value update is not a member of Char field (r) = spl.map (_.charAt (0)) If it would be Java, it would be much more code, but I would know how to do it, so I show what I mean: public class Field { private char[][] field; public Field (int rows, int cols, java.util.Scanner sc) { field = new char [rows][cols]; for (int r = 0; r < rows; ++r) { String line = sc.nextLine (); String[] spl = line.split (" "); for (int c = 0; c < cols; ++c) field [r][c] = spl[c].charAt (0); } } public static void main (String args[]) { new Field (3, 4, new java.util.Scanner ("fraese.fld")); } } and fraese.fld would look, for example, like that: M M M M . M I get some steps wide with val field = new Array Array [Char] but how would I then implement 'put'? Or is there a better way to implement the 2D-Array. Yes, I could use a one-dim-Array, and work with put (y, x, c) = field (y * width + x) = c but I would prefer a notation which looks more 2d-ish.

    Read the article

  • Different Scala Actor Implementations Overview

    - by Stefan K.
    I'm trying to find the 'right' actor implementation for my thesis. I realized there is a bunch of them and it's a bit confusing to pick one. Personally I'm especially interested in remote actors, but I guess a complete overview would be helpful to many others. This is a pretty general question, so feel free to answer just for the implementation you know about. I know about the following Scala Actor implementations (SAI). Please add the missing ones. Scala 2.7 (difference to) Scala 2.8 Akka (http://www.akkasource.org/) Lift (http://liftweb.net/) Scalaz (http://code.google.com/p/scalaz/) What are the target use-cases for these SAIs (lightweight vs. "heavy" enterprise framework)? do they support remote actors? What shortcomings do remote actors have in the SAIs? How is their performace? How active is there community? How easy are they to get started? How good is the documentation? How easy are they to extend? How stable are they? Which projects are using them? What are their shortcomings? What are their design principles? Are they thread based or event based (receive/ react) or both? Nested receiveS hotswapping the Actor’s message loop

    Read the article

  • Android: raise AlertDialog from background thread

    - by Stefan Klumpp
    In my activity there's some stuff going on in a background thread, which gets started in Activity_1. The processing of the background thread takes a while and I want to notify the user when it's completed via an AlertDialog. However, the user might have changed to Activity_2 or Activity_3 in the meantime and I would like to pop up the AlertDialog always in the current Activity. Any idea how to realize this?

    Read the article

  • commons-exec: hanging when I call executor.execute(commandLine);

    - by Stefan Kendall
    I have no idea why this is hanging. I'm trying to capture output from a process run through commons-exec, and I continue to hang. I've provided an example program to demonstrate this behavior below. import java.io.DataInputStream; import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; import org.apache.commons.exec.CommandLine; import org.apache.commons.exec.DefaultExecutor; import org.apache.commons.exec.ExecuteException; import org.apache.commons.exec.PumpStreamHandler; public class test { public static void main(String[] args) { String command = "java"; PipedOutputStream output = new PipedOutputStream(); PumpStreamHandler psh = new PumpStreamHandler(output); CommandLine cl = CommandLine.parse(command); DefaultExecutor exec = new DefaultExecutor(); DataInputStream is = null; try { is = new DataInputStream(new PipedInputStream(output)); exec.setStreamHandler(psh); exec.execute(cl); } catch (ExecuteException ex) { } catch (IOException ex) { } System.out.println("huh?"); } }

    Read the article

  • iPhone: Interface Builder leaks memory?

    - by Stefan Klumpp
    I have been working on an iPhone project, where we created all the user interface programmatically in code. Now I'm going to start a new iPhone project and thinking of using Interface Builder instead, because it has been recommended to me as being a very useful tool, creating less headache than writing everything in code and in general much faster (regarding development time). However, my team members have some concerns due to previous problems with using Interface Builder and resulting memory leaks. Therefor they suggest building everything in code again. I don't know where these concerns come from, but maybe someone with more experience than we have can give some insight on that topic. Doing a simple Google search doesn't really provide any information proofing that there are any problems with memory leaks created by the Interface Builder itself.

    Read the article

  • Function pointers in Objective-C

    - by Stefan Klumpp
    I have the following scenario: Class_A - method_U - method_V - method_X - method_Y Class_B - method_M - method_N HttpClass - startRequest - didReceiveResponse // is a callback Now I want to realize these three flows (actually there are many more, but these are enough to demonstrate my question): Class_A :: method_X -> HttpClass :: startRequest:params -> ... wait, wait, wait ... -> HttpClass :: didReceiveResponse -> Class_A :: method_Y:result and: Class_A :: method_U -> HttpClass :: startRequest:params -> ... wait, wait, wait ... -> HttpClass :: didReceiveResponse -> Class_A :: method_V:result and the last one: Class_B :: method_M -> HttpClass :: startRequest:params -> ... wait, wait, wait ... -> HttpClass :: didReceiveResponse -> Class_B :: method_N:result Please note, that the methods in Class_A and Class_B have different names and functionality, they just make us of the same HttpClass. My solution now would be to pass a C function pointer to startRequest, store it in the HttpClass and when didReceiveResponse gets called I invoke the function pointer and pass the result (which will always be a JSON Dictionary). Now I'm wondering if there can be any problems using plain C or if there are better solutions doing it in a more Objective-C way. Any ideas?

    Read the article

  • Best way to manage a header navigation menu from within a template?

    - by Stefan Kendall
    I'm looking to put navigation in my GSP template, and I would like to set the active class on the navigation elements for each respective page. What's the best way to do this? I have several .gsp views merging with a single template that looks like this: <div id="bd" role="main"> <div role="navigation" class="yui-g"> <ul id="nav"><a href="index.gsp"><li class="active">Home</li></a><a href = "products.gsp"><li>Products</li></a><a href = "contacts.gsp"><li>Contact</li></a></ul> </div> <g:layoutBody/> </div>

    Read the article

  • Unit tests - The benefit from unit tests with contract changes?

    - by Stefan Hendriks
    Recently I had an interesting discussion with a colleague about unit tests. We where discussing when maintaining unit tests became less productive, when your contracts change. Perhaps anyone can enlight me how to approach this problem. Let me elaborate: So lets say there is a class which does some nifty calculations. The contract says that it should calculate a number, or it returns -1 when it fails for some reason. I have contract tests who test that. And in all my other tests I stub this nifty calculator thingy. So now I change the contract, whenever it cannot calculate it will throw a CannotCalculateException. My contract tests will fail, and I will fix them accordingly. But, all my mocked/stubbed objects will still use the old contract rules. These tests will succeed, while they should not! The question that rises, is that with this faith in unit testing, how much faith can be placed in such changes... The unit tests succeed, but bugs will occur when testing the application. The tests using this calculator will need to be fixed, which costs time and may even be stubbed/mocked a lot of times... How do you think about this case? I never thought about it thourougly. In my opinion, these changes to unit tests would be acceptable. If I do not use unit tests, I would also see such bugs arise within test phase (by testers). Yet I am not confident enough to point out what will cost more time (or less). Any thoughts?

    Read the article

  • Benchmarking Java programs

    - by stefan-ock
    For university, I perform bytecode modifications and analyze their influence on performance of Java programs. Therefore, I need Java programs---in best case used in production---and appropriate benchmarks. For instance, I already got HyperSQL and measure its performance by the benchmark program PolePosition. The Java programs running on a JVM without JIT compiler. Thanks for your help! P.S.: I cannot use programs to benchmark the performance of the JVM or of the Java language itself (such as Wide Finder).

    Read the article

< Previous Page | 12 13 14 15 16 17 18 19 20 21 22 23  | Next Page >