Search Results

Search found 22413 results on 897 pages for 'train main'.

Page 64/897 | < Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >

  • How to use SendMessage to another form in same app

    - by Robert Frank
    I've been trying to get this to work for some time now and can't figure it out. Probably obvious once you know it. I simply want a non-modal form (or perhaps an instantiated non-TForm class) to send a message to the application's main form. I can make the main form send a message to itself and receive (announcing with a beep) But, I can't seem to have other objects send messages to the main form. I'm using WM_MY_MESSAGE = WM_APP + 200; What should the first argument of the SendMessage be to send a message to the main form? Even sending it to Application.MainForm.Handle doesn't seem to work. The reason I need to do this is that the modal form has a slider that another form (#2) needs to know when it changes. Notifying the other form via a callback procedure was making it sluggish as form #2 did some work before returning from the call. Is having a modal form send a windows message to the main form a reasonable way to avoid this?

    Read the article

  • Python overriding class (not instance) special methods

    - by André
    How do I override a class special method? I want to be able to call the __str__() method of the class without creating an instance. Example: class Foo: def __str__(self): return 'Bar' class StaticFoo: @staticmethod def __str__(): return 'StaticBar' class ClassFoo: @classmethod def __str__(cls): return 'ClassBar' if __name__ == '__main__': print(Foo) print(Foo()) print(StaticFoo) print(StaticFoo()) print(ClassFoo) print(ClassFoo()) produces: <class '__main__.Foo'> Bar <class '__main__.StaticFoo'> StaticBar <class '__main__.ClassFoo'> ClassBar should be: Bar Bar StaticBar StaticBar ClassBar ClassBar Even if I use the @staticmethod or @classmethod the __str__ is still using the built in python definition for __str__. It's only working when it's Foo().__str__() instead of Foo.__str__().

    Read the article

  • Jquery stop load function after too many clicks

    - by Sergio
    How can I stop loading function after user is clicked too many times on link? Jquery code looks like: $(document).ready(function(){ $(".menu_rfr").click(function() { $("#main").html('<img src="img/spin.gif" class="spin">'); location.replace($(this).attr('rel')); }); $(".menu_clickable").click(function() { $("#main").html('<img src="img/spin.gif" class="spin">'); $("#main").load($(this).attr('rel')); }); });

    Read the article

  • What does int argc, char *argv[] mean?

    - by Greg Treleaven
    In many C++ IDE's and compilers, when it generates the main function for you, it looks like this: int main(int argc, char *argv[]) When I code C++ without an IDE, just with a command line compiler, I type: int main() without any parameters. What does this mean, and is it vital to my program?

    Read the article

  • NullPointerException when generating RSA keys with boucycastle

    - by Tom Brito
    public static void main(String[] args) throws Exception { RSAKeyPairGenerator rsaKeyPairGen = new RSAKeyPairGenerator(); AsymmetricCipherKeyPair keyPair = rsaKeyPairGen.generateKeyPair(); } the rsaKeyPairGen is not null, but the generateKeyPair() method is throwing NullPointerException. What may be wrong? Error message: java.lang.NullPointerException at org.bouncycastle.crypto.generators.RSAKeyPairGenerator.generateKeyPair(Unknown Source) at pkg.main(Main.java:154)

    Read the article

  • maven compile fails because i have a non-maven jar

    - by pstanton
    i have a couple of internal libraries which i haven't/don't know how to add to my local maven repository. i've added them to the project's classpath but my maven-compile failes stating that it can't find the classes in the external jars (as expected): [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile (default-compile) on project proj: Compilation failure: Compilation failure: dir\src\main\java\package\MyClass.java:[8,25] package blah does not exist dir\src\main\java\package\MyClass.java:[9,25] package blah does not exist dir\src\main\java\package\MyClass.java:[21,12] cannot find symbol symbol : variable Blah location: class package.MyClass dir\src\main\java\package\MyClass.java:[28,9] cannot find symbol symbol : variable Blah location: class package.MyClass how do i tell maven about a jar i've sneakily added to my project's classpath so it can use it to compile?

    Read the article

  • 3 embedded UIScrollView problem

    - by Infinity
    Hello guys! I have 3 UIScrollView. Here is a sample code, about how they are added in eachother: UIScrollView main; UIScrollView page1; UIScrollView page2; UIScrollView doublePage; UIView pageContent1; UIView pageContent2; UIView doublePageContent; int nrPages = 1; sw2 = 0; main = [[UIScrollView alloc] initWithFrame:CGRectMake(0.0, 0.0, 768, 980)]; main.contentSize = CGSizeMake(768 * (nrPages - 1 + sw2), 980); page1.frame = CGRectMake(0, 0, 768, 980); page2.frame = CGRectMake(768, 0, 768, 980); pageNumber = i - 1 + sw2; (i is a variable in a for loop) doublePage.frame = CGRectMake(768 * (pageNumber - 1), 0, 768 * 2, 980); CGFloat contentWidth = [page1 bounds].size.width + [page2 bounds].size.width; CGFloat contentHeight = page1 ? self.page1.bounds.size.height : self.page2.bounds.size.height; doublePageContent = [[UIView alloc] initWithFrame:CGRectMake(0, 0, contentWidth, contentHeight)]; [page1 addSubview:pageContent1]; [page2 addSubview:pageContent2]; [doublePageContent addSubview:page1]; [doublePageContent addSubview:page2]; [doublePage addSubview:doublePageContent]; [main addSubview:doublepage]; And with this structure the main scrollview don't want to scroll. Without the doublepage scrollview it is working good. What do you think? What's the problem? I know this structure is a little weird, but I need this structure because other parts of the code. Edited, added the information about the sizes. If you need something more please tell me. And one more thing.. If I add 1 pixel to the width of the doublePage contentSize.width it scrolls, but a bit hard, so it scrolls first in the doublePage and then in the main.

    Read the article

  • Prototype mouseleave for two connected elements

    - by TenJack
    I have created a small navigation element that is positioned right on top of another element. It is only shown when a user mousenters/mouseovers the main element. I am having some trouble with the prototype. I would like this small nav element to be hidden when a user mouses out of the main box, but I would also like the small nav element to remain visible if a user mouses out of the main box but mouses into the small nav at the same time. This is my attempt so far with some pseudo-code to hopefully explain: $('main_box').observe('mouseenter', function(){ $('small_div').show() }) $('main_box').observe('mouseleave', function(){ if this element is $('small_div') then Event.stop() $('small_div').observe('mouseleave', function(){ if this element is $('main_box') Event.stop observe $('main_box') mouseleave else $('small_div').hide(); }) else $('small_div').hide(); }) The main thing I'm having trouble with is figuring out what element the mouse is over at a given point in time. Is there a way to do something like: on mouseleave do blah unless the mouse is over a specific element then do not do blah?

    Read the article

  • max count with joins

    - by trixet
    I have 3 tables: users: Id Login 1 John 2 Bill 3 Jim computers: Id Name 1 Computer1 2 Computer2 3 Computer3 4 Computer4 5 Computer5 sessions: UserId ComputerId Minutes 1 2 47 2 1 32 1 4 15 2 5 5 1 2 7 1 1 40 2 5 31 I would like to display this resulting table: Login Total_sess Total_min Most_freq_computer Sess_on_most_freq Min_on_most_freq John 4 109 Computer2 2 54 Bill 3 68 Computer5 2 36 Jim - - - - - Myself I can only cover first 3 columns with: SELECT Login, COUNT(sessions.UserId), SUM(Minutes) FROM users LEFT JOIN sessions ON users.Id = sessions.UserId GROUP BY users.Id And some kind of other columns with: SELECT main.* FROM (SELECT UserId, ComputerId, COUNT(*) AS cnt ,SUM(Minutes) FROM sessions GROUP BY UserId, ComputerId) AS main INNER JOIN ( SELECT ComputerId, MAX(cnt) AS maxCnt FROM ( SELECT ComputerId, UserId, COUNT(*) AS cnt FROM sessions GROUP BY ComputerId, UserId ) AS Counts GROUP BY ComputerId) AS maxes ON main.ComputerId = maxes.ComputerId AND main.cnt = maxes.maxCnt But I need to get whole resulting table in one query. I feel I'm doing something completely wrong. Need help.

    Read the article

  • C puzzle: Output of printf should be '5' always

    - by pragadheesh
    Hi, I found this puzzle in a C aptitude paper. void change() { //write something in this function so that output of printf in main function //should always give 5.you can't change the main function } int main() { int i = 5; change(); i = 10; printf("%d", i); return 0; } Any solutions.?

    Read the article

  • How to make this code compile?

    - by skydoor
    // File: foo.c static int var; void foo() { var++; } // end of file foo.c // File bar.c: static int var; void bar() { var++; } // end of file bar.c // file main.c static int var; void main() { foo(); bar(); printf("%d", var); } // end of file main.c Question: Will the above program compile ? If so what will be the result ? I tested the code and found it couldn't be compiled. I try to use extern in main.c to use the function foo() and bar() but it still couldn't be compiled.

    Read the article

  • iPhone SDK allow touches to affect multiple views

    - by Parad0x13
    I have a main view that has has two buttons on it that control methods to display the next image and display the previous image. In this case the 'Image' is a class that inherits from UIImageView and has multiple pictures on it that you can interact with, and I call this class a 'Pane'. The pane itself handles all the user interaction itself while the main view controls the display of next and previous panes with the buttons. Here is my dilemma, because the pane fully covers the main view it wont allow for the user to tap the buttons on the main view! So once a pane pops up you cannot change it via the buttons! Is there a way to allow touches through transparent parts of a view, or if not how in the world do I achieve this?! I cannot pass touchesBegan or any of those methods from the pane to the superview because all of the button touch methods are created in the xib file. I cannot insert the pane under the control panel because then you wouldn't be able to interact with the pane. And as far as I know theres no way to pass touch events to every single pane within the paneHoldingArray that belongs to the main view I cannot add the command buttons inside of the pane because I want to be able to replace the command button's image with a thumbprint render of the next/previous pane. I've been stuck on this for a very long time, please somebody help me out with a fix action or a new way to re-engineer the code so that it will work!

    Read the article

  • How do I create a solr core with the data from an existing one?

    - by steve_d
    Solr 1.4 Enterprise Search Server recommends doing large updates on a copy of the core, and then swapping it in for the main core. I am following these steps: Create prep core: http://localhost:8983/solr/admin/cores?action=CREATE&name=prep&instanceDir=main Perform index update, then commit/optimize on prep core. Swap main and prep core: http://localhost:8983/solr/admin/cores?action=SWAP&core=main&other=prep Unload prep core: http://localhost:8983/solr/admin/cores?action=UNLOAD&core=prep The problem I am having is, the core created in step 1 doesn't have any data in it. If I am going to do a full index of everything and the kitchen sink, that would be fine, but if I just want to update a (large) subset of the documents - that's obviously not going to work. (I could merge the cores, but part of what I'm trying to do is get rid of any deleted documents without trying to make a list of them.) Is there some flag to the CREATE action that I'm missing? The Solr Wiki page for CoreAdmin is a little sparse on details.

    Read the article

  • setting url in yaml file for google app engin (page not found) problem

    - by mswallace
    I am new to python and I am super excited to learn. I am building my first app on app engin and I am not totally understanding why my yaml file is not resolving to the url that I set up. here is the code handlers: - url: .* script: main.py - url: /letmein/.* script: letmein.py so if I go to http://localhost:8080/letmein/ I get a link is brooken or page not found error. here is the python code that I have in letmein.py from google.appengine.ext import webapp from google.appengine.ext.webapp import util class LetMeInHandler(webapp.RequestHandler): def get(self): self.response.out.write('letmein!') def main(): application = webapp.WSGIApplication([('/letmein/', LetMeInHandler)], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() thanks in advance for the help!

    Read the article

  • Multiple Broadcast Messages with Less Data or Less Broadcast Messages with More Data?

    - by niko
    Hi, I am developing an application which is communicating with the server. Tha application can perform log-in and get different parameters from server. The application consists of a RESTful client (custom class for making requests), Communication Service (the service which runs in the background) and the main activity. For now I created multiple broadcast messages and multiple broadcast receivers in the main activity so when the application performs login operation a receiver (loginBroadcastReceiver) in the main activity receives a message and when another parameter is received from the server different message is broadcasted and another receiver handles the message. This way however the application performance is poor but I am not sure whether it is due to multiple broadcast receivers. Does anyone know what is the best way to exchange data between service and main activity - is it better to create a single broadcast receiver and retrieve all parameters from message or is it better to initialize multiple broadcast receivers for multiple parameters? I would appreciate if you could provide any useful resource about the topic because I'm writing the thesis and it would be good if the solution could be explained.

    Read the article

  • How can I pin a div in my sidebar column to the bottom?

    - by vg1890
    I have a simple two column layout with a footer at the bottom. When the content in the sidebar is taller than the content in the main column, everything looks great. But when the height of the main column is greater than the sidebar, I need the sidebar to grow to the same height as the main column and for the last <div> in the sidebar to be pinned to the very bottom. Here's my sample code: http://jsfiddle.net/mqnML/1/

    Read the article

  • .NET Hashtable clone

    - by thelost
    Given the following code: Hashtable main = new Hashtable(); Hashtable inner = new Hashtable(); ArrayList innerList = new ArrayList(); innerList.Add(1); inner.Add("list", innerList); main.Add("inner", inner); Hashtable second = (Hashtable)main.Clone(); ((ArrayList)((Hashtable)second["inner"])["list"])[0] = 2; Why does the value within the array change from 1 to 2 in the "main" Hashtable, as the change was made on a clone ?

    Read the article

  • want to change background of table td on hover

    - by Brad
    I have a webpage that displays a calendar, and I want to change the background-color of any td that has their day number linked, so when I hover over that day, it changes the background-color. I thought this would work: .main-calendar td { width:14%; height:100px; text-align:center; border:1px solid #000; font-size:20px; vertical-align:middle; display:block; } table.main-calendar td a:hover, table.main-calendar td a:visited { display:block; text-decoration:none; background-color:red; color:#fff; } table.main-calendar td a:link { display:block; text-decoration:none; background-color:green; color:#fff; } Any help is appreciated.

    Read the article

  • Making "helper" windows in WPF

    - by RandomEngy
    I'm writing an app in WPF and want to make a "helper" window. The window needs to be resizable, with no minimize option and doesn't show in the taskbar. If the app receives focus, it should appear as well, but whether or not it's in front or behind the main window should be retained. When the main window is closed, it should close along with the app. An example is a detached pane in Visual Studio. I've made the helper windows not appear in the taskbar, but can't get the rest of the behaviors I want. If they're their own windows, they don't get focus along with the rest of the app. If I specify a the main window as their owner, the main window can't be on top of the helper window. Anyone know a good way to approach this?

    Read the article

  • Unable to control requests for static files on Google App Engine

    - by dan
    My simple GAE app is not redirecting to the /static directory for requests when url is multiple levels. Dir structure: /app/static/css/main.css App: I have two handlers one for /app and one for /app/new app.yaml: handlers: - url: /static static_dir: static - url: /app/static/(.*) static_dir: static\1 - url: /app/.* script: app.py login: required HTML: Description: When page is loaded from /app HTTP request for main.css is successful GET /static/css/main.css But when page is loaded from /app/new I see the following request: GET /app/static/css/main.cs That's when I tried adding the /app/static/(.*) in the app.yaml but it is not having any effect.

    Read the article

  • NoClassDefFoundError points to the wrong class.

    - by Sora
    I'm validating the installation of a program that consists of a few separate modules. They are not co-dependent. I have apple.jar and orange.jar, they are placed in the same folder and were developed in the same project, but run independent of each other. Running apple.jar goes fine, but orange.jar gives me a NoClassDefFoundError pointing to apple.jar. /usr/java/jre1.6.0_14/bin/java -jar validator.jar Exception in thread "main" java.lang.NoClassDefFoundError: orange/client/Apple Caused by: java.lang.ClassNotFoundException: orange.client.Apple at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) Could not find the main class: validator/client/StormDataXMLGenerator. Program will exit. The manifest file lists Orange as the correct main class. Main-Class: orange/client/Orange Anybody know why it's giving me the NoClassDefFoundError? Thanks in advance!

    Read the article

  • Problem about python import with error

    - by xiao
    Hello, I have write a small python module with one class and two functions. The skeleton of the module is as following: #file name: test_module.py class TestClass: @classmethod def method1(cls, param1): #to do something pass def __init__(self, param1): #to do something ... def fun1(*params): #to do something ... def fun2(*params): #to do something ... Another py file is a small script which imports function and class from the module, as following: import sys from test_module import TestClass, fun1, fun2 def main(sys_argv): li = range(5) inst1 = TestClass(li) fun1(inst1) fun2(inst1) return if __name__ == "__main__": main(sys.argv) But when I execute the script, it is broken with following message: ./script.py: line 4: syntax error near unexpected token `(' ./script.py: line 4: `def main(sys_argv):' I am not sure what the problem is. Is it a problem with import? But when I try to import the module in ipython, everything is just ok.

    Read the article

  • How to choose light version of database system

    - by adopilot
    I am starting one POS (Point of sale) project. Targeting system is going to be written in C# .NET 2 WinForms and as main database server We are going to use MS-SQL Server. As we have a lot of POS devices in chain for one store I will love to have backend local data base system on each POS device. Scenario are following: When main server goes down!! POS application should continue working "off-line" with local database, until connection to main server come up again. Now I am in dilemma which local database is going to be most adoptable for me. Here is some notes for helping me point me in right direction: To be Light "My POS devices art usually old and suffering with performances" To be Free "I have a lot of devices and I do not wont additional cost beside main SQL serer" One day Ill love to try all that port on Mono and Linux OS. Here is what I've researched so far: Simple XML "Light but I am afraid of performance, My main table of items is average of 10K records" SQL-Express "I am afraid that my POS devices is poor with hardware for SQLExpress, and also hard to install on each device and configure" Less known Advantage Database Server have free distribution of offline ADT system. DBF with extended Library,"Respect for good old DBFs but that era is behind Me with clipper and DBFs" MS Access Sqlite "Mostly like for now, but I am afraid how it is going to pair with MS SQL do they have same Data types". I know that in this SO is a lot of subjective data, but at least can someone recommended some others lite database system, or things that I shod most take attention before I choice database.

    Read the article

  • Prototype mouseleave for two elements

    - by TenJack
    I have created a small navigation element that is positioned right on top of another element. It is only shown when a user mousenters/mouseovers the main element. I am having some trouble with the prototype. I would like this small nav element to be hidden when a user mouses out of the main box, but I would also like the small nav element to remain visible if a user mouses out of the main box but mouses into the small nav at the same time. This is my attempt so far with some pseudo-code to hopefully explain: $('main_box').observe('mouseenter', function(){ $('small_div').show() }) $('main_box').observe('mouseleave', function(){ if this element is $('small_div') then Event.stop() $('small_div').observe('mouseleave', function(){ if this element is $('main_box') Event.stop observe $('main_box') mouseleave else $('small_div').hide(); }) else $('small_div').hide(); }) The main thing I'm having trouble with is figuring out what element the mouse is over at a given point in time. Is there a way to do something like: on mouseleave do blah unless the mouse is over a specific element then do not do blah?

    Read the article

< Previous Page | 60 61 62 63 64 65 66 67 68 69 70 71  | Next Page >