Search Results

Search found 3850 results on 154 pages for 'newbie cpp'.

Page 2/154 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • [newbie]Webservice - Threads - close if no active threads, if any activen, then wait till its compl

    - by Raj
    Hi I have an ASP.Net webservice running. When the system date changes, i want to close all the threads and restart them again, if the thread/s aren't doing any work. If any of the thread/s is in the process of doing some work(active threads), then i need to wait till the current thread/s complete its process and then close. This will prevent from aborting any current process. Any ideas on how i can perform such a task? Thanks PS:I am new to ASP.NET and Multithreading.

    Read the article

  • Python: some newbie questions on sys.stderr and using function as argument

    - by Cawas
    I'm just starting on Python and maybe I'm worrying too much too soon, but anyways... log = "/tmp/trefnoc.log" def logThis (text, display=""): msg = str(now.strftime("%Y-%m-%d %H:%M")) + " TREfNOC: " + text if display != None: print msg + display logfile = open(log, "a") logfile.write(msg + "\n") logfile.close() return msg def logThisAndExit (text, display=""): msg = logThis(text, display=None) sys.exit(msg + display) That is working, but I don't like how it looks. Is there a better way to write this (maybe with just 1 function) and is there any other thing I should be concerned under exiting? Now to some background... Sometimes I will call logThis just to log and display. Other times I want to call it and exit. Initially I was doing this: logThis ("ERROR. EXITING") sys.exit() Then I figured that wouldn't properly set the stderr, thus the current code shown on the top. My first idea was actually passing "sys.exit" as an argument, and defining just logThis ("ERROR. EXITING", call=sys.exit) defined as following (showing just the relevant differenced part): def logThis (text, display="", call=print): msg = str(now.strftime("%Y-%m-%d %H:%M")) + " TREfNOC: " + text call msg + display But that obviously didn't work. I think Python doesn't store functions inside variables. I couldn't (quickly) find anywhere if Python can have variables taking functions or not! Maybe using an eval function? I really always try to avoid them, tho. Sure I thought of using if instead of another def, but that wouldn't be any better or worst. Anyway, any thoughts?

    Read the article

  • Newbie can't get Tomcat to reload Flex/BlazeDS application

    - by Captain Aporam
    I'm an experienced 'old school' programmer, but new to Tomcat and Flex. I've followed the getting started for BlazeDS. I'm making changes to the Flex code using Flex Builder 3, but I just can't get the changes to show up when I refresh the page on my client. Server and client are separate physical machines, I've even re-started the server hardware. One curious thing, even when I re-started the server I didn't have to re-login to the Tomcat manager page - I didn't restart my client, I guess it remembers my session? TIA, getting frustrated - like my flex page is 'write once'.

    Read the article

  • Newbie Python programmer tangling with Lists.

    - by Sergio Tapia
    Here's what I've got so far: # A. match_ends # Given a list of strings, return the count of the number of # strings where the string length is 2 or more and the first # and last chars of the string are the same. # Note: python does not have a ++ operator, but += works. def match_ends(words): counter = 0 for word in words: if len(word) >= 2 and word[0] == word[-1]: counter += counter return counter # +++your code here+++ return I'm following the Google Python Class, so this isn't homework, but me just learning and improving myself; so please no negative comments about 'not doing my homework'. :P What do you guys think I'm doing wrong here? Here's the result: match_ends X got: 0 expected: 3 X got: 0 expected: 2 X got: 0 expected: 1 I'm really loving Python, so I just know that I'll get better at it. :)

    Read the article

  • C++ Newbie: Passing an fstream to a function to read data

    - by vgm64
    I have a text file named num.txt who's only contents is the line 123. Then I have the following: void alt_reader(ifstream &file, char* line){ file.read(line, 3); cout << "First Time: " << line << endl; } int main() { ifstream inFile; int num; inFile.open("num.txt"); alt_reader(inFile, (char*)&num); cout << "Second Time: " << num << endl; } The output is: First Time: 123 Second Time: 3355185 Can you help me figure out how to get an fstream that is read in a function still assign the variable in main? I'm doing this because alt_reader really has a lot more to it, but this is the part I'm stuck on. Thanks a lot for the help.

    Read the article

  • Why do we need to include the .h while everything works when including only the .cpp file?

    - by reaffer
    Why do we need to include both the .h and .cpp files , while we can make it works with making just a .cpp file and then including it . For example, Creating a file.h containing declarations, then creating a file.cpp containing definitions and including both on the main.cpp. Or, creating a file.cpp containing declaration/definitions ( no prototypes ) Including it on the main.cpp. Both worked for me , but still can't the difference since i do not have a background on the compiling and linking process .

    Read the article

  • How do debug header file implemetation (its .cpp) in c++ using GDB

    - by zengr
    Hi, I have these 3 file in my program: sample1.h (method in sample1.cpp are defined here) sample1.cpp (all the actual implementations) demo.cpp (I am using the methods in sampe1.cpp here, and have included sample1.h) Now, I am using GDB to debug and I know the basic commands like "break lineno." or "break methodname". But, how do I debug the methods written in sample1.cpp? I tried: break "sample1.cpp:mymethod" but it did not work. Thanks

    Read the article

  • CPP extension and multiline literals in Haskell

    - by jetxee
    Is it possible to use CPP extension on Haskell code which contains multiline string literals? Are there other conditional compilation techniques for Haskell? For example, let's take this code: -- If the next line is uncommented, the program does not compile. -- {-# LANGUAGE CPP #-} msg = "Hello\ \ Wor\ \ld!" main = putStrLn msg If I uncomment {-# LANGUAGE CPP #-}, then GHC refutes this code with a lexical error: [1 of 1] Compiling Main ( cpp-multiline.hs, cpp-multiline.o ) cpp-multiline.hs:4:17: lexical error in string/character literal at character 'o' Using GHC 6.12.1, cpphs is available. I confirm that using cpphs.compat wrapper and -pgmP cpphs.compat option helps, but I'd like to have a solution which does not depend on custom shell scripts. -pgmP cpphs does not work. P.S. I need to use different code for GHC < 6.12 and GHC = 6.12, is it possible without preprocessor?

    Read the article

  • Is perfectionism a newbie's friend or enemy? [closed]

    - by Akromyk
    Possible Duplicate: Where do you draw the line for your perfectionism? I see that the development community is very focused on doing things the right way and personally I would like to do the same too, however, is it a good or bad idea for a newbie to focus on design principles, design patterns, and commenting code when getting started, or is it better to let creativity run wild and potentially write sloppy code. Where should a newbie draw the line?

    Read the article

  • C/C++ : Why do we need to include the .h while everything works when including only the .cpp file?

    - by reaffer
    Hi , Why do we need to include both the .h and .cpp files , while we can make it works with making just a .cpp file and then including it . Case one : Creating a file.h containing declarations . Creating a file.cpp containing definitions . Including both on the main.cpp . Case two : Creating a file.cpp containing declaration/definitions ( no prototypes ) Including it on the main.cpp . Both worked for me , but still can't the difference since i do not have a background on the compiling and linking process .

    Read the article

  • CMake: Mac OS X: ld: unknown option: -soname

    - by Alex Ivasyuv
    I try to build my app with CMake on Mac OS X, I get the following error: Linking CXX shared library libsml.so ld: unknown option: -soname collect2: ld returned 1 exit status make[2]: *** [libsml.so] Error 1 make[1]: *** [CMakeFiles/sml.dir/all] Error 2 make: *** [all] Error 2 This is strange, as Mac has .dylib extension instead of .so. There's my CMakeLists.txt: cmake_minimum_required(VERSION 2.6) PROJECT (SilentMedia) SET(SourcePath src/libsml) IF (DEFINED OSS) SET(OSS_src ${SourcePath}/Media/Audio/SoundSystem/OSS/DSP/DSP.cpp ${SourcePath}/Media/Audio/SoundSystem/OSS/Mixer/Mixer.cpp ) ENDIF(DEFINED OSS) IF (DEFINED ALSA) SET(ALSA_src ${SourcePath}/Media/Audio/SoundSystem/ALSA/DSP/DSP.cpp ${SourcePath}/Media/Audio/SoundSystem/ALSA/Mixer/Mixer.cpp ) ENDIF(DEFINED ALSA) SET(SilentMedia_src ${SourcePath}/Utils/Base64/Base64.cpp ${SourcePath}/Utils/String/String.cpp ${SourcePath}/Utils/Random/Random.cpp ${SourcePath}/Media/Container/FileLoader.cpp ${SourcePath}/Media/Container/OGG/OGG.cpp ${SourcePath}/Media/PlayList/XSPF/XSPF.cpp ${SourcePath}/Media/PlayList/XSPF/libXSPF.cpp ${SourcePath}/Media/PlayList/PlayList.cpp ${OSS_src} ${ALSA_src} ${SourcePath}/Media/Audio/Audio.cpp ${SourcePath}/Media/Audio/AudioInfo.cpp ${SourcePath}/Media/Audio/AudioProxy.cpp ${SourcePath}/Media/Audio/SoundSystem/SoundSystem.cpp ${SourcePath}/Media/Audio/SoundSystem/libao/AO.cpp ${SourcePath}/Media/Audio/Codec/WAV/WAV.cpp ${SourcePath}/Media/Audio/Codec/Vorbis/Vorbis.cpp ${SourcePath}/Media/Audio/Codec/WavPack/WavPack.cpp ${SourcePath}/Media/Audio/Codec/FLAC/FLAC.cpp ) SET(SilentMedia_LINKED_LIBRARY sml vorbisfile FLAC++ wavpack ao #asound boost_thread-mt boost_filesystem-mt xspf gtest ) INCLUDE_DIRECTORIES( /usr/include /usr/local/include /usr/include/c++/4.4 /Users/alex/Downloads/boost_1_45_0 ${SilentMedia_SOURCE_DIR}/src ${SilentMedia_SOURCE_DIR}/${SourcePath} ) #link_directories( # /usr/lib # /usr/local/lib # /Users/alex/Downloads/boost_1_45_0/stage/lib #) IF(LibraryType STREQUAL "static") ADD_LIBRARY(sml-static STATIC ${SilentMedia_src}) # rename library from libsml-static.a => libsml.a SET_TARGET_PROPERTIES(sml-static PROPERTIES OUTPUT_NAME "sml") SET_TARGET_PROPERTIES(sml-static PROPERTIES CLEAN_DIRECT_OUTPUT 1) ELSEIF(LibraryType STREQUAL "shared") ADD_LIBRARY(sml SHARED ${SilentMedia_src}) # change compile optimization/debug flags # -Werror -pedantic IF(BuildType STREQUAL "Debug") SET_TARGET_PROPERTIES(sml PROPERTIES COMPILE_FLAGS "-pipe -Wall -W -ggdb") ELSEIF(BuildType STREQUAL "Release") SET_TARGET_PROPERTIES(sml PROPERTIES COMPILE_FLAGS "-pipe -Wall -W -O3 -fomit-frame-pointer") ENDIF() SET_TARGET_PROPERTIES(sml PROPERTIES CLEAN_DIRECT_OUTPUT 1) ENDIF() ### TEST ### IF(Test STREQUAL "true") ADD_EXECUTABLE (bin/TestXSPF ${SourcePath}/Test/Media/PlayLists/XSPF/TestXSPF.cpp) TARGET_LINK_LIBRARIES (bin/TestXSPF ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/test1 ${SourcePath}/Test/test.cpp) TARGET_LINK_LIBRARIES (bin/test1 ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/TestFileLoader ${SourcePath}/Test/Media/Container/FileLoader/TestFileLoader.cpp) TARGET_LINK_LIBRARIES (bin/TestFileLoader ${SilentMedia_LINKED_LIBRARY}) ADD_EXECUTABLE (bin/testMixer ${SourcePath}/Test/testMixer.cpp) TARGET_LINK_LIBRARIES (bin/testMixer ${SilentMedia_LINKED_LIBRARY}) ENDIF (Test STREQUAL "true") ### TEST ### ADD_CUSTOM_TARGET(doc COMMAND doxygen ${SilentMedia_SOURCE_DIR}/doc/Doxyfile) There was no error on Linux. Build process: cmake -D BuildType=Debug -D LibraryType=shared . make I found, that incorrect command generate in CMakeFiles/sml.dir/link.txt. But why, as the goal of CMake is cross-platforming.. How to fix it?

    Read the article

  • Advise on effectively re-entering CPP world [closed]

    - by Aadith
    I am getting back into C++ world after nearly a decade. Apparently, there has been a world of development. Would like to get the developer community's advice as to what would be a good approach to have a smooth take-off. To start with, I have done the following: Read up (very briefly) on C++ 11 standards Installed GCC 4.7 Wrote a Hello World program I am sure getting a decent book and reading through it would do. But I am looking for any strategic advise experts might have to share. Trying to leverage on past experience to have a short but effective initial learning span. What would be top few things I would have to look into?

    Read the article

  • Using Cpp Unit with visual studio 2010 [closed]

    - by Deepak
    I have downloaded "cppunit-cvs-repo-archive.tar.bz2" from http://sourceforge.net/projects/cppunit/ Now after unzipping the above .tar.bz2 what to do next? On searching on internet, it is mentioned that open the CppUnitLibraries.dsw project under cppunit-cvs-repo-archive\cppunit\src folder but the same file is existing with name "CppUnitLibraries.dsw,v" and on changing its extension to .dsw and on opening again it displays the message invalid project file.

    Read the article

  • Baby's first big CPP project - please help [closed]

    - by jamesson
    So, I need to do a few things to the code here; http://64.90.55.88/SynapseSource-Win.zip What I need to do 1)remove the opengl output window 2)Make it work with latest openni (http://75.98.78.94/default.aspx) - as far as I could tell it only works with a specific older version 3)Improve ram and cpu usage (assuming I don't get what I need from the first two changes) 4)Eventually rebuild it as an object in this sdk; http://cycling74.com/products/sdk/ I tried going through the documentation, but "the needle could not penetrate", alas. For example, I am still unclear about some basic things; a) what are the relative responsibilities of nite vs openni? b) which xml files are always used when the app launches, and what is their format? Many thanks in advance Joe Stavitsky

    Read the article

  • As a newbie, where should I go if I want to create a small GUI program?

    - by jimbmk
    Hello, I'm a newbie with a little experience writing in BASIC, Python and, of all things, a smidgeon of assembler (as part of a videogame ROM hack). I wanted to create small tool for modifying the hex values at particular points, in a particular file, that would have a GUI interface. What I'm looking for is the ability to create small GUI program, that I can distribute as an EXE (or, at least a standalone directory). I'm not keen on the idea of the .NET languages, because I don't want to force people to download a massive .NET framework package. I currently have Python with IDLE and Boa Constructor set up, and the application runs there. I've tried looking up information on compiling a python app that relies on Wxwidgets, but the search results and the information I've found has been confusing, or just completely incomprehensible. My questions are: Is python a good language to use for this sort of project? If I use Py2Exe, will WxWidgets already be included? Or will my users have to somehow install WxWidgets on their machines? Am I right in thinking at Py2Exe just produces a standalone directory, 'dist', that has the necessary files for the user to just double click and run the application? If the program just relies upon Tkinter for GUI stuff, will that be included in the EXE Py2Exe produces? If so, are their any 'visual' GUI builders / IDEs for Python with only Tkinter? Thankyou for your time, JBMK

    Read the article

  • linking c++ sources in iPhone project

    - by Steve918
    I have a single cpp file added to my iPhone project with a .cpp extension, but I'm seeing errors when linking like: operator new[](unsigned long)", referenced from: ___gxx_personality_sj0", referenced from: I thought as long as I named the cpp files with .cpp or .mm it would do the right thing, do I need to add some linker flags? Update: Complete Build log: http://dpaste.org/tXAy/ The C++ code: unzip.h unzip.cpp

    Read the article

  • When I run cxxtest I get this error that I dont underdstand?

    - by user299648
    ./cxxtest/cxxtestgen.py -o tests.cpp --error-printer DrawTestSuite.h g++ -I./cxxtest/ -c tests.cpp g++ -o tests tests.o Color.o tests.o: In function DrawTestSuite::testLinewidthOne()': tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference toLinewidth::Linewidth(double)' tests.cpp:(.text._ZN13DrawTestSuite16t… undefined reference to `Linewidth::draw(std::basic_ostream &)' collect2: ld returned 1 exit status make: * [tests] Error 1// DrawTestSuite.h DrawTestSuite.h contains the unit-test and The test function calls on Linewidth.h to execute the constructer and member function draw I have include "Linewidth.h" in DrawTestSuite.h

    Read the article

  • Unix - "xargs" - output "in the middle" (not at the end!)

    - by Petike
    Hello, example use of "xargs" application in Unix can be something like this: ls | xargs echo which is the same as (let's say I have "someFile" and "someDir/" in the working dir): echo someFile someDir so "xargs" take its "input" and place it "at the end" of the next command (here at the end of echo). But sometimes I want xargs to place its input somewhere "in the middle" of next command. For example: find . -type f -name "*.cpp" -print | xargs g++ -o outputFile so if I had in the current directory files "a.cpp" "b.cpp" "c.cpp" the output would be the same as with the command: g++ -o outputFile a.cpp b.cpp c.cpp but I want to have something like this: g++ a.cpp b.cpp c.cpp -o outputFile Is there a way to do it? P.S.: I need it in some cases, because e.g.: i586-mingw32msvc-g++ -o outputFile `pkg-config --cflags --libs gtkmm-2.4` a.cpp b.cpp c.cpp doesn't work but this one works fine: i586-mingw32msvc-g++ a.cpp b.cpp c.cpp -o outputFile `pkg-config --cflags --libs gtkmm-2.4` Thanks. Petike

    Read the article

  • Effective SEO Article Tutorials and Guide For Newbie Web Content Creators

    Getting updated knowledge for how to write SEO articles is essential because of the steady changes occurring in the search engine algorithms. There are certain challenges that most newbie content writers are facing when it comes to dealing with the issues like website content creation. With the introduction of Web 2.0, it is necessary to use high quality unique content in marketing products or services on the internet.

    Read the article

  • My method is being recognized within my own program. Newbie mistake probably.

    - by Sergio Tapia
    Here's my code: sentenceToTranslate = raw_input("Please write in the sentence you want to translate: ") words = sentenceToTranslate.split(" ") for word in words: if isVowel(word[0]): print "TEST" def isVowel(letter): if letter.lower() == "a" or letter.lower() == "e" or letter.lower() == "i" or letter.lower() == "o" or letter.lower() == "u": return True else: return False The error I get is: NameError: name 'isVowel' is not defined What am I doing wrong?

    Read the article

  • Makefiles - Compile all .cpp files in src/ to .o's in obj/, then link to binary in /

    - by Austin Hyde
    So, my project directory looks like this: /project Makefile main /src main.cpp foo.cpp foo.h bar.cpp bar.h /obj main.o foo.o bar.o What I would like my makefile to do would be to compile all .cpp files in the /src folder to .o files in the /obj folder, then link all the .o files in /obj into the output binary in the root folder /project. The problem is, I have next to no experience with Makefiles, and am not really sure what to search for to accomplish this. Also, is this a "good" way to do this, or is there a more standard approach to what I'm trying to do?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >