Search Results

Search found 2399 results on 96 pages for 'alex gosselin'.

Page 51/96 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How can I detect a debugger or other tool that might be analysing my software?

    - by Workshop Alex
    A very simple situation. I'm working on an application in Delphi 2007 which is often compiled as 'Release' but still runs under a debugger. And occasionally it will run under SilkTest too, for regression testing. While this is quite fun I want to do something special... I want to detect if my application is running within a debugger/regression-tester and if that's the case, I want the application to know which tool is used! (Thus, when the application crashes, I could report this information in it's error report.) Any suggestions, solutions?

    Read the article

  • in python: can i pass class method as and a default argument to another class method

    - by alex
    i want to to pass class method as and a default argument to another class method, so that i can re-use the method as a @classmethod @classmethod class foo: def func1(self,x): do somthing; def func2(self, aFunc = self.func1): # make some a call to afunc afunc(4) this why when the method func2 is called within the class aFunc defaults to self.func1, but i can call this same function from outside of the class and pass it a different function at the input. i get NameError: name 'self' is not defined

    Read the article

  • Unix and FreeBSD

    - by Alex Farber
    My final goal is to write the program which can run on the Unix OS. I know that there are many Unix versions, and don't know exactly for now which one I need to support. I cannot install any Unix OS right now. The only thing I can do is to use free OS which is close to Unix as much as possible. Is FreeBSD a good choice for this? I know that there is also OpenBSD, possibly something else.

    Read the article

  • Contact form contents spilling out of container div on window resize.

    - by Alex C
    I'm trying to get my contact form to not spill its contents out of the parent div when I resize the viewport. How can I go about doing this? I have used float clearing to prevent this as I understood it was supposed to be used, but it isn't working. What should I do to fix this? here is the page in question. also I have a similar problem with the header.. the menu drops below the header text if I make the browser window smaller. Thanks for any help you all have to offer. http://countercharge.net/catsite/index.php?P=contact

    Read the article

  • .net Email Template engine...

    - by alex
    I'm looking to create emails, mainly HTML, based on templates - I'd really like to do something like: Set up my template, as an HTML (or similar) file Include tags, that are then replaced with specific data (kind of like mail-merge....) I've seen this: http://www.bitethebullet.co.uk/EmailTemplateFramework/tabid/58/Default.aspx From searching on stack overflow, i understand nVelocity might be another option? But i can't find any examples to do what i want to do... Any other suggestions?

    Read the article

  • Cast LINQ Function Result to Domain Object

    - by Alex
    Hello, I have a table valued function to perform full text search on SQL server. The result type of my full text search function in LINQ is a special autogenerated type which includes KEY and RANK in addition to my regular domain object properties. So, if my regular domain object is PERSONS (with properties FirstName, LastName etc.), I also have a result object PERSONS_FTSResult with the same properties + KEY and RANK. Is there an easy way to cast it back to PERSONS?

    Read the article

  • Is there any way to put extras to Intent from preferences ?

    - by Alex Volovoy
    Hi i'm launching activity from preferences screen. Activity is shared among three preferences. I wonder if i can set extras for this activity in xml <Preference android:key="action_1" android:title="@string/action_1_title" > <intent android:action="com.package.SHAREDACTION" > </intent> </Preference> i wonder if i can do something like <extras> <item android:name="" android:value=""/> </extras> All i need to do to pass an integer really. I can different actions and check action instead of extras.

    Read the article

  • Include error in writing html file from php

    - by Grozav Alex Ioan
    I seem to have some problem with my code here. It creates a file from the php file, but I get an error on the include path. include('../include/config.php'); $name = ($_GET['createname']) ? $_GET['createname'] : $_POST['createname']; function buildhtml($strphpfile, $strhtmlfile) { ob_start(); include($strphpfile); $data = ob_get_contents(); $fp = fopen ($strhtmlfile, "w"); fwrite($fp, $data); fclose($fp); ob_end_clean(); } buildhtml('portfolio.php?name='.$name, "../gallery/".$name.".html"); The problem seems to be here: 'portfolio.php?name='.$name Any way I can replace this, and still send the variable over? Here's the error I get when I put ?name after the php extension: Warning: include(portfolio.php?name=hyundai) [function.include]: failed to open stream: No such file or directory in D:\Projects\Metro Web\Coding\admin\create.php on line 15 Warning: include(portfolio.php?name=hyundai) [function.include]: failed to open stream: No such file or directory in D:\Projects\Metro Web\Coding\admin\create.php on line 15 Warning: include() [function.include]: Failed opening 'portfolio.php?name=hyundai' for inclusion (include_path='.;C:\php\pear') in D:\Projects\Metro Web\Coding\admin\create.php on line 15

    Read the article

  • How do you handle very old browsers on your site?

    - by Alex
    Hi. We have a non-profit web site that got about 5 million hits in May. Of those, about 5,700 were from IE 5.x or lower; about 4,000 were from folks with Netscape 4.x or lower. We know that the current site's layout works for newer browsers and we're testing it on IE6 as well (along with Chrome, Opera, Safari, and Firefox). How do you handle the folks with the older browsers? Because of jQuery libraries and such, the pages might not function correctly on those old browsers. Is there an easy way to show a text-only version on browsers that can't handle the CSS and jQuery goodies? How do large sites handle this sort of thing? I've used the @embed to hide the stylesheet from Netscape 4.x, but not sure beyond that.

    Read the article

  • One letter game problem?

    - by Alex K
    Recently at a job interview I was given the following problem: Write a script capable of running on the command line as python It should take in two words on the command line (or optionally if you'd prefer it can query the user to supply the two words via the console). Given those two words: a. Ensure they are of equal length b. Ensure they are both words present in the dictionary of valid words in the English language that you downloaded. If so compute whether you can reach the second word from the first by a series of steps as follows a. You can change one letter at a time b. Each time you change a letter the resulting word must also exist in the dictionary c. You cannot add or remove letters If the two words are reachable, the script should print out the path which leads as a single, shortest path from one word to the other. You can /usr/share/dict/words for your dictionary of words. My solution consisted of using breadth first search to find a shortest path between two words. But apparently that wasn't good enough to get the job :( Would you guys know what I could have done wrong? Thank you so much. import collections import functools import re def time_func(func): import time def wrapper(*args, **kwargs): start = time.time() res = func(*args, **kwargs) timed = time.time() - start setattr(wrapper, 'time_taken', timed) return res functools.update_wrapper(wrapper, func) return wrapper class OneLetterGame: def __init__(self, dict_path): self.dict_path = dict_path self.words = set() def run(self, start_word, end_word): '''Runs the one letter game with the given start and end words. ''' assert len(start_word) == len(end_word), \ 'Start word and end word must of the same length.' self.read_dict(len(start_word)) path = self.shortest_path(start_word, end_word) if not path: print 'There is no path between %s and %s (took %.2f sec.)' % ( start_word, end_word, find_shortest_path.time_taken) else: print 'The shortest path (found in %.2f sec.) is:\n=> %s' % ( self.shortest_path.time_taken, ' -- '.join(path)) def _bfs(self, start): '''Implementation of breadth first search as a generator. The portion of the graph to explore is given on demand using get_neighboors. Care was taken so that a vertex / node is explored only once. ''' queue = collections.deque([(None, start)]) inqueue = set([start]) while queue: parent, node = queue.popleft() yield parent, node new = set(self.get_neighbours(node)) - inqueue inqueue = inqueue | new queue.extend([(node, child) for child in new]) @time_func def shortest_path(self, start, end): '''Returns the shortest path from start to end using bfs. ''' assert start in self.words, 'Start word not in dictionnary.' assert end in self.words, 'End word not in dictionnary.' paths = {None: []} for parent, child in self._bfs(start): paths[child] = paths[parent] + [child] if child == end: return paths[child] return None def get_neighbours(self, word): '''Gets every word one letter away from the a given word. We do not keep these words in memory because bfs accesses a given vertex only once. ''' neighbours = [] p_word = ['^' + word[0:i] + '\w' + word[i+1:] + '$' for i, w in enumerate(word)] p_word = '|'.join(p_word) for w in self.words: if w != word and re.match(p_word, w, re.I|re.U): neighbours += [w] return neighbours def read_dict(self, size): '''Loads every word of a specific size from the dictionnary into memory. ''' for l in open(self.dict_path): l = l.decode('latin-1').strip().lower() if len(l) == size: self.words.add(l) if __name__ == '__main__': import sys if len(sys.argv) not in [3, 4]: print 'Usage: python one_letter_game.py start_word end_word' else: g = OneLetterGame(dict_path = '/usr/share/dict/words') try: g.run(*sys.argv[1:]) except AssertionError, e: print e

    Read the article

  • How do I replace outbound link URLs in a PDF document, using PHP

    - by Alex Poole
    I have a PDF document with some external links. I'd like to parse the document, replace the destination of the links then close (and serve) the PDF document, all using PHP I know I can do this with PDFLib but I don't want to incur this cost. I could re-write the document with FPDF or DomPDF, but some of these PDFs are quite complex so this would be a major time investment. Surely there must be a way to do this directly to PDF docs, using native PHP? TIA

    Read the article

  • How to get a number closest to the average in c++?

    - by Alex Zielinski
    What I'm trying to achieve is to take the average of the numbers stored in the array and find the number which is closest to it. My code compiles, but has an error just after starting. I think it's something to do with the memory handling (I don't feel confident with pointers, etc. yet) Could some nice guy take a look at my code and tell me what's wrong with it? (don't be hard on me, I'm a beginner) #include <iostream> #include <cmath> using namespace std; double* aver(double* arr, size_t size, double& average); int main() { double arr[] = {1,2,3,4,5,7}; size_t size = sizeof(arr)/sizeof(arr[0]); double average = 0; double* p = aver(arr,size,average); cout << *p << " " << average << endl; } double* aver(double* arr, size_t size, double& average){ int i,j,sum; double* m = 0; int tmp[7]; for(i=0;i<size;i++) sum += arr[i]; average = sum/size; for(j=0;j<size;j++){ tmp[j] = arr[j] - average; if(abs(tmp[j])>*m) *m = tmp[j]; } return m; }

    Read the article

  • My Core Animation block isn't working like I'd expect

    - by Alex Reynolds
    I have a UIView called activityView, which contains two subviews activityIndicator and cancelOperationsButton. These views are embedded in a XIB and wired up to my view controller. I have two methods that deal with activating (showing) and deactivating (hiding) these two subviews: - (void) enableActivityIndicator { [activityIndicator startAnimating]; [cancelOperationsButton setHidden:NO]; } - (void) disableActivityIndicator { [activityIndicator stopAnimating]; [cancelOperationsButton setHidden:YES]; } By themselves, these two methods work fine. To give this a bit of polish, I'd like to add an animation that fades these subviews in and out: - (void) enableActivityIndicator { [activityIndicator startAnimating]; [cancelOperationsButton setHidden:NO]; [UIView beginAnimations:@"fadeIn" context:nil]; [UIView setAnimationDelay:0.0f]; [UIView setAnimationDuration:1.0f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; activityView.alpha = 1.0f; [UIView commitAnimations]; } - (void) disableActivityIndicator { [UIView beginAnimations:@"fadeOut" context:nil]; [UIView setAnimationDelay:0.0f]; [UIView setAnimationDuration:1.0f]; [UIView setAnimationCurve:UIViewAnimationCurveEaseOut]; activityView.alpha = 0.0f; [UIView commitAnimations]; [activityIndicator stopAnimating]; [cancelOperationsButton setHidden:YES]; } But the animations are not working — the subviews just show up or disappear without the parent view's alpha property having an effect on transparency. How should I write these methods to get the fade-in, fade-out effect I am after?

    Read the article

  • Why do mainframe greybeards refer to DB2/zOS as "he"? [closed]

    - by Alex Nauda
    If you ask a DB2/zOS engine DBA a question about DB2's behavior, the DBA will refer to the DB2 engine as "he" much the way a sailor uses "she" to refer to his ship. For example: "Once you fill the freespace, DB2 still wants to keep those rows in cluster order in the tablespace. That's why he'll split that page in half, and you end up with lots of half-empty pages. That is, unless the cluster key of the row you've just inserted is the highest in the table, in which case he makes a new empty page, and he puts just your new row into that page. So I wouldn't have to do this REORG if you would just sort your input like I suggested." Does anyone know where this tradition comes from?

    Read the article

  • How can I test a CRON job with PHP?

    - by alex
    This is the first time I've ever used a CRON. I'm using it to parse external data that is automatically FTP'd to a subdirectory on our site. I have created a controller and model which handles the data. I can access the URL fine in my browser and it works (however I will be restricting this soon). My problem is, how can I test if it's working? I've added this to my controller for a quick and dirty log $file = 'test.txt'; $contents = ''; if (file_exists($file)) { $contents = file_get_contents($file); } $contents .= date('m-d-Y') . ' --- ' . PHP_SAPI . "\n\n"; file_put_contents($file, $contents); But so far only got requests logged from myself from the browser, despite having my CRON running ever minute. 03-18-2010 --- cgi-fcgi 03-18-2010 --- cgi-fcgi I've set it up using cPanel with the command index.php properties/update/ the 2nd portion is what I use to access the page in my browser. So how can I test this is working properly, and have I stuffed anything up? Note: I'm using Kohana 3. Many thanks

    Read the article

  • Another Java vs. Scala perspective - is this typical?

    - by Alex R
    I have been reading about Scala for a while and even wrote some small programs to better understand some of the more exoteric features. Today I decided to do my first "real project", translating some 60 lines of ugly Java code to Scala to rewrite it using the better pattern-matching features (why? because the Java version was becoming hard to maintain due to excessive combination of regex and conditionals). About halfway through the editing process, Eclipse thew up this error: I get the general impression that the Scala IDE in Eclipse is a lot buggier and less complete than its Java equivalent. Is this correct or do I just have a bad installation? Is there a better IDE for Scala?

    Read the article

  • Kohana 3 and CRON always accessing index.php (not following the URI argument)

    - by alex
    OK, I hope this is my last question about CRON jobs and Kohana 3. Note: others are not duplicates, just other problems. Here is my CRON job (setup in cPanel) php /home/user/public_html/index.php --uri=properties/update As per this answer. I have set it up so it emails me the output. It is running every 5 mins. Unfortunately, it always emails me the source of the home page of my site (index.php or /). I can access that URL fine in my browser, i.e. http://www.example.com/properties/update and it works and does it's job correctly. I can tell the Cron is never hitting the script because I have a file logger in place. Would this have anything to do with .htaccess? Has this happened to anyone before, and how did they fix it? Many thanks.

    Read the article

  • Can't concatenate 2 arrays in PHP

    - by alex
    I've recently learned how to join 2 arrays using the + operator in PHP. But consider this code... $array = array('Item 1'); $array += array('Item 2'); var_dump($array); Output is array(1) { [0]= string(6) "Item 1" } Why does this not work? Skipping the shorthand and using $array = $array + array('Item 2') does not work either. Does it have something to do with the keys?

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >