Thread: How do I get&use my AI's camera's images if I don't have them beforehand in my code!

  1. #16
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    How ya like it so far? By the way is your avatar gif saying void main = boommm lol that's hilarious!

    Code:
    #include <iostream>
    #include <stdlib.h>
    #include <time.h>
    #include <ctime>
    
    
    using namespace std;
    
    
    static int x = 0;
    static int y = 0;
    
    
    int legnum(int legnumber)
    {
        if (legnumber < 5000)
        return 1;
        else if (legnumber < 12000)
        return 2;
        else if (legnumber < 26000)
        return 3;
        else if (legnumber < 50000)
        return 4;
    }
    
    
    int legs(int leg)
    {
        static int doItAgain = 0;
        ++doItAgain;
        if (doItAgain == 5)
        doItAgain = doItAgain - 4;
    
    
        if (doItAgain == 1)
        cout << "leg 1 ";
        else if (doItAgain == 2)
        cout << "leg 2 ";
        else if (doItAgain == 3)
        cout << "leg 3 ";
        else if (doItAgain == 4)
        cout << "leg 4 ";
    
    
        if (leg < 5000)
        cout << "moved left" << endl;
        else if (leg < 12000)
        cout << "moved forward" << endl;
        else if (leg < 26000)
        cout << "moved backward" << endl;
        else if (leg < 50000)
        cout << "moved right" << endl;
    
    
        return 0;
    }
    
    
    int main()
    {
        tryAgain:
    
    
        srand( time(0));
        int guess1 = rand();
        int guess2 = rand();
        int guess3 = rand();
        int guess4 = rand();
    
    
        int leg1 = guess1;
        int leg2 = guess2;
        int leg3 = guess3;
        int leg4 = guess4;
        leg1 = legnum(leg1);
        leg2 = legnum(leg2);
        leg3 = legnum(leg3);
        leg4 = legnum(leg4);
    
    
        legs(guess1);
        legs(guess2);
        legs(guess3);
        legs(guess4);
    
    
        if (leg1 == leg2 && leg1 == leg3 && leg1 == leg4 && x != 8 && x != -8 && y != 8 && y != -8)
        cout << "Robot moved forward and got acceleration sense by accelometer, which is the trigger to save actions just guessed. The sense instantly matches a close match in memory and links to and initiates the saved actions, +labeled actions are done." << endl;
        else
        goto tryAgain;
    
    
        again:
        if (leg1 == 1)
        x = --x;
        else if (leg1 == 2)
        y = ++y;
        else if (leg1 == 3)
        y = --y;
        else if (leg1 == 4)
        x = ++x;
        cout << "Currently at tile " << x << " " << y << "." << endl;
    
    
        if (x == 8 || x == -8 || y == 8 || y == -8)
        goto tryAgain;
    
    
        cout << "Enter a number to continue." << endl;
        int CONTINUE;
        cin >> CONTINUE;
    
    
        cout << "Robot moved forward again" << endl;
        goto again;
    
    
        goto tryAgain;
    
    
        return 0;
    }
    Last edited by ADVANCESSSS; 01-09-2016 at 08:32 PM.

  2. #17
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    I compiled your code. This was the compiler's digest:
    cc1plus: warnings being treated as errors
    In function 'int main()':
    Line 95: warning: operation on 'x' may be undefined
    Line 97: warning: operation on 'y' may be undefined
    Line 99: warning: operation on 'y' may be undefined
    Line 101: warning: operation on 'x' may be undefined


    Frankly your assignments on these lines are undefined and unnecessary. ++x; means x = x + 1; --y; means y = y - 1; and etc.

    There is a lot of language in the standard that explains why this behavior is undefined. I imagine you aren't terribly interested in that, but I will go through it in brief anyway. To be extremely basic, C++ instructions work in top-down sequence. On each line, you can group many unsequenced operations. This basically means that you have to take care to write unsequenced ops in such a way that it doesn't matter how they are executed.

    The standard says (C++11 1.9/15):
    Except where noted, evaluations of operands of individual operators and of subexpressions of individual expressions are unsequenced.
    x = ++x; for instance modifies x multiple times without sequencing. (Once for storing x, another time for adding one to x, and storing that.) So your code is subject to the rest of the rule:
    If a side effect on a scalar object is unsequenced relative to either another side effect on the same scalar object or a value computation using the value of the same scalar object, the behavior is undefined.
    Note that all of the number types are scalar objects.


    Look for higher warning settings here.

  3. #18
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    try it now I had changed the code after you replied I guess.

    oh and yes mine says warnings but doesnt stop for those~

  4. #19
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    It doesn't look like you changed anything

  5. #20
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    oh and yes mine says warnings but doesnt stop for those~






  6. #21
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    Quote Originally Posted by ADVANCESSSS View Post
    oh and yes mine says warnings but doesnt stop for those~
    Well, whatever. A clean compile means no warnings or errors. And undefined behavior isn't always nice. It can cause a crash.

  7. #22
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    Did ya see it execute though it's gettin coolerrrrrrrrrrrrrrrr

  8. #23
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,613
    This level of coding doesn't even get my dick hard anymore.

  9. #24
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    I'm tryin to show you how it'll turn around from walls...It's gettin there

  10. #25
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    Why when I opened a text file and put my black text cmd box behind it (while it was trying to find a correct combination of all 4 legs moving same direction) my computr started whistling, then immediatly stopped when I made the text box overlayer the notepad, then immediatly go back to whistling like steam when it was overlayed behind notepad box...wth......overheating?

  11. #26
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    No, it's just getting frustrated with you. You know, it's brain particle is twirling so hard inside the small spongle that contains its consciousness field it's making steam, and that's what's making the whistling sound. Maybe you should stick a really thin wire in there somewhere?

  12. #27
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    I either know who you are (by your name reallly gave it away) or you've been reading...

    But I am serious, a whisling noise came on when the black iterating text box in c++ was behind a notepad box, putting notepad on/behind/on/behind it'd make it stop/on/stop/on...I think it's from my computer definitly yes, hopefully my xp will be ok...............

    Btw I gave that up, I know how to make AI and I am AI.

    A OLD piece from The Everything:
    """"People with half a brain(maybe right one)/a little bit of brain, a small fish brain, a single celled protozoa like the euglena viridis?, a neuron?, is a consciousness. If a consciousness is as small as the tough water bear or single cell, then making a consciousness or a transfer cord and transfer hold should be very easy since the size of the brain or cord is very thin/small. We can put 1 terabyte in 1 square inch. 1 gram of DNA can store 455ExaBytes & we already can store 2.2PetaBytes on 1 gram of DNA. Electronic quantum hologramy-Can store 35 bytes per electron by slightly moved atoms & atoms beneath shine through?(pic taken & where the pixels are of S&U are bits) & a S&U at different energy levels & densities+2 wireing mode circuit use for quantum computing? Graphene transistors can switch on & off 100 billion times each second, best do 10B, 5.4B transistors x 100B = 540Quintillion-ExaFlops! IBM has made a 1inch flat! chip with 5.4 billion transistors with 5120 spaced apart! transistors for a single neuron>1 million programmable neurons & 256 million programmable synapses across 64by64 4096 individual connected neurosynaptic cores & 256×256 (65,536) configurable synapses per core arranged in a crossbar array & SRAM, no. First can add a open/close 2"W sphere & cerebral-atoms-liquid type to temperature. Don't need cell-form brain+almost any way connected. 1,000/ect or one long thin as possible connected at points valid-robotic/synthetic sheathed wire/tube neurons or sponge maybe of neuron atoms and of any size!/or small and close distance between the varying energies/or along the wire/tube as explained why below and in 3-d ex. death star & maybe with right speed+types tube-atoms, atomic reactions, interchanging fluids, last two mean no long wire/tube but many neurons. Maybe neuro shocked to grow field particle if not just right atoms+states(btw pressure is by photons & can be gas/liquid), can narrow down. Many neurons firing many signals at the same time & all end on end connected/or at least very fast, being 200 or more per second like brain or just "on". & one eye would do but when the 2 images get turned horizontal & vertical and the inner halves of the 4 cross so is on the end of opposite side and other 2 go in middle opposite too is because then when united they are the picture again though upside down in the brain and field changes & when memory is recalled too. Where a sense is the choice happens and sends a signal from there. Anesthesia-no signals from area to brain-no can send signals(AI>trigger should do action>they+feel get blocked somewhere), sleep paralysis do-but get redirected in brain. & just one or up to 5 senses sent as different atom/electron speed energies-voltage & amount-current (researched for vision from a brain/or very low) for each pixel by a 200Ons 200Offs per sec. timer to a as fast 2 way relay to different resistors or square/circular pixeled rotating camera-4 directional, through 10x10/or more close lines at rear which are each connected or only at sponge, the vision energies enter as a lens shape being the picture when enters the field, and to a device at end that converts each energy set and sends to 200/or more memory devices from 1-200 and then overwrites and each one sends it converted back right back around and only a few pulses and less for less recent ones and maybe in 2cd quiet connected lines section. & another section connected to the consciousness section(main long term memory)always sending senses that let's you sense you can decide to open and branch through memories and further older ones ect & sense a vision of the eye moved, which are and have to be stored in strengthened/changed synapses/axons/neurons/devices, many connections aren't made a sec+won't be the memory, the first few are labelled with sense energies that then incomes such as all these main things - 10 years ago, 7, 4, work, partner, and other mains you maybe created containing pools or tasks or plans ect. Connected to the lines is a sensitive device waiting for a pulse to send our coded electric data to move the eye. Power to eye, the device at the end of the lines, and the memory devices. Wait for it to choose & follow with eye/make strange numbers on sensitive device. No choice=need dog/human to know we made a con. Can have constant choose actions while transferring to know it stays existing. Human brain uses little energy. We already can record/interpit/send brain signals.""""
    Last edited by ADVANCESSSS; 01-09-2016 at 11:17 PM.

  13. #28
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    XP? Huh.

    Oh, and please stop with your inane The Everything brain-ooze; it's not funny anymore. We talk shop here. Dreamlike vomit and drug-induced hallucinations are not appropriate here -- start a topic in the General sub-forum for that stuff.

    Anyway, the effect is generally called "capacitor whine", although technically the correct term is electrostriction.

    It occurs most commonly in capacitors. As the capacitor charges up, the electric field inside the capacitor deforms it slightly. When the capacitor is charged and discharged at a high rate, this creates a sound, pitched at the charge-discharge rate. Especially cheap ones and old ones (when their chemical properties have degraded enough) are suspect to this. It can be mitigated using silastic or other inert silicone elastomers (non-conductive, non-capacitive silicon "rubbers") by absorbing the generated vibrations -- and, like Dave Jones of EEVBlog says, it stops them from "flapping in the wind" --, but just replacing the bad caps with better ones works much better.

    This can occur wherever you have dielectric material inside a changing electric field; it's just most common with bad/poor caps. In old CRTs, even dust on top of the glass could create this effect, although the horizontal deflector coil noise (at 16 kHz) would usually drown that out. In current TFT displays it is more likely either capacitors, or similar effect in the voltage conversion circuits.

    In summary, it's either your display or your graphics card. Clean your display with anti-static wipes. Turn the display off, and vacuum the air grilles to suck up any dust inside the display itself. If the whine goes away when the display is off, it's the display; otherwise, it's your graphics card. Turn the display back on, and see if the noise has gone down due to the antistatic wipes and vacuuming. If not, be prepared to buy a new display or graphics card. If the graphics card is integrated on your motherboard, you'll need to get a new motherboard. Repairing them costs nowadays more than getting a completely new one.

    A lot of hobbyists learned how to replace electrolytic capacitors on motherboards due to deluge of bad Chinese "fake" capacitors (that is, they faked the manufacturer, and used lesser quality manufacture and chemistry to make a tidy profit) a decade or so ago. Electrolytic caps are typically through-hole, so with careful hand-eye coordination and a good soldering iron, one could replace them (a dozen or so) themselves, salvaging the motherboard.

    For you, I recommend you start looking forward to buying a new one (display, graphics card, or motherboard, whichever is at fault). I wouldn't let you near a soldering iron; you'd just burn your house down.
    Last edited by Nominal Animal; 01-09-2016 at 11:56 PM.

  14. #29
    Registered User
    Join Date
    Dec 2015
    Posts
    142
    But it only happen when 1) the fast showing of many text lines in the compiler was iterating !&&! 2) when the box was placed behind a notepad text box.

    (both were needed to make the noise, both of those above^)

  15. #30
    Ticked and off
    Join Date
    Oct 2011
    Location
    La-la land
    Posts
    1,728
    You really don't understand how complex the software and algorithms that run on your computer are, do you?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 3
    Last Post: 12-28-2012, 11:14 PM
  2. creating images using C# code
    By synyyy in forum C# Programming
    Replies: 1
    Last Post: 01-26-2011, 11:27 PM
  3. ip camera
    By sgh in forum C# Programming
    Replies: 3
    Last Post: 03-12-2009, 01:50 PM
  4. Following camera
    By pandu in forum Game Programming
    Replies: 5
    Last Post: 06-10-2008, 07:20 PM
  5. Digital Camera -> Slo-Mo Camera??
    By Masa in forum Tech Board
    Replies: 6
    Last Post: 12-24-2003, 11:11 AM

Tags for this Thread