Search Results

Search found 45 results on 2 pages for 'kristoffer hagen'.

Page 2/2 | < Previous Page | 1 2 

  • Ordered many-to-many relationship in NHibernate

    - by Kristoffer
    Let's say I have two classes: Item and ItemCollection, where ItemCollection contains an ordered list of Item objects with an index, i.e. the list is ordered in a way specified by the user. Let's also say that they have a many-to-many relationship, an ItemCollection can contain many items and an Item can belong to several ItemCollections. That would, in my head, require three tables in the database. One for Item, one for ItemCollection and one for the ordered mapping. The mapping table would contain three columns: int ItemID int ItemCollectionID int ListIndex QUESTION: How would you design the ItemCollection class? Should the list of Item objects be a list, dictionary or other? What would the NHibernate mapping look like to get the ListIndex into the picture?

    Read the article

  • How do I retrieve a list of base class objects without joins using NHibernate ICriteria?

    - by Kristoffer
    Let's say I have a base class called Pet and two subclasses Cat and Dog that inherit Pet. I simply map these to three tables Pet, Cat and Dog, where the Pet table contains the base class properties and the Cat and Dog tables contain a foreign key to the Pet table and any additional properties specific to a cat or dog. A joined subclass strategy. Now, using NHibernate and ICriteria, how can I get a list of "pure" Pet objects (not cats or dogs, just pets), without making any joins to the other tables?

    Read the article

  • cakephp: Custom Authentication Object authenticate not called

    - by Kristoffer Darj
    The method authenticate in a Custom Authentication Object is never called. Is this a glicth or am I missing something? I don't get anything in the log, I'm just redirected to users/login (or the one I specified) CakeVersion: 2.4.1 <?php //My custom Auth Class //Path: app/Controller/Component/Auth/HashAuthenticate.php App::uses('BaseAuthenticate', 'Controller/Component/Auth'); class HashAuthenticate extends BaseAuthenticate { public function authenticate(CakeRequest $request, CakeResponse $response) { //Seems to not be called CakeLog::write('authenticate'); debug($this); die('gaah'); } } If I add the method getUser() (or unauthenticated() ), those gets called however so at least I know that cake finds the class and so on. It just skips the authenticate-method. The AppController looks like this class AppController extends Controller { public $helpers = array('Html', 'Form', 'Session'); public $components = array('Auth' => array( 'authenticate' => array('Hash'), 'authorize' => array('Controller'), ) ); } I found a similar question here: CakePHP 2.x custom "Authentication adapter &quot;LdapAuthorize&quot; was not found but there the issue was typos.

    Read the article

  • UpdateModel prefix - ASP.NET MVC

    - by Kristoffer Ahl
    I'm having trouble with TryUpdateModel(). My form fields are named with a prefix but I am using - as my separator and not the default dot. <input type="text" id="Record-Title" name="Record-Title" /> When I try to update the model it does not get updated. If i change the name attribute to Record.Title it works perfectly but that is not what I want to do. bool success = TryUpdateModel(record, "Record"); Is it possible to use a custom separator?

    Read the article

  • C# DLL reference changes version and becomes unloadable (Plugin-system)

    - by Kristoffer
    I will try to keep this as simple as possible. I have a rather simple plugin system that has run into a problem. I have 2 assemblies: Host.exe Plugin.dll Plugin.dll references Host.exe (which contains interfaces and classes that Plugin.dll implement and use). At runtime, Host.exe loads Plugin.dll through reflection and this works great. Except when Host.exe updates and gets a new version number. Then I get an error once I try to load Plugin.dll, saying that Host.exe (with the old version number) can't be found. This means I have to rebuild all plugins every time Host.exe changes build number. Anyone got a solution to this?

    Read the article

  • Dynamic Array traversal in PHP

    - by Kristoffer Bohmann
    I want to build a hierarchy from a one-dimensional array and can (almost) do so with a more or less hardcoded code. How can I make the code dynamic? Perhaps with while(isset($array[$key])) { ... }? Or, with an extra function? Like this: $out = my_extra_traverse_function($array,$key); function array_traverse($array,$key=NULL) { $out = (string) $key; $out = $array[$key] . "/" . $out; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" . $out : ""; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" . $out : ""; $key = $array[$key]; $out = $array[$key] ? $array[$key] . "/" . $out : ""; return $out; } $a = Array(102=>101, 103=>102, 105=>107, 109=>105, 111=>109, 104=>111); echo array_traverse($a,104); Output: 107/105/109/111/104

    Read the article

  • Custom SQL function for NHibernate dialect

    - by Kristoffer Ahl
    I want to be able to call a custom function called "recent_date" as part of my HQL. Like this: [Date] >= recent_date() I created a new dialect, inheriting from MsSql2000Dialect and specified the dialect for my configuration. public class NordicMsSql2000Dialect : MsSql2000Dialect { public NordicMsSql2000Dialect() { RegisterFunction( "recent_date", new SQLFunctionTemplate( NHibernateUtil.Date, "dateadd(day, -15, getdate())" ) ); } } var configuration = Fluently.Configure() .Database( MsSqlConfiguration.MsSql2000 .ConnectionString(c => .... ) .Cache(c => c.UseQueryCache().ProviderClass<HashtableCacheProvider>()) .Dialect<NordicMsSql2000Dialect>() ) .Mappings(m => ....) .BuildConfiguration(); When calling recent_date() I get the following error: System.Data.SqlClient.SqlException: 'recent_date' is not a recognized function name I'm using it in a where statement for a HasMany-mapping like below. HasMany(x => x.RecentValues) .Access.CamelCaseField(Prefix.Underscore) .Cascade.SaveUpdate() .Where("Date >= recent_date()"); What am I missing here?

    Read the article

  • Fluent many-to-many: Deleting one end does not remove the entry in the relation table

    - by Kristoffer
    I have two classes (Parent, Child) that have a many-to-many relationship that only one end (Parent) knows about. My problem is that when I delete a "relation unaware" object (Child), the record in the many-to-many table is left. I want the relationship to be removed regardless of which end of it is deleted. How can I do that with Fluent NHibernate mappings, without adding a Parent property on Child? The classes: public class Parent { public Guid Id { get; set; } public IList<Child> Children { get; set; } } public class Child { public Guid Id { get; set; } // Don't want the property below: // public Parent Parent { get; set; } }

    Read the article

  • Is it possible to run javascript with other target?

    - by Kristoffer Nolgren
    I have a facebook app that I authenticate using a general-purpose authentification. Like this: // Fixar oAuth jso_configure({ "facebook": { client_id: "393963983989013", redirect_uri: "http://resihop.herokuapp.com/", authorization: "https://www.facebook.com/dialog/oauth", presenttoken: "qs" } }); // Make sure that you have jso_ensureTokens({ "facebook": [""] }); // This dumps all cached tokens to console, for easyer debugging. //jso_dump(); jso_ensureTokens({ "facebook": [""] }); It's tirggered on document.ready. Because it's a facebook app I can't run the authentification in the iFrame. Facebook denies this using X-Frame-Options. The solution, if you authenticate with a link is to use target="_top". How do i Achieve the same effect in javascript? Maybe I need to edit one of the funcitons (though ideally not, as they are part of a library) in that case please point me in the right direction.

    Read the article

  • MetadataType and client validation in ASP.NET MVC 2

    - by Kristoffer Ahl
    Inherited properties and MetadataType does not seem to work with client side validation in ASP.NET MVC 2. The validation of our MetadataTypes work as expected on the server but for some reason it does not generate the appropriate client scripts for it. Client side validation kicks in as expected for properties with the DataAnnotations attributes set on the PersonView so I know that client side validation is active and that it works. Does anyone know if or how it can be fixed? Here's what we have: public abstract class PersonView { public string FirstName { get; set; } public string LastName { get; set; } public string Email { get; set; } [Required] public string PhoneNumber { get; set; } public string AddressLine1 { get; set; } public string AddressLine2 { get; set; } public string AddressZipCode { get; set; } public string AddressCity { get; set; } public string AddressCountry { get; set; } } [MetadataType(typeof(CustomerViewMetaData))] public class CustomerView : PersonView {} [MetadataType(typeof(GuestViewMetaData))] public class GuestView : PersonView {} public class GuestViewMetaData { [Required(ErrorMessage = "The guests firstname is required")] public string FirstName { get; set; } [Required(ErrorMessage = "The guests lastname is required")] public string LastName { get; set; } } public class CustomerViewMetaData { [Required(ErrorMessage = "The customers firstname is required")] public string FirstName { get; set; } [Required(ErrorMessage = "The customers lastname is required")] public string LastName { get; set; } [Required(ErrorMessage = "The customers emails is required")] public string Email { get; set; } } As you can see, it's nothing fancy or strange in there... Can it be fixed? Is it a bug in ASP.NET MVC 2?

    Read the article

  • Error when passing data between views

    - by Kristoffer Bilek
    I'm using a plist (array of dictionaries) to populate a tableview. Now, when a cell i pressed, I want to pass the reprecented dictionary to the detail view with a segue. It's working properly to fill the tableview, but how do I send the same value to the detail view? This is my try: #import "WinesViewController.h" #import "WineObject.h" #import "WineCell.h" #import "WinesDetailViewController.h" @interface WinesViewController () @end @implementation WinesViewController - (id)initWithStyle:(UITableViewStyle)style { self = [super initWithStyle:style]; if (self) { // Custom initialization } return self; } - (void)viewDidLoad { [super viewDidLoad]; } - (void)viewDidUnload { [super viewDidUnload]; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } #pragma mark - Table view data source - (void)viewWillAppear:(BOOL)animated { wine = [[WineObject alloc] initWithLibraryName:@"Wine"]; self.title = @"Vinene"; [self.tableView deselectRowAtIndexPath:[self.tableView indexPathForSelectedRow] animated:YES]; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [wine libraryCount]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"wineCell"; WineCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell... cell.nameLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Name"]; cell.districtLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"District"]; cell.countryLabel.text = [[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Country"]; cell.bottleImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Image"]]; cell.flagImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Flag"]]; cell.fyldeImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Fylde"]]; cell.friskhetImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Friskhet"]]; cell.garvesyreImageView.image = [UIImage imageNamed:[[wine libraryItemAtIndex:indexPath.row] valueForKey:@"Garvesyre"]]; return cell; } #pragma mark - Table view delegate - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([[segue identifier] isEqualToString:@"DetailSegue"]) { NSIndexPath *selectedRowIndex = [self.tableView indexPathForSelectedRow]; WinesDetailViewController *winesdetailViewController = [segue destinationViewController]; //Here comes the error line: winesdetailViewController.winedetailName = [wine objectAtIndex:indexPath.row] valueForKey:@"Name"]; } } I get one error for: winesdetailViewController.winedetailName = [wine objectAtIndex:indexPath.row] valueForKey:@"Name"]; Use of undeclaired identifier: indexPath. did you mean NSIndexPath? I think I've missed something important here..

    Read the article

  • $("body").scrollTop() doesn't update in safari

    - by Kristoffer Nolgren
    I'm working on a website: http://beta.projektopia.se/ the body has several background-images that are updated on scroll like this: $(document).ready(function(){ $(document).scroll(function(){ var scrollfactor=$("body").scrollTop()*0.2; var centerscrollpos =scrollfactor+613; var docheight = $(document).height(); var windowheight = $(window).height(); var bottompos = (docheight-980)-((docheight-windowheight)*0.2)+scrollfactor; var scrollpos = 'center '+scrollfactor+'px,center '+bottompos+'px, center '+ centerscrollpos+'px,center 0px'; $("body").css("background-position", scrollpos); }); }); Lots of calculations, but the important thing is that a scrollpos is created that should change the position of the background when you scroll, to create a parallax-effect. It works great in chrome, but in firefox, the variable scrollfactor, that is suppose to get the current scroll-position, doesn't update. ps, some people have this issue due to lack of correct doctype. I believe i have declared it correctly like this: <!DOCTYPE html>

    Read the article

  • Asynchronously get user data in facebook tab?

    - by Kristoffer Nolgren
    Using the php sdk, I check if a user inside a tab likes the corresponding page. If i put the following code inside index.php and use that page as my page-tab-url, <?php require_once("facebook/facebook.php"); // Create our application instance // (replace this with your appId and secret). $facebook = new Facebook(array( 'appId' => '1399475990283166', 'secret' => 'mysercret', 'cookie' => true )); $signed_request = $facebook->getSignedRequest(); echo $signed_request['page']['liked']; ?> it outputs '1'. I would like to achieve this asynchronously instead, so I put the php in a separate file and try to access it using ajax instead $http.post('/facebook/likes.php'). success(function(data){ console.log(data); }).error(function(data){ console.log(data); } ); This sample is using angular, but what javascript library i'm using probably doesn't matter. When I access the info with javascript Facebook doesn't seem to get the info that I liked the page. Adding a print_r($facebook); on the page I'm retreiving the same values as if i'm not in a facebook-tab: ( [sharedSessionID:protected] => [appId:protected] => 1399475990283166 [appSecret:protected] => 679fb0ab947c2b98e818f9240bc793da [user:protected] => [signedRequest:protected] => [state:protected] => [accessToken:protected] => [fileUploadSupport:protected] => [trustForwarded:protected] => ) Can I access theese values asynchronosly somehow?

    Read the article

  • C++ const-reference semantics?

    - by Kristoffer
    Consider the sample application below. It demonstrates what I would call a flawed class design. #include <iostream> using namespace std; struct B { B() : m_value(1) {} long m_value; }; struct A { const B& GetB() const { return m_B; } void Foo(const B &b) { // assert(this != &b); m_B.m_value += b.m_value; m_B.m_value += b.m_value; } protected: B m_B; }; int main(int argc, char* argv[]) { A a; cout << "Original value: " << a.GetB().m_value << endl; cout << "Expected value: 3" << endl; a.Foo(a.GetB()); cout << "Actual value: " << a.GetB().m_value << endl; return 0; } Output: Original value: 1 Expected value: 3 Actual value: 4 Obviously, the programmer is fooled by the constness of b. By mistake b points to this, which yields the undesired behavior. My question: What const-rules should you follow when designing getters/setters? My suggestion: Never return a reference to a member variable if it can be set by reference through a member function. Hence, either return by value or pass parameters by value. (Modern compilers will optimize away the extra copy anyway.)

    Read the article

  • How Are Businesses Advancing with the Experience Revolution?

    - by Charles Knapp
    Businesses worldwide are operating in a new era. Customers are taking charge of their relationships with brands, and the customer experience has become the most important differentiator and driver of business value. Where is the experience heading? And how can businesses take advantage of the customer experience revolution? Find out from the experts at a one-of-a-kind event: the Oracle Customer Experience Summit at Oracle OpenWorld, San Francisco, October 3-5. Our featured speakers are global visionaries including Seth Godin, George Kembel from the Stanford d:School, Bruce Temkin, Kerry Bodine and Paul Hagen from Forrester, and Gene Alvarez from Gartner. Featured industry leaders will include speakers from Athene Group, Bazaarvoice, Comcast, Consortium of Service Innovation, Haworth, Intuit, KPN, Marriott, Nikon, Quicksilver, Royal Caribbean, SapientNitro, Southwest, Stryker, Stuart Concannon, and Twilio. Featured speakers from Oracle will include Oracle President Mark Hurd, Anthony Lye, David Vap, Brian Curran, John Kembel, and Matthew Banks. So, please join us at the Customer Experience Summit at the Oracle OpenWorld Conference.

    Read the article

  • Network.downloadfile is very slow

    - by user324067
    I have tried using the My.Computer.Network.DownloadFile method but unfortunately it is slow. Executing the simple command below takes ~5-10 secs, which I would say is a lot longer than expected for downloading a 9 kb file. `My.Computer.Network.DownloadFile("http://www.google.dk", "j:\temp\test.html")` I am connecting via a high-speed connection (10GB) from a Win7 machine. Do anyone know of any explanations for this behavior? Hope that you can help me out with this. Kristoffer

    Read the article

  • Applet networking patterns

    - by Kristoffersen
    Hi SO. I have an applet that connects to a server, it receives some commands and based on that it haves to draw (or move) different things. Which patterns should I use? I assume that the network connection and applet should run in two different threads? Thanks, Kristoffer

    Read the article

  • Purple Cows, Copernicus, and Shampoo – Lessons in Customer Experience

    - by Christina McKeon
    What makes a great customer experience? And, why should you or your organization care? These are the questions that set the stage for the Oracle Customer Experience Summit, which kicked off yesterday in San Francisco. Day 1: The first day was filled with demos and insights from customer experience experts and Oracle customers sharing what it takes to deliver great customer experiences. Author Seth Godin delivered an entertaining presentation that included an in-depth exploration of the always-connected, always-sharing experience revolution that we are witnessing and yes, talked about the purple cow. It turns out that customer experience is your way to be the purple cow. Before everyone headed out to see Pearl Jam and Kings of Leon at the Oracle customer appreciation event, the day wrapped up with a discussion around building a customer-centric culture. Where do you start? Whom does it involve? What are some pitfalls to avoid? Day 2: The second day addressed the details behind all the questions brought up at the end of Day 1. Before you start on a customer experience initiative, Paul Hagen noted that you must understand you will forge a path similar to Copernicus. You will be proposing ideas and approaches that challenge current thinking in your organization. Just as Copernicus' heliocentric theory started a scientific revolution, your customer-centric efforts will start an experience revolution. If you think customer experience is like a traditional marketing approach, think again. It’s not about controlling your customers and leading them where you want them to go. It might sound like heresy to some, but your customers are already in control, whether or not your company realizes and acknowledges it. And, to survive and thrive, you'll have to focus on customers by thinking outside-in and working towards a brand that is better and more authentic. We learned how Vail Resorts takes this customer-centric approach. Employees must experience the mountain themselves and understand the experience from the guest’s standpoint. This has created a culture where employees do things for guests that are not expected. We also learned a valuable lesson in designing and innovating customer-centered experiences from Kerry Bodine. First you make the thing, and then you make the thing right. In this case, the thing is customer experience. Getting customer experience right means iterative prototyping and testing of your ideas. This is where shampoo comes in—think lather, rinse, repeat. Be prepared to keep repeating until the customer experience is right. Many of these sessions will be posted to YouTube in the coming weeks so be sure to subscribe to our CX channel.

    Read the article

  • What You Can Learn from the NFL Referee Lockout

    - by Christina McKeon
    American football is a lot like religion. The fans are devoted followers that take brand loyalty to a whole new level. These fans that worship their teams each week showed that they are powerful customers whose voice has an impact. Yesterday, these fans proved that their opinion could force the hand of a large and powerful institution. With a three-month NFL referee lockout that seemed like it was nowhere close to resolution, the Green Bay Packers and the Seattle Seahawks competed last Monday night. For those of you that might have been out of the news cycle the past few days, Green Bay lost the game due to a controversial call that many experts and analysts agree should have resulted in Green Bay winning the game. Outrage ensued. The NFL had pulled replacement referees from the high school ranks, and these replacements did not have the knowledge and experience to handle high intensity NFL games. Fans protested about their customer experience. Their anger-filled rants were heard in social media, in the headlines of newspapers, on radio, and on national TV. Suddenly, the NFL was moved to reach an agreement with the referees. That agreement was reached late in the night on Wednesday with many believing that the referees had the upper hand forcing the owners into submission. Some might argue that the referees benefited, not the fans. Since the fans wanted qualified and competent referees, I would say the fans did benefit. The referees are scheduled to return to the field this Sunday, so the fans got what they wanted. What can you learn from this negative customer experience? Customers are in control. NFL owners thought they were controlling this situation with the upper hand over referees. The owners figured out they weren’t in control when their fans reacted negatively. Customers can make or break you more now than ever before, which is why it is more important to connect with them, engage them in a personal manner, and create rewarding relationships. Protect your brand. Whether knowingly or unknowingly, the NFL put their brand and each team’s brand at risk with replacement referees. Think about each business decision you make, and how it may impact your brand at different points in time. A decision that results in a gain today could result in a larger loss down the road. Customer experience matters. The NFL likely foresaw declining revenues in ticket sales, merchandising, advertising, and other areas if the lockout continued. While fans primarily spoke with their minds in the days following the Green Bay debacle, their wallets would be the next things to speak. Customer experience directly affects your success and is one of the few areas where you can differentiate your business. What would you do if your brand got such negative attention? Would you be prepared to navigate such stormy waters? Would you be able to prevent such a fiasco? If you don’t have a good answer to these questions, consider joining us October 3-5, 2012 at the Oracle Customer Experience Summit in San Francisco. You’ll have the opportunity to learn even more about customer experience from industry experts such as best-selling author Seth Godin, Paul Hagen and Kerry Bodine from Forrester Research, Inc., George Kembel from the Stanford d.School, Bruce Temkin of The Temkin Group, and Gene Alvarez from Gartner Inc.. There will also be plenty of your peers and customer experience experts available for networking and discussions.

    Read the article

< Previous Page | 1 2