Search Results

Search found 1226 results on 50 pages for 'jack flynn'.

Page 23/50 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Problem building a complete binary tree of height 'h' in Python

    - by Jack
    Here is my code. The complete binary tree has 2^k nodes at depth k. class Node: def __init__(self, data): # initializes the data members self.left = None self.right = None self.data = data root = Node(data_root) def create_complete_tree(): row = [root] for i in range(h): newrow = [] for node in row: left = Node(data1) right = Node(data2) node.left = left node.right = right newrow.append(left) newrow.append(right) row = copy.deepcopy(newrow) def traverse_tree(node): if node == None: return else: traverse_tree(node.left) print node.data traverse_tree(node.right) create_complete_tree() print 'Node traversal' traverse_tree(root) The tree traversal only gives the data of root and its children. What am I doing wrong?

    Read the article

  • Configuration manager for PHP

    - by Jack
    I am working on code re-factoring of configuration file loading part in PHP. Earlier I was using multiple 'ini' files but now I plan to go for single XML file which will be containing all configuration details of the project. Problem is, if somebody wants configuration file in ini or DB or anything else and not the default one (in this case XML), my code should handle that part. If somebody wants to go for other configuration option like ini, he will have to create ini file similar to my XML configuration file and my configuration manager should take care everything like parsing, storing in cache. For that I need a mechanism lets say proper interface for my configuration data where the underlying data store can be anything( XML, DB, ini etc) also I don't want it to be dependent on these underlying store and anytime in future this should be extensible to other file formats.

    Read the article

  • Testing a Django view cause "AttributeError: 'NoneType' object has no attribute 'handler500'" error

    - by jack
    I just wanted to start testing a Django view using the code below: from django.test.client import Client c = Client() response = c.get('/search/keyword') print response.content It just throws out following error message: "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 286, in get response = self.request(**r) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 230, in request response = self.handler(environ) File "/usr/local/lib/python2.6/dist-packages/django/test/client.py", line 74, in __call__ response = self.get_response(request) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 143, in get_response return self.handle_uncaught_exception(request, resolver, exc_info) File "/usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py", line 178, in handle_uncaught_exception callback, param_dict = resolver.resolve500() File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 268, in resolve500 return self._resolve_special('500') File "/usr/local/lib/python2.6/dist-packages/django/core/urlresolvers.py", line 258, in _resolve_special callback = getattr(self.urlconf_module, 'handler%s' % view_type) AttributeError: 'NoneType' object has no attribute 'handler500' The view works in browser. What's wrong with above code?

    Read the article

  • Liferay hook: filter url giving filterstart error and current url generates exception null

    - by jack
    I'm trying to make an autologinfilter in Eclipse using a liferay hook. Now I've added the: <filter> <filter-name>myautologinfilter</filter-name> <filter-class>bla.bla.xyz</filter-class> </filter> <filter-mapping> <filter-name>myautologinfilter</filter-name> <url-pattern>/c/login/myurl</url-pattern> </filter-mapping> To the liferay hook's web.xml. In the liferay-hook.xml I added: portal.properties And in that hook.xml I added: auto.login.hooks=bla.bla.xyz bla.bla.xyz implements AutoLogin, but for now it's pretty gutted: @Override public String[] login(HttpServletRequest request, HttpServletResponse response) throws AutoLoginException { Object parameters = request.getAttribute("javax.servlet.forward.query_string"); Map<String, String> x = parserClass.parsing(parameters.toString()); System.out.println("voornaam: " + geparsdeParameters.get("tokenvalue1")); try { return null; } catch (Exception e) { throw new AutoLoginException(e); } } Since the hook doesn't start when I add the filtering I removed it and just tried: http://localhost:8080/c/portal/login?tokenvalue1=55 but when I check my tomcat I see: Error XYZ Url: url myUsedUrl exception null Also I tried adding some util classes but I got: classnotfoundexceptions. Is there anything specific I have to do when I add extra classes in a hook? Any advice/input would be appreciated. Or someone's ear I could lend so I could mail them a little bit so I could pick their brain a bit would be really appreciated since I don't know anyone who programs for liferay.

    Read the article

  • beginner's ruby question: how to use erb to output file after binding

    - by john
    Hi, I got the following example: require 'erb' names = [] names.push( { 'first' => "Jack", 'last' => "Herrington" } ) names.push( { 'first' => "LoriLi", 'last' => "Herrington" } ) names.push( { 'first' => "Megan", 'last' => "Herrington" } ) myname = "John Smith" File.open( ARGV[0] ) { |fh| erb = ERB.new( fh.read ) print erb.result( binding ) accompanied by text.txt <% name = "Jack" %> Hello <%= name %> <% names.each { |name| %> Hello <%= name[ 'first' ] %> <%= name[ 'last' ] %> <% } %> hi, my name is <%= myname %> } it prints nicely to screen. what is the simplest way to output another file: "text2.txt"? thank you!!!

    Read the article

  • upgrading from MVC4 to MVC5 pre-Release

    - by Jack M
    I have made that dreadful error of upgrading from MVC4 to MVC5 pre-release by updating the razor, and mvc webpage in my references I have System.Web.Mvc, System.Web.Webpages, System.Web.Webpages.Razor and System.Web.Razor as version v4.0.30319, when I run my application I get [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\membership\c70f06fe\9163b1ca\assembly\dl3\291c956e\73c25daa_cf74ce01\System.Web.WebPages.Razor.dll'. is this the same as http://www.asp.net/whitepapers/mvc4-release-notes Thanks Adding a stacktrace: [InvalidCastException: [A]System.Web.WebPages.Razor.Configuration.HostSection cannot be cast to [B]System.Web.WebPages.Razor.Configuration.HostSection. Type A originates from 'System.Web.WebPages.Razor, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Web.WebPages.Razor\v4.0_2.0.0.0__31bf3856ad364e35\System.Web.WebPages.Razor.dll'. Type B originates from 'System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\c70f06fe\9163b1ca\assembly\dl3\291c956e\73c25daa_cf74ce01\System.Web.WebPages.Razor.dll'.] System.Web.WebPages.Razor.WebRazorHostFactory.CreateHostFromConfig(String virtualPath, String physicalPath) +193 System.Web.WebPages.Razor.RazorBuildProvider.GetHostFromConfig() +51 System.Web.WebPages.Razor.RazorBuildProvider.CreateHost() +24 System.Web.WebPages.Razor.RazorBuildProvider.get_Host() +34 System.Web.WebPages.Razor.RazorBuildProvider.EnsureGeneratedCode() +85 System.Web.WebPages.Razor.RazorBuildProvider.get_CodeCompilerType() +34 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) +189 System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() +265 System.Web.Compilation.BuildProvidersCompiler.PerformBuild() +21 System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +580 System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +571 System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile, Boolean throwIfNotFound, Boolean ensureIsUpToDate) +203 System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean throwIfNotFound) +249 System.Web.Compilation.BuildManager.GetCompiledType(VirtualPath virtualPath) +17 System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +90 System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +380 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +109 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +890 System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +97 System.Web.Mvc.Async.<>c__DisplayClass1e.<BeginInvokeAction>b__1b(IAsyncResult asyncResult) +241 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +29 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +19 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__4(IAsyncResult asyncResult, ProcessRequestState innerState) +51 System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +111 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

    Read the article

  • Manual alternative to mod_deflate

    - by Bobby Jack
    Say I don't have mod_deflate compiled into apache, and I don't feel like recompiling right now. What are the downsides to a manual approach, e.g. something like: AddEncoding x-gzip .gz RewriteCond %{HTTP_ACCEPT_ENCODING} gzip RewriteRule ^/css/styles.css$ /css/styles.css.gz (Note: I'm aware that the specifics of that RewriteCond need to be tweaked slightly)

    Read the article

  • x86 assembler question

    - by b-gen-jack-o-neill
    Hi, I have 2 simple, but maybe tricky questions. Let´s say I have assembler instruction: MOV EAX,[ebx+6*7] - what I am curious is, does this instruction really actually translates into opcode as it stands,so computation of code in brackets is encoded into opcode, or is this just pseudo intruction for compiler, not CPU, so that compiler before computes the value in brackets using add mul and so, store outcome in some reg and than uses MOV EAX,reg with computed value? Just to be clear, I know the output will be the same. I am interested in execution. Second is about LEA instruction. I know what it does, but I am more interested wheather its real instruction, so compiles does not further change it, just make it into opcode as it stands, or just pseudo code for compiler to, again, first compute adress and than store it.

    Read the article

  • How to parse an XML file using PHP?

    - by Jack
    Here I have a variable 'response' which is obtained by parsing an XML file. $url = 'http://xxxxx.xml'; $ch = curl_init($url); $response = curl_exec($ch); The url structure is as follows - <user> <id>734</id> <name>Peter Parker</name> - <status> <favorited>false</favorited> </status> </user> How to access each bit of info like id,name,favorited from response?

    Read the article

  • What does flushing thread local memory to global memory mean?

    - by Jack Griffith
    Hi, I am aware that the purpose of volatile variables in Java is that writes to such variables are immediately visible to other threads. I am also aware that one of the effects of a synchronized block is to flush thread-local memory to global memory. I have never fully understood the references to 'thread-local' memory in this context. I understand that data which only exists on the stack is thread-local, but when talking about objects on the heap my understanding becomes hazy. I was hoping that to get comments on the following points: When executing on a machine with multiple processors, does flushing thread-local memory simply refer to the flushing of the CPU cache into RAM? When executing on a uniprocessor machine, does this mean anything at all? If it is possible for the heap to have the same variable at two different memory locations (each accessed by a different thread), under what circumstances would this arise? What implications does this have to garbage collection? How aggressively do VMs do this kind of thing? Overall, I think am trying to understand whether thread-local means memory that is physically accessible by only one CPU or if there is logical thread-local heap partitioning done by the VM? Any links to presentations or documentation would be immensely helpful. I have spent time researching this, and although I have found lots of nice literature, I haven't been able to satisfy my curiosity regarding the different situations & definitions of thread-local memory. Thanks very much.

    Read the article

  • New TabItem Content ActualHeight crashes Xaml Window

    - by Jack Navarro
    I am able to create new TabItems with Content dynamically to a new window by streaming the Xaml with XamlReader: NewWindow newWindow = new NewWindow(); newWindow.Show(); TabControl myTabCntrol = newWindow.FindName("GBtabControl") as TabControl; StringReader stringReader = new StringReader(XamlGrid); XmlReader xmlReader = XmlReader.Create(stringReader); TabItem myTabItem = new TabItem(); myTabItem.Header = qDealName; myTabItem.Content = (UIElement)XamlReader.Load(xmlReader); myTabCntrol.Items.Add(myTabItem); This works fine. It displays a new grid wrapped in a scrollviewer. The problem is access the TabItem content from the newWindow. TabItem ti = GBtabControl.SelectedItem as TabItem; string scrollvwnm = "scrollViewer" + ti.Header.ToString(); MessageBox.Show(ti.ActualHeight.ToString()); // returns 21.5 ScrollViewer scrlvwr = this.FindName(scrollvwnm) as ScrollViewer; MessageBox.Show(scrollvwnm); // Displays name double checked for accuracy MessageBox.Show(scrlvwr.ActualHeight.ToString()); //Crashes ScrollViewer scrlvwr = ti.FindName(scrollvwnm) as ScrollViewer; MessageBox.Show(scrollvwnm); // Displays name double checked for accuracy MessageBox.Show(scrlvwr.ActualHeight.ToString()); //Also Crashes Is there a method to refresh UI in XAML so the new window is able to access the newly loaded tab item content? Thanks

    Read the article

  • COMException Problem

    - by Jack Harvin
    Wondering if anyone could help with my problem. Below is the code, and after the code an explination of where the exception is thrown. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using System.Web; using WatiN.Core; using System.Threading; using System.IO; namespace WindowsFormsApplication1 { public partial class Form1 : System.Windows.Forms.Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { } private void button1_Click(object sender, EventArgs e) { Thread t = new Thread(createApplications); Settings.AutoStartDialogWatcher = false; t.SetApartmentState(System.Threading.ApartmentState.STA); t.Start(); } private void createApplications() { createApp("username", "password", "Test App", "This is just a test description", "http:/mysite.com"); } private void createApp(String username, String password, String appName, String description, String appUrl) { var currentBrowser = new IE("http://mysite.com/login/php"); currentBrowser.TextField(Find.ById("username")).TypeText(username); currentBrowser.TextField(Find.ById("password")).TypeText(password); currentBrowser.Button(Find.ById("submit")).Click(); currentBrowser.GoTo("http://mysite.com/createmusicapp.php"); currentBrowser.TextField(Find.ById("application_name")).TypeText(appName); currentBrowser.TextField(Find.ById("application_description")).TypeText(description); currentBrowser.TextField(Find.ById("application_url")).TypeText(appUrl); currentBrowser.RadioButton(Find.ById("client_application_desktop_1")).Click(); currentBrowser.RadioButton(Find.ById("client_application_is_writable_1")).Click(); WatiN.Core.Image captchaImage = currentBrowser.Div(Find.ById("recaptcha_image")).Image(Find.ByStyle("display", "block")); Form2 captcha = new Form2(captchaImage.Src); captcha.ShowDialog(); } } } The exception is thrown on this line: currentBrowser.TextField(Find.ById("username")).TypeText(username); BUT, it's thrown when it gets to this line: captcha.ShowDialog(); It logs in, and fills in the app details and Form2 loads fine, but once loaded, after around 2-3 seconds the exception happens. I am wondering if it's anything to do with the threads? But I wouldn't know how to solve it if it was. The complete exception thrown is: The object invoked has disconnected from its clients. (Exception from HRESULT: 0x80010108 (RPC_E_DISCONNECTED))

    Read the article

  • Does MSDeploy support website and database upgrades?

    - by Samuel Jack
    I've just been reading about MSDeploy, the new website deployment tool from Microsoft. I'm developing an installer for a webapplication and a webservice to be used for our off-the-shelf product. I have a couple of questions that I couldn't find obvious answers to. Does MSDeploy have robust support for upgrading websites after the initial deployment? I can see MSDeploy has good support for the initial deployment of databases. But does it have support for upgrading schemas whilst preserving the current data? Links addressing these specific questions would be good.

    Read the article

  • Grails deploy on Tomcat6

    - by Jack
    Hello, while trying to deploy a Grails application into tomcat6 I ran into some problems: I used the grails war command to build up a war, then copied it to var/lib/tomcat6/webapps and tried to restart the container. I had to change default Tomcat policy to skip security exceptions, since I couldn't access environment variable (like grails.env), then tried again but it gives me an exception related to instantiating something, but it's not clear where should I try to fix the error, according to tomcat6 logs the problem is: SEVERE: Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsC$ org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pluginManager' defined in ServletContext$ at java.lang.Thread.run(Thread.java:619) Caused by: org.codehaus.groovy.grails.exceptions.NewInstanceCreationException: Could not create a new instance of class [Hiberna$ ... 1 more Caused by: java.lang.NoClassDefFoundError: org.hibernate.cfg.Environment It seems like it's unable to load org.hibernate.cfg.Environment class. I checked the applicationContext.xml and it refers to grails.xml to search for plugins, in this last file I actually have HibernateGrailsPlugin. Where should I look to find if the plugin is present?

    Read the article

  • Facebook App : Problem with storing user info

    - by Jack
    I want to store basic user info like name and proxied email into my MySQL database. Here's my code $user = $facebook->require_login($required_permissions = 'publish_stream','status_update','email'); $con = mysql_connect("xxxx","xxxxx","xxxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxx_userdb", $con); //Uptil Here it is working fine...No problem with db connection $fql_firstname = "select first_name from user where uid = '$user'"; $fql_lastname = "select last_name from user where uid = '$user'"; $fql_email = "select proxied_email from user where uid = '$user'"; $fql_fname_result = $facebook->api_client->fql_query($fql_firstname); $fql_lname_result = $facebook->api_client->fql_query($fql_lastname); $fql_email_result = $facebook->api_client->fql_query($fql_email); echo "<pre>FQL Result:" . print_r($fql_fname_result,true) . "</pre>"; echo "<pre>FQL Result:" . print_r($fql_lname_result,true) . "</pre>"; echo "<pre>FQL Result:" . print_r($fql_email_result,true) . "</pre>"; Here's the output I get FQL Result: FQL Result: FQL Result: What am I doing wrong?

    Read the article

  • Recover backup copy of a ubuntu linux installation on a usb stick using dd

    - by Werner
    Hi, I installed Ubuntu 10.04 on a usb stick in persistent install mode. So I could boot the laptop or my desktop computer with the stick, at boot time. Once I needed the 8GB stick for another purposes so I thought about coyping it to my desktop doing from mac os x: dd if=/dev/disks3s of=/Users/jack/Desktop/usb_copy Now I am trying to do the opposite, after having used the stick, which was formatted to NTFS, just doing dd if=/Users/jack/Desktop/usb_copy of=/dev/disks3s but although I can see that almost of the files are there, I can not boot again. IT is also strange the the file permissions are kind of strange, something like _user What can I do ? Thanks

    Read the article

  • SELLER REPORT FORM

    - by jack
    how to produce seller ID :xxxxx name :xxxxx address :xxxxxx phone : xxxxxx identification : passport identificatio : drivers licence identification : birth certificate xml file KS0000001 Mr. Clive Owen 14 Fifth Street Sin City NSW 2480 0455555551 &p; &dl; </seller> </sellers> dtd file <!ENTITY p "passport."> <!ENTITY dl "drivers licence."> <!ENTITY bc "birth certificate."> <!ENTITY mc "medicare card.">

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >