Search Results

Search found 4656 results on 187 pages for 'sleepy john'.

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

  • Generic TypeIdenitifier convertion.How?

    - by John
    How do I convert the TypeIdenitifier to a class type? I need to use implicit convertion. type TMyChildArray<T>=class(TMyArray<T>) private FData:Array of T; procedure AddEnd(); end; TTypeIdenitifierParentClass=class(TAnotherParentClass) protected TestField:Cardinal; end; procedure TMyChildArray<T>.AddEnd(); var elem:T; begin for elem in Fdata do TTypeIdenitifierParentClass(elem).TestField:=0; end; I get "Invalid typecast" on the implicit convertion "TTypeIdenitifierParentClass(elem).TestField:=0;". The principle I want to use is that the TypeIdenitifier will represent a class that descends from TTypeIdenitifierParentClass.There are many class types,but all of them descend that class. How do I do this?

    Read the article

  • javascript error listener

    - by John Doe
    hi all i try using window.attachEvent (or addEventListener) to capture js errors my callback function gets only one event parameter my question is: how do i get line number and source file of the error from this event? the alternative usage window.onerror=callback; works but an event listener has other benefits thus im giving it a try

    Read the article

  • Checking deployed port in ruby on rails application

    - by john chan
    Is there an elegant way to check which port you deployed a ruby on rails application using mongrel? I could not find a directive (i.e. such as #{RAILS_ROOT} which contains the root directory of the application) that I can use to perform a check. I need this to do a check since I am deploying the same application on different ports and I need the app to do different things according to the port that is being accessed. Any help would be appreciated, Thanks

    Read the article

  • django-admin.py startproject mysite not working well on windows 7

    - by john
    Hi I'm learning django and I did successfully start a site on Window XP by following the tutorial. However, on Window 7 when I issued: django-admin.py startproject mysite python.exe was started and a window appeared to ask me to choose either python.exe or other program to open a file.... did I do anthing wrong or there are more tricks for window 7? thanks.

    Read the article

  • Countdown timer using jquery or google app engine ?

    - by john
    hi everybody, I need to do a countdown clock, that counts down the days, hours, minutes and seconds that are left to a date of my choice,Using jquery or google app engine(Python). I created a timer using Javascript,But in that i used system time. I need to use server time.Can any body give me ideas to build up a count down Timer using server UTC time.

    Read the article

  • Library to parse C/C++ source code

    - by John
    Which library should I use to parse C/C++ source code file? I need to parse source file, calculate how much useful strings inside, how much 'for' blocks, 'if' blocks, how much comments inside. I also may need to insert a comment or small piece of code after each 'for' block. Is there any libraries? May be any library included in Microsoft Visual Studio?

    Read the article

  • What is the fastest way to get a DataTable into SQL Server?

    - by John Gietzen
    I have a DataTable in memory that I need to dump straight into a SQL Server temp table. After the data has been inserted, I transform it a little bit, and then insert a subset of those records into a permanent table. The most time consuming part of this operation is getting the data into the temp table. Now, I have to use temp tables, because more than one copy of this app is running at once, and I need a layer of isolation until the actual insert into the permanent table happens. What is the fastest way to do a bulk insert from a C# DataTable into a SQL Temp Table? I can't use any 3rd party tools for this, since I am transforming the data in memory. My current method is to create a parameterized SqlCommand: INSERT INTO #table (col1, col2, ... col200) VALUES (@col1, @col2, ... @col200) and then for each row, clear and set the parameters and execute. There has to be a more efficient way. I'm able to read and write the records on disk in a matter of seconds...

    Read the article

  • php regex guitar tab (tabs or tablature, a type of music notation)

    - by John
    I am in the process of creating a guitar tab to rtttl (Ring Tone Text Transfer Language) converter in PHP. In order to prepare a guitar tab for rtttl conversion I first strip out all comments (comments noted by #- and ended with -#), I then have a few lines that set tempo, note the tunning and define multiple instruments (Tempo 120\nDefine Guitar 1\nDefine Bass 1, etc etc) which are stripped out of the tab and set aside for later use. Now I essentially have nothing left except the guitar tabs. Each tab is prefixed with it's instrument name in conjunction with the instrument name noted prior. Some times we have tabs for 2 separate instruments that are linked because they are to be played together, ie a Guitar and a Bass Guitar playing together. Example 1, Standard Guitar Tab: |Guitar 1 e|--------------3-------------------3------------| B|------------3---3---------------3---3----------| G|----------0-------0-----------0-------0--------| D|--------0-----------0-------0-----------0------| A|------2---------------2---2---------------2----| E|----3-------------------3-------------------3--| Example 2, Conjunction Tab: |Guitar 1 e|--------------3-------------------3------------| B|------------3---3---------------3---3----------| G|----------0-------0-----------0-------0--------| D|--------0-----------0-------0-----------0------| A|------2---------------2---2---------------2----| E|----3-------------------3-------------------3--| | | |Bass 1 G|----------0-------0-----------0-------0--------| D|--------2-----------2-------2-----------2------| A|------3---------------3---3---------------3----| E|----3-------------------3-------------------3--| I have considered other methods of identifying the tabs with no solid results. I am hoping that someone who does regular expressions could help me find a way to identify a single guitar tab and if possible also be able to match a tab with multiple instruments linked together. Once the tabs are in an array I will go through them one line at a time and convert them into rtttl lines (exploded at each new line "\n"). I do not want to separate the guitar tabs in the document via explode "\n\n" or something similar because it does not identify the guitar tab, rather, it is identifying the space between the tabs - not on the tabs themselves. I have been messing with this for about a week now and this is the only major hold up I have. Everything else is fairly simple. As of current, I have tried many variations of the regex pattern. Here is one of the most recent test samples: <?php $t = " |Guitar 1 e|--------------3-------------------3------------| B|------------3---3---------------3---3----------| G|----------0-------0-----------0-------0--------| D|--------0-----------0-------0-----------0------| A|------2---------------2---2---------------2----| E|----3-------------------3-------------------3--| |Guitar 1 e|--------------3-------------------3------------| B|------------3---3---------------3---3----------| G|----------0-------0-----------0-------0--------| D|--------0-----------0-------0-----------0------| A|------2---------------2---2---------------2----| E|----3-------------------3-------------------3--| | | |Bass 1 G|----------0-------0-----------0-------0--------| D|--------2-----------2-------2-----------2------| A|------3---------------3---3---------------3----| E|----3-------------------3-------------------3--| "; preg_match_all("/^.*?(\\|).*?(\\|)/is",$t,$p); print_r($p); ?> It is also worth noting that inside the tabs, where the dashes and #'s are, you may also have any variation of letters, numbers and punctuation. The beginning of each line marks the tuning of each string with one of the following case insensitive: a,a#,b,c,c#,d,d#,e,f,f#,g or g. Thanks in advance for help with this most difficult problem.

    Read the article

  • Setting Environment Variables For NMAKE Before Building A 'Makefile Solution'

    - by John Dibling
    I have an MSVC Makefile Project in which I need to set an environment variable before running NMAKE. For x64 builds I needs to set it to one value, and for x86 builds I need to set it to something else. So for example, when doing a build I would want to SET PLATFORM=win64 if I'm building a 64-bit compile, or SET PLATFORM=win32 if I'm building 32-bit. There does not appear to be an option to set environment variables or add a pre-build even for makefile projects. How do I do this? EDIT: Running MSVC 2008

    Read the article

  • Android : Stop image scaling down

    - by John Smith
    Hi, I'm trying to draw an image in a view but having problems trying to maintain the scale of the original image. Basically, I have a small view and I would like to show part of the image in the view. The intention then is to perform a translation on the image so that a different part appears in the view. No matter what I try, either the image is down-scaled automatically to fit the view or the whole image is viewable. I've tried playing about with the settings on BitmapDrawable, ImageView and Layout to no avail. Anyone know a good way to achieve this?

    Read the article

  • How to run a long task in backgroung in iOS applications?

    - by John Canady
    I am developing an application which requires running a task in background. I am trying this by calling a method which will retrieve(download) data from web server through web services. this method will call some more methods which are in different view controller classes. Here when I tap on home button of device, the method is calling but no further execution of the remaining code. This is the code I have written in (void)applicationDidEnterBackground:(UIApplication )application { UIApplication app = [UIApplication sharedApplication]; UIBackgroundTaskIdentifier bgTask = 0; bgTask = [app beginBackgroundTaskWithExpirationHandler:^{ [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }]; // Start the long-running task and return immediately. dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ // Do the work associated with the task. NSString *updatekey = [[NSUserDefaults standardUserDefaults] objectForKey:@"updatesetting"]; if([updatekey isEqualToString:@"enabled"]) { DataSettingsView *periodicUpdate = [[DataSettingsView alloc] init]; [periodicUpdate updateDataPeriodically]; //[periodicUpdate viewDidLoad]; //[periodicUpdate release]; } [app endBackgroundTask:bgTask]; bgTask = UIBackgroundTaskInvalid; }); } some one please help me in this background execution of long tasks with some example of code. Some help will appreciated and helpful to me.

    Read the article

  • I wired up a z 80 using telephone wire and put a jump to 0000 0000 0000 0000

    - by john
    I put 1100 0011 0000 0000 0000 0000 in the 2764 eprom --- this is supposed to test the z80 -- I have a 555 timer running at 500 khz. Can this small program work with the z80 ? I looked at the address pins on a m465 oscilloscope. The address shows highs up to 0100 0000. I think it should only count to 0000 0000 0000 0011. Can the z80 be tested? The Santa Clara Valley also made the lm1871 radio control chip that could not show a high or a low without completing the entire rc loop.

    Read the article

  • How to use Scanner to accept only valid int as input

    - by John
    I'm trying to make a small program more robust and I need some help with that. Scanner kb = new Scanner(System.in); int num1; int num2 = 0; System.out.print("Enter number 1: "); num1 = kb.nextInt(); while(num2<num1) { System.out.print("Enter number 2: "); num2 = kb.nextInt(); } Number 2 has to be greater than number 1 Also I want the program to automatically check and ignore if the user enters a character instead of a number. Because right now when a user enters for example r instead of a number the program just exits.

    Read the article

  • VisualSvn Server

    - by John
    Hi all, When I am trying to setup VisualSVN Server in my server. I get error. I can not find solution Error: service VisualSVN Server failed to start. Please check VisualSVN Server log in Event Viewer for more details. Thanks for help.

    Read the article

  • How do I get the output of an Xcode user script to auto indent?

    - by John Gallagher
    The Problem I want to press a key when I have a line highlighted and convert from a single line: JGLogEntry *logEntry = [JGLogEntry applicationNoWindowsFrom:date1 to:date2 intoMOC:mockRawMOC]; to a multiline statement: JGLogEntry *logEntry = [JGLogEntry applicationNoWindowsFrom:date1 to:date2 intoMOC:mockRawMOC]; What I've Tried I've got a simple ruby script that almost gets me there. #!/usr/bin/env ruby s = STDIN.read s.gsub!(/(:.+?\w) (\w.+?)/,'\1' + "\n\t" +'\2') print s When I set the output to "Replace Selection", I get this: JGLogEntry *logEntry = [JGLogEntry applicationNoWindowsFrom:date1 to:date2 intoMOC:mockRawMOC]; When I set the output to "Place on Clipboard", then paste it in, I get the desired result: JGLogEntry *logEntry = [JGLogEntry applicationNoWindowsFrom:date1 to:date2 intoMOC:mockRawMOC]; However, this is two keypresses which is clumsy. Any ideas how I can get the replaced text to obey Xcode's auto indent rules?

    Read the article

  • Search backward through a string using a regex (in Python)?

    - by John Mulder
    I'm parsing some code and want to match the doxygen comments before a function. However, because I want to match for a specific function name, getting only the immediately previous comment is giving me problems. Is there a way to search backward through a string using the Python Regex library? Is there a better (easier) approach that I'm missing?

    Read the article

  • GWT + OSX = SWT issues

    - by John Leonard
    I'm new to GWT development and I'm putting myself through the paces with Google's tutorial but I'm getting errors: java[10574:80f] [Java CocoaComponent compatibility mode]: Enabled 2009-11-06 15:27:38.769 java[10574:80f] [Java CocoaComponent compatibility mode]: Setting timeout for SWT to 0.100000 I checked my Java prefs and I have Java SE6 (64 bit) as the preferred JVM. I'm really not sure how to clear this up.

    Read the article

  • vnc application for iPhone. How to go about building one?

    - by John Stewart
    Alright.. I am on a mission to learn iPhone development as much as possible. At my current job they have requested me if I can build a vnc viewer in iPhone.. there are many vnc apps but i want to learn how to build an app like that.. what would be the architecture of this app how should i organize my app? Any thoughts? comments?

    Read the article

  • What's the easy way to test for 304 reponses?

    - by John Mee
    I need to test if my 304 responses are working, but my development environment is pretty hard set on force no-cache. Is there an easy way to modify the max-age value of the cache-control header before it goes out? I'm perhaps a bit optimistic in hoping chrome (or an extension, or FF) has a console command letting me alter the if-modified-since header then send the request. Maybe paste something into a telnet connection?

    Read the article

  • C++ Multiple Inheritance Question

    - by John
    The scenario generating this is quite complex so I'll strip out a few pieces and give an accurate representation of the classes involved. /* This is inherited using SI by many classes, as normal */ class IBase { virtual string toString()=0; }; /* Base2 can't inherit IBase due to other methods on IBase which aren't appropriate */ class Base2 { string toString() { ... } }; /* a special class, is this valid? */ class Class1 : public IBase, public Base2 { }; So, is this valid? Will there be conflicts on the toString? Or can Class1 use Base2::toString to satisfy IBase? Like I say there are lots of other things not shown, so suggestions for major design changes on this example are probably not that helpful... though any general suggestions/advice are welcome.

    Read the article

  • Hero Class, php classes

    - by John
    I am going to have different classes for a character that a user play. Like "Mage, Warrior" etc. I am thinking of a method like have some CharacterBase class (abstract?) and then I have a child class which is like WarriorClass or something like that. I think the approach is called Factory pattern or something like that. Anyone got a clue of what I'm trying to achieve here, and are there perhaps any better way to do this?

    Read the article

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