Search Results

Search found 1605 results on 65 pages for 'brian m hunt'.

Page 7/65 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Trouble getting NSString from NSDictionary key into UILabel

    - by Brian
    I'm attempting to put the value associated with the key called "duration" into a UILabel but I'm getting a blank or "(null)" result showing up in the UILabel. My NSDictionary object with its keys seems to be logging as being full of the data and keys I think I want, as such: the content of thisRecordingsStats is { "12:48:25 AM, April 25" = { FILEPATH = "/Users/brian/Library/Application Support/iPhone Simulator/3.1.3/Applications/97256A91-FC47-4353-AD01-15CD494060DD/Documents/12:48:25 AM, April 25.aif"; duration = "00:04"; applesCountString = 0; ...and so on. Here's the code where I'm trying to put the NSString into the UILabel: cell.durationLabel.text = [NSString stringWithFormat:@"%@",[thisRecordingsStats objectForKey:@"duration"]]; I've also tried these other permutations: cell.durationLabel.text = [thisRecordingsStats objectForKey:@"duration"]; and I've also tried this tag-based approach: label = (UILabel *)[cell viewWithTag:8]; label.text = [[thisRecordingsStats objectForKey:@"duration"] objectAtIndex:1]; and: UILabel *label; label = (UILabel *)[cell viewWithTag:8]; label.text = [NSString stringWithFormat:@"%@",[[thisRecordingsStats objectForKey:@"duration"] objectAtIndex:1]]; I've also tried creating a string from the key's paired value and see a "(null)" value or blankness using that too. What am I missing? I assume it's something with the formatting of the string. Thanks for looking!!

    Read the article

  • Python-daemon doesn't kill its kids

    - by Brian M. Hunt
    When using python-daemon, I'm creating subprocesses likeso: import multiprocessing class Worker(multiprocessing.Process): def __init__(self, queue): self.queue = queue # we wait for things from this in Worker.run() ... q = multiprocessing.Queue() with daemon.DaemonContext(): for i in xrange(3): Worker(q) while True: # let the Workers do their thing q.put(_something_we_wait_for()) When I kill the parent daemonic process (i.e. not a Worker) with a Ctrl-C or SIGTERM, etc., the children don't die. How does one kill the kids? My first thought is to use atexit to kill all the workers, likeso: with daemon.DaemonContext(): workers = list() for i in xrange(3): workers.append(Worker(q)) @atexit.register def kill_the_children(): for w in workers: w.terminate() while True: # let the Workers do their thing q.put(_something_we_wait_for()) However, the children of daemons are tricky things to handle, and I'd be obliged for thoughts and input on how this ought to be done. Thank you.

    Read the article

  • Get signal names from numbers in Python

    - by Brian M. Hunt
    Is there a way to map a signal number (e.g. signal.SIGINT) to its respective name (i.e. "SIGINT")? I'd like to be able to print the name of a signal in the log when I receive it, however I cannot find a map from signal numbers to names in Python, i.e. import signal def signal_handler(signum, frame): logging.debug("Received signal (%s)" % sig_names[signum]) signal.signal(signal.SIGINT, signal_handler) For some dictionary sig_names, so when the process receives SIGINT it prints: Received signal (SIGINT) Thank you.

    Read the article

  • Javascript upload in spite of same origin policy

    - by Brian M. Hunt
    Can one upload files to a domain other than the domain a script originates from? For example, suppose you're hosting files on www.example.com, and you want to upload files to uploads.example.com, would the following script violate the same origin policy (using uploadify): <!-- from http://www.example.com/upload.html --> <input id="fileInput" name="fileInput" type="file" /> <script type="text/javascript">// <![CDATA[ $(document).ready(function() { $('#fileInput').uploadify({ 'uploader' : 'uploadify.swf', 'script' : 'http://upload.example.com/uploadify.php', 'cancelImg' : 'cancel.png', 'auto' : true, 'folder' : '/uploads' }); }); // ]]></script> I haven't seen a clear reference on the same origin policy that would indicate one-way or the other whether the this would be an issue with any browsers.

    Read the article

  • WCF ReliableMessaging method called twice

    - by Brian
    Using Fiddler, we see 3 HTTP requests (and matching responses) for each call when: WS-ReliableMessaging is enabled, and, the method returns a large amount of data (17MB) The first HTTP request is a SOAP message with the action "CreateSequence" (presumable to establish the reliable session). The second and third HTTP requests are identical SOAP messages invoking our webservice method. Why are there two identical messages? Here is our config: <system.serviceModel> <client> <endpoint address="http://server/vdir/AccountingService.svc" binding="wsHttpBinding" bindingConfiguration="customWsHttpBinding" behaviorConfiguration="LargeServiceBehavior" contract="MyProject.Accounting.IAccountingService" name="BasicHttpBinding_IAccountingService" /> </client> <bindings> <wsHttpBinding> <binding name="customWsHttpBinding" maxReceivedMessageSize="90000000"> <reliableSession enabled="true"/> <security mode="None" /> </binding> </wsHttpBinding> </bindings> <behaviors> <endpointBehaviors> <behavior name="LargeServiceBehavior"> <dataContractSerializer maxItemsInObjectGraph="2147483647"/> </behavior> </endpointBehaviors> </behaviors> </system.serviceModel> Thanks, Brian

    Read the article

  • How to improve the use of Delphi Frames

    - by Brian Frost
    I've used frames in Delphi for years, and they are one of the most powerful features of the VCL, but standard use of them seems to have some risk such as: It's easy to accidentally move or edit the frame sub-components on a frame's host form without realising that you are 'tweaking' with the frame - I know this does not affect the original frame code, but it's generally not what you would want. When working with the frame you are still exposed to its sub-components for visual editing, even when that frame is years old and should not be touched. So I got to thinking.... Is there a way of 'grouping' components such that their positions are 'locked'? This would be useful for finished forms as well as frames. Often other developers return code to me where only the form bounds have changed and even they did not intend any change. Is there any way of turning a frame and its components into a single Delphi component? If so, the frame internals would be completely hidden and its useability would increase further. I'm interested in any thoughts... Brian.

    Read the article

  • jQuery AJAX call not working in Webkit

    - by Brian
    I've run into a strange issue with Webkit based browsers (both Safari and Chrome - I'm testing on a Mac) and I am not sure what is causing it. Here's a small script I've created that replicates the issue: <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" language="javascript"> function doRequest() { document.test.submit(); $.ajax({ type: "GET", cache: false, url: 'ajax.php?tmp=1', success: doSuccess }); } function doSuccess(t_data,t_status,req) { alert('Data is: '+ t_data +', XMLHTTPRequest status is: '+ req.status); } </script> </head> <body> <form name="test" method="post" action="ajax.html" enctype="multipart/form-data"> <input type="file" name="file_1"> <br><input type="button" value="upload" onclick="doRequest();"> </form> </body> </html> ajax.php is: <?php echo $_REQUEST['tmp']; ?> This works as is on Firefox, but the XMLHTTPRequest status is always "0" on both Safari and Chrome. If I remove this line: document.test.submit(); then it works, but of course the form is not submitted. I've tried changing the form submit button from "button" to "submit", but that also prevents it from working on Safari or Chrome. What I am trying to accomplish is: submit the form call another script to get status on the file being uploaded via the form (it's for a small upload progress meter). Any help is really appreciated - I'm hopeful it is just a quirk I'm not familiar with. Thanks! Brian

    Read the article

  • How can I modify/merge Jinja2 dictionaries?

    - by Brian M. Hunt
    I have a Jinja2 dictionary and I want a single expression that modifies it - either by changing its content, or merging with another dictionary. >>> import jinja2 >>> e = jinja2.Environment() Modify a dict: Fails. >>> e.from_string("{{ x[4]=5 }}").render({'x':{1:2,2:3}}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "jinja2/environment.py", line 743, in from_string return cls.from_code(self, self.compile(source), globals, None) File "jinja2/environment.py", line 469, in compile self.handle_exception(exc_info, source_hint=source) File "<unknown>", line 1, in template jinja2.exceptions.TemplateSyntaxError: expected token 'end of print statement', got '=' Two-stage update: Prints superfluous "None". >>> e.from_string("{{ x.update({4:5}) }} {{ x }}").render({'x':{1:2,2:3}}) u'None {1: 2, 2: 3, 4: 5}' >>> e.from_string("{{ dict(x.items()+ {3:4}.items()) }}").render({'x':{1:2,2:3}}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "jinja2/environment.py", line 868, in render return self.environment.handle_exception(exc_info, True) File "<template>", line 1, in top-level template code TypeError: <lambda>() takes exactly 0 arguments (1 given) Use dict(x,**y): Fails. >>> e.from_string("{{ dict((3,4), **x) }}").render({'x':{1:2,2:3}}) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "jinja2/environment.py", line 868, in render return self.environment.handle_exception(exc_info, True) File "<template>", line 1, in top-level template code TypeError: call() keywords must be strings So how does one modify the dictionary x in Jinja2 by changing an attribute or merging with another dictionary? This question is similar to: How can I merge two Python dictionaries as a single expression? -- insofar as Jinja2 and Python are analogous.

    Read the article

  • Unusual request URL in ASP.NET health monitoring event

    - by Troy Hunt
    I’m seeing a rather strange occurrence in the request information section of an ASP.NET health monitoring email I hope someone can shed some light on. This is a publicly facing website which runs on infrastructure at an Indian hosting provider. Health monitoring is notifying us of server errors via automated email but every now and then the requested URL appears as a totally different website. For example: Request information: Request URL: http://www.baidu.com/Default.aspx Request path: /Default.aspx User host address: 221.13.128.175 User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Obviously the site in question is not Baidu and obviously this attribute is not the referrer either; the “Request URL” value is the path which has generated the error. The IP address is located in Beijing (coincidental given the Baidu address?) and in this instance it looks like the SQL server backend was not accessible (I haven't included the entire error message for security's sake). What would cause the request URL attribute to be arbitrarily changed to that of another site? I’ve never seen this occur in a health monitoring event before. Thanks!

    Read the article

  • create app that has plugin which contains PyQt widget

    - by brian
    I'm writing an application that will use plugins. In the plugin I want to include a widget that allows the options for that plugin to be setup. The plugin will also include methods to operate on the data. What is is the best way to include a widget in a plugin? Below is pseudo code for what I've tried to do. My original plan was to make the options widget: class myOptionsWidget(QWidget): “”” create widget for plug in options “”” …. Next I planned on including the widget in my plugin: class myPlugin def __init__(self): self.optionWidget = myOptionsWidget() self.pluginNum = 1 …. def getOptionWidget(self): return(self.optionWidget) Then at the top level I'd do something like a = myPlugin() form = createForm(option=a.getOptionWidget()) … where createForm would create the form and include my plugin options widget. But when I try "a = myPlugin()" I get the error "QWidget: Must construct a QApplication before a QpaintDevice" so this method won't work. I know I would store the widget as a string and call eval on it but I'd rather not do that in case later on I want to convert the program to C++. What is the best way to write a plugin that includes a widget that has the options? Brian

    Read the article

  • Jinja2 returns "None" string for Google App Engine models

    - by Brian M. Hunt
    Google App Engine models, likeso: from google.appengine.ext.db import Model class M(): name = db.StringProperty() Then in a Jinja2 template called from a Django view with an in instance of M passed in as m: The name of this M is {{ m.name }}. When m is initialized without name being set, the following is printed: The name of this M is None. The preferable and expected output (and the output when using Django templates) would be/is: The name of this M is . Do you know why this is happening, and how to get the preferred & expected output?

    Read the article

  • Backbone.js not registering Model.hasChanged event

    - by Brian M. Hunt
    Hello, I'm trying to get a View in Backbone.js to save when there's a 'change' event if (and only if) the data has changed. Long story short, I've a 'change' event set on the View that calls this: function changed_event() { log.debug("Before: " + this.model.get('name')) // not 'contrived!' this.model.set({'name': 'contrived!'}); log.debug("After: " + this.model.get('name')) // 'contrived!' if (this.model.hasChanged()) { alert("This is never called."); } } I'd like to know why the model.hasChanged() is false when clearly the model has been changed. I'm not sure what other information is necessary, but if there is more information that may be helpful please comment and I'll elaborate. Thank you for reading.

    Read the article

  • How to chroot Django

    - by Brian M. Hunt
    Can one run Django in a chroot? Notably, what's necessary in order to set up (for example) /var/www as a chroot'd directory and then have Django run in that chroot'd directory? Thank you - I'm grateful for any input.

    Read the article

  • Does SharpSVN have an API to manage repository permissions

    - by Troy Hunt
    Does anyone know if there is any API exposed to manage repository permissions within SharpSVN? For example, programatically adding read and write permissions on a per repository basis. Alternatively, any other thoughts on managing permissions with other SVN APIs? Worst case wil be manually managing the contents of svnaccessfile but this is a last resort. Thanks.

    Read the article

  • Is is possible to derive currency symbol from currency code?

    - by Dave Hunt
    My iPhone app formats an NSDecimalNumber as a currency using setCurrencyCode, however another screen displays just the currency symbol. Rather than storing both the currency code and symbol, is it possible to derive the symbol from the code? I thought the following might work, but it just returns the symbol as $: currencyCode = [dictPrices valueForKey:@"currencyCode"]; NSNumberFormatter *numberFormatter = [[[NSNumberFormatter alloc] init] autorelease]; [numberFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4]; [numberFormatter setCurrencyCode:currencyCode]; [numberFormatter setNumberStyle:NSNumberFormatterCurrencyStyle]; NSString *currencySymbol = [numberFormatter currencySymbol];

    Read the article

  • ETL mechanisms for MySQL to SQL Server over WAN

    - by Troy Hunt
    I’m looking for some feedback on mechanisms to batch data from MySQL Community Server 5.1.32 with an external host down to an internal SQL Server 05 Enterprise machine over VPN. The external box accumulates data throughout business hours (about 100Mb per day), which then needs to be transferred internationally across a WAN connection to an internal corporate environment before some BI work is performed. This should just be change-sets making their way down each night. I’m interested in thoughts on the ETL mechanisms people have successfully used in similar scenarios before. SSIS seems like a potential candidate; can anyone comment on the suitability for this scenario? Alternatively, other thoughts on how to do this in a cost-conscious way would be most appreciated. Thanks!

    Read the article

  • kick off a map reduce job from my java/mysql webapp

    - by Brian
    Hi guys, I need a bit of archecture advice. I have a java based webapp, with a JPA based ORM backed onto a mysql relational database. Now, as part of the application I have a batch job that compares thousands of database records with each other. This job has become too time consuming and needs to be parallelized. I'm looking at using mapreduce and hadoop in order to do this. However, I'm not too sure about how to integrate this into my current architecture. I think the easiest initial solution is to find a way to push data from mysql into hadoop jobs. I have done some initial research on this and found the following relevant information and possibilities: 1) https://issues.apache.org/jira/browse/HADOOP-2536 this gives an interesting overview of some inbuilt JDBC support 2) This article http://architects.dzone.com/articles/tools-moving-sql-database describes some third party tools to move data from mysql to hadoop. To be honest I'm just starting out with learning about hbase and hadoop but I really don't know how to integrate this into my webapp. Any advice is greatly appreciated. cheers, Brian

    Read the article

  • Python Process won't call atexit

    - by Brian M. Hunt
    I'm trying to use atexit in a Process, but unfortunately it doesn't seem to work. Here's some example code: import time import atexit import logging import multiprocessing logging.basicConfig(level=logging.DEBUG) class W(multiprocessing.Process): def run(self): logging.debug("%s Started" % self.name) @atexit.register def log_terminate(): # ever called? logging.debug("%s Terminated!" % self.name) while True: time.sleep(10) @atexit.register def log_exit(): logging.debug("Main process terminated") logging.debug("Main process started") a = W() b = W() a.start() b.start() time.sleep(1) a.terminate() b.terminate() The output of this code is: DEBUG:root:Main process started DEBUG:root:W-1 Started DEBUG:root:W-2 Started DEBUG:root:Main process terminated I would expect that the W.run.log_terminate() would be called when a.terminate() and b.terminate() are called, and the output to be something likeso (emphasis added)!: DEBUG:root:Main process started DEBUG:root:W-1 Started DEBUG:root:W-2 Started DEBUG:root:W-1 Terminated! DEBUG:root:W-2 Terminated! DEBUG:root:Main process terminated Why isn't this working, and is there a better way to log a message (from the Process context) when a Process is terminated? Thank you for your input - it's much appreciated.

    Read the article

  • How do I use text in one cell to trigger row to be copied on another sheet in Excel?

    - by Brian Eby
    I provide all of the cut lists for our cabinet manufacturing in Excel. I tally all parts for the entire job on the first worksheet in an Excel file, and then filter the rows based on the "Material" column, and manually copy/paste each row in to its own material-specific worksheet (example: I filter "Materials" column for "Maple Ply", and then copy all "Maple Ply" rows to the "Maple Ply" worksheet). Then the material specific worksheets are sent to the shop floor for cutting. This is time consuming, and if I need to change any data in the first page, I have to go and manually update the copied row in its material-specific page. Is there any way to make each material page "look" for its material, and automatically populate itself with any row that has the appropriate material in the material column (example: any time I enter "Maple Ply" in the material column of sheet one, that row is automatically copied to the "Maple Ply" worksheet)? If so, could this link be dynamic, rather than just a copy, so that if I change a cell in a particular row on sheet one, that data is also updated on the material-specific worksheet copy? Thank you, Brian

    Read the article

  • Reading a large file into Perl array of arrays and manipulating the output for different purposes

    - by Brian D.
    Hello, I am relatively new to Perl and have only used it for converting small files into different formats and feeding data between programs. Now, I need to step it up a little. I have a file of DNA data that is 5,905 lines long, with 32 fields per line. The fields are not delimited by anything and vary in length within the line, but each field is the same size on all 5905 lines. I need each line fed into a separate array from the file, and each field within the line stored as its own variable. I am having no problems storing one line, but I am having difficulties storing each line successively through the entire file. This is how I separate the first line of the full array into individual variables: my $SampleID = substr("@HorseArray", 0, 7); my $PopulationID = substr("@HorseArray", 9, 4); my $Allele1A = substr("@HorseArray", 14, 3); my $Allele1B = substr("@HorseArray", 17, 3); my $Allele2A = substr("@HorseArray", 21, 3); my $Allele2B = substr("@HorseArray", 24, 3); ...etc. My issues are: 1) I need to store each of the 5905 lines as a separate array. 2) I need to be able to reference each line based on the sample ID, or a group of lines based on population ID and sort them. I can sort and manipulate the data fine once it is defined in variables, I am just having trouble constructing a multidimensional array with each of these fields so I can reference each line at will. Any help or direction is much appreciated. I've poured over the Q&A sections on here, but have not found the answer to my questions yet. Thanks!! -Brian

    Read the article

  • jQuery $.each(arr, foo) versus $(arr).each(foo)

    - by Brian M. Hunt
    In jQuery, what's the difference between the following two constructions of jQuery.each: // Given var arr = [1,2,3,4], results = [], foo = function (index, element) { /* something done to/with each element */ results.push(element * element); // arbitrary thing. } // construction #1 $.each(arr, foo); // results = [1,4,9,16] // construction #2 $(arr).each(foo); // results = [1,4,9,16] Is there any difference, or is it purely syntax?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >