richieking 44 Master Poster

You can also try this.
This is according to your post

hello i'm trying to figure out how to write a program in c++ that check when i insert a password and force me to add at least 2 capital letters and 2 numbers in the password (you've seen this before right? when signing up for new account and checks for password stringth)

Below is a simple code to mimic such thing.

bool chkUperDegitPwd( const std::string pwd){
    static size_t sCount=0; // static count

   for(auto &p: pwd){  // >= c++11
        if(std::isdigit(p)){
            sCount++;
        }else if(std::isalpha(p)){
           if(std::isupper(p)){
               sCount++;
            }
        }
   }
   return pwd.length() == sCount ?true:false;
}

// use case
std::string pwd;
std::getline(std::cin,pwd);
if(chkUperDegitPwd(pwd)){
  //do your stuff
}else{
 // password error
}
richieking 44 Master Poster

You may wanna change your class name to say txt or whatever.
Array is a C++ lib. MosChops just warned you aboout that.
Now add change to say class txt and add this code.

   enum {MAX_INT=5};// global enum

  bool operator ==(txt a){
      return a.getSize() == getSize();
            }

    const int getSize(void)const{
        int sum  = 0;
        for (int x=0; x < MAX_INT; x++) {
            sum += arr[x];
        }
        return sum;
    }

I want you to figure things out yourself.

richieking 44 Master Poster

You can not simply connect to your database on another system like that.
There must be a contact or a server on the remote system that you will use to open the way to the inner operation.
This is simply done by running a server on the remote system that will connect to your app and via the connection have access to the DB.
Look into sockets and clients howtos.

So in short, there must be a server and a client.
Besides this there is no way to just connect to remote DB like what you want. Well i stand to be corrected but i am pretty confident with my answer as i have done this numerous times.

richieking 44 Master Poster

Are you talking about this?
Well show some code next time. We are here to help not to do your homework.

float recSq(float x, float y){
   return x*y;
   }
richieking 44 Master Poster

Master when do you need your programme? How soon? Anything again master?

richieking 44 Master Poster

And you expect us to do that for you dont you master?
Sure we will.. just give us one more month please master.

richieking 44 Master Poster

And your code?

richieking 44 Master Poster

Also you can bring the innitializing of the
int[] values = new int[numbValues]; into the constructor.

 Object(int numbValues) {
values = new int[numbValues];
this.numbValues = numbValues;
}

but leave the declaration outside .
that is
`int [] values;'

By this you will be fine also.
that means you will need to called the class with a value new Object(33);

nostalgia commented: Solved my problem, thanks! +0
richieking 44 Master Poster

There are 2 thing that may help fix your problem. At least anyone of them is enough for the task.
1.Thread
2.javax swing Timer.

1.if you need thread then you will need to call the runnable method to innitiate the clock. This must be called in an event.

  1. If you use the javax swing timer, then thhats more easier..
    Timer timer = new Timer(int);
    then you innitiate the timer.start(); in the event.

Also to make things more protective . Always organize data that you will use in many places so that there wont be a subtle error.

here.

Font font = new Font("Impact", Font.BOLD, 45);

min.setFont(font);

You get the idea?

richieking 44 Master Poster

Also you are using the standard laout manager with Swing. How do you want to see the app layout, can you draw or show us a pic or something how you want to see your layout so that we can assist you?

richieking 44 Master Poster

what is your level in c++?
Do you need to store something permanent ?
Do you have experience with database?

sarafadeenl1 commented: fairly good, i dont need to store something permanently, i do have little +0
richieking 44 Master Poster

try google py4a. there is layers for that.

richieking 44 Master Poster

pyPdf is a simple as abc. it cant get cheaper than that!

Bosterk commented: Thank +1
richieking 44 Master Poster

Try this

>>> print "\n".join([x for x in "dog,cat,bird,good,bad,blah,blah,blah".split(",")])
dog
cat
bird
good
bad
blah
blah
blah
>>>
richieking 44 Master Poster

For some reason it just jumps to the else statement instead of going to if and elif.
Any input would really be apreciated.

a=raw_input( "What is your name: ")
b= int(raw_input( "What year were you born: "))
c= int(raw_input( "What year is it now: "))
print "Hello",a,"you are",c-b,"years old."
class object():
    'userAge'== c-b
    'teenager'== (13,14,15,16,17,18,19)
    if 'userAge' <=12:
         print "You are really young"
    elif 'userAge'=='teenager':
         print "You are a teen"
    else:
         print "You're really old."
         
         
object()

You just need to take your time and learn python. Read pybooks and practice a lot

Ene Uran commented: agree +8
richieking 44 Master Poster

what a nice piece of article tony. you got talent my friend :) .

Azmah commented: agreed +2
richieking 44 Master Poster

Google for pyaudio. Also if you want a linux native app, there are other libs for banshe,audacious, in pytyon that you can use then it will use their audio engine respectively.

richieking 44 Master Poster

Never knew wx python does not yet support python3.x because that's what i use currently, do you think that in the nearest future it will.

Dont Even think about that for now. It will take some time. There is a lot of loads on the developers at the moment.

Just stick to TK if you want py3k, else you may atleast use py2.7 which goes well with wxpy2.8 and still call in the future function in into your code.

vegaseat commented: good point +13
richieking 44 Master Poster

look at the right -> there is up and down sign.
click on up.

richieking 44 Master Poster
print "Equations"

print "a+1 (1), a+2 (2), a+3 (3), a+4 (4)"

while True:
	d=int(raw_input("number:" ))
	if d==0:
		break;
	if d == 1:
		print a+1
		
## Then continue from there
richieking 44 Master Poster

what a teacher your are Snippsat. impressed!

richieking 44 Master Poster
print(["/".join(date.split("-"))])

2011/03/03

from my htc phone ;)

richieking 44 Master Poster

why dont you only read the lines into a list and slize it???

The increment the index to get what you want?

listc = [x.split() for x in f.readline()]
## now you get the data like
ins =0
ins2 =0
for x in listc:
   print listc[ins:ins2+1],listc[ins+2:ins2+3]
   ins+=3
   ins2+=4

something like this. coming from my HTC fone.
hope you get the idea

BirdaoGwra commented: I solved my problem bcos of his help +2
richieking 44 Master Poster

Yep line 36.
Assignment operator needed not comparism.

monthN = "Decemeber";

instead

richieking 44 Master Poster

or this.........

a = a= [(x+2,x*2) for x in range(1,300)]

And plot some graph with it ;)

richieking 44 Master Poster

backslash is native to windows as forwardslash to linux/unix/bsd file path. if you want to write an app. for network , then your good choice shout be forwardslash.

richieking 44 Master Poster

There are 3 things going on with your script.
1. a is global variable assigned the value of 10.
2. You function is a function that has a default value set. that is global a which got the value of 10.
due to that

foo()

will print the default value which is

def foo(x=10)

because a=10. So when you call

foo()

it will return the default value.

Try and call foo(a) on line 6. This will print the current value of a which is 5.

3.Variable scope and function definations are very simple once you master them.
As you can see.

foo()

took no value. As long as you dont give a value to

foo()

.... It will keep printing the value of first a which is 10.

Try and change the value of first a and call

foo()

without a value to see.

Hope you get the idea. happy codding :)

richieking 44 Master Poster

on line 53.... you have wx.EXPAND flat set but you have not given the permission to expand. Change to this,,,,,,,,,

sizer.Add(myEditor, 1, wx.EXPAND)

1 is the proportion/permission. so change the 0 to 1 anywhere you want to expand.
If you got more than one expand... Then you increase the proportion of the bigger control you want to .

;)

ShadyTyrant commented: Found solution +2
richieking 44 Master Poster

yep...

because pyserial has included it.
example.,,,,

import serial
ser = serial.Serial (0 , baudrate = 57600 , timeout = 1) #open serial port (1) - 1
line = ser.readline() ## will get the implementation of FileList method readline() if you dont have a local readline() method define

ser.close()
richieking 44 Master Poster

def on_paint(event):
self.dc == wx.PaintDC(event.GetEventObject())
self.dc.SetPen(wx.Pen("BLACK", 4))

self.hangingman.Bind(wx.EVT_PAINT, on_paint)

There error is this method you creadted is not part of the class without the keyword self. try this.......

def on_paint(self,event):
        self.dc == wx.PaintDC(event.GetEventObject())
        self.dc.SetPen(wx.Pen("BLACK", 4))

self.hangingman.Bind(wx.EVT_PAINT, on_paint)

And here you go ;)