Search Results

Search found 328 results on 14 pages for 'samuel clay'.

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

  • Python 4 step setup with progressBars

    - by Samuel Taylor
    I'm having a problem with the code below. When I run it the progress bar will pulse for around 10 secs as meant to and then move on to downloading and will show the progress but when finished it will not move on to the next step it just locks up. import sys import time import pygtk import gtk import gobject import threading import urllib import urlparse class WorkerThread(threading.Thread): def __init__ (self, function, parent, arg = None): threading.Thread.__init__(self) self.function = function self.parent = parent self.arg = arg self.parent.still_working = True def run(self): # when does "run" get executed? self.parent.still_working = True if self.arg == None: self.function() else: self.function(self.arg) self.parent.still_working = False def stop(self): self = None class MainWindow: def __init__(self): gtk.gdk.threads_init() self.wTree = gtk.Builder() self.wTree.add_from_file("gui.glade") self.mainWindows() def mainWindows(self): self.mainWindow = self.wTree.get_object("frmMain") dic = { "on_btnNext_clicked" : self.mainWindowNext, } self.wTree.connect_signals(dic) self.mainWindow.show() self.installerStep = 0 # 0 = none, 1 = preinstall, 2 = download, 3 = install info, 4 = install #gtk.main() self.mainWindowNext() def pulse(self): self.wTree.get_object("progress").pulse() if self.still_working == False: self.mainWindowNext() return self.still_working def preinstallStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 1 WT = WorkerThread(self.heavyWork, self) #Would do a heavy function here like setup some thing WT.start() gobject.timeout_add(75, self.pulse) def downloadStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 2 urllib.urlretrieve('http://mozilla.mirrors.evolva.ro//firefox/releases/3.6.3/win32/en-US/Firefox%20Setup%203.6.3.exe', '/tmp/firefox.exe', self.updateHook) self.mainWindowNext() def updateHook(self, blocks, blockSize, totalSize): percentage = float ( blocks * blockSize ) / totalSize if percentage > 1: percentage = 1 self.wTree.get_object("progress").set_fraction(percentage) while gtk.events_pending(): gtk.main_iteration() def installInfoStep(self): self.wTree.get_object("btnNext").set_sensitive(1) self.wTree.get_object("notebook1").set_current_page(1) self.installerStep = 3 def installStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 4 WT = WorkerThread(self.heavyWork, self) #Would do a heavy function here like setup some thing WT.start() gobject.timeout_add(75, self.pulse) def mainWindowNext(self, widget = None): if self.installerStep == 0: self.preinstallStep() elif self.installerStep == 1: self.downloadStep() elif self.installerStep == 2: self.installInfoStep() elif self.installerStep == 3: self.installStep() elif self.installerStep == 4: sys.exit(0) def heavyWork(self): time.sleep(10) if __name__ == '__main__': MainWindow() gtk.main()

    Read the article

  • How to diganose an unlogged Error 500 on Apache?

    - by samuel morhaim
    We are running a very simple Symfony script, that randomly returns an Error 500. The system administrator says he can't find any trace of an Error 500 on the error logs, however using Curl or Firebug, it is obvious that an Error 500 is being returned. The script simply parses a POST request submitted to an URL on our server. We already checked for performance, memory etc but nothing seems to be the problem. How is this possible? We already enabled all debugging, logging, on Apache, PHP, etc and nothing.

    Read the article

  • Image storage as a service

    - by Samuel
    Google App Engine provides a image API for storing / retrieving images. We are currently not in a position to deploy our application on top of App Engine because of limitations in the java frameworks (jboss seam 2.2.0) we are using to build our j2ee application. We would eventually want to deploy our production application on top of Google App Engine, but what are the short term options (java based open source products) which provides comparable functionality to Google App Engine's Image API and will have an easier migration path at a later point in time.

    Read the article

  • Getting jQuery datepicker to attach to a TextBox within a ListView

    - by Clay
    I am using the jQuery Datepicker without any problem for TextBox controls that are non-templated. However, I am unable to get the datepicker to work with a TextBox that is in an EditItemTemplate of a ListView control. My latest attempt is to get a handle on this textbox by CSS class name "DateControl", any ideas? <asp:ListVIew id="lvTest" runat="server"> <LayoutTemplate>...</LayoutTemplate> <ItemTemplate>...</ItemTemplate> <EditItemTemplate> <tr> <td> <asp:TextBox ID="txtExpReceiveDate" runat="server" Text='<%#Eval("exp_receive_date","{0:dd-MMM-yy}") %>' CssClass="DateControl" /> </td> </tr> </EditTemplate> </asp:ListView> <script type="text/javascript" language="javascript"> $(document).ready(function () { $('DateControl').datepick({ dateFormat: 'M-dd-yyyy' }); }); </script>

    Read the article

  • capturing user identity for an online application

    - by Samuel
    We are designing an online application (college admission form) which mandates the user to upload a scanned copy of his photo along with his signature, so that this information can be used to cross verify the applicant when he appears for a exam + personal interview at a later point in time. This entire process requires a scanner for the applicant to scan his photo / signature into an appropriate size. Is there a better way to capture user identity for such purposes as usage of scanner for capturing signature, photo is a painful process.

    Read the article

  • javascript: execute a bunch of asynchronous method with one callback

    - by Samuel Michelot
    I need to execute a bunch of asynchronous methods (client SQLite database), and call only one final callback. Of course, the ugly way is: execAll : function(callBack) { asynch1(function() { asynch2(function() { ... asynchN(function() { callBack(); }) }) }); } But I know there are better ways to do it. Intuitively I would detect when all call back has been called with a counter to call the final callback. I think this is a common design-pattern, so if someone could point me in the right direction... Thanks in advance !

    Read the article

  • date representation in user interface

    - by Samuel
    Most of the sites capture the date (e.g. birth date) information as either a single entity (i.e via a calendar control) or instead as separate fields (date, month, year). Are there any benefits in showing them as separate fields? Are they represented in the database as DATE data type or as separate fields. I am just trying to understand the pros & cons of representing the date field.

    Read the article

  • Tortoise SVN does not give option to "Add to SVN"

    - by Clay Nichols
    I've created an SVN repository and added folders and added contents and Committed. No problem. But when go to add a new folder (the others were on the P:\ drive, now I want to add our website which is on the C:\ drive) but Tortoise doesn't give me the option of Adding a folder. I have no idea why. Help file shows the instructions I'd expect ("right click on the folder you want to add and choose +Add...") but Add... isn't in the menu. This is TortoiseSVN v 1.6.7.18415 (I'm about to update it but I was able to add folders before so I don't think this is just a bug, I think maybe I'm missing something obvious).

    Read the article

  • Pseudo Transparant images

    - by Samuel
    Hello World! For an assignment at university we program in a pretty unknown language Modula 2, which lacks major graphic support. I was wondering how to achieve a 'transparency' effect on images, i figured it would work like this: Create a 2D array for the background area of the image filled with the colours of the different pixels in that area, create another 2D array of the image with again the colours of every picture and than merge the pixel colours and draw the different "new colours" on their appropriate place. What i was wondering about: how do i merge the colours (hexadecimals) just: ( colour1 + colour2 ) / 2 ? Thanks for your help!!

    Read the article

  • AudioConverterConvertBuffer problem with insz error

    - by Samuel
    Hi Codegurus, I have a problem with the this function AudioConverterConvertBuffer. Basically I want to convert from this format _ streamFormat.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked |0 ; _streamFormat.mBitsPerChannel = 16; _streamFormat.mChannelsPerFrame = 2; _streamFormat.mBytesPerPacket = 4; _streamFormat.mBytesPerFrame = 4; _streamFormat.mFramesPerPacket = 1; _streamFormat.mSampleRate = 44100; _streamFormat.mReserved = 0; to this format _streamFormatOutput.mFormatFlags = kLinearPCMFormatFlagIsSignedInteger | kLinearPCMFormatFlagIsPacked|0 ;//| kAudioFormatFlagIsNonInterleaved |0; _streamFormatOutput.mBitsPerChannel = 16; _streamFormatOutput.mChannelsPerFrame = 1; _streamFormatOutput.mBytesPerPacket = 2; _streamFormatOutput.mBytesPerFrame = 2; _streamFormatOutput.mFramesPerPacket = 1; _streamFormatOutput.mSampleRate = 44100; _streamFormatOutput.mReserved = 0; and what i want to do is to extract an audio channel(Left channel or right channel) from an LPCM buffer based on the input format to make it mono in the output format. Some logic code to convert is as follows This is to set the channel map for PCM output file SInt32 channelMap[1] = {0}; status = AudioConverterSetProperty(converter, kAudioConverterChannelMap, sizeof(channelMap), channelMap); and this is to convert the buffer in a while loop AudioBufferList audioBufferList; CMBlockBufferRef blockBuffer; CMSampleBufferGetAudioBufferListWithRetainedBlockBuffer(sampBuffer, NULL, &audioBufferList, sizeof(audioBufferList), NULL, NULL, 0, &blockBuffer); for (int y=0; y<audioBufferList.mNumberBuffers; y++) { AudioBuffer audioBuffer = audioBufferList.mBuffers[y]; //frames = audioBuffer.mData; NSLog(@"the number of channel for buffer number %d is %d",y,audioBuffer.mNumberChannels); NSLog(@"The buffer size is %d",audioBuffer.mDataByteSize); numBytesIO = audioBuffer.mDataByteSize; convertedBuf = malloc(sizeof(char)*numBytesIO); status = AudioConverterConvertBuffer(converter, audioBuffer.mDataByteSize, audioBuffer.mData, &numBytesIO, convertedBuf); char errchar[10]; NSLog(@"status audio converter convert %d",status); if (status != 0) { NSLog(@"Fail conversion"); assert(0); } NSLog(@"Bytes converted %d",numBytesIO); status = AudioFileWriteBytes(mRecordFile, YES, countByteBuf, &numBytesIO, convertedBuf); NSLog(@"status for writebyte %d, bytes written %d",status,numBytesIO); free(convertedBuf); if (numBytesIO != audioBuffer.mDataByteSize) { NSLog(@"Something wrong in writing"); assert(0); } countByteBuf = countByteBuf + numBytesIO; But the insz problem is there... so it cant convert. I would appreciate any input Thanks in advance

    Read the article

  • c99 goto past initialization

    - by R Samuel Klatchko
    While debugging a crash, I came across this issue in some code: int func() { char *p1 = malloc(...); if (p1 == NULL) goto err_exit; char *p2 = malloc(...); if (p2 == NULL) goto err_exit; ... err_exit: free(p2); free(p1); return -1; } The problem occurs when the first malloc fails. Because we jump across the initialization of p2, it contains random data and the call to free(p2) can crash. I would expect/hope that this would be treated the same way as in C++ where the compiler does not allow a goto to jump across an initialization. My question: is jumping across an initialization allowed by the standard or is this a bug in gcc's implementation of c99?

    Read the article

  • Inserting rows while fetching(from another table) in SQLite

    - by Samuel
    I'm getting this error no matter what with python and sqlite. File "addbooks.py", line 77, in saveBook conn.commit() sqlite3.OperationalError: cannot commit transaction - SQL statements in progress The code looks like this: conn = sqlite3.connect(fname) cread = conn.cursor() cread.execute('''select book_text from table''') while True: row = cread.fetchone() if row is None: break .... for entry in getEntries(doc): saveBook(entry, conn) Can't do a fetchall() because table and column size are big, and the memory is scarce. What can be done without resorting to dirty tricks(as getting the rowids in memory, which would probably fit, and then selecting the rows one by one)?.

    Read the article

  • How come my red border is not wrapping around my text div and my side bar div

    - by Clay
    How come my red border is not wrapping around my text div and my side bar div. Here's my code: CSS: body{ background-color: #d7d7d7; color: #666666; font-family: arial, sans-serif; font-size: x-small; } div#header { background-color: #323232; height: 140px; width: 950px; } div#maincontainer { background-color: #d7d7d7; width: 950px; height: auto; margin-top: 5px; border: 1px solid red; } div#maintextcontainer{ //background-color: #333333; width: 640px; //margin-right: 10px; margin: 1px; float: left; color: black; } div#maintextcontainer h2{ color: #4f4f4f; } div#sidebarcontainer { //background-color: #333333; width: 300px; float: left; color: black; margin: 1px; } div#footer{ background-color: #323232; width: 950px; margin-top: 5px; clear: left; } div#global{ width: 950px; margin: auto; } HTML: <div id="global"> <div id="header"> This is the header div</div> <div id="maincontainer"> <div id="maintextcontainer">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Morbi aliquam neque eu turpis euismod eget suscipit nulla ultrices. Donec sagittis mi non sem vestibulum elementum dapibus risus auctor. Praesent tristique laoreet dapibus. Integer vel ligula lorem, et pharetra lorem. </div> <div id="sidebarcontainer">Nam at lectus vitae est tempor lacinia sed et ante. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Praesent interdum mi id nisi aliquet pulvinar. </div> </div> <div id="footer">This is Footer Text</div> </div>

    Read the article

  • Scheduler with Asp Mvc

    - by Samuel
    Hi, I want to use a Scheduler like Telerik Scheduler in my Mvc project. The problem is that the Scheduler is a Asp.Net WebForm control. For this reason, I must create a WebForm page in my Mvc project to put the Scheduler control. When I show the page, it work fine to render the layout of the control but if I try to interact with it; click for change date, change to day view to week view, the control don't change. I know that postback doesn't work in mvc project but does it work in a WebForm page in a Mvc project? If it doesn't work, it is the reason why when I try to interact with the control, the control don't respond. I think it's because the postback don't work and the Scheduler use 100 % Databinding where when I change date, the postback don't contain any data that I have changed and for this reason, the control can't change is layout. Have you any ideas about postback with WebForm in mvc project? What type of design can I adopt? (Two differents projets: One for my Scheduler with WebForm and another for all the rest of my website in Mvc project) Any other control easily to use with Scheduler? Tips and tricks when needing both WebForm control and Mvc control in Mvc project? Thank you very much.

    Read the article

  • Multiple Post Requests Occuring in Quick Succession

    - by Samuel
    This is a bit of an open ended question but we have a problem with a web application that on the final step of completing an order, multiple post requests are being made, sometimes up to 10 and all within a couple of seconds to the page. Theirs nothing unusual about the page, the user fills out a form which is then validated using the jQuery form validation plugin. We've seen this behavior exhibited over a couple of different browser types, notably IE6 but also IE8. We've also managed to trigger the bug ourselves but nothing out of the ordinary seems to occur on the browsers end, everything progresses as normal. Apache logs show that multiple post requests where made at the same time and the Rails logs show that multiple posts requests were also received by the application, leading me to think it's a problem with the browser. I've exhausted all avenues that I can think of for debugging so I'm throwing this out there to see if anyone has some ideas of what we could try or look for next.

    Read the article

  • Why does jQuery fadeOut not work inside this setInterval loop?

    - by Clay McClure
    I'm trying to load random items into a div every few seconds, with a nice fadeOut/fadeIn transition between each load. Here's the code: <html> <body> <div id="item"></div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script> <script type="text/javascript"> // Load a random item var item = $('#item'); function load_item() { item.fadeOut(5000, function() { item.load('http://dynamic.xkcd.com/comic/random/ #middleContent img', null, function() { item.fadeIn(5000); }); }); }; // Load initial featured item load_item(); // Schedule repeated loading setInterval(load_item, 15000); </script> </body> </html> This works fine the first time through, but on subsequent calls to load_item, the fadeOut() seems to stop working. It doesn't actually fade the #item div out, but jumps immediately into the callback function, ignoring the 5000 delay. What am I doing wrong?

    Read the article

  • capturing user IP address information for audit

    - by Samuel
    We have a requirement to log IP address information of all users who use a certain web application based on JEE 5. What would be an appropriate sql data type for storing IPv4 or IPv6 addressses in the following supported databases (h2, mysql, oracle). There is also a need to filter activity from certain IP addresses. Should I just treat the representation as a string field (say varchar(32) to hold ipv4, ipv6 addresses)

    Read the article

  • Randomize numbers within a subset

    - by Samuel
    I have a array of integer numbers (say 1,2,3,4,5 or 1,2,3, ... 10 or 1,2,3, ... 50) from which I would like to get a random set of numbers ordered differently every time. Is there a utility method to do this? e.g. for 1,2,3,4,5 post randomization it might be either [1,5,4,2,3 or 2,1,3,5,4 or 3,1,2,4,5 or ...] I would like to know if there is a java utility method / class which already provides this capability?

    Read the article

  • How to disable sql creation for JPA entity classes

    - by Samuel
    We have some JPA entity classes which are currently under development and wouldn't want them as part of the testing cycle. We tried commenting out the relevant entity classes in META-INF\persistence.xml but the hbm2ddl reverse engineering tool still seems to generate SQL for those entities. How do I tell my code to ignore these classes? Are there any annotations for these or should I have to comment out the @Entity annotation along with my changes in persistence.xml file.

    Read the article

  • Python 4 steps setup with progressBars

    - by Samuel Taylor
    I'm having a problem with the code below. When I run it the progress bar will pulse for around 10 secs as meant to and then move on to downloading and will show the progress but when finished it will not move on to the next step it just locks up. import sys import time import pygtk import gtk import gobject import threading import urllib import urlparse class WorkerThread(threading.Thread): def __init__ (self, function, parent, arg = None): threading.Thread.__init__(self) self.function = function self.parent = parent self.arg = arg self.parent.still_working = True def run(self): # when does "run" get executed? self.parent.still_working = True if self.arg == None: self.function() else: self.function(self.arg) self.parent.still_working = False def stop(self): self = None class MainWindow: def __init__(self): gtk.gdk.threads_init() self.wTree = gtk.Builder() self.wTree.add_from_file("gui.glade") self.mainWindows() def mainWindows(self): self.mainWindow = self.wTree.get_object("frmMain") dic = { "on_btnNext_clicked" : self.mainWindowNext, } self.wTree.connect_signals(dic) self.mainWindow.show() self.installerStep = 0 # 0 = none, 1 = preinstall, 2 = download, 3 = install info, 4 = install #gtk.main() self.mainWindowNext() def pulse(self): self.wTree.get_object("progress").pulse() if self.still_working == False: self.mainWindowNext() return self.still_working def preinstallStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 1 WT = WorkerThread(self.heavyWork, self) #Would do a heavy function here like setup some thing WT.start() gobject.timeout_add(75, self.pulse) def downloadStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 2 urllib.urlretrieve('http://mozilla.mirrors.evolva.ro//firefox/releases/3.6.3/win32/en-US/Firefox%20Setup%203.6.3.exe', '/tmp/firefox.exe', self.updateHook) self.mainWindowNext() def updateHook(self, blocks, blockSize, totalSize): percentage = float ( blocks * blockSize ) / totalSize if percentage > 1: percentage = 1 self.wTree.get_object("progress").set_fraction(percentage) while gtk.events_pending(): gtk.main_iteration() def installInfoStep(self): self.wTree.get_object("btnNext").set_sensitive(1) self.wTree.get_object("notebook1").set_current_page(1) self.installerStep = 3 def installStep(self): self.wTree.get_object("progress").set_fraction(0) self.wTree.get_object("btnNext").set_sensitive(0) self.wTree.get_object("notebook1").set_current_page(0) self.installerStep = 4 WT = WorkerThread(self.heavyWork, self) #Would do a heavy function here like setup some thing WT.start() gobject.timeout_add(75, self.pulse) def mainWindowNext(self, widget = None): if self.installerStep == 0: self.preinstallStep() elif self.installerStep == 1: self.downloadStep() elif self.installerStep == 2: self.installInfoStep() elif self.installerStep == 3: self.installStep() elif self.installerStep == 4: sys.exit(0) def heavyWork(self): time.sleep(10) if __name__ == '__main__': MainWindow() gtk.main() I have a feeling that its something to do with: while gtk.events_pending(): gtk.main_iteration() Is there a better way of doing this?

    Read the article

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