Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 116/191 | < Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >

  • graphing amplitude

    - by John
    I was wondering if someone could point me to a good tutorial or show me how to graph the amplitude from a bytearray. The audio format I am using is: ULAW 8000.0 Hz, 8 bit, mono, 1 bytes/frame.

    Read the article

  • Keeping messages in queue in case of receiver crash

    - by John Doe
    Hi, We've a Spring JMS message listener container for receiving messages asynchronously. Using DefaultMessageListenerContainer and in sessionTransacted mode. I understand being in sessionTransacted mode means in case of an exception the message will be put back into the queue. But how can I make sure the message won't be deleted from the queue even if the receiver (which is picked the message) crashes or just the machine running it looses power? At first I thought CLIENT_ACKNOWLEDGE acknowledge mode should save me, but apparently it's not the case, Spring calls .acknowledge() no matter what. So here's my question, how can I guarantee the delivery? Using a custom MessageListenerContainer? Using a transaction manager?

    Read the article

  • Make text in a <div> wrap around a child element.

    - by John
    In Word you can place an image on a page and have the text flow nicely around it. I was wondering how far one can get towards this using CSS, noting that is has to work in IE6. I already have something sort of close using float, but the floated child-element still 'blocks' text above it. So it partially wraps. Is it possible to put a child div at some arbitrary position in the parent, and have text flow around it freely? The actual use-case here is to put illustrations inside the main content , where each illustration is implemented inside a child . I repeat, it has to work on IE6. And I don't want to get too involved in browser-specific hacks... floating the child at least works on IE6 with no tweaking. Currently I have like this: <div> <div class="illustration"> <img src="image1.png" /> <p>Illustration caption</p> </div> <p>Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Atvero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. </p> </div> div.illustration { float:right; border-top: 1px solid #505050; border-left: 1px solid #505050; border-right: 1px solid #505050; border-bottom: 1px solid #505050; margin-right:30px; margin-top:100px; text-align:center; padding:2px; background: #96C3FF; } div.illustration p { margin:0; font-size:small; font-style:italic; padding:0; }

    Read the article

  • .gitignore not working for me

    - by John Grey
    Hi, I'm trying to create a new git repository from existing folder. I've created a .gitignore file in the root of the folder. But if I say 'git add *' 'git commit' 'git push' files that should be ignored still get commited to the remote repository. I'm on Windows. Also I've bought a license for SmartGIT. It also seems to ignore .gitignore. I have to manually select which new files to commit. What am I doing wrong?

    Read the article

  • Prawn image position

    - by John
    I'm trying to layout 6 images per page with prawn in Ruby: case (idx % 6) # ugly when 0 : (pdf.start_new_page; pdf.image img, :position => :left, :vposition => :top, :width => 270) when 1 : pdf.image img, :position => :right, :vposition => :top, :width => 270 when 2 : pdf.image img, :position => :left, :vposition => :center, :width => 270 when 3 : pdf.image img, :position => :right, :vposition => :center, :width => 270 when 4 : pdf.image img, :position => :left, :vposition => :bottom, :width => 270 when 5 : pdf.image img, :position => :right, :vposition => :bottom, :width => 270 end Not sure what I'm doing wrong, but it prints the first 3 images to the PDF, then creates a new page and prints the last three: Page 1: <img> <img> <blank> <blank> <blank> <blank> Page 2: <blank> <blank> <blank> <img> <img> <img> Any suggestions would help.

    Read the article

  • Is my code really not unit-testable?

    - by John
    A lot of code in a current project is directly related to displaying things using a 3rd-party 3D rendering engine. As such, it's easy to say "this is a special case, you can't unit test it". But I wonder if this is a valid excuse... it's easy to think "I am special" but rarely actually the case. Are there types of code which are genuinely not suited for unit-testing? By suitable, I mean "without it taking longer to figure out how to write the test than is worth the effort"... dealing with a ton of 3D math/rendering it could take a lot of work to prove the output of a function is correct compared with just looking at the rendered graphics.

    Read the article

  • Upload image with Tumblr API in PHP

    - by John
    I'm having trouble uploading a photo from my computer to tumblr using their API. http://www.tumblr.com/docs/en/api photo - Requires either source or data, but not both. If both are specified, source is used. * source - The URL of the photo to copy. This must be a web-accessible URL, not a local file or intranet location. * data - An image file. See File uploads below. * caption (optional, HTML allowed) * click-through-url (optional) I need to use data File uploads can be done in a data parameter where specified above. You may use either of the common encoding methods: multipart/form-data method, like a file upload box in a web form. Maximum size: o 50 MB for videos o 10 MB for photos o 10 MB for audio I would post my code but it's not showing up correctly for me.

    Read the article

  • c++ global operator not playing well with template class

    - by John
    ok, i found some similar posts on stackoverflow, but I couldn't find any that pertained to my exact situation and I was confused with some of the answers given. Ok, so here is my problem: I have a template matrix class as follows: template <typename T, size_t ROWS, size_t COLS> class Matrix { public: template<typename, size_t, size_t> friend class Matrix; Matrix( T init = T() ) : _matrix(ROWS, vector<T>(COLS, init)) { /*for( int i = 0; i < ROWS; i++ ) { _matrix[i] = new vector<T>( COLS, init ); }*/ } Matrix<T, ROWS, COLS> & operator+=( const T & value ) { for( vector<T>::size_type i = 0; i < this->_matrix.size(); i++ ) { for( vector<T>::size_type j = 0; j < this->_matrix[i].size(); j++ ) { this->_matrix[i][j] += value; } } return *this; } private: vector< vector<T> > _matrix; }; and I have the following global function template: template<typename T, size_t ROWS, size_t COLS> Matrix<T, ROWS, COLS> operator+( const Matrix<T, ROWS, COLS> & lhs, const Matrix<T, ROWS, COLS> & rhs ) { Matrix<T, ROWS, COLS> returnValue = lhs; return returnValue += lhs; } To me, this seems to be right. However, when I try to compile the code, I get the following error (thrown from the operator+ function): binary '+=' : no operator found which takes a right-hand operand of type 'const matrix::Matrix<T,ROWS,COLS>' (or there is no acceptable conversion) I can't figure out what to make of this. Any help if greatly appreciated!

    Read the article

  • Save object in CoreData

    - by John
    I am using CoreData with iPhone SDK. I am making a notes app. I have a table with note objects displayed from my model. When a button is pressed I want to save the text in the textview to the object being edited. How do I do this? I've been trying several things but none seem to work. Thanks EDIT: NSManagedObjectContext *context = [fetchedResultsController managedObjectContext]; NSEntityDescription *entity = [[fetchedResultsController fetchRequest] entity]; NSManagedObject *newManagedObject = [NSEntityDescription insertNewObjectForEntityForName:[entity name] inManagedObjectContext:context]; [newManagedObject setValue:detailViewController.textView.text forKey:@"noteText"]; NSError *error; if (![context save:&error]) { /* Replace this implementation with code to handle the error appropriately. abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. If it is not possible to recover from the error, display an alert panel that instructs the user to quit the application by pressing the Home button. */ NSLog(@"Unresolved error %@, %@", error, [error userInfo]); abort(); } The above code saves it correctly but it saves it as a new object. I want it to be saved as the one I have selected in my tableView.

    Read the article

  • More elegant way to parse inline variables in strings

    - by Tom
    Currently I have this: function parse_string($string, $variables){ extract($variables); return eval('return "'. addcslashes($string, '"') .'";'); } So I can input this string: 'Hi {$name}, my name is {$own_name}' Together with this array: array('name' => 'John', 'own_name' => 'Tom') And get this back: 'Hi John, my name is Tom'   I've never liked this eval() approach but it works and it's fast (faster than regex at least). Question: Is there a more elegant way to do this (faster than using regex) in PHP5?

    Read the article

  • PHP / Windows - Opendir() fails opening subdirectories within symbolic linked directories

    - by John Himmelman
    Does anyone know a solution to this problem? I'm unable to open a subdirectory within a symboliclink'd directory. I've confirmed that the paths are correct (even copy & pasted the path into explorer, which parsed it fine). This is a strange, annoying, bug :|. Example: C:\folder\symbolic_link\dir1\dir2 - opening dir2 fails. C:\folder\symbolic_link\dir1 - works C:\folder\real_directory\dir1\dir2 - works C:\folder\real_directory\dir1 - works

    Read the article

  • Microsoft learning support for VS2010

    - by John
    OK, I am a big fan of WPF, and while it is large area to fully understand, Microsoft has been great in posting loads of training video at http://windowsclient.net/learn/videos_wpf.aspx However with the release of 2010 it all seams to have gone very quiet. I expected a lot of the support to be updated for 2010 and I also expected a lot of new videos on the best way to use the new features in 2010. Currently I find myself working through videos based on 2008 (or even 2005) and trying to apply them to 2010. Don't get me wrong it not that I mind doing this, it just that I fear I may be learning methods which have better or different solutions in 2010. It is just me expecting too much of Microsoft, or have I missed out on a new website?

    Read the article

  • Whats the best semantic default/starting layout for html5?

    - by John Isaacks
    I am a little confused on how the new tags should go. Is this correct: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> </head> <body> <section> <header> <nav></nav> </header> <section> </section> <footer> </footer> <section> </body> </html> Or should one of the sections be an <article>? What should be the starting layout?

    Read the article

  • How to understand existing projects

    - by John
    Hi. I am a trainee developer and have been writing .NET applications for about a year now. Most of the work I have done has involved building new applications (mainly web apps) from scratch and I have been given more or less full control over the software design. This has been a great experience however, as a trainee developer my confidence about whether the approaches I have taken are the best is minimal. Ideally I would love to collaborate with more experienced developers (I find this the best was I learn) however in the company I work for developers tend to work in isolation (a great shame for me). Recently I decided that a good way to learn more about how experienced developers approach their design might be to explore some open source projects. I found myself a little overwhelmed by the projects I looked at. With my level of experience it was hard to understand the body of code I faced. My question is slight fuzzy one. How do developers approach the task of understanding a new medium to large scale project. I found myself pouring over lots of code and struggling to see the wood for the trees. At any one time I felt that I could understand a small portion of the system but not see how its all fits together. Do others get this same feeling? If so what approaches do you take to understanding the project? Do you have any other advice about how to learn design best practices? Any advice will be very much appreciated. Thank you.

    Read the article

  • Using stringstream instead of `sscanf` to parse a fixed-format string

    - by John Dibling
    I would like to use the facilities provided by stringstream to extract values from a fixed-format string as a type-safe alternative to sscanf. How can I do this? Consider the following specific use case. I have a std::string in the following fixed format: YYYYMMDDHHMMSSmmm Where: YYYY = 4 digits representing the year MM = 2 digits representing the month ('0' padded to 2 characters) DD = 2 digits representing the day ('0' padded to 2 characters) HH = 2 digits representing the hour ('0' padded to 2 characters) MM = 2 digits representing the minute ('0' padded to 2 characters) SS = 2 digits representing the second ('0' padded to 2 characters) mmm = 3 digits representing the milliseconds ('0' padded to 3 characters) Previously I was doing something along these lines: string s = "20101220110651184"; unsigned year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0, milli = 0; sscanf(s.c_str(), "%4u%2u%2u%2u%2u%2u%3u", &year, &month, &day, &hour, &minute, &second, &milli ); The width values are magic numbers, and that's ok. I'd like to use streams to extract these values and convert them to unsigneds in the interest of type safety. But when I try this: stringstream ss; ss << "20101220110651184"; ss >> setw(4) >> year; year retains the value 0. It should be 2010. How do I do what I'm trying to do? I can't use Boost or any other 3rd party library, nor can I use C++0x.

    Read the article

  • What is Restful Routing?

    - by John Baker
    I have been searching pretty hard for info out on the net to explain exactly what Restful routing is but I haven't had any success. There are a lot of resources but not a who lot make sense to me. I'm familiar with Ruby On Rails's routing system and well as how Code Igniter and PhpCake route things but is there more to it than having a centralized location where you give out routes based on a directory structure? Like this: controller/action/id/ Admin/editUser/22 I'd appreciate any help with this, it's had me baffled for months. I just thought of putting it on SO. Thanks

    Read the article

  • Why does C++ linking use virtually no CPU?

    - by John
    On a native C++ project, linking right now can take a minute or two, yet during this time CPU drops from 100% during compilation to virtually zero. Does this mean linking is primarily a disk activity? If so, is this the main area an SSD would make big changes? But, why aren't all my OBJ files (or as many as possible) kept in RAM after compilation to avoid this? With 4Gb of RAM I should be able to save a lot of disk access and make it CPU-bound again, no?

    Read the article

  • Why does Apple create it's views this way

    - by John Smith
    In the hope of fixing a bug of mine from another post i would like to know why apple writes this (for it's Elements example) UIView *localContainerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; self.containerView = localContainerView; [localContainerView release]; instead of the simpler method: containerView = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]]; ?

    Read the article

  • Type of member is not CLS-compliant

    - by John Galt
    Using Visual Studio 2008 and VB.Net: I have a working web app that uses an ASMX web service which is compiled into its separate assembly. I have another class library project compiled as a separate assembly that serves as a proxy to this web service. This all seems to work at runtime but I am getting this warning at compile time which I don't understand and would like to fix: Type of member 'wsZipeee' is not CLS-compliant I have dozens of webforms in the main project that reference the proxy class with no compile time complaints as this snippet shows: Imports System.Data Partial Class frmZipeee Inherits System.Web.UI.Page Public wsZipeee As New ProxyZipeeeService.WSZipeee.Zipeee Dim dsStandardMsg As DataSet Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load And yet I have one webform (also in the root of the main project) which gives me the "not CLS-compliant" message but yet attempts to reference the proxy class just like the other ASPX files. I get the compile time warning on the line annoted by me with 'ERROR here.. Imports System.Data Partial Class frmHome Inherits System.Web.UI.Page Public wsZipeee As New ProxyZipeeeService.WSZipeee.Zipeee ERROR here Dim dsStandardMsg As DataSet Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load This makes no sense to me. The file with the warning is called frmHome.aspx.vb; all others in the project declare things the same way and have no warning. BTW, the webservice itself returns standard datatypes: integer, string, and dataset.

    Read the article

  • CakePHP Observe field for validation check(already exists)

    - by deck john
    i have already user observe field in cakephp 1.3 Now i want to do the same thing in cakephp 2.0 I have one form.there is a one field named email. When user insert email. onblur there is a popup one message that displays "email already exists" or "right" for that i have write below code in my projects. the below code is my add file code <?php $options = array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exist'); echo $this->ajax->observeField('UserEmailId',array('url' => array( 'controller' => 'users', 'action' => 'is_exist'), 'update' => 'email_exists')); ?> In my controller i have created one function like public function is_exist($id = null) { $result = "yes"; $this->set('existdata',$result); } i have also created is_exists.ctp fiel in view/uers. i dont know why its not working. i did the same thing in Cakephp 1.3 and its working file but not in cakephp 2.0 can anyone tell me how i implement this ? thanks in advance

    Read the article

  • Picking apples off a tree

    - by John Retallack
    I have the following problem: I am given a tree with N apples, for each apple I am given it's weight and height. I can pick apples up to a given height H, each time I pick an apple the height of every apple is increased with U. I have to find out the maximum weight of apples I can pick. 1 = N = 100000 0 < {H, U, apples' weight and height, maximum weight} < 231 Example: N=4 H=100 U=10 height weight 82 30 91 10 93 5 94 15 The answer is 45: first pick the apple with the weight of 15 then the one with the weight of 30. Could someone help me approach this problem?

    Read the article

  • How to convert Xml files to Text Files

    - by John
    Hi all, I have around 8000 xml files that needs to be converted into text files. The text file must contain title, description and keywords of the xml file without the tags and removing other elements and attributes as well. In other words, i need to create 8000 text files containing the title,description and keywords of the xml file. I need codings for this to be done systematically. Any help would be greatly appreciated. Thanks in advance.

    Read the article

  • Very simple python functions takes spends long time in function and not subfunctions

    - by John Salvatier
    I have spent many hours trying to figure what is going on here. The function 'grad_logp' in the code below is called many times in my program, and cProfile and runsnakerun the visualize the results reveals that the function grad_logp spends about .00004s 'locally' every call not in any functions it calls and the function 'n' spends about .00006s locally every call. Together these two times make up about 30% of program time that I care about. It doesn't seem like this is function overhead as other python functions spend far less time 'locally' and merging 'grad_logp' and 'n' does not make my program faster, but the operations that these two functions do seem rather trivial. Does anyone have any suggestions on what might be happening? Have I done something obviously inefficient? Am I misunderstanding how cProfile works? def grad_logp(self, variable, calculation_set ): p = params(self.p,self.parents) return self.n(variable, self.p) def n (self, variable, p ): gradient = self.gg(variable, p) return np.reshape(gradient, np.shape(variable.value)) def gg(self, variable, p): if variable is self: gradient = self._grad_logps['x']( x = self.value, **p) else: gradient = __builtin__.sum([self._pgradient(variable, parameter, value, p) for parameter, value in self.parents.iteritems()]) return gradient

    Read the article

  • Can a custom MFC window/dialog be a class template instantiation?

    - by John
    There's a bunch of special macros that MFC uses when creating dialogs, and in my quick tests I'm getting weird errors trying to compile a template dialog class. Is this likely to be a big pain to achieve? Here's what I tried: MyDlg.h template <class W> class CMyDlg : public CDialog { typedef CDialog super; DECLARE_DYNAMIC(CMyDlg <W>) public: CMyDlg (CWnd* pParent); // standard constructor virtual ~CMyDlg (); // Dialog Data enum { IDD = IDD_MYDLG }; protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support DECLARE_MESSAGE_MAP() private: W *m_pWidget; //W will always be a CDialog }; IMPLEMENT_DYNAMIC(CMyDlg<W>, super) <------------------- template <class W> CMyDlg<W>::CMyDlg(CWnd* pParent) : super(CMyDlg::IDD, pParent) { m_pWidget = new W(this); } I get a whole bunch of errors but main one appears to be: error C2955: 'CMyDlg' : use of class template requires template argument list I tried using some specialised template versions of macros but it doesn't help much, other errors change but this one remains. Note my code is all in one file, since C++ templates don't like .h/.cpp like normal. I'm assuming someone must have done this in the past, possibly creating custom versions of macros, but I can't find it by searching, since 'template' has other meanings.

    Read the article

< Previous Page | 112 113 114 115 116 117 118 119 120 121 122 123  | Next Page >