Search Results

Search found 31491 results on 1260 pages for 'simple talk'.

Page 90/1260 | < Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >

  • How to reduce simple cpp application size? (compiled with RAD Studio 2010 cpp builder)

    - by peterg
    I am using rad studio 2010 cpp builder. I've created a new SDI application, added a TCppWebBrowser control and a simple button that onclick trigger the .navigate for the TCppWebBrowser, I compiled it and I got a 1.20mb file, I was expecting less than 700kb at least. How can I reduce the size of the compiled exe? I don't want to use "build with runtime packages", I know that will make it very small but I want to get all the necessary packages and dependencies inside the exe but maybe I am getting more than I use, I tried unchecking/removing a lot of design packages (in project/options/packages) I don't use but the file size didn't decreased. Also I was thinking maybe the TForm component that comes with RAD Studio is giving me more stuff than I need and that could make the file bigger, I mean I only need to drop a webbrowser control and a few buttons in the form, maybe there's a minimal form component I could use to replace TForm. Any suggestions will be appreciated.

    Read the article

  • How to add event listners / signals to a simple superman class?

    - by Kabumbus
    I can and would love to use boost or std for this. Sorry - I am new to C++. So I created a really simple program like: #include <iostream> #include <string> using namespace std; class superman { public: string punch(){return cout << "superman: I hit the bad guy!" << endl;}; }; int main() { superman clark; clark.punch(); cin.get(); } I want to add an event listner that would tell me when clark punched and cout something like "superman punched!". How to add such event listner and event function to my class?

    Read the article

  • How can i get Simple Plain Text from WMD Editor?

    - by stackuser1
    I'm able to get Markdown and html formated text from WMD editor. In my requirement i also need to get plain text from WMD Editor. I would like to explain a simple example. In StackOverflow we will see markdown text while typing description in wmd editor, in preview we are able to see the formated text. In Question Page, with out this markdown and formated text we are able to see the question description in two lines. I need to achieve same kind of functionality. Please suggest me what i need to do.

    Read the article

  • Is there any simple way to test two PNGs for equality?

    - by Mason Wheeler
    I've got a bunch of PNG images, and I'm looking for a way to identify duplicates. By duplicates I mean, specifically, two PNG files whose uncompressed image data are identical, not necessarily whose files are identical. This means I can't do something simple like compare CRC hash values. I figure this can actually be done reliably since PNGs use lossless compression, but I'm worried about speed. I know I can winnow things down a little by testing for equal dimensions first, but when it comes time to actually compare the images against each other, is there any way to do it reasonably efficiently? (ie. faster than the "double-for-loop checking pixel values against each other" brute-force method?)

    Read the article

  • What task can I automate in Python that's fun, simple, and useful?

    - by froadie
    I'm trying to learn Python. I'm going to eventually be using it at work, but I don't have an active project in it as of now. I've been reading through some documentation and would like to learn some basics, but I learn best when actually coding. So I'm thinking of attempting a small Python project just to sort of "get my feet wet" in Python. While reading/asking around, I've often heard people say that if you need a Python project you should automate some task you do on your computer on a day-to-day basis. Maybe I'm not so imaginative, but I can't think of anything I'd like to automate... Does anyone have any ideas of something simple, fun, and not too time-consuming that someone can automate to get some basic experience in Python? Something that they would come out of feeling like they accomplished something fun and useful?

    Read the article

  • How to create a simple server/client application using boost.asio?

    - by the_drow
    I was going over the examples of boost.asio and I am wondering why there isn't an example of a simple server/client example that prints a string on the server and then returns a response to the client. I tried to modify the echo server but I can't really figure out what I'm doing at all. Can anyone find me a template of a client and a template of a server? I would like to eventually create a server/client application that receives binary data and just returns an acknowledgment back to the client that the data is received.

    Read the article

  • Can't declare even the most simple class in PHP - Am I going insane?

    - by Phil
    I'm getting this error whenever I attempt to declare a class: Parse error: syntax error, unexpected T_VARIABLE, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home3/foundloc/public_html/booka/page2.php on line 7 (line 7 is the class declaration by the way). Here's the incredibly simple class I am attempting to declare: Class abc { $a = “Hello!”; } Is there some setting on PHP that i need to turn on? I feel like this is one of those 'did you check if the TV is plugged in' type of issues....

    Read the article

  • How can Perl's XML::Simple ignore HTML embedded in XML?

    - by Miriam Raphael Roberts
    I have an XML file that I am pulling from the web and parsing. One of the items in the XML is a 'content' value that has HTML. I am using XML::Simple::XMLin to parse the file like so: $xml= eval { $data->XMLin($xmldata, forcearray => 1, suppressempty=> +'') }; When I use Data::Dumper to dump the hash, I discovered that SimpleXML is parsing the HTML into the hash tree: 'content' = { 'div' = [ { 'xmlns' = 'http://www.w3.org/1999/xhtml', 'p' = [ { 'a' = [ { 'href' = 'http://miamiherald.typepad.com/.a/6a00d83451b26169e20133ec6f4491970b-pi', 'style' = 'FLOAT: left', 'img' = [ etc..... This is not what I want. I want to just grab content inside of this entry. How do I do this?

    Read the article

  • Which containers / graphics components to use in a simple Java Swing game?

    - by rize
    I'm creating a simple labyrinth game with Java + Swing. The game draws a randomized labyrinth on the screen, places a figure in the middle, and the player is then supposed to find the way out by moving the figure with arrow-keys. As for now, I'm using a plain background and drawing the walls of the labyrinth with Graphics.drawLine(). I have a custom picture of the figure in a .gif file, which I load as a BufferedImage object. However, I want the player to see only part of the labyrinth at a time, and the screen should follow the figure in the game, as the player moves around. I'm planning to do this by creating an Image object of the whole labyrinth when it is created, and then "cutting" a square around the current position of the figure and displaying this with Graphics.drawImage(). I'm new with Swing though, and I can't figure out how to draw the figure at different positions "above" the labyrinth without redrawing the whole thing. Which container/component should I use for the labyrinth and then for the figure to achieve this?

    Read the article

  • What is a simple way to combine two Emacs major modes, or to change an existing mode?

    - by Winston C. Yang
    In Emacs, I'm working with a file that is a hybrid of two languages. Question 1: Is there a simple way to write a major mode file that combines two major modes? Details: The language is called "brew" (not the "BREW" of "Binary Runtime Environment for Wireless"). brew is made up of the languages R and Latex, whose modes are R-mode and latex-mode. The R code appears between the tags <% and %. Everything else is Latex. How can I write a brew-mode.el file? (Or is one already available?) One idea, which I got from this posting, is to use Latex mode, and treat the code of the form <% ... % as a comment. Question 2: How do you change the .emacs file or the latex.el file to have Latex mode treat code of the form <% ... % as a comment?

    Read the article

  • What's a simple way to web-ify my command-line daemon?

    - by dreeves
    Suppose I have a simple daemon type script that I run on my webserver. I run it in a terminal, with gnu screen, so I can keep an eye on it. That works fine (incidentally, I use this trick). But now suppose I'd like to make a web page where I can keep an eye on my script's output. What's the easiest way to do that? Notes: This is mainly for myself and a couple co-hackers so if websockets is the answer and it only works on Chrome or something, that's acceptable. This question is asking something similar: http://stackoverflow.com/questions/1964494/how-to-make-all-connected-browsers. But I'm hoping for a simpler, quick-and-dirty solution, and especially a general way to quickly do this for any script I might want to keep an eye on from a browswer.

    Read the article

  • How to use List<T>.Find() on a simple collection that does not implement Find()?

    - by Bilal
    Hi, I want to use List.Find() on a simple collection that does not implement Find(). The naive way I thought of, is to just wrap it with a list and execute .Find(), like this: ICollection myCows = GetAllCowsFromFarm(); // whatever the collection impl. is... var steak = new List<Cow>(myCows).Find(moo => moo.Name == "La Vache qui Rit"); Now, 1st of all I'd like to know, C#-wise, what is the cost of this wrapping? Is it still faster to 'for' this collection the traditional way? Second, is there a better straightforward way elegantly use that .Find()? Cheers!

    Read the article

  • MVC (model-view-controller) - can it be explained in simple terms?

    - by DVK
    I need to explain to a not-very-technical manager the MVC (model-view-controller) concept and ran into trouble. The problem is that the explanation needs to be on a "your grandma will get it" level - e.g. even the fairly straightforward explanation offered on MVC Wiki page didn't work, at least with my commentary. Does anyone have a reference to a good MVC explanation in simple terms? It would ideally be done with non-techie metaphor examples (e.g. similar to "Decorator pattern is like glasses") - one reason I failed was that all MVC examples I could come up with were development related. I once saw a list of pattern explanations but to the best of my memory MVC was not on it. Thanks!

    Read the article

  • Want to build simple SQL admin interface to change a few values in a table.

    - by Adam McC
    i am currently building a system in MSSQL 2K5. i have a table that holds information about certain insurance schemes such as overheads and other things. these values will change occasionally and currently i administer the database straight through the management Studio. i would like to build a simple interface that will allow my colleagues to change these values by selecting the company in a dropdown and the current values will populate. they can then edit these values and submit them to the database. is this possible in the current Visual Studio supplied with MSSQL server 2K5 or do i need to get another product. i am confident that with the help of stack overflow and google i can build this myself, but i need pointed in the right direction as to which environment would be easiest and best to start building it. Many thanks, adam

    Read the article

  • In MongoDB, how can I replicate this simple query using map/reduce in ruby?

    - by Matthew Rathbone
    Hi, So using the regular MongoDB library in Ruby I have the following query to find average filesize across a set of 5001 documents: avg = 0 total = collection.count() Rails.logger.info "#{total} asset creation stats in the system" collection.find().each {|row| avg += (row["filesize"] * (1/total.to_f)) if row["filesize"]} Its pretty simple, so I'm trying to do the same using map/reduce as a learning exercise. This is what I came up with: map = 'function(){emit("filesizes", {size: this.filesize, num: 1});}' reduce = 'function(k, vals){ var result = {size: 0, num: 0}; for(var x in vals) { var new_total = result.num + vals[x].num; result.num = new_total result.size = result.size + (vals[x].size * (vals[x].num / new_total)); } return result; }' @results = collection.map_reduce(map, reduce) However the two queries come back with two different results! What am I doing wrong?

    Read the article

  • ORM on iPhone. More simple than CoreData.

    - by Alexander Babaev
    The question is rather simple. I know that there is SQLite. There is Core Data also. But I need something in between. More object-oriented than SQLite API and simplier than Core Data. Main points are: I need access to stored entities only by id. No queries required. I need to store items of a single type, it means that I can use only one table if I choose SQLite. I want automatic object-relational conversion. Or object-storage if the storage is not relational. I can use object archiving, but I have to implement things (NSArchiver). But I want to write some kind of class and get persistence automatically. As it can be done with Hibernate/ActiveRecord/Core Data/etc. Thanks.

    Read the article

  • A consistent and simple group of IDE and tools for embedded code and unit test in C++ ?

    - by TridenT
    I’m starting a new firmware project in C++ for Texas Instrument C283xx and C6xxx targets. The unit tests will not run on the target, but will be compiled with gcc/gcov on a PC with windows (and run as well on PC) with simple metrics for tested code coverage. The whole project will be part of Cruise Control.NET for continuous integrations. My question is: what are the consistent IDE / framework / tools to work together? A/ One of the developers says CodeComposerStudio V3.1 for application and CodeBlocks + CxxUnit for the Unit tests. B/ I’m more attracted with CodeComposerStudio V4 for application, Eclipse CDT (well, as CCS V4) and CppUnit for unit test + MockCpp for mocks. I don’t want the best in class tools for each process, but a global, consistent and easy solution (or group of tools if you prefer).

    Read the article

  • Writing a simple batch file to setup a variable?

    - by Sam
    I want to write a simple batch file where i want to setup a environment variable based on the machine architecture. It is as below: set ARCH=%PROCESSOR_ARCHITECTURE% echo %ARCH% if %ARCH%==x86 ( set JAVA_ROOT=C:\Progra~1\Java\j2re1.4.2_13 ) else ( set JAVA_ROOT=C:\Progra~2\Java\j2re1.4.2_13 ) echo JAVA_ROOT is %JAVA_ROOT% On 64-bit machine where the architecture is 'AMD64' the JAVA_ROOT will be displayed as 'C:\Progra~2\Java\j2re1.4.2_13' at the echo statement. But when i run an application that uses this file, the first value of JAVA_ROOT would be picked up 'C:\Progra~1\Java\j2re1.4.2_13'. I don't have any idea why it goes in the 'if' part even though i am running this on 64-bit Windows7. When i echoed the

    Read the article

  • For simple C cmd programs: how to add "program executed in 12,345 seconds" ?

    - by WoodsieLord
    I'm a windows user, and I'm learning C. I use Codeblocks and visual c++ 2008 express at home to write simple C command line programs (I'm a beginner) and I find really useful when codeblocks adds a few lines at the end with the time it takes (example: "Process returned 0 (0x0) execution time : 6.848 s"). I want to add this functionality to the .exe so I can 'benchmark' or 'test' the program on a few computers. I tried using time(NULL) but it only works with 1 second precision. I also found very interesting answers here (I'm actually looking for the same thing): http://stackoverflow.com/questions/2173323/calculating-time-by-the-c-code The solution proposed by Mark Wilkins, works fine on visual c++ 2008 express on my windows 64 bit PC, but the .exe does not work anywhere else. Am I doing something wrong? I would like a method to count elapsed wall time for my programs, that must have 32bit compatibility. Thanks in advance!

    Read the article

  • Simple "Hello World!" console application crashes when run by windows TaskScheduler (1.0)

    - by user326627
    I have a batch file which starts multiple instances of simple console application (Hello World!). I work on Windows server 2008 64-bit. I configure it to run in TaskScheduler, at startup, and whether user is logged-in or not. The later configuration means that the instances will run without GUI (i.e. - no window). When I run this task, some of the instances just fail, after consuming 100& CPU. Application event-log shows the following error: "Faulting module KERNEL32.dll, version 6.0.6002.18005, time stamp 0x49e0421d, exception code 0xc0000142, fault offset 0x00000000000b8fb8, process id 0x29bc, application start time 0x01cae17d94a61895." Running the batch file directly works just fine. It seems to me that the OS has a problem loading too many instances of the application when no window is displayed. However - I can’t figure out why... Any idea??

    Read the article

  • Simple Scala syntax - trying to define "==" operator - what am I missing?

    - by Alex R
    While experimenting with some stuff on the REPL, I got to a point where I needed something like this: scala class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } Just a simple class with an "==" operator. Why doesn't it work??? Here's the result: :10: error: type mismatch; found : A required: ?{val x: ?} Note that implicit conversions are not applicable because they are ambiguous: both method any2ArrowAssoc in object Predef of type [A](x: A)ArrowAssoc[A] and method any2Ensuring in object Predef of type [A](x: A)Ensuring[A] are possible conversion functions from A to ?{val x: ?} class A(x:Int) { println(x); def ==(a:A) : Boolean = { this.x == a.x; } } ^ This is scala 2.8 RC1. Thanks

    Read the article

  • MySQL Simple query gives "Query was empty". Transaction help needed I think.

    - by user129609
    Hi, I'm trying to do a simple transaction in MySQL delimiter go start transaction; BEGIN DECLARE EXIT HANDLER FOR SQLEXCEPTION, SQLWARNING, NOT FOUND ROLLBACK; INSERT INTO jext_categories (Name) VALUES ('asdfas'); INSERT INTO jext_categories (Name) VALUES ('asdfas2'); END; commit; SELECT * FROM jext_categories; go delimiter ; but I keep getting an error saying query was empty. Could someone please tell me what I am doing wrong, and also, what is the proper format for doing a transaction in MySQL? Thanks!

    Read the article

  • Why isn't this simple test class's method inherited in Ruby?

    - by Kevin Bannister
    Consider this very simple logging class: class MockLog def self.log_stub_method(*args) args.each do |a| define_method "#{a}" do |msg| t = Time.now.strftime("%Y-%m-%d %H:%M:%S") $stderr.puts "[#{a.upcase}] \u00bb [#{t}] #{msg}" end end end log_stub_method :fatal, :error, :warn, :info, :debug end Let's add logging to all our classes: class Module def has_logging() class_eval { @log = MockLog.new def log self.class.instance_variable_get :@log end } end end Now, why doesn't this work? class Foo has_logging end Foo.new.log.nil? # => false, as expected class Bar < Foo end Bar.new.log.nil? # => true?! Why wasn't the `log` method inherited?

    Read the article

  • How to represent a Many-To-Many relationship in XML or other simple file format?

    - by CSharperWithJava
    I have a list management appliaction that stores its data in a many-to-many relationship database. I.E. A note can be in any number of lists, and a list can have any number of notes. I also can export this data to and XML file and import it in another instance of my app for sharing lists between users. However, this is based on a legacy system where the list to note relationship was one-to-many (ideal for XML). Now a note that is in multiple lists is esentially split into two identical rows in the DB and all relation between them is lost. Question: How can I represent this many-to-many relationship in a simple, standard file format? (Preferably XML to maintain backwards compatibility)

    Read the article

  • Django: How do I go about changing my simple app to use Ajax?

    - by swisstony
    I currently have a web page where the user enters some data and then clicks a submit button. I process the data in views.py and then use the same Django template to return and display the original data and the results. What I would like to do is try to give it a bit more of a modern look and feel. You know the sort of thing, the page doesn't refresh but displays a spinning disk until the results are displayed. I assume this means using Ajax? How difficult is it to modify a simple app like this to use Ajax? What is involved? What are the best tools to use? JQuery?

    Read the article

< Previous Page | 86 87 88 89 90 91 92 93 94 95 96 97  | Next Page >