Search Results

Search found 81 results on 4 pages for 'ockonal'.

Page 3/4 | < Previous Page | 1 2 3 4  | Next Page >

  • Making shared library from exist o-files

    - by Ockonal
    Hi guys, I have a project. I need in shared library of it to use in extensions. I don't want to make copy of this project but with shared-library settings. Are there any way to build it using *.o-files from building project? As I understand, I can write makefile for this.

    Read the article

  • tor api in own project

    - by Ockonal
    Hello, I'm going to develop gui-based application for tor controlling (like vidalia or torK). Are there any libraries for using tor? I don't want to parse each byte of information from sockets. My program should display branches of computers, use chosen as traffic-provider etc. What I need in my case? Are there any small and simple samples (for example open-source projects) to do this.

    Read the article

  • Help with code optimization

    - by Ockonal
    Hello, I've written a little particle system for my 2d-application. Here is raining code: // HPP ----------------------------------- struct Data { float x, y, x_speed, y_speed; int timeout; Data(); }; std::vector<Data> mData; bool mFirstTime; void processDrops(float windPower, int i); // CPP ----------------------------------- Data::Data() : x(rand()%ScreenResolutionX), y(0) , x_speed(0), y_speed(0), timeout(rand()%130) { } void Rain::processDrops(float windPower, int i) { int posX = rand() % mWindowWidth; mData[i].x = posX; mData[i].x_speed = WindPower*0.1; // WindPower is float mData[i].y_speed = Gravity*0.1; // Gravity is 9.8 * 19.2 // If that is first time, process drops randomly with window height if (mFirstTime) { mData[i].timeout = 0; mData[i].y = rand() % mWindowHeight; } else { mData[i].timeout = rand() % 130; mData[i].y = 0; } } void update(float windPower, float elapsed) { // If this is first time - create array with new Data structure objects if (mFirstTime) { for (int i=0; i < mMaxObjects; ++i) { mData.push_back(Data()); processDrops(windPower, i); } mFirstTime = false; } for (int i=0; i < mMaxObjects; i++) { // Sleep until uptime > 0 (To make drops fall with randomly timeout) if (mData[i].timeout > 0) { mData[i].timeout--; } else { // Find new x/y positions mData[i].x += mData[i].x_speed * elapsed; mData[i].y += mData[i].y_speed * elapsed; // Find new speeds mData[i].x_speed += windPower * elapsed; mData[i].y_speed += Gravity * elapsed; // Drawing here ... // If drop has been falled out of the screen if (mData[i].y > mWindowHeight) processDrops(windPower, i); } } } So the main idea is: I have some structure which consist of drop position, speed. I have a function for processing drops at some index in the vector-array. Now if that's first time of running I'm making array with max size and process it in cycle. But this code works slower that all another I have. Please, help me to optimize it. I tried to replace all int with uint16_t but I think it doesn't matter.

    Read the article

  • How to pass function reference into arguments

    - by Ockonal
    Hi, I'm using boost::function for making function-references: typedef boost::function<void (SomeClass &handle)> Ref; someFunc(Ref &pointer) {/*...*/} void Foo(SomeClass &handle) {/*...*/} What is the best way to pass Foo into the someFunc? I tried something like: someFunc(Ref(Foo));

    Read the article

  • Floating inner div in parent

    - by Ockonal
    Hello, I have two divs: <div id="modalBox" style="position: absolute; border: 1px solid #bababa; width: 400px; height: 180px; background-color: #e3e6ca; text-align: center; -moz-border-radius: 6px; -webkit-border-radius: 6px; display: none;"> <div style="background-color: #98002f; background-image: url(*/images/tab_background.gif); color: white; width: 400px; height: 25px; -moz-border-radius-topright: 6px; -moz-border-radius-topleft: 6px; -webkit-border-top-right-radius: 6px; -webkit-border-top-left-radius: 6px;"> <h3>Please, fill the form to confirm your identity:</h3> </div> ... </div> What I get: How can I make inner div floating top?

    Read the article

  • Trouble with arrays

    - by Ockonal
    Hi guys, I have such string in PHP: $data = '1;3;5;7;9'; And cycle: for ($i=0; $i < count($someArray); $i++) { // If $i == any number in $data } What is the faster way to compare $i from cycle with numbers in string. I have to check that cycle-counter is in string.

    Read the article

  • Iterating through boost ptr_vector

    - by Ockonal
    Hello, I have a ptr_vector list of my own objects. Something like this: boost::ptr_vector<SomeClass> *list; list.push_back(new SomeClass()>; ... BOOST_FOREACH(SomeClass *tempObj, list) // [x] { tempObj->... } >‘boost::ptr_vector<SomeClass>*’ is not a class, struct, or union type

    Read the article

  • Trouble with QxtGlobalShortcut [solved]

    - by Ockonal
    Hello, i'm trying to set global shortcut for my applcation using QxtGlobalShortcut. Here is my code: QxtGlobalShortcut m_hotkeyHandle; m_hotkeyHandle.setShortcut( QKeySequence("Ctrl+Shift+X") ); m_hotkeyHandle.setEnabled(true); connect( &m_hotkeyHandle, SIGNAL(activated()), this, SLOT(hotkeyPressed()) ); void MainWindow::hotkeyPressed() { QMessageBox::information(this, "Good", "Hot key triggered", "yes", "no"); } But after applcation started i got: QxtGlobalShortcut failed to register: "Ctrl+Shift+X" And my programm doesn't activate after hot key pressing. What should i do? EDIT: There was a bug in Qxt-lib 0.5 with shortcut. I spoke with developer and knew that i just need to update library from dev-branch (0.5.1 is worked).

    Read the article

  • Iterating through std queue

    - by Ockonal
    Hi, I'm trying to use BOOST_FOREACH for iterating through the std::queue. But there isn't iterators in that class cause I have an error: std::queue<std::string> someList; BOOST_FOREACH(std::string temp, someList) { std::cout << temp; } >no matching function for call to begin(...) >no type named ‘iterator’ in ‘class std::queue<std::basic_string<char> >’ I need in structure like: the first comes, the first goes away.

    Read the article

  • Send select's values in array

    - by Ockonal
    Hello, I have such select list in html: <input type="checkbox" name="drive_style" value=1 checked />123<br /> <input type="checkbox" name="drive_style" value=2 />123<br /> <input type="checkbox" name="drive_style" value=3 checked /> 123<br /> <input type="checkbox" name="drive_style" value=4 />123<br /> <input type="checkbox" name="drive_style" value=5 checked />123<br /> I have to send values(1, 3, ...) of checked boxes to the php script (I'm using ajax with jquery) like an array. Something like: drive_style[index]. $.post('post_reply.php', {'drive_style' : $('drive_style')}, function(data){ alert(data); }); In PHP script: print_r($_POST['drive_style']); [object Object]

    Read the article

  • Mysql - NOW() function calling

    - by Ockonal
    Hello, I'm using php for making queries for mysql. Here is one: UPDATE `subscribers` SET `curDate` = NOW() WHERE `e_mail` = "$resEmail" curDate - DateTime type. The problem is that after this query curDate of given email is 0000-00-00 00:00:00 What's wrong?

    Read the article

  • Virtual function - including some html

    - by Ockonal
    Hello, I have a php-file which includes another html-file: <? virtual("../top.html");?> The problem is that any code before this include compiles and runs well, after - nothing. There aren't any errors etc. After commenting this line, everything works. Code was written under local computer with ArchLinux + LAMP. Now I have ubuntu 10.04 with the same configuration. What could it be?

    Read the article

  • Help to write regular expression

    - by Ockonal
    Hello, I have to get any text between: Final-Recipient: RFC822; !HERE! Action I need !HERE! from this example. There could be any string. I tried something like: $Pattern = '/Final-Recipient: RFC822; (.*) Action/'; But it doesn't work. upd Here is the string I'm trying to parse: http://dpaste.com/187638/

    Read the article

  • PHP, login to pop3-server

    - by Ockonal
    Hi guys, I have another one problem with pop3. Here is connection to pop3-server: $pop3Server = '62.113.86.215'; // mail.roller.ru $pop3User = 'mail-robot%roller.ru'; $pop_conn = fsockopen($pop3Server, 110, $errno, $errstr, 30); echo fgets($pop_conn, 1024); It returns OK. The next step is login: fputs($pop_conn, 'USER '.$pop3User.'\r\n'); //stream_set_timeout($pop_conn, 3); print fgets($pop_conn, 1024); And I get time-out. Why? p.s. Here is full code: http://pastie.org/934170

    Read the article

  • Work with function references

    - by Ockonal
    Hello, I have another one question about functions reference. For example, I have such definition: typedef boost::function<bool (Entity &handle)> behaviorRef; std::map< std::string, ptr_vector<behaviorRef> > eventAssociation; The first question is: how to insert values into such map object? I tried: eventAssociation.insert(std::pair< std::string, ptr_vector<behaviorRef> >(eventType, ptr_vector<behaviorRef>(callback))); But the error: no matching function for call to ‘boost::ptr_vector<boost::function<bool(Entity&)> >::push_back(Entity::behaviorRef&)’ And I undersatnd it, but can't make workable code. The second question is how to call such functions? For example, I have one object of behaviorRef, how to call it with boost::bind with passing my own values?

    Read the article

  • Matching id's in BeautifulSoup

    - by Ockonal
    Hello, I'm using BeautifulSoup - python module. I have to find any reference to the div's with id like: 'post-#'. For example: <div id="post-45">...</div> <div id="post-334">...</div> How can I filter this? html = '<div id="post-45">...</div> <div id="post-334">...</div>' soupHandler = BeautifulSoup(html) print soupHandler.findAll('div', id='post-*') > []

    Read the article

  • Boost singleton trouble

    - by Ockonal
    Hi guys, I have some class which uses boost singleton. It calls some function from own c++ library. This library is written in make file as dependence. Now I have another singleton class and it should call first singleton class. After this code I got linkers error about undefined references for functions which are used in first singleton. When I remove calling first singleton class from second the errors remove. Maybe there is something wrong?

    Read the article

  • Make object by it's name

    - by Ockonal
    Hello, is it possible to return exemplar of object using passed type name (string) in c++? I have some base abstract class Base and a few derivates. Example code: class Base { /* ... */ }; class Der1 : public Base { /* ... */ }; class Der2 : public Base { /* ... */ }; And I need function like: Base *objectByType(const std::string &name); Number of derivates classes are changeable and I don't want to make something like switching of name and returning by hands new object type. Is it possible in c++ to do that automatically anyway? p.s. usage should looks like: dynamic_cast<Der1>(objectByType("Der1")); I need pure c++ code (crossplatform). Using boost is permissible.

    Read the article

  • Segfaults with singletons

    - by Ockonal
    Hello, I have such code: // Non singleton class MyLogManager { void write(message) {Ogre::LogManager::getSingletonPtr()->logMessage(message);} } class Utils : public singleton<Utils> { MyLogManager *handle; MyLogManager& getHandle { return *handle; } }; namespace someNamespace { MyLogManager &Log() { return Utils::get_mutable_instance().getHandle(); } } int main() { someNamespace::Log().write("Starting game initializating..."); } In this code I'm using boost's singleton (from serialization) and calling Ogre's log manager (it's singleton-type too). The program fails at any trying to do something with Ogre::LogManager::getSingletonPtr() object with code User program stopped by signal (SIGSEGV) I checked that getSingletonPtr() returns address 0x000 But using code Utils::get_mutable_instance().getHandle().write("foo") works good in another part of program. What's wrong could be there with calling singletons?

    Read the article

  • Click at link by address template

    - by Ockonal
    Hello, I'm using Selenium for making some work: script should click at link followed by it's own address. For example, there is a method: clickAndWait. I have to pass it link title. But at my page this title changes, so I have to pass address to click at. Could you help me with this? p.s. I asked this question in selenium group, but still have no answer. upd: For exampe, I have such html-code: <a href="lalala.com">Some changeable title</a> <a href="another.com">Some changeable title</a> And selenium pseudocode: ClickAndWait('Some changeable title') But I have to click at site 'another.com', not 'lalala.com'. And link's title changes every time. Only link address is the same.

    Read the article

  • Template function in define

    - by Ockonal
    Hello, I have some template function and I want to call it using define in c++: #define CONFIG(key, type, def) getValue<type>(key, def); Of course, it won't work. Could I make something like this?

    Read the article

  • Filling array with numbers

    - by Ockonal
    Hello, I have such situation: There is 8 div-blocks with ids like 'rateN_wrapper' where is 'N' is the number of div: <div id="rate1_wrapper"> <a href="#" id="0_1">...</a> <a href="#" id="0_2">...</a> <a href="#" id="0_3">...</a> </div> <div id="rate2_wrapper"> <a href="#" id="1_1">...</a> <a href="#" id="1_2">...</a> <a href="#" id="1_3">...</a> </div> ... var ratings = new Array(); for (i=0; i < 8; i++) { ratings[i] = -1; // Default is unrated } for (i=0; i < 8; i++) { $('#rate' + i + '_wrapper a').click(function() { ratings[i] = parseInt( $(this).attr('id').split('_')[1] ); console.debug(ratings); }); } My work is to fill array in need place with clicked link's id (parsed). But it's always changes only latest element of array (8). Why?

    Read the article

< Previous Page | 1 2 3 4  | Next Page >