Search Results

Search found 1557 results on 63 pages for 'daniel'.

Page 31/63 | < Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >

  • Using GridSplitter in a Xaml file for both Silverlight and WPF

    - by Daniel Plaisted
    I have a Xaml file which is used in a project which can be built for both Silverlight and WPF. I want to use the GridSplitter control. However, this control is in different Xaml namespaces on Silverlight and desktop WPF. In WPF, the namespace is: http://schemas.microsoft.com/winfx/2006/xaml/presentation On Silverlight, it is: http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk So if the xaml code is <GridSplitter/>, it will work on WPF but not Silverlight, and if the code is <sdk:GridSplitter/>, it will work on Silverlight but not WPF. Is there a way to write this so that it works on both platforms?

    Read the article

  • UIView or UIViewController for custom View

    - by Daniel A. White
    What is the best way to create a custom UIView that I can consume in Interface Builder? Create a custom UIView in Interface Builder and inherit from UIView in a code file, then somehow use it in another UIView ala like a control. (How do I do this?) Create a custom UIView in Interface Builder and have a custom UIViewController wire it up. In my main ViewController, place the new view. Basically, I am trying to create a reusable display view and would like a quick way to change it across all my instances with minimal effort.

    Read the article

  • VB.NET Debug Error

    - by Daniel
    I get this error "Illegal characters in path" for this code: Dim strm As System.IO.FileStream strm = New System.IO.FileStream(filepath, IO.FileMode.Open, IO.FileAccess.Read)

    Read the article

  • Python's subprocess.Popen object hangs gathering child output when child process does not exit

    - by Daniel Miles
    When a process exits abnormally or not at all, I still want to be able to gather what output it may have generated up until that point. The obvious solution to this example code is to kill the child process with an os.kill, but in my real code, the child is hung waiting for NFS and does not respond to a SIGKILL. #!/usr/bin/python import subprocess import os import time import signal import sys child_script = """ #!/bin/bash i=0 while [ 1 ]; do echo "output line $i" i=$(expr $i \+ 1) sleep 1 done """ childFile = open("/tmp/childProc.sh", 'w') childFile.write(child_script) childFile.close() cmd = ["bash", "/tmp/childProc.sh"] finish = time.time() + 3 p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, stdin=subprocess.PIPE) while p.poll() is None: time.sleep(0.05) if finish < time.time(): print "timed out and killed child, collecting what output exists so far" out, err = p.communicate() print "got it" sys.exit(0) In this case, the print statement about timing out appears and the python script never exits or progresses. Does anybody know how I can do this differently and still get output from my child processe

    Read the article

  • Apache RewriteRule: it is possible to 'detect' the first and second parameter?

    - by DaNieL
    Im really really a newbie in regexp and i cant figure out how to do that. My goal is to have the RewriteRule to 'slice' the request url in 3 parts: example.com/foo #should return: index.php?a=foo&b=&c= example.com/foo/bar #should return: index.php?a=foo&b=bar&c= example.com/foo/bar/baz #should return: index.php?a=foo&b=bar&c=baz example.com/foo/bar/baz/bee #should return: index.php?a=foo&b=bar&c=baz/bee example.com/foo/bar/baz/bee/apple #should return: index.php?a=foo&b=bar&c=baz/bee/apple example.com/foo/bar/baz/bee/apple/and/whatever/else/no/limit/in/those/extra/parameters #should return: index.php?a=foo&b=bar&c=baz/bee/apple/and/whatever/else/no/limit/in/those/extra/parameters In short, the first parameter in the url (foo) should be given to a, the second (bar) to b, and the rest of the string in c I wroted this one <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^(([a-z0-9/]))?(([a-z0-9/]+))?(([a-z0-9]+))(.*)$ index.php?a=$1&b=$2&c=$3 [L,QSA] </IfModule> but obviously doesnt work, and i dont even know if what i want is possible. Any suggestion?

    Read the article

  • JSP or .ascx equivalent for Scala?

    - by Daniel Worthington
    I'm working on a small MVC "framework" (it's really very small) in Scala. I'd like to be able to write my view files as Scala code so I can get lots of help from the compiler. Pre-compiling is great, but what I really want is a way to have the servlet container automatically compile certain files (my view files) on request so I don't have to shut down Jetty and compile all my source files at once, then start it up again just to see small changes to my HTML. I do this a lot with .ascx files in .NET (the file will contain just one scriptlet tag with a bunch of C# code inside which writes out markup using an XmlWriter) and I love this workflow. You just make changes and then refresh your browser, but it's still getting compiled! I don't have a lot of experience with Java, but it seems possible to do this with JSP as well. I'm wondering if this sort of thing is possible in Scala. I have looked into building this myself (see more info here: http://www.nabble.com/Compiler-API-td12050645.html) but I would rather use something else if it's out there.

    Read the article

  • Default value for field in Django model

    - by Daniel Garcia
    Suppose I have a model: class SomeModel(models.Model): id = models.AutoField(primary_key=True) a = models.IntegerField(max_length=10) b = models.CharField(max_length=7) Currently I am using the default admin to create/edit objects of this type. How do I set the field 'a' to have the same number as id? (default=???) Other question Suppose I have a model: event_date = models.DateTimeField( null=True) year = models.IntegerField( null=True) month = models.CharField(max_length=50, null=True) day = models.IntegerField( null=True) How can i set the year, month and day fields by default to be the same as event_date field?

    Read the article

  • How to get the stacktrace in a mobile device?

    - by Daniel Moura
    I'm getting a NullPointerException in a Nokia S40. I want to know what is causing this exception. The device shows: NullPointerException java/lang/NullPointerException This error only occurs in the device, running in the emulator the application works fine. I use microlog to debug my application. But the application works fine if the log is enabled. Is there a way to get the stack trace when I get this NullPointerException? I don't need all details like the line number just which method cause this exception. UPDATE: I installed the same application in another Nokia S40 and the same error didn't occur. Nokia 2660 - error Nokia 6131 - no error UPDATE 2: Somehow I find what was causing the NullPointerException. import javax.microedition.lcdui.Canvas; import javax.microedition.lcdui.Graphics; public class OuterClass extends Canvas { private Config config; public OuterClass() { this.config = new Config(); } public void paint(Graphics graphics) { HelperClass helper = new HelperClass(this.config); helper.doStuff(); } public void dispose() { this.config = null; } public class Config implements IConfig { public int getSomething() { // ... } } } public class HelperClass { private IConfig config; public HelperClass(IConfig) { this.config = config; } public doStuff() { config.getSomething(); // Here is thrown NullPointerException } } In some situations a thread is started and call the OuterClass.dispose() before the helper.doStuff() causing the NPE. I think when I enabled the log it made the thread slower and helper.doStuff() was called when I expected it to be called.

    Read the article

  • Selenium RC test - IE gives 403 error on Tomcat app, Tomcat root OK

    - by Ed Daniel
    I'm new to Selenium RC, having previously used Selenium IDE and only run tests in Firefox. I'm trying to get a basic test to run using Selenium RC through Eclipse; my test works OK in Firefox, and in Safari now that I've killed the pop-up blocker, but IE8 is causing a SeleniumException to be thrown, containing an "XHR ERROR" with a 403 response: com.thoughtworks.selenium.SeleniumException: XHR ERROR: URL = http://localhost:8080/pims Response_Code = 403 Error_Message = Forbidden at com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97) at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:91) at com.thoughtworks.selenium.DefaultSelenium.open(DefaultSelenium.java:335) at org.pimslims.seleniumtest.FirstTest.testNew(FirstTest.java:32) ... I can do a similar test on http:/ /localhost:8080 (space between the slashes here because SO thinks I'm spamming) and it's fine - I can make IE open that Tomcat default page and click a link. It's only if I try to open my application at http:/ /localhost:8080/pims that I see this error - and only in IE. I can open that URL in IE by typing it into the address bar. I was convinced that there's some setting in IE that's causing this, but I've tried everything I can think of. http:/ /localhost:8080 is in my Trusted Sites, and I've turned the security for that zone down to the minimum, allowed anything that looks related to popups, etc. If I try adding http:/ /localhost:8080/pims/ to Trusted Sites, IE says it's already there. I've also messed around with proxy settings, to no avail, but may have missed something obvious. I've tried starting the test with *iexplore, *iehta, and *iexploreproxy - all behave the same. Is there something I've missed? For reference, here is my test case - this works as is, in Firefox, opening the PIMS application's index page and clicking a link: public class FirstTest extends SeleneseTestCase { @Override public void setUp() throws Exception { this.setUp("http://localhost:8080/", "*firefox"); } public void testNew() throws Exception { final Selenium s = this.selenium; s.open("/pims"); s.click("logInOutLink"); s.waitForPageToLoad("30000"); } } Any help is greatly appreciated!

    Read the article

  • Why is 1px sometimes 2px when specified in Android XML?

    - by Daniel Lew
    I've got a desire for a one-pixel divider line, just for looks. I thought I could accomplish this using a View of height 1px, with a defined background. However, I'm getting some very odd behavior on different devices - sometimes the 1px ends up as 2px. Take this sample layout for example: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> <View android:layout_width="fill_parent" android:layout_height="1px" android:background="@android:color/white" android:layout_marginBottom="4dp" /> </LinearLayout> When run on my G1, this comes out fine. But on the Nexus One, it alternates between 1px lines and 2px lines. Does anyone know where this is going awry? Why does Android sometimes make 1px into 2px?

    Read the article

  • Is there a detailed description of optimizations in the Android build process?

    - by Daniel Lew
    I've been curious as to all the optimizations that go into the building of an .apk. I'm curious because of two things I've tried in the past to bring down the size of my .apk: I have had a few large json assets in projects before, as well as a static sqlite database. I tried bringing down the size of the apk by gzipping them before the build process, but the resulting size is exactly the same. I just today tried pngcrush on my /drawable/ folders. The resulting build was exactly the same size as before. I would think that perhaps #1 could be explained by the zip process, but simply zipping the /drawable/ folders in #2 result in different-sized files. Perhaps the build process runs something akin to pngcrush? Regardless, I was wondering if anyone knew where to find a detailed description of all the optimizations in the Android build process. I don't want to waste my time trying to optimize what is already automated, and also I think it'd help my understanding of the resulting apk. Does anyone know if this is documented anywhere?

    Read the article

  • Whois list of Top Level Domain against their corresponding registrar

    - by Daniel
    I'm trying to find a list of TLD's to their corresponding whois server, for example .com americanWhoisServer .net someOtherWhoisServer .au australianWhoisServer In the end i'm aiming for something like a Dictionary where the key is the TLD and the value is the whois server address (eg whois.apnic.net). Ah snap, i just realised that i am given the IP addresses and not domain names but a list could still come in handy. How can i determine which whois server to use given a IP address? Guess and check?

    Read the article

  • Taking video from video camera and displaying it with MPMoviePlayerController IPhone SDK

    - by Daniel
    Has anyone tried taking a video from the camera and then using the video player provided to play it? When you take the video in portrait mode, sometimes the movie will play (when the player puts it in landscape mode) and when it puts it in portrait mode you cannot view the movie all you hear is sound,sometimes in landscape mode is flickers and does not play right, has anyone encountered this and found a way to fix it? My code to play the video looks like this: - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info { NSURL *urls=[info objectForKey:@"UIImagePickerControllerMediaURL"] ; moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[info urls]]; if (moviePlayer) { [moviePlayer play]; } } I checked settings on the docs nothing seems like it would fix this...Thanks

    Read the article

  • Diff Algorithm

    - by Daniel Magliola
    I've been looking like crazy for an explanation of a diff algorithm that works and is efficient. The closest I got is this link to RFC 3284 (from several Eric Sink blog posts), which describes in perfectly understandable terms the data format in which the diff results are stored. However, it has no mention whatsoever as to how a program would reach these results while doing a diff. I'm trying to research this out of personal curiosity, because I'm sure there must be tradeoffs when implementing a diff algorithm, which are pretty clear sometimes when you look at diffs and wonder "why did the diff program chose this as a change instead of that?"... Does anyone know where I can find a description of an efficient algorithm that'd end up outputting VCDIFF? By the way, if you happen to find a description of the actual algorithm used by SourceGear's DiffMerge, that'd be even better. NOTE: longest common subsequence doesn't seem to be the algorithm used by VCDIFF, it looks like they're doing something smarter, given the data format they use. Thanks!

    Read the article

  • In ExtJS, how do I place two fieldsets side-by-side in a panel with a hbox layout?

    - by Daniel T.
    In ExtJS, I'm having a little trouble placing two fieldsets side-by-side in a panel with a hbox layout. The hbox layout seems to be unaware of the fieldset's height, and cuts it off, even if I explicitly set the panel's height to something large. Here's what it looks like: The blue border is the hbox panel, and there's 2 fieldsets inside, 'Client Info' and 'Owner Info'. The code is like so (simplified and runnable in Firebug): var clientInfo = { xtype: 'fieldset', defaultType: 'textfield', title: 'Client Info', items: [ { fieldLabel: 'First Name' }, { fieldLabel: 'Last Name' }, { fieldLabel: 'Cell Phone #' }, { fieldLabel: 'Work Phone #' } ] }; var ownerInfo = { xtype: 'fieldset', defaultType: 'textfield', title: 'Owner Info', items: [ { fieldLabel: 'First Name' }, { fieldLabel: 'Last Name' }, { fieldLabel: 'Cell Phone #' }, { fieldLabel: 'Work Phone #' } ] }; new Ext.Panel({ layout: 'hbox', frame: true, height: 400, width: 800, defaults: { flex: 1 }, items: [ clientInfo, ownerInfo ] }).render(document.body); P.S. If you remove defaults: { flex: 1 }, the fieldsets render correctly, but doesn't automatically resize to fit the container, which is something I need. Does anybody know how to fix this rendering issue? Thanks.

    Read the article

  • Is preg_match safe enaught in input satinization?

    - by DaNieL
    Im building a new web-app, LAMP environment... im wondering if preg_match can be trusted for user's input validation (+ prepared stmt, of course) for all the text-based fields (aka not html fields; phone, name, surname, etc..). For example, for a classic 'email field', if i check the input like: $email_pattern = "/^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)" . "|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}" . "|[0-9]{1,3})(\]?)$/"; $email = $_POST['email']; if(preg_match($email_pattern, $email)){ //go on, prepare stmt, execute, etc... }else{ //email not valid! do nothing except warn the user } can i sleep easy against the sql/xxs injection? I write the regexp to be the more restrictive as they can.

    Read the article

  • Nav Controller, UITableViewController, UITextField to become firstResponder?

    - by Daniel Granger
    I have a core data application which uses a navigation controller to drill down to a detail view and then if you edit one of the rows of data in the detail view you get taken to an Edit View for the that single line, like in Apples CoreDataBooks example! The edit view is a UITableviewController which creates its table with a single section single row and a UITextfield in the cell, programatically. What I want to happen is when you select a row to edit and the edit view is pushed onto the nav stack and the edit view is animated moving across the screen, I want the textfield to be selected as firstResponder so that the keyboard is already showing as the view moves across the screen to take position. Like in the Contacts app or in the CoreDataBooks App. I currently have the following code in my app which causes the view to load and then you see the keyboard appear (which isn't what I want, I want the keyboard to already be there) - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [theTextField becomeFirstResponder]; } You can't put this in -viewWillAppear as the textfield hasn't been created yet so theTextField is nil. In the CoreDataBooks App where they achieve what i want they load there tableview from a nib so they use the same code but in -viewWillAppear as the textfield has already been created! Is there anyway of getting around this without creating a nib, I want to keep the implementation programatic to enable greater flexibility. Many Thanks

    Read the article

  • C# collection/string .Contains vs collection/string.IndexOf

    - by Daniel
    Is there a reason to use .Contains on a string/list instead of .IndexOf? Most code that I would write using .Contains would shortly after need the index of the item and therefore would have to do both statements. But why not both in one? if ((index = blah.IndexOf(something) = 0) // i know that Contains is true and i also have the index

    Read the article

  • Symfony FK Constraint Issue

    - by Daniel Hertz
    Hello! So I have a table schema that has users who can be friends. User: actAs: { Timestampable: ~ } columns: name: { type: string(255), notnull: true } email: { type: string(255), notnull: true, unique: true } nickname: { type: string(255), unique: true } password: { type: string(300), notnull: true } image: { type: string(255) } FriendsWith: actAs: { Timestampable: ~ } columns: friend1_id: { type: integer, primary: true } friend2_id: { type: integer, primary: true } relations: User: { onDelete: CASCADE, local: friend1_id, foreign: id } User: { onDelete: CASCADE, local: friend2_id, foreign: id } It builds the database correctly, but when I try to insert test data like: User: user1: name: Danny Gurt email: [email protected] nickname: danny password: test1 user2: name: Adrian Soian email: [email protected] nickname: adrian password: test1 FriendsWith: friendship1: friend1_id: user1 friend2_id: user2 I get this integrity constraint problem: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`krowdd`.`friends_with`, CONSTRAINT `friends_with_ibfk_1` FOREIGN KEY (`friend1_id`) REFERENCES `user` (`id`) ON DELETE CASCADE) Any ideas? Thanks!

    Read the article

  • Numbered list in Report Builder export to word

    - by Daniel
    I have created a SQL Server Reporting Services Report Builder 3 report that contains a list of several items from a SharePoint list. I would like the list on the report to be a numbered list, so that when exported to Word, if a user adds another item to the document, the numbering is updated automatically. I can simulate a numbered list by creating a table and using 'RowNumber' in one of the columns, however this does not get rendered as a true numbered list. Is there any way to create a true numbered list in Report Builder 3

    Read the article

< Previous Page | 27 28 29 30 31 32 33 34 35 36 37 38  | Next Page >