Search Results

Search found 2842 results on 114 pages for 'undefined hero'.

Page 19/114 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Simplepie - fetch feeds from database

    - by krike
    I want to fetch multiple feeds from the database and in so doing fetch all new content from those feeds it works but there is a problem and I have no idea what's causing it, this is the code: $feed_sql = mysqli_query($link, "SELECT feed from tutorial_feed WHERE approved=1"); $feeds = array(); $i = 0; while($feed_r = mysqli_fetch_object($feed_sql)): $feeds[$i] .= $feed_r->feed; $i++; endwhile; $feed = new SimplePie($feeds); $feed-handle_content_type(); foreach($feed-get_items(0, 100) as $item) : echo $item-get_permalink().""; endforeach; I first get Notice: Undefined offset: 0 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 1 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 2 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 3 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 4 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 5 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 6 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 7 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 8 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 9 in I:\wamp\www\cmstut\includes\cron.php on line 22 Notice: Undefined offset: 10 in I:\wamp\www\cmstut\includes\cron.php on line 22 and then it will start printing the permalinks to the new content based on the imported feeds, I know undefined offset means it does not exist but I don't get it, any help would be appreciated

    Read the article

  • How to solve Fatal error: Call to undefined function readline()? readline library not found?

    - by SirBT
    I have an Ubuntu 12.04 LTS. And XAMPP for linux 1.7.7. When I code in php with and call the readline function I get this error message? "Fatal error: Call to undefined function readline()" I recently found the below thread which pointed out the name of the package that contained the desired readline: How to solve configure: error: readline library not found? I went ahead and installed # apt-get install libreadline6. But this didnt seem to make a difference. I still get the same error message: "Fatal error: Call to undefined function readline()". Was the thread missing further steps? Can anyone help me? I am new to Ubuntu. <?php echo "Simple menu \n" ; echo "1. Play Sports \n"; echo "2. Play Strategy games \n"; $userInput = readline('Enter something here: '); ?>

    Read the article

  • C++: Calling class functions within a switch

    - by user1446002
    i've been trying to study for my finals by practicing classes and inheritance, this is what I've come up with so far for inheritance and such however I'm unsure how to fix the error occuring below. #include<iostream> #include<iomanip> #include<cmath> #include<string.h> using namespace std; //BASE CLASS DEFINITION class hero { protected: string name; string mainAttr; int xp; double hp; double mana; double armour; int range; double attkDmg; bool attkType; public: void dumpData(); void getName(); void getMainAttr(); void getAttkData(); void setAttkData(string); void setBasics(string, string, double, double, double); void levelUp(); }; //CLASS FUNCTIONS void hero::dumpData() { cout << "Name: " << name << endl; cout << "Main Attribute: " << mainAttr << endl; cout << "XP: " << xp << endl; cout << "HP: " << hp << endl; cout << "Mana: " << mana << endl; cout << "Armour: " << armour << endl; cout << "Attack Range: " << range << endl; cout << "Attack Damage: " << attkDmg << endl; cout << "Attack Type: " << attkType << endl << endl; } void hero::getName() { cout << "Name: " << name << endl; } void hero::getMainAttr() { cout << "Main Attribute: " << mainAttr << endl; } void hero::getAttkData() { cout << "Attack Range: " << range << endl; cout << "Attack Damage: " << attkDmg << endl; cout << "Attack Type: " << attkType << endl; } void hero::setAttkData(string attr) { int choice = 0; if (attr == "Strength") { choice = 1; } if (attr == "Agility") { choice = 2; } if (attr == "Intelligence") { choice = 3; } switch (choice) { case 1: range = 128; attkDmg = 80.0; attkType = 0; break; case 2: range = 350; attkDmg = 60.0; attkType = 0; break; case 3: range = 600; attkDmg = 35.0; attkType = 1; break; default: break; } } void hero::setBasics(string heroName, string attribute, double health, double mp, double armourVal) { name = heroName; mainAttr = attribute; hp = health; mana = mp; armour = armourVal; } void hero::levelUp() { xp = 0; hp = hp + (hp * 0.1); mana = mana + (mana * 0.1); armour = armour + ((armour*0.1) + 1); attkDmg = attkDmg + (attkDmg * 0.05); } //INHERITED CLASS DEFINITION class neutHero : protected hero { protected: string drops; int xpGain; public: int giveXP(int); void dropItems(); }; //INHERITED CLASS FUNCTIONS int neutHero::giveXP(int exp) { xp += exp; } void neutHero::dropItems() { cout << name << " has dropped the following items: " << endl; cout << drops << endl; } /* END OF OO! */ //FUNCTION PROTOTYPES void dispMenu(); int main() { int exit=0, choice=0, mainAttrChoice=0, heroCreated=0; double health, mp, armourVal; string heroName, attribute; do { dispMenu(); cin >> choice; switch (choice) { case 1: system("cls"); cout << "Please enter your hero name: "; cin >> heroName; cout << "\nPlease enter your primary attribute\n"; cout << "1. Strength\n" << "2. Agility\n" << "3. Intelligence\n"; cin >> mainAttrChoice; switch (mainAttrChoice) { case 1: attribute = "Strength"; health = 750; mp = 150; armourVal = 2; break; case 2: attribute = "Agility"; health = 550; mp = 200; armourVal = 6; break; case 3: attribute = "Intelligence"; health = 450; mp = 450; armourVal = 1; break; default: cout << "Choice invalid, please try again."; exit = 1; break; hero player; player.setBasics(heroName, attribute, health, mp, armourVal); player.setAttkData(attribute); heroCreated=1; system("cls"); cout << "Your hero has been created!\n\n"; player.dumpData(); system("pause"); break; } case 2: system("cls"); if (heroCreated == 1) { cout << "Your hero has been detailed below.\n\n"; **player.dumpData(); //ERROR OCCURS HERE !** system("pause"); } else { cout << "You have not created a hero please exit this prompt " "and press 1 on the menu to create a hero."; } break; case 3: system("cls"); cout << "Still Under Development"; system("pause"); break; case 4: system("cls"); exit = 1; break; default: cout << "Your command has not been recognised, please try again.\n"; system("pause"); break; } } while (exit != 1); system("pause"); return 0; } void dispMenu() { system("cls"); cout << "1. Create New Hero\n" "2. View Current Hero\n" "3. Fight Stuff\n" "4. Exit\n\n" "Enter your choice: "; } However upon compilation I get the following errors: 220 `player' undeclared (first use this function) Unsure exactly how to fix it as I've only recently started using OO approach. The error has a comment next to it above and is in case 2 in the main. Cheers guys.

    Read the article

  • 2d, Top-down map with different levels

    - by Ktash
    So, I'm creating a 2d, top down, sprite based (tiled) game, and right now I'm working on maps (well, a map editor at the moment, but it will be creating my maps, so basically the same thing). The scenario So, I'm thinking about efficiency and creating a map in pieces. In each piece, I plan on having 'layers'. Basically, I plan on rendering it down to a 'below hero' level, and an 'above hero' level, with the hero rendered in between obviously. There will likely also be a 'on level with hero' layer, but I'm not quite there yet. Not even worrying about events or interaction yet. Just looking to get a hero on the screen. Now for movement, I obviously need to know what tiles can be moved and in what direction. My plan at the moment is each tile getting 8 bits (4 'can enter in direction' bits, 4 'can leave in direction'). This will allow me to limit movement and even allow one way directional movement. The dilemma This works great for a lot of scenarios. It will allow me to store a map in essentially 3 layers, a string, and gives me flexibility going forward. However, I can't create maps that themselves have layers. A good example is a bridge where the user can go under or over the bridge without invalid moves being allowed. I can't create a platform and allow movement underneath. These are things I would like to be able to include in my game. My idea In theory, I could allow multiple hero layers and then allow multiple sets of 'below' and 'above' layers (or sandwich layers). But this complicates my system, and makes movement between maps potentially tricky (If the hero is on the third layer at the edge of a map, but that corresponds to the second layer on the other map, how can I allow or disallow movement). My question Is there a better way to manage multiple maps with multiple levels like this where a users level may be 'connected' on different levels on different maps? Or even... Am I doing this the hard way? Is there a more standard way to handle top-down 2d tiled maps that I am just not aware of? Things to note or that might be helpful This will be done in Javascript (transferred around in JSON) State will need to be transferred quickly, so a map-id and x/y/direction should be enough to get me a boolean 'can move' value Maps will not be standard sized (though they will be in a certain number of tiles) Making an editor tool so that I can have others help, so something that I can create in a tool would be helpful 'Teleportation' locations will likely need to exist to get into building maps and to and from different map sets (which will not necessarily be connected), but have not been created yet (lumping in with events at the moment).

    Read the article

  • I am getting error when using Attributes in Rcpp and have RcppArmadillo code

    - by howard123
    I am trying to create a package with RcppArmadillo. The code uses the new attributes methodology of Rcpp. The sourceCpp works fine and compiles the code, but when I build a package I get errors when I use RcppArmadillo code. Without the RcppArmadillo code and using regulare C++, I do not get these errors. The C++ code (it is essentially the fastLm sample code) is: // [[Rcpp::depends(RcppArmadillo)]] #include <Rcpp.h> #include <RcppArmadillo.h> using namespace Rcpp; // [[Rcpp::depends(RcppArmadillo)]] #include <RcppArmadillo.h> // [[Rcpp::export]] List fastLm(NumericVector yr, NumericMatrix Xr) { int n = Xr.nrow(), k = Xr.ncol(); arma::mat X(Xr.begin(), n, k, false); arma::colvec y(yr.begin(), yr.size(), false); arma::colvec coef = arma::solve(X, y); arma::colvec resid = y - X*coef; double sig2 = arma::as_scalar(arma::trans(resid)*resid/(n-k)); arma::colvec stderrest = arma::sqrt( sig2 * arma::diagvec( arma::inv(arma::trans(X)*X)) ); return List::create(Named("coefficients") = coef, Named("stderr") = stderrest); } Here is the compilation error, after I execute "R Rcpp::compileAttributes() * Updated src/RcppExports.cpp == Rcmd.exe INSTALL --no-multiarch NewPackage * installing to library 'C:/Users/Howard/Documents/R/win-library/2.15' * installing *source* package 'NewPackage' ... ** libs g++ -m64 -I"C:/R/R-2-15-2/include" -DNDEBUG -I"C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/include" -I"C:/Users/Howard/Documents/R/win-library/2.15/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o g++ -m64 -I"C:/R/R-2-15-2/include" -DNDEBUG -I"C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/include" -I"C:/Users/Howard/Documents/R/win-library/2.15/RcppArmadillo/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall -mtune=core2 -c test_arma3.cpp -o test_arma3.o g++ -m64 -shared -s -static-libgcc -o NewPackage.dll tmp.def RcppExports.o test_arma3.o C:/Users/Howard/Documents/R/win-library/2.15/Rcpp/lib/x64/libRcpp.a -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-2-15-2/bin/x64 -lR test_arma3.o:test_arma3.cpp:(.text+0xae4): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text+0x19db): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text+0x1b0c): undefined reference to `dgemv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib8solve_odIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE[_ZN4arma6auxlib8solve_odIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE]+0x702): undefined reference to `dgels_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib8solve_udIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE[_ZN4arma6auxlib8solve_udIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EE]+0x51c): undefined reference to `dgels_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb[_ZN4arma6auxlib10det_lapackIdEET_RKNS_3MatIS2_EEb]+0x14b): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma6auxlib5solveIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EEb[_ZN4arma6auxlib5solveIdNS_3MatIdEEEEbRNS2_IT_EES6_RKNS_4BaseIS4_T0_EEb]+0x375): undefined reference to `dgesv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdEEvPT_RKNS_3MatIS3_EEPKS3_S3_S3_[_ZN4arma4gemvILb1ELb0ELb0EE15apply_blas_typeIdEEvPT_RKNS_3MatIS3_EEPKS3_S3_S3_]+0x17d): undefined reference to `dgemv_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_2OpINS_3MatIdEENS_9op_htransEEES5_EEvRNS4_INT_9elem_typeEEERKNS_4GlueIS8_T0_NS_10glue_timesEEE[_ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_2OpINS_3MatIdEENS_9op_htransEEES5_EEvRNS4_INT_9elem_typeEEERKNS_4GlueIS8_T0_NS_10glue_timesEEE]+0x37a): undefined reference to `dgemm_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x2c1): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x322): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x398): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x775): undefined reference to `dgetrf_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x7d6): undefined reference to `dgetri_' test_arma3.o:test_arma3.cpp:(.text$_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE[_ZN4arma10op_diagvec5applyINS_2OpINS_4GlueINS2_INS_3MatIdEENS_9op_htransEEES5_NS_10glue_timesEEENS_6op_invEEEEEvRNS4_INT_9elem_typeEEERKNS2_ISC_S0_EE]+0x892): undefined reference to `dgetri_' collect2: ld returned 1 exit status ERROR: compilation failed for package 'NewPackage' * removing 'C:/Users/Howard/Documents/R/win-library/2.15/NewPackage' * restoring previous 'C:/Users/Howard/Documents/R/win-library/2.15/NewPackage' Exited with status 1.

    Read the article

  • can not access MovieClip properties in flashDevelop

    - by numerical25
    I know there is something I am doing wrong. In my controls I have keydown events that control my hero. As of right now, I am trying to rotate my hero but he refuses to turn . Below is my Hero Class, my control class, and gameobject class. pretty much all the classes associate with the controls class. package com.Objects { import com.Objects.GameObject; /** * ... * @author Anthony Gordon */ [Embed(source='../../../bin/Assets.swf', symbol='OuterRim')] public class Hero extends GameObject { public function Hero() { } } } Here is my Controls class. This is the class where I am trying to rotate my hero but he doesnt. The keydown event does work cause I trace it. package com.Objects { import com.Objects.Hero; import flash.events.*; import flash.display.MovieClip; /** * ... * @author Anthony Gordon */ public class Controls extends GameObject { private var aKeyPress:Array; public var ship:Hero; public function Controls(ship:Hero) { this.ship = ship; IsDisplay = false; aKeyPress = new Array(); engine.sr.addEventListener(KeyboardEvent.KEY_DOWN, keyDownListener); engine.sr.addEventListener(KeyboardEvent.KEY_UP,keyUpListener); } private function keyDownListener(e:KeyboardEvent):void { //trace("down e.keyCode=" + e.keyCode); aKeyPress[e.keyCode] = true; trace(e.keyCode); } private function keyUpListener(e:KeyboardEvent):void { //trace("up e.keyCode=" + e.keyCode); aKeyPress[e.keyCode]=false; } override public function UpdateObject():void { Update(); } private function Update():void { if (aKeyPress[37])//Key press left ship.rotation += 3,trace(ship.rotation ); ///DOESNT ROtate }//End Controls } } Here is GameObject Class package com.Objects { import com.Objects.Engine; import com.Objects.IGameObject; import flash.display.MovieClip; /** * ... * @author Anthony Gordon */ public class GameObject extends MovieClip implements IGameObject { private var isdisplay:Boolean = true; private var garbage:Boolean; public static var engine:Engine; public var layer:Number = 0; public function GameObject() { } public function UpdateObject():void { } public function GarbageCollection():void { } public function set Garbage(garb:Boolean):void { garbage = garb; } public function get Garbage():Boolean { return garbage } public function get IsDisplay():Boolean { return isdisplay; } public function set IsDisplay(display:Boolean):void { isdisplay = display; } public function set Layer(l:Number):void { layer = l; } public function get Layer():Number { return layer } } }

    Read the article

  • Annoying Bug in banner cycle

    - by Davemof
    I have created a rotating banner script for a new site I'm developing View banner here(it rotates every 10 seconds) Unfortunately to the transition seems to be a biut buggy, and the image will fade out, show the same image again and then fade in the new one. I think I have made a simple error somewhere, but can't figure out where it is. the code used to cycle the banners is: In document ready: if ($('.home').length > 0){ $('<img width="100%" />').attr('src', '/assets/img/backgrounds/home/hero'+homecount+'.jpg').load(function(){ $('.hero').append( $(this) ); $('.hero img').fadeIn('medium').delay(10000).fadeOut('slow', loopImages); setHeroHeight(); }); } Outside document ready: function loopImages(){ homecount = homecount+1; if (homecount > 5){ homecount = 1; } $('.hero img') .attr('src', '/assets/img/backgrounds/home/hero'+homecount+'.jpg') .load(function(){ $('.hero img').fadeIn('fast')}).delay(10000).fadeOut('slow', loopImages); } Any help would be greatly appreciated Thanks Dave

    Read the article

  • Unable to build my c++ code with g++ 4.6.3

    - by Mriganka
    I am facing multiple issues with building my c++ code on Ubuntu 12.04. This code was building and running fine on RH Enterprise. I am using g++ 4.6.3. Here's the output of g++ -v. g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) Here's a sample of my code: #include "Word.h" #include < string> using namespace std; pthread_mutex_t Word::_lock = PTHREAD_MUTEX_INITIALIZER; Word::Word(): _occurrences(1) { memset(_buf, 0, 25); } Word::Word(char *str): _occurrences(1) { memset(_buf, 0, 25); if (str != NULL) { strncpy(_buf, str, strlen(str)); } } g++ -c -ansi or g++ -c -std=c++98 or g++ -c -std=c++03, none of these options are able to build the code correctly. I get the following compilation errors: mriganka@ubuntu:~/WordCount$ make g++ -c -g -ansi Word.cpp -o Word.o Word.cpp: In constructor ‘Word::Word()’: Word.cpp:10:21: error: ‘memset’ was not declared in this scope Word.cpp: In constructor ‘Word::Word(char*)’: Word.cpp:16:21: error: ‘memset’ was not declared in this scope Word.cpp:19:34: error: ‘strlen’ was not declared in this scope Word.cpp:19:35: error: ‘strncpy’ was not declared in this scope Word.cpp: In member function ‘void Word::operator=(const Word&)’: Word.cpp:37:42: error: ‘strlen’ was not declared in this scope Word.cpp:37:43: error: ‘strncpy’ was not declared in this scope Word.cpp: In copy constructor ‘Word::Word(const Word&)’: Word.cpp:44:21: error: ‘memset’ was not declared in this scope Word.cpp:45:52: error: ‘strlen’ was not declared in this scope Word.cpp:45:53: error: ‘strncpy’ was not declared in this scope So basically g++ 4.6.3 on Ubuntu 12.04 is not able to recognize the standard c++ headers. And I am not finding a way out of this situation. Second problem: In order to make progress, I included < string.h instead of < string. But now I am facing linking errors with my message queue and pthread library functions. Here's the error that I am getting: mriganka@ubuntu:~/WordCount$ make g++ -c -g -ansi Word.cpp -o Word.o g++ -lrt -I/usr/lib/i386-linux-gnu Word.o HashMap.o main.o -o word_count main.o: In function `main': /home/mriganka/WordCount/main.cpp:75: undefined reference to `pthread_create' /home/mriganka/WordCount/main.cpp:90: undefined reference to `mq_open' /home/mriganka/WordCount/main.cpp:93: undefined reference to `mq_getattr' /home/mriganka/WordCount/main.cpp:113: undefined reference to `mq_send' /home/mriganka/WordCount/main.cpp:123: undefined reference to `pthread_join' /home/mriganka/WordCount/main.cpp:129: undefined reference to `mq_close' /home/mriganka/WordCount/main.cpp:130: undefined reference to `mq_unlink' main.o: In function `count_words(void*)': /home/mriganka/WordCount/main.cpp:151: undefined reference to `mq_open' /home/mriganka/WordCount/main.cpp:154: undefined reference to `mq_getattr' /home/mriganka/WordCount/main.cpp:162: undefined reference to `mq_timedreceive' collect2: ld returned 1 exit status Here's my makefile: CC=g++ CFLAGS=-c -g -ansi LDFLAGS=-lrt INC=-I/usr/lib/i386-linux-gnu SOURCES=Word.cpp HashMap.cpp main.cpp OBJECTS=$(SOURCES:.cpp=.o) EXECUTABLE=word_count all: $(SOURCES) $(EXECUTABLE) $(EXECUTABLE): $(OBJECTS) $(CC) $(LDFLAGS) $(INC) -pthread $(OBJECTS) -o $@ .cpp.o: $(CC) $(CFLAGS) $< -o $@ clean: rm -f *.o word_count Please help me to resolve both the issues. I searched online relentlessly for any solution of these problems, but no one seems to have encountered these issues.

    Read the article

  • Compile PHP Error with freetype

    - by Robert Ross
    Hey Guys, I configured PHP myself, included all of the libraries I needed... but then realized I forgot the freetype library. So I went back to my php-5.3.2 directory and ran ./configure '--with-free-type=/usr/local/lib' PHP did the configure fine, no errors. But when I run make: collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 Something that comes up frequently: /php-5.3.2/ext/libxml/libxml.c:336: undefined reference to `ts_resource_ex' /php-5.3.2/ext/sqlite3/sqlite3.c:663: undefined reference to `executor_globals_id' ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_final': /php-5.3.2/ext/sqlite3/sqlite3.c:811: undefined reference to `ts_resource_ex' ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_step': /php-5.3.2/ext/sqlite3/sqlite3.c:799: undefined reference to `ts_resource_ex' ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_callback_func': /php-5.3.2/ext/sqlite3/sqlite3.c:788: undefined reference to `ts_resource_ex' ext/sqlite3/.libs/sqlite3.o: In function `php_sqlite3_authorizer': /php-5.3.2/ext/sqlite3/sqlite3.c:1782: undefined reference to `ts_resource_ex' /php-5.3.2/ext/sqlite3/sqlite3.c:1787: undefined reference to `core_globals_id' ext/sqlite3/.libs/sqlite3.o: In function `zim_sqlite3_open': /php-5.3.2/ext/sqlite3/sqlite3.c:161: undefined reference to `core_globals_id' /php-5.3.2/ext/sqlite3/sqlite3.c:123: undefined reference to `core_globals_id' The undefined reference comes up for several things. So it fails here but it didn't when I initially compiled PHP. What's going on? Do I need to reconfigure the entire thing? Thanks in advance.

    Read the article

  • Why does HTTP::Message::decodable complain about "Can't use an undefined value as a HASH reference"?

    - by scarba05
    I'm getting a Can't use an undefined value as a HASH reference error trying to call HTTP::Message::decodable() using Perl 5.10 / libwww installed on Debian Lenny OS using the aptitude package manager. I'm really stuck so would appreciate some help please. Here's the error: Can't use an undefined value as a HASH reference at (eval 2) line 1. at test.pl line 4 main::__ANON__('Can\'t use an undefined value as a HASH reference at enter code here`(eval 2)...') called at (eval 2) line 1 HTTP::Message::__ANON__() called at test.pl line 6 Here's the code: use strict; use HTTP::Request::Common; use Carp; $SIG{ __DIE__ } = sub { Carp::confess( @_ ) }; print HTTP::Message::decodable();

    Read the article

  • Adding custom attribute to openldap

    - by arukaen
    I am attempting to setup ConTagged - The LDAP Address Book but I am having a few issues with some of the attributes. The problem is that some of them are undefined and they do not seem to be in the inetorgperson.schema. How do I set these custom attributes? For reference, here is the exact error I receive whenever I make a change to a contact. The LDAP server returned the following errors Invalid syntax Undefined attribute type(del anniversary) Undefined attribute type(del marker) Object class violation(mod c) Undefined attribute type(del custom1) Undefined attribute type(del custom2) Undefined attribute type(del custom3) Undefined attribute type(del custom4)

    Read the article

  • Iterate over defined elements of a JS array

    - by sibidiba
    I'm using a JS array to Map IDs to actual elements, i.e. a key-value store. I would like to iterate over all elements. I tried several methods, but all have its caveats: for (var item in map) {...} Does iterates over all properties of the array, therefore it will include also functions and extensions to Array.prototype. For example someone dropping in the Prototype library in the future will brake existing code. var length = map.lenth; for (var i = 0; i < length; i++) { var item = map[i]; ... } does work but just like $.each(map, function(index, item) {...}); They iterate over the whole range of indexes 0..max(id) which has horrible drawbacks: var x = []; x[1]=1; x[10]=10; $.each(x, function(i,v) {console.log(i+": "+v);}); 0: undefined 1: 1 2: undefined 3: undefined 4: undefined 5: undefined 6: undefined 7: undefined 8: undefined 9: undefined 10: 10 Of course my IDs wont resemble a continuous sequence either. Moreover there can be huge gaps between them so skipping undefined in the latter case is unacceptable for performance reasons. How is it possible to safely iterate over only the defined elements of an array (in a way that works in all browsers and IE)?

    Read the article

  • Why can't I compile this version of Postfix?

    - by Coofucoo
    I just installed postfix 2.7.11 in Ubuntu server from source code. I do not use the ubuntu own one because I need the old version. I found a very interesting problem. Before, in both CentOS 5 and 6, I can build the source code without any problem. But, in Ubuntu server 12.04 is totally different. I got the following problems: dict_nis.c:173: error: undefined reference to 'yp_match' dict_nis.c:187: error: undefined reference to 'yp_match' dns_lookup.c:347: error: undefined reference to '__dn_expand' dns_lookup.c:218: error: undefined reference to '__res_search' dns_lookup.c:287: error: undefined reference to '__dn_expand' dns_lookup.c:498: error: undefined reference to '__dn_expand' dns_lookup.c:383: error: undefined reference to '__dn_expand' Yes, this reason is obviously. I just search related library and add it to the makefile. It works. The question is why? What is the difference between Ubuntu Server and CentOS? One possibility is gcc and ld version. Ubuntu server use different version of gcc and ld with CentOS. But I am not sure.

    Read the article

  • b2Body moves without stopping

    - by SentineL
    I got a quite strange bug. It is difficult to explain it in two words, but i'll try to do this in short. My b2Body has restitution, friction, density, mass and collision group. I controlling my b2Body via setting linear velocity to it (called on every iteration): (void)moveToDirection:(CGPoint)direction onlyHorizontal:(BOOL)horizontal { b2Vec2 velocity = [controlledObject getBody]-GetLinearVelocity(); double horizontalSpeed = velocity.x + controlledObject.acceleration * direction.x; velocity.x = (float32) (abs((int) horizontalSpeed) < controlledObject.runSpeed ? horizontalSpeed : controlledObject.maxSpeed * direction.x); if (!horizontal) { velocity.y = velocity.y + controlledObject.runSpeed * direction.y; } [controlledObject getBody]->SetLinearVelocity(velocity); } My floor is static b2Body, it has as restitution, friction, density, mass and same collision group in some reason, I'm setting b2Body's friction of my Hero to zero when it is moving, and returning it to 1 when he stops. When I'm pushing run button, hero runs. when i'm releasing it, he stops. All of this works perfect. On jumping, I'm setting linear velocity to my Hero: (void)jump { b2Vec2 velocity = [controlledObject getBody]->GetLinearVelocity(); velocity.y = velocity.y + [[AppDel cfg] getHeroJumpVlelocity]; [controlledObject getBody]->SetLinearVelocity(velocity); } If I'll run, jump, and release run button, while he is in air, all will work fine. And here is my problem: If I'll run, jump, and continue running on landing (or when he goes from one static body to another: there is small fall, probably), Hero will start move, like he has no friction, but he has! I checked this via beakpoints: he has friction, but I can move left of right, and he will never stop, until i'll jump (or go from one static body to another), with unpressed running button. I allready tried: Set friction to body on every iteration double-check am I setting friction to right fixture. set Linear Damping to Hero: his move slows down on gugged moveing. A little more code: I have a sensor and body fixtures in my hero: (void) addBodyFixture { b2CircleShape dynamicBox; dynamicBox.m_radius = [[AppDel cfg] getHeroRadius]; b2FixtureDef bodyFixtureDef; bodyFixtureDef.shape = &dynamicBox; bodyFixtureDef.density = 1.0f; bodyFixtureDef.friction = [[AppDel cfg] getHeroFriction]; bodyFixtureDef.restitution = [[AppDel cfg] getHeroRestitution]; bodyFixtureDef.filter.categoryBits = 0x0001; bodyFixtureDef.filter.maskBits = 0x0001; bodyFixtureDef.filter.groupIndex = 0; bodyFixtureDef.userData = [NSNumber numberWithInt:FIXTURE_BODY]; [physicalBody addFixture:bodyFixtureDef]; } (void) addSensorFixture { b2CircleShape sensorBox; sensorBox.m_radius = [[AppDel cfg] getHeroRadius] * 0.95; sensorBox.m_p.Set(0, -[[AppDel cfg] getHeroRadius] / 10); b2FixtureDef sensor; sensor.shape = &sensorBox; sensor.filter.categoryBits = 0x0001; sensor.filter.maskBits = 0x0001; sensor.filter.groupIndex = 0; sensor.isSensor = YES; sensor.userData = [NSNumber numberWithInt:FIXTURE_SENSOR]; [physicalBody addFixture:sensor]; } Here I'm tracking is hero in air: void FixtureContactListener::BeginContact(b2Contact* contact) { // We need to copy out the data because the b2Contact passed in // is reused. Squirrel *squirrel = (Squirrel *)contact->GetFixtureB()->GetBody()->GetUserData(); if (squirrel) { [squirrel addContact]; } } void FixtureContactListener::EndContact(b2Contact* contact) { Squirrel *squirrel = (Squirrel *)contact->GetFixtureB()->GetBody()->GetUserData(); if (squirrel) { [squirrel removeContact]; } } here is Hero's logic on contacts: - (void) addContact { if (contactCount == 0) [self landing]; contactCount++; } - (void) removeContact { contactCount--; if (contactCount == 0) [self flying]; if (contactCount <0) contactCount = 0; } - (void)landing { inAir = NO; acceleration = [[AppDel cfg] getHeroRunAcceleration]; [sprite stopAllActions]; (running ? [sprite runAction:[self runAction]] : [sprite runAction:[self standAction]]); } - (void)flying { inAir = YES; acceleration = [[AppDel cfg] getHeroAirAcceleration]; [sprite stopAllActions]; [self flyAction]; } here is Hero's moving logic: - (void)stop { running = NO; if (!inAir) { [sprite stopAllActions]; [sprite runAction:[self standAction]]; } } - (void)left { [physicalBody setFriction:0]; if (!running && !inAir) { [sprite stopAllActions]; [sprite runAction:[self runAction]]; } running = YES; moveingDirection = NO; [bodyControls moveToDirection:CGPointMake(-1, 0) onlyHorizontal:YES]; } - (void)right { [physicalBody setFriction:0]; if (!running && !inAir) { [sprite stopAllActions]; [sprite runAction:[self runAction]]; } running = YES; moveingDirection = YES; [bodyControls moveToDirection:CGPointMake(1, 0) onlyHorizontal:YES]; } - (void)jump { if (!inAir) { [bodyControls jump]; } } and here is my update method (called on every iteration): - (void)update:(NSMutableDictionary *)buttons { if (!isDead) { [self updateWithButtonName:BUTTON_LEFT inButtons:buttons whenPressed:@selector(left) whenUnpressed:@selector(stop)]; [self updateWithButtonName:BUTTON_RIGHT inButtons:buttons whenPressed:@selector(right) whenUnpressed:@selector(stop)]; [self updateWithButtonName:BUTTON_UP inButtons:buttons whenPressed:@selector(jump) whenUnpressed:@selector(nothing)]; [self updateWithButtonName:BUTTON_DOWN inButtons:buttons whenPressed:@selector(nothing) whenUnpressed:@selector(nothing)]; [sprite setFlipX:(moveingDirection)]; } [self checkPosition]; if (!running) [physicalBody setFriction:[[AppDel cfg] getHeroFriction]]; else [physicalBody setFriction:0]; } - (void)updateWithButtonName:(NSString *)buttonName inButtons:(NSDictionary *)buttons whenPressed:(SEL)pressedSelector whenUnpressed:(SEL)unpressedSelector { NSNumber *buttonNumber = [buttons objectForKey:buttonName]; if (buttonNumber == nil) return; if ([buttonNumber boolValue]) [self performSelector:pressedSelector]; else [self performSelector:unpressedSelector]; } - (void)checkPosition { b2Body *body = [self getBody]; b2Vec2 position = body->GetPosition(); CGPoint inWorldPosition = [[AppDel cfg] worldMeterPointFromScreenPixel:CGPointMake(position.x * PTM_RATIO, position.y * PTM_RATIO)]; if (inWorldPosition.x < 0 || inWorldPosition.x > WORLD_WIDGH / PTM_RATIO || inWorldPosition.y <= 0) { [self kill]; } }

    Read the article

  • MouseEvent.CLICK not working? (AS3)

    - by Jake
    ok so here's my code in AS3, I'd like to know why when i actually click on the picture, nothing happens. And if any of you have great tutorial of what to learn after classes/functions in AS3, let me know =D : package { import flash.display.Bitmap; import flash.display.Sprite; import flash.display.Shape; import flash.events.MouseEvent; public class Main extends Sprite { [Embed(source="../Pics/Picture.png")] private var HeroClass:Class; private var hero:Bitmap = new HeroClass(); public function Main():void { addChild(hero); hero.addEventListener(MouseEvent.CLICK, onClick); function onClick(e:MouseEvent):void { trace("hey"); hero.visible = false; } } } }

    Read the article

  • Simple way to decrease values without making a new attribute?

    - by Jam
    I'm making a program where you're firing a 'blaster', and I have 5 ammo. I'm blasting an alien who has 5 health. At the end I instantiate the player and make him blast 6 times to check that the program works correctly. But the way I've done it makes it so that the amount won't decrease. Is there an easy fix to this, or do I just have to make a new attribute for ammo and health? Here's what I have: class Player(object): """ A player in a shooter game. """ def blast(self, enemy, ammo=5): if ammo>=1: ammo-=1 print "You have blasted the alien." print "You have", ammo, "ammunition left." enemy.die(5) else: print "You are out of ammunition!" class Alien(object): """ An alien in a shooter game. """ def die(self, health=5): if health>=1: health-=1 print "The alien is wounded. He now has", health, "health left." elif health==0: health-=1 print "The alien gasps and says, 'Oh, this is it. This is the big one. \n" \ "Yes, it's getting dark now. Tell my 1.6 million larvae that I loved them... \n" \ "Good-bye, cruel universe.'" else: print "The alien's corpse sits up momentarily and says, 'No need to blast me, I'm dead already!" # main print "\t\tDeath of an Alien\n" hero = Player() invader = Alien() hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) hero.blast(invader) raw_input("\n\nPress the enter key to exit.")

    Read the article

  • Jquery: Is there some way to make val() return an empty string instead of 'undefined' for an empty list?

    - by Chris
    With Jquery, is there some way to make val() return an empty string instead of 'undefined' when called against an empty list of elements? E.g., I have this code: var x = $('#my-textbox-id').not('.watermark').val(); The idea is that I want to get the value of my textbox, but I want an empty string if it is currently showing the watermark (i don't want the watermark value!). The selector works, but i don't want 'undefined' - I want an empty string ''.

    Read the article

  • SQL Server Driver for PHP 2.0 CTP2 is now released

    - by The Official Microsoft IIS Site
    digg_url = "http://blogs.msdn.com/b/sqlphp/archive/2010/06/15/sql-server-driver-for-php-2-0-ctp2-is-now-released.aspx";digg_title = "SQL Server Driver for PHP 2.0 CTP2 is now released";digg_bgcolor = "#FFFFFF";digg_skin = "normal"; digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined; It is our pleasure to announce the release of Community Technology Preview 2 (CTP2) of the SQL Server Driver for PHP 2.0! We would like to...(read more)

    Read the article

  • Skype crash immediatly after launch

    - by K_naille
    when I'm launch skype, it crashes immediatly. Error: mathieu@mathieu-desktop:~$ skype `menu_proxy_module_load': skype: undefined symbol: menu_proxy_module_load (skype:10442): Gtk-WARNING **: Failed to load type module: (null) `menu_proxy_module_load': skype: undefined symbol: menu_proxy_module_load (skype:10442): Gtk-WARNING **: Failed to load type module: (null) `menu_proxy_module_load': skype: undefined symbol: menu_proxy_module_load (skype:10442): Gtk-WARNING **: Failed to load type module: (null) `menu_proxy_module_load': skype: undefined symbol: menu_proxy_module_load (skype:10442): Gtk-WARNING **: Failed to load type module: (null) Abandon (core dumped) mathieu@mathieu-desktop:~$ Can you help me? Thank.

    Read the article

  • HTC Hero Mouse Ball click not working on Custom ListView?

    - by UMMA
    dear friends, i have created custom list view using class EfficientAdapter extends BaseAdapter implements { private LayoutInflater mInflater; private Context context; public EfficientAdapter(Context context) { mInflater = LayoutInflater.from(context); this.context = context; } public View getView(final int position, View convertView, ViewGroup parent) { ViewHolder holder; convertView = mInflater.inflate(R.layout.adaptor_content, null); convertView.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { } }); } and other necessary methods... also } using touch screen when i click on list item OnClickListener of list item is called. but when i use Mouse Ball / Track Ball (Phone Hardware) to click on ListItem OnClickListener of list item is not called. can any one guide me is this Phone bug or My Fault? any help would be appriciated.

    Read the article

  • Android Hero denies XMLSocket or Socket connection? ....errors #2031, #2048

    - by claudi-ursica
    Hi, I am trying to adapt an existing flash web chat application for the Android mobile phone and I am having this really annoying issue. The server is a custom based solution and can send back both binary messages or XML. So I can use either XMLSocket class or the Socket class to get data from the server. Everything works fine when deployed and I connect from the desktop but when I try it from the android mobile I get the infamous errors #2031, followed by #2048. Now the crossdomain.xml file is rock solid and works well for desktop. When the connect socket method runs I see that the server replies with the crossdomain file but I get the error when running on the mobile. Has anyone bumped into this? Is there some limitation from the mobile phone part. I wasn't able to find anything relevant for this issue, in terms of the phone not allowing Socket or XMLSocket connections. The phone(s) Motorola and HTC run Android 2.1 and indicates the flash FL10,1,123,358 version of flash lite. The issue can be reproduced also on the HTC Desire. Any input on this would be highly appreciated... 10x, Claudiu

    Read the article

  • Force Close problem while Moving track ball on disabled EditText On HTC Hero Phone?

    - by UMMA
    dear friends, i have a small form with four EditText fields in which second EditText is disable for text Editing. now when i roll Android Phone ball to move from the top to bottom first time it selects disabled EditText and then third EditText and moves downward to foruth EditText. but when i try to move upward on Disabled EditText it displays me error Force Close after selecting it. it is only happening in phone not in Emulator. please guide how to resolve this issue? any help would be appriciated.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >