Search Results

Search found 122 results on 5 pages for 'niels kristian'.

Page 3/5 | < Previous Page | 1 2 3 4 5  | Next Page >

  • Embedded pdf object steals focus and will not let it go

    - by Kristian Hebert
    Hi guys, I was given the task of adding some usability to one of our applications, ie. make sure that every controll has a shortcut key, and that they can be reached by "tabbing" through the page. The gui runs in a IE. control on a winform, and consists of asp.net pages, so basically it is just asp.net always running in internet explorer. My problem is that one of the pages has an embeded pdf in it, like so: <object tabindex="-1" height="273" width="663" visible="false" type="Application/pdf" data="showpdf.ashx#navpanes=0"></object> showpdf.ashx is an httphandler, that streams the pdf contents to the response. It does not handle focus in any way. Now when I run this page, the pdf application steals focus, no matter what I do to set it to another control. And when it takes focus, I cannot take it back with the keyboard. Only a mouseclick on the page will set it to another control. I have tried to set focus in code behind OnPreRender, or in jevescript, but no luck. It seems that the http handler always runs after all the other code, and it sets focus on the pdf object. Any thought would be greatly appreciated.

    Read the article

  • Chaining multiple MapReduce jobs in Hadoop.

    - by Niels Basjes
    In many real-life situations where you apply MapReduce, the final algorithms end up being several MapReduce steps. I.e. Map1 , Reduce1 , Map2 , Reduce2 , etc. So you have the output from the last reduce that is needed as the input for the next map. The intermediate data is something you (in general) do not want to keep once the pipeline has been successfully completed. Also because this intermediate data is in general some data structure (like a 'map' or a 'set') you don't want to put too much effort in writing and reading these key-value pairs. What is the recommended way of doing that in Hadoop? Is there a (simple) example that shows how to handle this intermediate data in the correct way, including the cleanup afterward? Thanks.

    Read the article

  • How do I use DomainContext.Load in my ViewModel?

    - by kristian
    I'm trying to use RIA services to provide data to my Silverlight application by calling DomainContext.Load to retrieve a collection of widgets. I want to expose this collection through a property of the ViewModel so I can bind a control to the collection in my page. I think my approach must be fundamentally wrong because Load is called asynchronously and is therefore not available when my page loads and the control tried to bind. Can someone please show me the right way to do this? My Silverlight page has the following XAML: <navigation:Page x:Class="Demo.UI.Pages.WidgetPage" // the usual xmlns stuff here... xmlns:local="clr-namespace:Demo.UI.Pages" mc:Ignorable="d" xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" d:DataContext="{d:DesignInstance Type=local:WidgetPageModel, IsDesignTimeCreatable=False}" d:DesignWidth="640" d:DesignHeight="480" Title="Widget Page"> <Canvas x:Name="LayoutRoot"> <ListBox ItemsSource="{Binding RedWidgets}" Width="150" Height="500" /> </Canvas> </navigation:Page> My ViewModel looks like this: public class WidgetPageModel { private WidgetDomainContext WidgetContext { get; set; } public WidgetPageModel() { this.WidgetContext = new WidgetDomainContext(); WidgetContext.Load(WidgetContext.GetAllWidgetsQuery(), false); } public IEnumerable<Widget> RedWidgets { get { return this.WidgetContext.Widgets.Where(w => w.Colour == "Red"); } } }

    Read the article

  • Display weekday in textbox or label using date from textbox

    - by Niels Schultz
    I have a textbox with calendar extender and a label <label for="<%= tbxFrom.ClientID %>"> From</label> <asp:Label ID="lblWeekDayFrom" runat="server"></asp:Label> <asp:TextBox ID="tbxFrom" runat="server" CssClass="Calendar"></asp:TextBox> <cc1:CalendarExtender ID="extTbxFrom" runat="server" TargetControlID="tbxStartTag"> </cc1:CalendarExtender> and now I would like to show the weekday of the currently selected date, either using a formatting inside the textbox like Th 05/20/2010 or showing the weekday as string using the label on the left side of the texbox (lblWeekDayFrom). There is a calendarExtender to select the date, but I would also like to be able to have the users enter the date manually. I tried to use JQuery to capture changes, but the label is not showing anything, and it triggers the RequiredFieldValidator on every initial page load. $(document).ready(function() { $('#<%= tbxFrom.ClientID %>').change(updateDate($('#<%= tbxFrom.ClientID %>').val())) } ); function updateDate(date) { $('#<%= lblWeekDayFrom.ClientID %>').val(date); }

    Read the article

  • Spree how to use Hooks

    - by kristian nissen
    According to http://spreecommerce.com/documentation/theming.html#hooks you should be able to use spree hooks using my_theme_hooks.rb but how? Do I need to extend a class and where can I check which hooks are used in the default theme?

    Read the article

  • Show models.ManyToManyField as inline, with the same form as models.ForeignKey inline

    - by Kristian
    I have a model similar to the following (simplified): models.py class Sample(models.Model): name=models.CharField(max_length=200) class Action(models.Model): samples=models.ManyToManyField(Sample) title=models.CharField(max_length=200) description=models.TextField() Now, if Action.samples would have been a ForeignKey instead of a ManyToManyField, when I display Action as a TabularInline in Sample in the Django Admin, I would get a number of rows, each containing a nice form to edit or add another Action. However; when I display the above as an inline using the following: class ActionInline(admin.TabularInline): model=Action.samples.through I get a select box listing all available actions, and not a nifty form to create a new Action. My question is really: How do I display the ManyToMany relation as an inline with a form to input information as described? In principle it should be possible since, from the Sample's point of view, the situation is identical in both cases; Each Sample has a list of Actions regardless if the relation is a ForeignKey or a ManyToManyRelation. Also; Through the Sample admin page, I never want to choose from existing Actions, only create new or edit old ones.

    Read the article

  • ASP.NET FormsAuthentication Cookie Problem

    - by Niels Bosma
    We use FormAuthentication to manage logins and I have a case where a customer complains where he can login from one computer but to from another. I can see in my logs that his authentican is successfull but he gets bumped back to the login page. I can reproduce the symptons by disabling cookies so I asked the customer to test if cookies are enabled on http://www.tempesttech.com/cookies/cookietest1.asp, but this came out positive. What have I missed? Is there any antivirus/security software that can mess up (ASP.NET) cookies? The user is using IE7 and claims to have F-secure installed.

    Read the article

  • Review my ASP.NET Authentication code.

    - by Niels Bosma
    I have had some problems with authentication in ASP.NET. I'm not used most of the built in authentication in .NET. I gotten some complaints from users using Internet Explorer (any version - may affect other browsers as well) that the login process proceeds but when redirected they aren't authenticated and are bounced back to loginpage (pages that require authentication check if logged in and if not redirect back to loginpage). Can this be a cookie problem? Do I need to check if cookies are enabled by the user? What's the best way to build authentication if you have a custom member table and don't want to use ASP.NET login controls? Here my current code: using System; using System.Linq; using MyCompany; using System.Web; using System.Web.Security; using MyCompany.DAL; using MyCompany.Globalization; using MyCompany.DAL.Logs; using MyCompany.Logging; namespace MyCompany { public class Auth { public class AuthException : Exception { public int StatusCode = 0; public AuthException(string message, int statusCode) : base(message) { StatusCode = statusCode; } } public class EmptyEmailException : AuthException { public EmptyEmailException() : base(Language.RES_ERROR_LOGIN_CLIENT_EMPTY_EMAIL, 6) { } } public class EmptyPasswordException : AuthException { public EmptyPasswordException() : base(Language.RES_ERROR_LOGIN_CLIENT_EMPTY_PASSWORD, 7) { } } public class WrongEmailException : AuthException { public WrongEmailException() : base(Language.RES_ERROR_LOGIN_CLIENT_WRONG_EMAIL, 2) { } } public class WrongPasswordException : AuthException { public WrongPasswordException() : base(Language.RES_ERROR_LOGIN_CLIENT_WRONG_PASSWORD, 3) { } } public class InactiveAccountException : AuthException { public InactiveAccountException() : base(Language.RES_ERROR_LOGIN_CLIENT_INACTIVE_ACCOUNT, 5) { } } public class EmailNotValidatedException : AuthException { public EmailNotValidatedException() : base(Language.RES_ERROR_LOGIN_CLIENT_EMAIL_NOT_VALIDATED, 4) { } } private readonly string CLIENT_KEY = "9A751E0D-816F-4A92-9185-559D38661F77"; private readonly string CLIENT_USER_KEY = "0CE2F700-1375-4B0F-8400-06A01CED2658"; public Client Client { get { if(!IsAuthenticated) return null; if(HttpContext.Current.Items[CLIENT_KEY]==null) { HttpContext.Current.Items[CLIENT_KEY] = ClientMethods.Get<Client>((Guid)ClientId); } return (Client)HttpContext.Current.Items[CLIENT_KEY]; } } public ClientUser ClientUser { get { if (!IsAuthenticated) return null; if (HttpContext.Current.Items[CLIENT_USER_KEY] == null) { HttpContext.Current.Items[CLIENT_USER_KEY] = ClientUserMethods.GetByClientId((Guid)ClientId); } return (ClientUser)HttpContext.Current.Items[CLIENT_USER_KEY]; } } public Boolean IsAuthenticated { get; set; } public Guid? ClientId { get { if (!IsAuthenticated) return null; return (Guid)HttpContext.Current.Session["ClientId"]; } } public Guid? ClientUserId { get { if (!IsAuthenticated) return null; return ClientUser.Id; } } public int ClientTypeId { get { if (!IsAuthenticated) return 0; return Client.ClientTypeId; } } public Auth() { if (HttpContext.Current.User.Identity.IsAuthenticated) { IsAuthenticated = true; } } public void RequireClientOfType(params int[] types) { if (!(IsAuthenticated && types.Contains(ClientTypeId))) { HttpContext.Current.Response.Redirect((new UrlFactory(false)).GetHomeUrl(), true); } } public void Logout() { Logout(true); } public void Logout(Boolean redirect) { FormsAuthentication.SignOut(); IsAuthenticated = false; HttpContext.Current.Session["ClientId"] = null; HttpContext.Current.Items[CLIENT_KEY] = null; HttpContext.Current.Items[CLIENT_USER_KEY] = null; if(redirect) HttpContext.Current.Response.Redirect((new UrlFactory(false)).GetHomeUrl(), true); } public void Login(string email, string password, bool autoLogin) { Logout(false); email = email.Trim().ToLower(); password = password.Trim(); int status = 1; LoginAttemptLog log = new LoginAttemptLog { AutoLogin = autoLogin, Email = email, Password = password }; try { if (string.IsNullOrEmpty(email)) throw new EmptyEmailException(); if (string.IsNullOrEmpty(password)) throw new EmptyPasswordException(); ClientUser clientUser = ClientUserMethods.GetByEmailExcludingProspects(email); if (clientUser == null) throw new WrongEmailException(); if (!clientUser.Password.Equals(password)) throw new WrongPasswordException(); Client client = clientUser.Client; if (!(bool)client.PreRegCheck) throw new EmailNotValidatedException(); if (!(bool)client.Active || client.DeleteFlag.Equals("y")) throw new InactiveAccountException(); FormsAuthentication.SetAuthCookie(client.Id.ToString(), true); HttpContext.Current.Session["ClientId"] = client.Id; log.KeyId = client.Id; log.KeyEntityId = ClientMethods.GetEntityId(client.ClientTypeId); } catch (AuthException ax) { status = ax.StatusCode; log.Success = status == 1; log.Status = status; } finally { LogRecorder.Record(log); } } } }

    Read the article

  • Problem with ASP.NET Authentication

    - by Niels Bosma
    I'm having problem with our login procedure. Some customers complain that they can't login. I can see in our logs that their login is successful and that they are redirected from the login page to the member area. But there somehow the login isn't detected and they are bounced back to the login page. I've asked customers to check if cookies are supported (http://www.html-kit.com/tools/cookietester/) but problem remains even if this test returns true. This is how I've implemented the login procedure (simplyfied): protected void Login(string email, string password) { FormsAuthentication.SignOut(); Guid clientId = /* Validate login by checking email and password, if fails display error otherwise get client id */ FormsAuthentication.SetAuthCookie(clientId.ToString(), true); HttpContext.Current.Response.Redirect("~/Members.aspx"); } On the member page I check for authentication by in Page_Load function: public static void IsAuthenticated() { if (!HttpContext.Current.User.Identity.IsAuthenticated) { HttpContext.Current.Response.Redirect("~/Login.aspx", true); } } Maybe I'm using FormsAuthentication completely wrong? I've asked this before but still haven't been able to figure this out, I'd appreciate any help.

    Read the article

  • sproutcore - todos tutorial, addbutton not responding in firefox

    - by kristian nissen
    I'm testing the sproutcore todo's tutorial and I have checked the code in step-5 and it's identical to my code at least as far as I can see, but the addButton is not responding to click events. addTask: function () { var task; task = Sinatra.store.createRecord(Sinatra.Task, { 'description': 'New Task', 'isDone': false, 'priority': 1 }); this.selectObject(task); this.invokeLater(function () { var contentIndex = this.indexOf(task); var list = Sinatra.mainPage.getPath('mainPane.middleView.contentView') var listItem = list.itemViewForContentIndex(contentIndex); listItem.beginEditing(); }); return YES; and in the main: addButton: SC.ButtonView.design({ layout: { centerY: 0, height: 24, right: 12, width: 100 }, title: 'Add Task', target: 'Sinatra.tasksController', action: 'addTask' }), I can't see the problem, please help. (I have only tested this in firefox on kubuntu)

    Read the article

  • Getting the median of 3 values using scheme's

    - by kristian Roger
    The problem this time is to get the median of three values (easy) I did this: (define (med x y z) (car(cdr(x y z))) and it was accepted but when testing it: (med 3 4 5) I get this error: Error: attempt to call a non-procedure (2 3 4) And when entering letters instead of number i get: (md x y z) Error: undefined varia y (package user) Using something besides x y z I get: (md d l m) Error: undefined variable d (package user) the question was deleted dont know how anyway write a function that return the median of 3 values Sorry for editing the question I got that I should put the values in order first not just a sill car and cdr thing so I did so 33> (define (med x y z) (if(and( (<x y) (<y z) y if(and( (<y x) (<x z) x z))))) Warning: invalid expression (if (and< (<x y) (<y z) y if (and ((<y x) (<x z) x z)))) but as u see Im getting a warning so what is wronge ?

    Read the article

  • Drupal 6 node_view empty

    - by kristian nissen
    I'm trying to produce a page with a list of specific nodes but the node_view returns an empty string. This is my query: function events_upcoming() { $output = ''; $has_events = false; $res = pager_query(db_rewrite_sql("SELECT n.nid, n.created FROM {node} n WHERE n.type = 'events' AND n.status = 1 ORDER BY n.sticky DESC, n.created DESC"), variable_get('default_nodes_main', 10)); while ($n = db_fetch_object($res)) { $output .= node_view(node_load($n->nid), 1); $has_events = true; } if ($has_events) { $output .= theme('pager', NULL, variable_get('default_nodes_main', 10)); } return $output; } hook_menu (part of): 'events/upcoming' => array( 'title' => t('Upcoming Events'), 'page callback' => 'events_upcoming', 'access arguments' => array('access content'), 'type' => MENU_SUGGESTED_ITEM ), the implementation of hook_view: function events_view($node, $teaser = false, $page = false) { $node = node_prepare($node, $teaser); if ($page) { // TODO: Handle breadcrump } return $node; } now, if I add a var_dump($node) inside events_view the node is present and I can see the values I want, and if I add a var_dump inside while loop in events_upcoming I also get a node id from the query. the strange thing is, when I load localhost/events/upcoming I see the pager and nothing else. I have used the blog.module as a reference, but what am I missing here?

    Read the article

  • Splitting input into substrings in PIG (Hadoop)

    - by Niels Basjes
    Assume I have the following input in Pig: some And I would like to convert that into: s so som some I've not (yet) found a way to iterate over a chararray in pig latin. I have found the TOKENIZE function but that splits on word boundries. So can "pig latin" do this or is this something that requires a Java class to do that?

    Read the article

  • Which Hadoop API should I use?

    - by Niels Basjes
    In the latest Hadoop Studio the 0.18 API of Hadoop is called "Stable" and the 0.20 API of Hadoop is called "Unstable". Now given the fact that we'll start coding a new Hadoop project in the next few weeks; which API should we use and which Hadoop distribution (Apache, Cloudera, Yahoo, ...) should we use? Thanks for your insights.

    Read the article

  • http_post_data basic authentication?

    - by kristian nissen
    I have a remote service that I need to access, according to the documentation it's restricted using basic authentication and all requests have to be posted (HTTP POST). The documentation contains this code example - VB script: Private Function SendRequest(ByVal Url, ByVal Username, ByVal Password, ByVal Request) Dim XmlHttp Set XmlHttp = CreateObject("MSXML2.XmlHttp") XmlHttp.Open "POST", Url, False, Username, Password XmlHttp.SetRequestHeader "Content-Type", "text/xml" XmlHttp.Send Request Set SendRequest = XmlHttp End Function how can I accomplish this in PHP? When I post data to the remote server it replies: 401 Unauthorized Access which is fine because I'm not posting my user/pass just the data. Bu when I add my user/pass as it's describe here: http://dk.php.net/manual/en/http.request.options.php like this: $res = http_post_data('https://example.com', $data, array( 'Content-Type: "text/xml"', 'httpauth' => base64_encode('user:pass'), 'httpauthtype' => HTTP_AUTH_BASIC ) ); the protocol is https - I get a runtime error in return (it's a .Net service). I have tried it without the base64_encode but with the same result.

    Read the article

  • ASP.NET:Paging when deleting rows

    - by Niels Bosma
    I have a datagrid where a row can be deleted (using ajax). I'm have problem with the pager in the following scenario: Lets say my PageSize is 10, I have 101 rows so that's 11 pages with the last page with an single element. Let no assume that I'm on page 10 (PageIndex=9) and delete a row. Then I go to the 11'th page (who's now empty and doesn't really exist). ASP now shows me the EmptyDataTemplate and no pager so I can't go back. My approach (which isn't working) is to detect this scenario and step one page back: public void Bind() { gridMain.DataBind(); } public void SetPage(int page) { gridMain.PageIndex = page; gridMain.DataBind(); } protected void ldsGridMain_Selecting(object sender, LinqDataSourceSelectEventArgs e) { selectArgs = e; e.Result = (new EnquiryListController()).GetEnquiryList(OnBind(this), supplier); } protected void ldsGridMain_Selected(object sender, LinqDataSourceStatusEventArgs e) { totalRows = selectArgs.Arguments.TotalRowCount; //Detect if we need to update the page: if (gridMain.PageIndex > 0 && (gridMain.PageSize * gridMain.PageIndex + 1) > totalRows) SetPage(gridMain.PageIndex - 1); } protected void gridMain_PageIndexChanging(object sender, GridViewPageEventArgs e) { SetPage(e.NewPageIndex); } I can see that SetPage is called with the the right page index, but the databind doesn't seem to called as I still get the EmptyDataTemplate.

    Read the article

  • Rails shoulda and factory_girl setup

    - by kristian nissen
    I have installed both shoulda and factory_girl, I can run shoulda just fine, but when I add this: require 'factory_girl' Factory.define :user do |u| u.mail '[email protected]' u.pass 'secret' end to my test/test_helper.rb I'm getting this error: /test/test_helper.rb:1:in `require': no such file to load -- factory_girl (LoadError) when I execute rake test:units I have installed both gems using: sudo gem install thoughtbot-shoulda --source=http://gems.github.com sudo gem install thoughtbot-factory_girl --source=http://gems.github.com and can see both of them being installed fine. And by the way, this works fine as well: script/console Loading development environment (Rails 2.3.8) require 'factory_girl' = [] so requiring the gems seems to be working

    Read the article

  • geting the median of 3 values using sheme car & cdr

    - by kristian Roger
    Hi still stuck with the ugly scheme the problem this time is to get the median of three values (easy) I did all these : (define (med x y z) (car(cdr(x y z))) and it was accepted but when testing it (med 3 4 5) I will get this error Error: attempt to call a non-procedure (2 3 4) and when entering letters inetead of number i got (md x y z) Error: undefined varia y (package user) using somthin else than x y z i got (md d l m) Error: undefined variable d (package user) so what is wronge ?!

    Read the article

  • car and cdr in scheme is driving me crazy ...

    - by kristian Roger
    Hi Im facing a probem with the car and cdr functions for example: first I defined a list caled it x (define x (a (bc) d ( (ef) g ) )) so x now is equal to (a (bc) d ( (ef) g ) now for example I need to get the g from this list using only car and cdr (!! noshortcuts as caddr cddr !!) the correct answer is: (car(cdr(car(cdr(cdr(cdr x)))))) BUT how ? :-( I work according to the rule (the car gives the head of list and cdr gives the tail) and instead of getting the answer above I keep reaching wronge answers can any one help me in understanding this ... give me step or a way to solve it step by step thanx in advance Im really sick of scheme language.

    Read the article

  • Provide me with recources on Greibach & Chomsky Normal Form

    - by kristian Roger
    Hi, first please (bare with me)... :-( Im having a course at University ( Theory of Computation ) at first it was easy and simple BUT then we reach the context free grammer specialy the part where we should convert a grammer to Normal forms (Greibach & Chomsky) the thing that I couldnt understand so as usual I went to google and start searching for tutorials or videos I found many(tutorials not videos) but the problem that in tutorials they always explain things as if Im an expert or aware of every thing ... so can anyone please provide me with docs or links where they explaine the methods step by step ... (Please dont tell me to go back to my instructor because if he is useful I wont be asking your help ) thanx in advance

    Read the article

  • htaccess rewrite rule loads assets twice?

    - by kristian nissen
    I am using these rules: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !\..+$ RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*+)$ /$1/ [L,R] RewriteRule !\.(js|ico|gif|jpg|png|css|html|swf|flv|xml)$ index.php But when I check resources loaded in chrome, I can see that my .css files are loaded twice.

    Read the article

  • car and cdr in Scheme are driving me crazy ...

    - by kristian Roger
    Hi Im facing a problem with the car and cdr functions for example: first I defined a list called it x (define x (a (bc) d ( (ef) g ) )) so x now is equal to (a (bc) d ( (ef) g ) ) now for example I need to get the g from this list using only car and cdr (!! noshortcuts as caddr cddr !!) the correct answer is: (car(cdr(car(cdr(cdr(cdr x)))))) BUT how ? :-( I work according to the rules (the car gives the head of list and cdr gives the tail) and instead of getting the answer above I keep reaching wrong answers. Can any one help me in understanding this ... give me step or a way to solve it step by step Thanks in advance. I'm really sick of Scheme.

    Read the article

< Previous Page | 1 2 3 4 5  | Next Page >