Search Results

Search found 735 results on 30 pages for 'bas brain'.

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

  • C++ MySQL++ Delete query statement brain killer question

    - by shauny
    Hello all, I'm relatively new to the MySQL++ connector in C++, and have an really annoying issue with it already! I've managed to get stored procedures working, however i'm having issues with the delete statements. I've looked high and low and have found no documentation with examples. First I thought maybe the code needs to free the query/connection results after calling the stored procedure, but of course MySQL++ doesn't have a free_result method... or does it? Anyways, here's what I've got: #include <iostream> #include <stdio.h> #include <queue> #include <deque> #include <sys/stat.h> #include <mysql++/mysql++.h> #include <boost/thread/thread.hpp> #include "RepositoryQueue.h" using namespace boost; using namespace mysqlpp; class RepositoryChecker { private: bool _isRunning; Connection _con; public: RepositoryChecker() { try { this->_con = Connection(false); this->_con.set_option(new MultiStatementsOption(true)); this->_con.set_option(new ReconnectOption(true)); this->_con.connect("**", "***", "***", "***"); this->ChangeRunningState(true); } catch(const Exception& e) { this->ChangeRunningState(false); } } /** * Thread method which runs and creates the repositories */ void CheckRepositoryQueues() { //while(this->IsRunning()) //{ std::queue<RepositoryQueue> queues = this->GetQueue(); if(queues.size() > 0) { while(!queues.empty()) { RepositoryQueue &q = queues.front(); char cmd[256]; sprintf(cmd, "svnadmin create /home/svn/%s/%s/%s", q.GetPublicStatus().c_str(), q.GetUsername().c_str(), q.GetRepositoryName().c_str()); if(this->DeleteQueuedRepository(q.GetQueueId())) { printf("query deleted?\n"); } printf("Repository created!\n"); queues.pop(); } } boost::this_thread::sleep(boost::posix_time::milliseconds(500)); //} } protected: /** * Gets the latest queue of repositories from the database * and returns them inside a cool queue defined with the * RepositoryQueue class. */ std::queue<RepositoryQueue> GetQueue() { std::queue<RepositoryQueue> queues; Query query = this->_con.query("CALL sp_GetRepositoryQueue();"); StoreQueryResult result = query.store(); RepositoryQueue rQ; if(result.num_rows() > 0) { for(unsigned int i = 0;i < result.num_rows(); ++i) { rQ = RepositoryQueue((unsigned int)result[i][0], (unsigned int)result[i][1], (String)result[i][2], (String)result[i][3], (String)result[i][4], (bool)result[i][5]); queues.push(rQ); } } return queues; } /** * Allows the thread to be shut off. */ void ChangeRunningState(bool isRunning) { this->_isRunning = isRunning; } /** * Returns the running value of the active thread. */ bool IsRunning() { return this->_isRunning; } /** * Deletes the repository from the mysql queue table. This is * only called once it has been created. */ bool DeleteQueuedRepository(unsigned int id) { char cmd[256]; sprintf(cmd, "DELETE FROM RepositoryQueue WHERE Id = %d LIMIT 1;", id); Query query = this->_con.query(cmd); return (query.exec()); } }; I've removed all the other methods as they're not needed... Basically it's the DeleteQueuedRepository method which isn't working, the GetQueue works fine. PS: This is on a Linux OS (Ubuntu server) Many thanks, Shaun

    Read the article

  • simplemodal or my brain bug?

    - by g0sha
    Sorry for my Eng. I`m trying to use simplemodal in my project authorization form, but here is a little trouble: <javascript> function usr_init() { $('div#usrinfo').html("test"); } </javascript> <html> <a href="#" onClick='$("#authdiv").modal();'>TEST!</a> </html> In authdiv I have a form with onSubmit="usr_init()"; But after automatic close #usrinfo changes to previous value. What to do with this problem?

    Read the article

  • C++ brain teaser

    - by mxp
    I recently refactored code like this (MyClass to MyClassR). class SomeMember { long m_value; public: SomeMember() : m_value(0) {} SomeMember(int a) : m_value(a) {} SomeMember(int a, int b) : m_value(a+b) {} }; class MyClass { SomeMember m_first, m_second, m_third; public: MyClass(const bool isUp, const int x, const int y) { if (isUp) { m_first = SomeMember(x); m_second = SomeMember(y); m_third = SomeMember(x, y); } else { m_first = SomeMember(y); m_second = SomeMember(x); m_third = SomeMember(y, x); } } }; class MyClassR { SomeMember m_first, m_second, m_third; public: MyClassR(const bool isUp, const int x, const int y) : m_first(isUp ? x : y) , m_second(isUp ? y : x) , m_third(isUp ? x, y : y, x) { } }; What is the error, why does it compile (at least VC6 with warning level 3 doesn't complain) and what is the right way of doing it? I (assume) I already have all these answers but I think it's and interesting problem to share.

    Read the article

  • PHP math gets crazy, need explanation, my brain is melting

    - by derei
    I know that playing with php float can give strange results if you try to add "goats + apples", but please take a look to the following case: $val = 1232.81; $p1 = 1217.16; $p2 = 15.65; $sum = $p1 + $p2; $dif = $val - $sum; echo $dif; It will give you -2.2737367544323E-13 ... yeah, ALMOST zero, but then why it doesn't say 0 ? This freaks me out big time. Please, I need some valid explanation.

    Read the article

  • Brevets : Samsung compte poursuivre Apple sur l'utilisation de la 4G LTE dans l'iPhone 5, le constructeur dénigre Android aux Pays-Bas

    Brevets : Samsung compte poursuivre Apple sur l'utilisation de la 4G LTE dans l'iPhone 5 le constructeur dénigre Android aux Pays-Bas Apple se prépare pour le lancement demain de l'iPhone 5. De son côté, Samsung se prépare également. Mais pour bloquer la commercialisation du nouveau dispositif d'Apple. Selon un article du Korea Times, le constructeur coréen a confirmé qu'il allait trainer Apple devant les tribunaux, suite à la demande de la firme à la pomme d'interdire la gamme Galaxy S sur le territoire américain. Pour rappel, Samsung avait été condamné à verser un milliard de dollars à Apple pour avoir violé les brevets de la société sur le Design de l'iPhone. La ...

    Read the article

  • Using game of life or other virtual environment for artificial (intelligence) life simulation? [clos

    - by Berlin Brown
    One of my interests in AI focuses not so much on data but more on biologic computing. This includes neural networks, mapping the brain, cellular-automata, virtual life and environments. Described below is an exciting project that includes develop a virtual environment for bots to evolve in. "Polyworld is a cross-platform (Linux, Mac OS X) program written by Larry Yaeger to evolve Artificial Intelligence through natural selection and evolutionary algorithms." http://en.wikipedia.org/wiki/Polyworld " Polyworld is a promising project for studying virtual life but it still is far from creating an "intelligent autonomous" agent. Here is my question, in theory, what parameters would you use create an AI environment? Possibly a brain environment? Possibly multiple self contained life organisms that have their own "brain" or life structures. I would like a create a spin on the game of life simulation. What if you have a 64x64 game of life grid. But instead of one grid, you might have N number of grids. The N number of grids are your "life force" If all of the game of life entities die in a particular grid then that entire grid dies. A group of "grids" makes up a life form. I don't have an immediate goal. First, I want to simulate an environment and visualize what is going on in the environment with OpenGL and see if there are any interesting properties to the environment. I then want to add "scarce resources" and see if the AI environment can manage resources adequately.

    Read the article

  • F# &ndash; Converting your C# brain to the F# way

    - by MarkPearl
    My brain still thinks in C#!!! I have been looking at F# and trying to figure out the basics of it, but all the time in the back of my mind I am going – what is the C# equivalent to this or that… It’s frustrating because I almost want a F# to C# dictionary the whole time – and simply translate my C# code to F# – which would negate the main motivation for learning F# – as I want learn functional programming - if I was simply doing C# code in a F# syntax I would be gaining nothing! So I am experiencing pain while my brain forms some new neural networks… but luckily I live in a country where we have 11 official spoken languages, and plenty more unofficial languages so I have gone through the pain of learning how to speak a new language before – and I am finding the process is almost identical in learning a programming language that promotes a different way of looking at problems (from Object Orientated to Functional). That beings said… the first thing to learn is the basic syntax… I have searched the web for appropriate places to get a translation – and have been quite disappointed with what is out there for F#. Luckily, OCaml came to the rescue. There are some really good tutorials on getting started with OCaml syntax, one in particular that stood out was the OCamal-Tutorial. What I particularly like about it is that it is doing comparisons between C based languages and OCaml. Give it a read sometime – it’s well worth it and has definitely helped me understand F# a little better.

    Read the article

  • Are there studies on what programming languages does to the brain? [closed]

    - by Eduard Florinescu
    Are there studies on what effects have programming languages on the brain or for that matter any other artificial languages in general, like mathematics ? Speaking from my personal experience I feel very different every time I speak Italian, I feel like a virtuoso on a quest but at the other end when I coded in machine code in debug.exe I felt like the main charcter inp(Movie). Why do I bring this up because I am suspecting that languages affect your mind and popular legends back this up too often: are full of mathematicians that crossed the Rubicon.

    Read the article

  • Is it theoretically possible to emulate a human brain on a computer?

    - by JoelK
    Our brain consists of billions of neurons which basically work with all the incoming data from our senses, handle our consciousness, emotions and creativity as well as our hormone system, etc. So I'm completely new to this topic but doesn't each neuron have a fixed function? E.g.: If a signal of strength x enters, if the last signal was x ms ago, redirect it. From what I've learned in biology about our nerves system which includes our brain because both consist of simple neurons, it seems to me as our brain is one big, complicated computer. Maybe so complicated that things such as intelligence and cognition become possible? As the most complicated things about a neuron pretty much are the chemical aspects on generating an electric singal, keeping itself alive, and eventually segmenting itself, it should be pretty easy emulating some on a computer, or? You won't have to worry about keeping your virtual neuron alive, or? If you can emulate a single neuron on a computer, which shouldn't be too hard, could you theoretically emulate more than 1000 billions of them, recreating intelligence, cognition and maybe even creativity? In my question I'm leaving out the following aspects: Speed of our current (super) computers Actually writing a program for emulating neurons I don't know much about this topic, please tell me if I got anything wrong :) (My secret goal: Make a copy of my brain and store it on some 10 million TB HDD and make someone start it up in the future)

    Read the article

  • Drbd Primary/Primary + iSCSI: accessing to different files avoids split brain?

    - by Eddie C.
    I have a question / curiosity about split-brain on a Drbd Primary/Primary configuration. Supposing two nodes (hosts), host1 and host2 configured with Drbd Primary/Primary and two different shares (NFS, CIFS o iSCSI) of a replicated area (saying /drbd) /drbd/file1.data /drbd/file2.data If a pool of client would access only by host1 share reading and wrinting only file1.data and another pool only by host2 share to file2.data, this scenario should avoid split brain situation in case of one node failure or it's just a conjecture? The final purpose is load balance between the two nodes in normal condition and collapsing to one node only in case of failure. Thank you! Eddie

    Read the article

  • How to shorten brain context switch delay when need to use new technology\framework?

    - by gasan
    The problem is when I have to deal with a new framework\library\language it completely slows my work process, at first it's kind of shock, you're sitting on your place about a day doing nothing surfing the net, because you simply can't do anything even read docs, then, on the second day I realize that I definitely should do something and starting read about it, then I realize that I don't understand it, then I'm reading until I got feeling that I should show some results immediately and then I'm writing the code quite fast and the job doesn't seem to be difficult. Then job is done and I won't probably return to that technology\framework for a month or a year or never at all. And I will almost certainly forget almost everything about it after a month. To illustrate by checkpoints I experience: shock, long studying times, work with the new tech briefly, never use it afterwards, then I completely forget it. So what would be the solution here?

    Read the article

  • How much audio latency is noticeable by human brain?

    - by Borek
    I am choosing a wireless headset for my PC (I hate cables) and am looking at Sennheiser RS 170 / 180. They supposedly sound great, however, there is a 25ms audio latency. I've heard that this is OK when watching TV or listening musing but is bad for games. The question is - has there been any research / hard data that would show how much of a delay is noticeable by human brain? 25ms doesn't sound like a lot but I may be wrong.

    Read the article

  • Harnessing Business Events for Predictive Decision Making - part 1 / 3

    - by Sanjeev Sharma
    Businesses have long relied on data mining to elicit patterns and forecast future demand and supply trends. Improvements in computing hardware, specifically storage and compute capacity, have significantly enhanced the ability to store and analyze mountains of data in ever shrinking time-frames. Nevertheless, the reality is that data growth is outpacing storage capacity by a factor of two and computing power is still very much bounded by Moore's Law, doubling only every 18 months.Faced with this data explosion, businesses are exploring means to develop human brain-like capabilities in their decision systems (including BI and Analytics) to make sense of the data storm, in other words business events, in real-time and respond pro-actively rather than re-actively. It is more like having a little bit of the right information just a little bit before hand than having all of the right information after the fact. To appreciate this thought better let's first understand the workings of the human brain.Neuroscience research has revealed that the human brain is predictive in nature and that talent is nothing more than exceptional predictive ability. The cerebral-cortex, part of the human brain responsible for cognition, thought, language etc., comprises of five layers. The lowest layer in the hierarchy is responsible for sensory perception i.e. discrete, detail-oriented tasks whereas each of the above layers increasingly focused on assembling higher-order conceptual models. Information flows both up and down the layered memory hierarchy. This allows the conceptual mental-models to be refined over-time through experience and repetition. Secondly, and more importantly, the top-layers are able to prime the lower layers to anticipate certain events based on the existing mental-models thereby giving the brain a predictive ability. In a way the human brain develops a "memory of the future", some sort of an anticipatory thinking which let's it predict based on occurrence of events in real-time. A higher order of predictive ability stems from being able to recognize the lack of certain events. For instance, it is one thing to recognize the beats in a music track and another to detect beats that were missed, which involves a higher order predictive ability.Existing decision systems analyze historical data to identify patterns and use statistical forecasting techniques to drive planning. They are similar to the human-brain in that they employ business rules very much like mental-models to chunk and classify information. However unlike the human brain existing decision systems are unable to evolve these rules automatically (AI still best suited for highly specific tasks) and  predict the future based on real-time business events. Mistake me not,  existing decision systems remain vital to driving long-term and broader business planning. For instance, a telco will still rely on BI and Analytics software to plan promotions and optimize inventory but tap into business events enabled predictive insight to identify specifically which customers are likely to churn and engage with them pro-actively. In the next post, i will depict the technology components that enable businesses to harness real-time events and drive predictive decision making.

    Read the article

  • How to import a macro file (previously exported as .bas file) to Microsoft Word using command line?

    - by Nam Gi VU
    I'm writing a command-line program that has a step in which I need to replace text in a Word file. The replacing task is accomplished using Word macro. What I need to do now is to call this macro from command-line. At the moment we can do this by using the -mMacroName parameter of 'winword.exe', i.e. \winword.exe -mMacroName. But this need the macro to be already available as a global macro. Since I need to run the program on another computer, I need to import the above replacing macro programatically... and I don't know how to do this. Please help.

    Read the article

  • How to auto mount partition on startup xubuntu?

    - by Bas
    I want to auto mount all my partitions on startup. But i can't get it to work as i'm new to xubuntu. This is how my fstab file looks like: proc /proc proc nodev,noexec,nosuid 0 0 #Entry for /dev/sda1 : UUID=3bf842ea-923b-43fe-b5f9-066fc920aaec / ext4 errors=remount-$ #Entry for /dev/sdb1 : UUID=F0C859BDC8598330 /media/Bas ntfs-3g defaults,locale=en_US.UTF-8 $ #Entry for /dev/sda3 : UUID=146213A76D02F7AD /media/sda3 ntfs-3g defaults,locale=en_US.UTF-8 $ UUID=1C33A98704D941F1 /media/sda3 ntfs-3g defaults,locale=en_US.UTF-8 $ #Entry for /dev/sda5 : UUID=ba48c631-5652-4ce7-85a3-bda96b353ca7 none swap sw 0 $ The last line I added myself but it's not working. I spend the whole day trying to figure this out without success. So can anyone help me with this? Thanks in advance

    Read the article

  • Need to exclude results in a MySQL query where two table fields are not of certain values (brain far

    - by DondeEstaMiCulo
    I don't know if I'm just burnt out and can't think, or what... But I can't seem to make this work right... (We're using MySQL 5.1...) I have two tables which have some transactional stuff stored in them. There will be many records per user_id in each table. Table1 and Table2 have a one-to-one relationship with each other. I want to pull records from both tables, but I want to exclude records which have certain values in both tables. I don't care if they both don't have these values, or if just one does, but both tables should not have both values. (Does this make any sense? lol) For example: SELECT t1.id, t1.type, t2.name FROM table1 t1 INNER JOIN table2 t2 ON table.xid = table2.id WHERE t1.user_id = 100 AND (t1.type != 'FOO' AND t2.name != 'BAR') So t1.type is type ENUM with about 10 different options, and t2.name is also type ENUM with 2 options. My expected results would look a little like: 1, FOO, YUM 2, BOO, BAR 3, BOO, YUM But instead, all I'm getting is: 3, BOO, YUM Because it's filtering out all records which has 'FOO' as the type, and 'BAR' as the name. I keep waiting for that D'oh! moment where it hits me and I feel like an idiot for not realizing what I'm doing wrong. But it hasn't come. And I still feel like an idiot, lol. I appreciate any light any of you can shed on this! Many thanks in advance for the help!

    Read the article

  • C# Bug or Brain Teaser? Cast working only with Coalesce (??) Operator

    - by Alex
    This is very strange, maybe someone can explain what's happening, or this is a bug (though I tend to think that this is probably just something intricate about C#). The following code throws the error "Cannot implicitly convert type 'uint?' to 'uint'.": public void Test(UInt32? p) { UInt32 x = p; } However, this code works without error: public void Test(UInt32? p) { UInt32 x = p ?? 1; } Huh? Why does this work? Why would the coalesce operator cause implicit conversion of UInt32? (nullable) to UInt32 (non-nullable), while the first error message says that there is no implicit conversion between those types?

    Read the article

  • Could you help me write a proper query in rails for accessing the following information?

    - by aditi-syal
    @workname = [] @recos = [] @bas = [] if current_user.recommendations.size != 0 current_user.recommendations.each do |r| if r.work_type == 'J' @job = Job.find_by_id(r.work_id) @workname.push "#{@job.title} at #{@job.company.name}" else @qualification = Qualification.find_by_id(r.work_id) @workname.push "Student at #{@qualification.school_name}" end @recommender = User.find_by_id(r.recommender_id) if r.recommender_work_type == 'J' @job = Job.find_by_id(r.recommender_work_id) @recos.push "#{@recommender.first_name} #{@recommender.last_name}" @bas.push "#{r.basis.gsub("You","#{@job.title} at #{@job.company.name}")}" else @qualification = Qualification.find_by_id(r.recommender_work_id) @recos.push "#{@recommender.first_name} #{@recommender.last_name} as " @bas.push "#{r.basis.gsub("You","Student at #{@qualification.school_name}")}" end end end

    Read the article

  • how to unescape XML in java

    - by Bas Hendriks
    Hi, I need to unescape a xml string containing escaped XML tags: &lt; &gt; &amp; etc... I did find some libs that can perform this task, but i'd rather use a single method that can perform this task. Can someone help? cheers, Bas Hendriks

    Read the article

  • http error code 12019 in Ajax call

    - by Bas Hendriks
    Hi, When executing a ajax call i received a http error code 12019. This call works most of the time, but in rare occasions i get this errorcall. I found that this error code is described as "The requested operation cannot be carried out because the handle supplied is not in the correct state." (@msdn). Can anybody tell me what this means? Thanx, Bas Hendriks

    Read the article

  • Can I append to a preprocessor macro?

    - by JCSalomon
    Is there any way in standard C—or with GNU extensions—to append stuff to a macro definition? E.g., given a macro defined as #define quux_list X(foo) X(bar) can I append X(bas) so that it now expands as if I’d defined it #define quux_list X(foo) X(bar) X(bas)? I’m playing with discriminated/tagged unions along these lines: struct quux_foo { int x; }; struct quux_bar { char *s; }; struct quux_bas { void *p; }; enum quux_type {quux_foo, quux_bar, quux_bas}; struct quux { enum quux_type type; union { struct quux_foo foo; struct quux_bar bar; struct quux_bas bas; } t; }; I figure this is a good place for the X-macro. If I define a macro #define quux_table X(foo) X(bar) X(bas) the enumeration & structure can be defined thus, and never get out of sync: #define X(t) quux_ ## t, enum quux_type {quux_table}; #undef X #define X(t) struct quux_ ## t t; struct quux { enum quux_type type; union {quux_table} t; }; #undef X Of course, the quux_* structures can get out of sync, so I’d like to do something like this, only legally: struct quux_foo { int x; }; #define quux_table quux_table X(foo) struct quux_bar { char *s; }; #define quux_table quux_table X(bar) struct quux_bas { void *p; }; #define quux_table quux_table X(bas) (Well, what I really want to be able to do is something like member_struct(quux, foo) { int x; }; but I’m well aware that macros cannot be (re)defined from within macros.) Anyhow, that’s my motivating example. Is there a way to accomplish this? Boost.Preprocessor examples are fine, if you can show me how to make the X-macro technique work with that library.

    Read the article

  • Writing Large Portions Of Code Then Debugging?

    - by The Floating Brain
    Lately I have been writing a game engine, and I have been writing a lot of "foundation stuff" (standard interfaces, modules, a message system ect.), but I have noticed a pattern, a lot of the stuff is interdependent and I can not debug until everything is done, hence I do not debug for about 3 to 5 hours at a time. I am wondering if this is an acceptable practice for this part of the project, and if not, if anyone can give me some advice? -----Update-----: I downloaded some code metrics tools, and my programs cyclomatic complexity is 1.52 which as I understand it is good, and should correlate to high cohesion, if I am wrong please correct me/

    Read the article

  • How do I get a get the left pane of my GUI app to talk to the right pane?

    - by bas-brain
    I need help on developing a UI for a app. Basically this app will have do panels, left and right, lets say. On the left panel will be displayed customers and when I click on the customer name on the right will appear tabs with information, some kind of form with name, email, picture, etc. I already developed the left panel with DictionaryGrid which I could found on tutorials and so on, but no idea on the right panel which is the form side. Any help??? Just the idea and the development is with me, thanks very much

    Read the article

  • How does TransactionScope guarantee data integrity across multiple databases?

    - by Bas Smit
    Hey guys, Can someone tell me the principle of how TransactionScope guarantees data integrity across multiple databases? I imagine it first sends the commands to the databases and then waits for the databases to respond before sending them a message to apply the command sent earlier. However when execution is stopped abruptly when sending those apply messages we could still end up with a database that has applied the command and one that has not. Can anyone shed some light on this? Edit: I guess what Im asking is can I rely on TransactionScope to guarantee data integrity when writing to multiple databases in case of a power outage or a sudden shutdown. Thanks, Bas Example: using(var scope=new TransactionScope()) { using (var context = new FirstEntities()) { context.AddToSomethingSet(new Something()); context.SaveChanges(); } using (var context = new SecondEntities()) { context.AddToSomethingElseSet(new SomethingElse()); context.SaveChanges(); } scope.Complete(); }

    Read the article

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