Search Results

Search found 80 results on 4 pages for 'hugh perkins'.

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

  • How do I copy a python function to a remote machine and then execute it?

    - by Hugh
    I'm trying to create a construct in Python 3 that will allow me to easily execute a function on a remote machine. Assuming I've already got a python tcp server that will run the functions it receives, running on the remote server, I'm currently looking at using a decorator like @execute_on(address, port) This would create the necessary context required to execute the function it is decorating and then send the function and context to the tcp server on the remote machine, which then executes it. Firstly, is this somewhat sane? And if not could you recommend a better approach? I've done some googling but haven't found anything that meets these needs. I've got a quick and dirty implementation for the tcp server and client so fairly sure that'll work. I can get a string representation the function (e.g. func) being passed to the decorator by import inspect string = inspect.getsource(func) which can then be sent to the server where it can be executed. The problem is, how do I get all of the context information that the function requires to execute? For example, if func is defined as follows, import MyModule def func(): result = MyModule.my_func() MyModule will need to be available to func either in the global context or funcs local context on the remote server. In this case that's relatively trivial but it can get so much more complicated depending on when and how import statements are used. Is there an easy and elegant way to do this in Python? The best I've come up with at the moment is using the ast library to pull out all import statements, using the inspect module to get string representations of those modules and then reconstructing the entire context on the remote server. Not particularly elegant and I can see lots of room for error. Thanks for your time

    Read the article

  • What disables "Run Project" in Expression Blend 3

    - by Hugh
    I am developing a Sketchflow (Silverlight) project in Expression Blend 3. It has been working fine up until today, now I cannot run the project. Specifically in the Project menu the "Run Project" option is now greyed out (all the other options are fine). F5 also doesn't have any effect. I've obviously messed up the code somewhere but I can't find any information on what could cause the "Run Project" option to be disabled. This would obviously help the troubleshooting. Does anybody know what controls this functionality? I can build the project no problem. And if I package the project (so it runs outside Expression) this also works fine. It is just launching it from Expression that doesn't work.

    Read the article

  • Out of Memory When Loading Java Entities

    - by Hugh Buchanan
    I have a terrible problem that hopefully has a very simple answer. I am running out of memory when I perform a basic If I have code like this: MyEntity myEntity; for (Object id: someIdList) { myEntity = find(id); // do something basic with myEntity } And the find() method is a standard EntityManager related method: public MyEntity find(Object id) { return em.find(mycorp.ejb.entity.MyEntity.class, id); } This code worked a couple of weeks ago, and works fine if there are fewer items in the database. The resulting error I am facing is: java.lang.OutOfMemoryError: GC overhead limit exceeded The exception is coming from oracle toplink calling some oracle jdbc methods. The loop exists because an EJBQL such as "select object(o) from MyEntity as o" will overload the application server when there are lots of records.

    Read the article

  • Which languages support *recursive* function literals / anonymous functions?

    - by Hugh Allen
    It seems quite a few mainstream languages support function literals these days. They are also called anonymous functions, but I don't care if they have a name. The important thing is that a function literal is an expression which yields a function which hasn't already been defined elsewhere, so for example in C, &printf doesn't count. EDIT to add: if you have a genuine function literal expression <exp>, you should be able to pass it to a function f(<exp>) or immediately apply it to an argument, ie. <exp>(5). I'm curious which languages let you write function literals which are recursive. Wikipedia's "anonymous recursion" article doesn't give any programming examples. Let's use the recursive factorial function as the example. Here are the ones I know: JavaScript / ECMAScript can do it with callee: function(n){if (n<2) {return 1;} else {return n * arguments.callee(n-1);}} it's easy in languages with letrec, eg Haskell (which calls it let): let fac x = if x<2 then 1 else fac (x-1) * x in fac and there are equivalents in Lisp and Scheme. Note that the binding of fac is local to the expression, so the whole expression is in fact an anonymous function. Are there any others?

    Read the article

  • app-engine-patch and "object_detail" view didn't work

    - by Hugh
    Hi(Sorry for my ugly english) When I calling the flowing: http://192.168.62.90:8000/blog/entry/?agphdXR1bW4xOTEychALEgpibG9nX2VudHJ5GCYM will use this: urlpatterns = patterns('', (r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}), (r'^$', list_detail.object_list, entry_info), (r'^entry/(?P<object_id>.*)$', list_detail.object_detail, {'queryset': Entry.all(), 'template_name': 'sample_test_page.html'}), ) and the error is: Generic view must be called with either an object_id or a slug/slug_field. I want to know why this didn't work for me.

    Read the article

  • How do you pass or share variables between django views?

    - by Hugh
    Hi, I'm kind of lost as to how to do this: I have some chained select boxes, with one select box per view. Each choice should be saved so that a query is built up. At the end, the query should be run. But how do you share state in django? I can pass from view to template, but not template to view and not view to view. Or I'm truly not sure how to do this. Please help!

    Read the article

  • Where can I find a good definition of a Software construct?

    - by Hugh
    I have scoured for 2 hours now across the internet, I have found courses with modules on software constructs but no clear definition only hints as to what one is. As far as I understand the definition it is an object that can be defined with a purpose for example a TCP/IP connection uses a Port which is a Software construct. Can anyone refer me to a full definition or give a more robust one?

    Read the article

  • Dynamically creating page definitions in Cherrypy

    - by Hugh
    Hi, I've been looking around the CherryPy documentation, but can't quite get my head around what I want to do. I suspect it might be more of a Python thing than a CherryPy thing... My current class looks something like this: import managerUtils class WebManager: def A(self, **kwds): return managerUtils.runAction("A", kwds) A.enabled = True def B(self, **kwds): return managerUtils.runAction("B", kwds) B.enabled = True def C(self, **kwds): return managerUtils.runAction("C", kwds) C.enabled = True Obviously there's a lot of repetition in here. in managerUtils.py, I have a dict that's something like: actions = {'A': functionToRunForA, 'B': functionToRunForB, 'C': functionToRunForC} Okay, so that's a slightly simplistic view of it, but I'm sure you get the idea. I want to be able to do something like: import managerUtils class WebManager: def __init__(self): for action in managerUtils.actions: f = registerFunction(action) f.enabled = True Any ideas of how to do this?

    Read the article

  • Per-process CPU usage on Win95 / Win98 / WinME

    - by Hugh Allen
    How can you programmatically measure per-process (or better, per-thread) CPU usage under windows 95, windows 98 and windows ME? If it requires the DDK, where can you obtain that? Please note the Win9x requirement. It's easy on NT. EDIT: I tried installing the Win95/98 version of WMI, but Win32_Process.KernelModeTime and Win32_Process.UserModeTime return Null (as do most Win32_Process properties under win9x).

    Read the article

  • php : open a file download dialog

    - by Hugh Valin
    I have a mpg file hosted in Amazon S3, that I want to link to a page I have, so the user will be able to download it from the page. I have in my page a linke: bla bla" The link to the file workds when I right click it and choose "Save Target As" , but I would like it to work also when I left click it, and that it will open a file download dialog. right now, a left click will direct to a page that has the video directly played in it (in FireFox) or just won't load (in Explorer) I am working in php, anyone has a clue why this happens?

    Read the article

  • Java session facade not being found via InitialContext lookups

    - by Hugh Buchanan
    I have a project that is Java EE 5 running on Glassfish. The IDE is Netbeans 6.7.1. We periodically have a very annoying problem with new session facades not being located via InitialContext: javax.naming.NameNotFoundException: No object bound to name java:comp/env/GlobalConfigEntityFacadeLocal In my class (within the same EJB container), I can use the other session facades just fine. This sort of problem happens periodically, and a mixture of clean&build and deleting the build-impl.xml files from nbproject sometimes resolve this. We are not using ejb-jar.xml (stopped using that over a year ago, it is now an empty The code that is calling this is very straight forward: GlobalConfigEntityFacadeLocal globalConfigEntityFacade = null; try { InitialContext ic = new InitialContext(); globalConfigEntityFacade = (GlobalConfigEntityFacadeLocal) ic.lookup("java:comp/env/GlobalConfigEntityFacadeLocal"); ... } catch ( ... ) {} Any advice would be appreciated!!!! Cheers

    Read the article

  • factory class, wrong number of arguments being passed to subclass constructor

    - by Hugh Bothwell
    I was looking at Python: Exception in the separated module works wrong which uses a multi-purpose GnuLibError class to 'stand in' for a variety of different errors. Each sub-error has its own ID number and error format string. I figured it would be better written as a hierarchy of Exception classes, and set out to do so: class GNULibError(Exception): sub_exceptions = 0 # patched with dict of subclasses once subclasses are created err_num = 0 err_format = None def __new__(cls, *args): print("new {}".format(cls)) # DEBUG if len(args) and args[0] in GNULibError.sub_exceptions: print(" factory -> {} {}".format(GNULibError.sub_exceptions[args[0]], args[1:])) # DEBUG return super(GNULibError, cls).__new__(GNULibError.sub_exceptions[args[0]], *(args[1:])) else: print(" plain {} {}".format(cls, args)) # DEBUG return super(GNULibError, cls).__new__(cls, *args) def __init__(self, *args): cls = type(self) print("init {} {}".format(cls, args)) # DEBUG self.args = args if cls.err_format is None: self.message = str(args) else: self.message = "[GNU Error {}] ".format(cls.err_num) + cls.err_format.format(*args) def __str__(self): return self.message def __repr__(self): return '{}{}'.format(type(self).__name__, self.args) class GNULibError_Directory(GNULibError): err_num = 1 err_format = "destination directory does not exist: {}" class GNULibError_Config(GNULibError): err_num = 2 err_format = "configure file does not exist: {}" class GNULibError_Module(GNULibError): err_num = 3 err_format = "selected module does not exist: {}" class GNULibError_Cache(GNULibError): err_num = 4 err_format = "{} is expected to contain gl_M4_BASE({})" class GNULibError_Sourcebase(GNULibError): err_num = 5 err_format = "missing sourcebase argument: {}" class GNULibError_Docbase(GNULibError): err_num = 6 err_format = "missing docbase argument: {}" class GNULibError_Testbase(GNULibError): err_num = 7 err_format = "missing testsbase argument: {}" class GNULibError_Libname(GNULibError): err_num = 8 err_format = "missing libname argument: {}" # patch master class with subclass reference # (TO DO: auto-detect all available subclasses instead of hardcoding them) GNULibError.sub_exceptions = { 1: GNULibError_Directory, 2: GNULibError_Config, 3: GNULibError_Module, 4: GNULibError_Cache, 5: GNULibError_Sourcebase, 6: GNULibError_Docbase, 7: GNULibError_Testbase, 8: GNULibError_Libname } This starts out with GNULibError as a factory class - if you call it with an error number belonging to a recognized subclass, it returns an object belonging to that subclass, otherwise it returns itself as a default error type. Based on this code, the following should be exactly equivalent (but aren't): e = GNULibError(3, 'missing.lib') f = GNULibError_Module('missing.lib') print e # -> '[GNU Error 3] selected module does not exist: 3' print f # -> '[GNU Error 3] selected module does not exist: missing.lib' I added some strategic print statements, and the error seems to be in GNULibError.__new__: >>> e = GNULibError(3, 'missing.lib') new <class '__main__.GNULibError'> factory -> <class '__main__.GNULibError_Module'> ('missing.lib',) # good... init <class '__main__.GNULibError_Module'> (3, 'missing.lib') # NO! ^ why? I call the subclass constructor as subclass.__new__(*args[1:]) - this should drop the 3, the subclass type ID - and yet its __init__ is still getting the 3 anyway! How can I trim the argument list that gets passed to subclass.__init__?

    Read the article

  • Creating many native GUI frontends for a cross-platform application

    - by Hugh Young
    I've been away from GUI programming for quite some time so please pardon my ignorance. I would like to attempt the following: Write a Mac OSX app but still be able to port to Win/Linux (i.e. C++ core with Obj-C GUI) Avoid Qt/other toolkits on OSX (i.e. talk to Cocoa directly - I feel that many Qt apps I use stick out like sore thumbs compared to the rest of my system) Not as important, but it would be nice to avoid Visual Studio if it means I can have the freedom to use newer C++ features even on Windows if they help create better code. I believe this configuration might get me what I'm looking for: Core C++ Static Library OSX GUI (Cocoa) Windows GUI (Qt+MinGW?) OR (no new C++ features, Visual Studio + ManagedC++/C#/????) Linux GUI (Qt) Once again, sorry for my ignorance but is this possible? Is this sane? Are there any real-world open source examples accomplish something like this?

    Read the article

  • How the SPARC T4 Processor Optimizes Throughput Capacity: A Case Study

    - by Ruud
    This white paper demonstrates the architected latency hiding features of Oracle’s UltraSPARC T2+ and SPARC T4 processors That is the first sentence from this technical white paper, but what does it exactly mean? Let's consider a very simple example, the computation of a = b + c. This boils down to the following (pseudo-assembler) instructions that need to be executed: load @b, r1 load @c, r2 add r1,r2,r3 store r3, @a The first two instructions load variables b and c from an address in memory (here symbolized by @b and @c respectively). These values go into registers r1 and r2. The third instruction adds the values in r1 and r2. The result goes into register r3. The fourth instruction stores the contents of r3 into the memory address symbolized by @a. If we're lucky, both b and c are in a nearby cache and the load instructions only take a few processor cycles to execute. That is the good case, but what if b or c, or both, have to come from very far away? Perhaps both of them are in the main memory and then it easily takes hundreds of cycles for the values to arrive in the registers. Meanwhile the processor is doing nothing and simply waits for the data to arrive. Actually, it does something. It burns cycles while waiting. That is a waste of time and energy. Why not use these cycles to execute instructions from another application or thread in case of a parallel program? That is exactly what latency hiding on the SPARC T-Series processors does. It is a hardware feature totally transparent to the user and application. As soon as there is a delay in the execution, the hardware uses these otherwise idle cycles to execute instructions from another process. As a result, the throughput capacity of the system improves because idle cycles are no longer wasted and therefore more jobs can be run per unit of time. This feature has been in the SPARC T-series from the beginning, so why this paper? The difference with previous publications on this topic is in the amount of detail given. How this all works under the hood is fully explained using two example programs. Starting from the assembly language instructions, it is demonstrated in what way these programs execute. To really see what is happening we go down to the processor pipeline level, where the gaps in the execution are, and show in what way these idle cycles are filled by other copies of the same program running simultaneously. Both the SPARC T4 as well as the older UltraSPARC T2+ processor are covered. You may wonder why the UltraSPARC T2+ is included. The focus of this work is on the SPARC T4 processor, but to explain the basic concept of latency hiding at this very low level, we start with the UltraSPARC T2+ processor because it is architecturally a much simpler design. From the single issue, in-order pipelines of this processor we then shift gears and cover how this all works on the much more advanced dual issue, out-of-order architecture of the T4. The analysis and performance experiments have been conducted on both processors. The results depend on the processor, but in all cases the theoretical estimates are confirmed by the experiments. If you're interested to read a lot more about this and find out how things really work under the hood, you can download a copy of the paper here. A paper like this could not have been produced without the help of several other people. I want to thank the co-author of this paper, Jared Smolens, for his very valuable contributions and our highly inspiring discussions. I'm also indebted to Thomas Nau (Ulm University, Germany), Shane Sigler and Mark Woodyard (both at Oracle) for their feedback on earlier versions of this paper. Karen Perkins (Perkins Technical Writing and Editing) and Rick Ramsey at Oracle were very helpful in providing editorial and publishing assistance.

    Read the article

  • What will happen if on my DB server I'll run out of space?

    - by Noam
    I'm seeing a hugh difference of free disk space between df -h and du -sxh / I've understood in my question Resolving unix server disk space not adding up that du -sxh / is a better estimation as to when I will run out of disk space. Having said that, assuming in my case the above sentence will prove to be wrong and I will run soon out of disk space, what will happen? I assume the MySQL will fail INSERT queries, but other than that, will I just need to delete some files or will it be a problematic situation?

    Read the article

  • sIFR load before rest of page?

    - by hfidgen
    Hiya, Is it possible to have sIFR "preload" or load before the rest of the page content? At present it is the last thing to load (due to the text position) and as it's quite an obvious part of the page I get a huge mash-up of text replacement all in a quick flurry which is not very appealing. It looks like the site is having an epileptic fit. Once loaded, all is fine though :) Any work-arounds to the load-fitting? Cheers Hugh

    Read the article

  • Responsive Design: Which Framework Should I Use? CSS3 & HTML5

    - by Jayhal
    I've been looking for a suitable set of HTML5/CSS3 foundation files to start new projects on. I started off piecing together my own files, but I believe I might be better served in finding a solid and fairly compatible(with me) CSS3/HTML5 framework and then tweaking certain things that may not best suit my own process. I'd love to find something that is responsive and that includes aspects focusing on layout, type(hor and vert baselines), form and interface components, cross-browser issues, and preferably built on something other than a just imple css reset, but that does include rebuilding elements consistently across browsers for a clean work slate. Extra features like polyfills or others area great, as is good documentation and examples. So far, off the top of my head I know of, Skeleton 1140 Grid 320 & Up (plus BP) HTML5 Boilerplate 2.0 and Mobile Inuit.css Less Framework Fluir Perkins.Less A few WP themes Are there any great one I don't know about? I work a lot in WP, and something that is easily incorporated (but also stand alone) is ideal. Plugins and wide set feature while maintaining the ability to cut it down when needed(flexibility) is also a big plus, and in par with a faster learning, since I want to start using whatever I find immediately . What are some of the better options you guys might be able to recommend? Systems or scripts, plugins, and other related tools are also welcome, Thanks!

    Read the article

  • Domain transfer from Yahoo to Godaddy. Google apps downtime

    - by Kedar
    I am moving my domain from Yahoo to Godaddy (cause yahoo charges ridiculously hugh amounts than others). My problem is I use this domain for Google apps and one of those is my custom email. So here are a few questions that I have - 1) Godaddy told me there is going to be a 48 hours of downtime. Is there anything that I can do to minimize the downtime? 2) Will I lose all the email that I get during this downtime? or they be stored in the cloud and bulk emailed me once my domain is up with Godaddy? If they are lost is there any workaround to forward them to my gmail during the downtime (i know sounds stupid, but I have to ask). Any help is much appreciated. Thanks in advance.

    Read the article

  • Unable to mount smb share. "Please select another viewer and try again". Please help. Serious smb/nautilus foo needed

    - by oznah
    This don't think this is the typical, "I can't mount a windows share" post. I am using stock Ubuntu 12.04. I am pretty sure this is a Nautilus issue, but I have reached a dead end. I have one share that I can't mount using smb://server/share via nautilus. I get the following error. Error: Failed to mount Windows share Please select another viewer and try again I can mount this share from other machines(non-ubuntu) using the same credentials so I know I have perms on the destination share. I can mount other shares on other servers from my Ubuntu box so I am pretty sure I have all the smb packages I need on my Ubuntu box. To make thing more interesting, if I use smbclient from the command line, I mount this share with no problems from my Ubuntu box. So here's what we know: destination share perms are ok (no problem accessing from other machines) smb is setup correctly on Ubuntu box (access other windows shares no problem) I only get the error when using nautilus smbclient in terminal works, no problem Any help would be greatly appreciated. Googling turned up simple mount/perms issues, and I don't think that is what is going on here. Let me know if you need more information. Hugh

    Read the article

  • How to redirect domain to new server?

    - by hfidgen
    I've got a domain registered with a hosting company who I no longer wish to use. I'm happy for them to keep managing my domain, but I want my domain to point to my new (better) server which i've just bought and set up. I know my new server's IP address and Nameservers, What do I need to do in my domain management control panel to make it point to my new server? Change the "A" record to the new IP? Change the nameservers to my new hosts nameservers? Is that it? Are there no other record on either server which need changing? I always get confused by who needs to do what when it comes to domains... Thanks, Hugh

    Read the article

  • Live Webcast: Crystal Ball: Simulation of production uncertainty in unconventional reservoirs - November 29

    - by Melissa Centurio Lopes
    Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin; mso-bidi-font-family:"Times New Roman"; mso-bidi-theme-font:minor-bidi;} In our webcast on 29 November, Oracle solution specialist Steve Hoye explains how you can effectively forecast EURs for unconventional reservoirs – supporting better investment decisions and reducing financial exposure and risk. Attend the webcast to find out how your Oil & Gas industry can: Use historical production data and data from other unconventional reservoirs to generate accurate production forecasts Conduct Monte Carlo simulations in minutes to model likely declines in production rates over time Accurately predict probable EURs to inform investment decisions Assess the site against key criteria, such as Value at Risk and Likelihood of Economic Success. Don't miss this opportunity to learn new techniques for mitigating financial risk across your unconventional reservoir projects. Register online today. "Oracle Crystal Ball is involved in every major investment decision that we make for wells." Hugh Williamson, Risk and Cost Advisor, Drilling and Completions, BP

    Read the article

  • Display the newest result from my database

    - by nogggin1
    Im building a webpage that displays the newest result from a database as a news article. The parts of the database are title, bodytext and created although I wish to keep created hidden. I am quite new to PHP and dont have any idea how to do this, could i please get some help just to display it as: title bodytext i need to be able to connect to the database with my details then display the results in a div i have set up. although i only want to show the newest result! thank you. Ned Perkins

    Read the article

  • ado.net slow updating large tables

    - by brett
    The problem: 100,000+ name & address records in an access table (2003). Need to iterate through the table & update detail with the output from a 3rd party dll. I currently use ado, and it works at an acceptable speed (less than 5 minutes on a network share). We will soon need to update to access 2007 and its 'non jet' accdb format to maintain compatability with clients. I've tried using ado.net datsets, but updating the records takes hours! We process 5-10 of these tables per day - so this cannot be a solution. Any ideas on the fastest way to update individual records using ado.net? Surely we didn't take such a hugh backward step with ado.net? Any help would be appreciated.

    Read the article

  • Do there any dev who wrote iPhone wifi/bluetooth multiplay before?

    - by Jerry1923
    Hi there, do there any dev who wrote iPhone wifi/bluetooth multiplay before? Recently, I'm trying to make my latest game Doodle Kart to have mulityplay via bluetooth. But I found that there are hugh data need to share between the 2 devices. -your car's position and direction -your car's status(it is in normal state, it is hitting by bullet, it is falling into to hole....) -CUP car's position, dicretion, and their status -items position and status (pencil, bullet...) I'm thinking about one device calculate all the things, and the other device just wait and receive the data to display on the screen. Does it make sense? Hey, I should ask you the most important question first: Do you think it's possible to make bluetooth multiplay work on my game? It's just too much data need to share between the device.

    Read the article

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