Stefano Mtangoo 455 Senior Poster

Here are my 2cents:
1.Have two textfiles (or whatever) in your server as well as on app
2. app.txt stores current version, last updated, update interval
3. serv.txt stores latest version and status (alpha, beta etc) and type (next version or just bugfix)

At startup, have program compare last updated, add to interval and then compare to current date to see if it should look for update or not.
Then if it is to check for upd, it should invoke update.exe (or whatever you call) which will update necessary components (files et al)

You will be just changing server version and put something higher. Anyway you could use database with full details of what to be updated and the link to the updated file on server. This is better but you can implement whatever you see fullfilling your needs

I'm in hurry, so forgive me for any typo or broken english ;)

Stefano Mtangoo 455 Senior Poster

So Any good tutorial on Swing or SWT? I only need tutorial bundled for offline uses as I code at home with no net. I thing that will be abig factor for me moving either direction.

Don't point me to readme above. I have read it, but I just need an offline tut. Also unless available for download, freely, don't point me to a book. It is hard to get them here!

Thanks buddies

Stefano Mtangoo 455 Senior Poster

It is LEGAL to ask for starting point, or for PROBLEM in coding But it drives me bananas someone wants his/her homework done. Oh! Why did you go to college/School then?? :lol:

Stefano Mtangoo 455 Senior Poster

I'm willing to bet that you copied the code from that site without adding the necessary scaffolding.

You bet it! You are really here to prove me wrong. It is kinda foolish to forgot main. It is like trying entering without a door ;)

Thanks Narue

Stefano Mtangoo 455 Senior Poster

Thanks guys, I have got alot from you :)
feel free to add any information you wish on subject, but thread is solved

Stefano Mtangoo 455 Senior Poster

Hi All,
I'm trying to make commandline mp3 player using libwmp3. I use codeblocks and have tried alot and I get error below. I have tried to include libwmp3.h, add libwmp3.a try changing compiler; but no success :(

Please help me to get through. I use the code for mp3 player posted at their site.

Thanks

expected constructor or destructor or type conversion before "->" token .

Stefano Mtangoo 455 Senior Poster

So Ada,
what do you recommend ;)

Stefano Mtangoo 455 Senior Poster

That is error in PHP script.
If you are a dev. fix it or else seek for help to right people

Stefano Mtangoo 455 Senior Poster

Hi all,
I need to install apps in my USB Mandriva 2010.
In office I have to install Elite Core's SSCyberoam client which is Windows vista exe. I cannot access net without it so I need wine to install it.

All versions of wine at official download fails and also cannot access repo (Can't go to net without SSC remember?) So Is there a wine distribution full packaged with all dependencies?

What other trick can do aJob to install SSC (.exe)

Stefano Mtangoo 455 Senior Poster

I'm new to Java, but will eventually want to use GUI for my Desktop applications. So as usual in any language, GUI toolkits are "debatable". In Python (My current "mother toungue") We have PyQT vs PyGTK vs wxPython and it is a good debate. I would like to hear your opinion on Java Swing vs Standard Widgets Toolkit ;)

Also, do I need to add anything to use Swing/SWT with eclipse or they are included in JDK/Eclipse?

Here we go!

Stefano Mtangoo 455 Senior Poster

Thanks guys for inputs. It seems to me that there are many ways of doing the same :)

What do you guys suggest, suppose you were to do it?

Stefano Mtangoo 455 Senior Poster

Not all IDE's support code completion well. Of all IDE's I've tried, I found PyDev and Eric4 work best in this respect.

Have you checked Wing IDE yet?
Eric is most of the time associated with PyQT. It is made by It!

Stefano Mtangoo 455 Senior Poster

Deitel's C++ How to program

Stefano Mtangoo 455 Senior Poster

Quick 'n dirty: I need a way to upload a small bit of text (<200 bytes) to my web server.

PHP is capable of that in few lines if you do it manually. Also you can automate the task using Task Scheduler (Win) or crontab (*nix)

.. from my C++ app.

That smells like C++

Stefano Mtangoo 455 Senior Poster

That worked, thanks

Stefano Mtangoo 455 Senior Poster

Thanks guys!
I will try to implement your good codes.
Not Closed yet, so if anyone wants to say anything ;)

Stefano Mtangoo 455 Senior Poster

I tried to use the above code for an example and i came across a Deprecated on Call-time pass-by-reference for these following code:

array_map( 'stripslashes',&$_POST ); //Strips slashes
    array_map( 'mysql_real_escape_string',&$_POST ); //Escapes data to protect against sql injection

.

can anyone assist me on this? thanks

It is good warning -- That you use later version that Keith's
This works without warning

array_map( 'stripslashes',$_POST ); //Strips slashes
    array_map( 'mysql_real_escape_string',$_POST ); //Escapes data to protect against sql injection

.

Stefano Mtangoo 455 Senior Poster

neat huh ;)

<?php
require('includes/application_top.php');
require('includes/classes/crypto.php');
include('includes/classes/class.formvalidation.php');
include('includes/classes/class.phpmailer.php');

if (!$allow_signup) {
header('location: login.php?signup=yes');
exit;
}

if (isset($_POST['submit'])) {

$my_form = new validator;
$mail = new PHPMailer();

if($my_form->checkEmail($_POST['email'])) { // check for good mail

if ($my_form->validate_fields('firstname,lastname,email,username,password')) { // comma delimited list of the required form fields
if ($_POST['password'] == $_POST['password2']) {
//create new user, enable
$username = mysql_real_escape_string(str_replace(' ', '_', $_POST['username']));
$sql = "SELECT userName FROM " . $db_prefix . "users WHERE userName='".$username."';";
$result = mysql_query($sql);
if(mysql_numrows($result) > 0){
$display = '<div class="responseError">User already exists, please try another username.</div><br/>';
} else {
$sql = "SELECT email FROM " . $db_prefix . "users WHERE email='".$email."';";
$result = mysql_query($sql);
if(mysql_numrows($result) > 0){
$display = '<div class="responseError">Email address already exists. If this is your email account, please log in or reset your password.</div><br/>';
} else {
$crypto = new phpFreaksCrypto;
$salt = substr($crypto->encrypt((uniqid(mt_rand(), true))), 0, 10);
$secure_password = $crypto->encrypt($salt . $crypto->encrypt($password));
$sql = "INSERT INTO " . $db_prefix . "users (userName, password, salt, firstname, lastname, email, status)
VALUES ('".$username."', '".$secure_password."', '".$salt."', '".$firstname."', '".$lastname."', '".$email."', 1);";
mysql_query($sql) or die(mysql_error());

//send confirmation email
$mail->IsHTML(true);

$mail->From = $user->email; // the email field of the form
$mail->FromName = 'NFL Pick \'Em Admin'; // the name field of the form

$mail->AddAddress($_POST['email']); // the form will be sent to this address
$mail->Subject = 'NFL Pick \'Em Confirmation'; // the subject of email

// html text block
$mail->Body = '<p>Thank you for signing up for the NFL Pick \'Em Pool. Please click the below link to confirm your account:<br />' . …
Stefano Mtangoo 455 Senior Poster

Can you summarize the whole bunch of words? I mean what you specifically want?

Stefano Mtangoo 455 Senior Poster

When you add a page in CMS (Like Wordpress' admin) what does it actually do? Add predefined table? Or what?
Thanks!

kvprajapati commented: Very good question. +6
Atli commented: good question +3
Stefano Mtangoo 455 Senior Poster

sure, but any query combining SELECT INNER JOIN and LIMIT is sufficient for my need. I want to use two different tables with related info. I don't have any other idea than using INNER JOIN....ON

Stefano Mtangoo 455 Senior Poster

Nope, the laptop I use is at home and I'm at work. So I will do once I get there. If you can do a test for me, I will be grateful. Otherwise I will check it at home

Stefano Mtangoo 455 Senior Poster

So If i remove the comma it wil work ;)

Stefano Mtangoo 455 Senior Poster

Good guide,
I will use it and repost (I'm away home now)

Stefano Mtangoo 455 Senior Poster

Hi,
I'm learning making CMS. As you can see, I cannot do everything from scratch. So I request anyone with code in his codebase that works fine on paging or knows practical code to point me. I want to page my articles once are more than let say 10

Cheers :)

Stefano Mtangoo 455 Senior Poster

Thanks I'm checking

Stefano Mtangoo 455 Senior Poster

Hi all,
I want to do simple query to do the Join
Here is illustartion of my query which gives error

"SELECT * FROM table1, INNER JOIN table2 ON table1.colx = table2.colx LIMIT 30"

What goes wrong here?

Stefano Mtangoo 455 Senior Poster

Hi all,
I have a question here :)
Suppose I have a library in source code form (Let say mysql++) and I have built it, and now I have the files (.h, .lib, .dll). How do I combine them in project? I use code blocks

Why I ask?
Because Python Have done some damage in my thinking ;)
You just do simple stuffs and there you have the whole library to use
Just

import sqlite3

Thanks guys & girls

Stefano Mtangoo 455 Senior Poster

"syntax error: unexpected = on line 15"

<?php

root=$doc->createElement('subscribers');//forgot $ sign

?>

end quote.

You forgot $ sign
Try this:

<?php

$root=$doc->createElement('subscribers');//inserted  $ sign

?>
Stefano Mtangoo 455 Senior Poster

Thanks niek_e,
I'm going to devour that right now :)

Stefano Mtangoo 455 Senior Poster

polite BUMP :)

Stefano Mtangoo 455 Senior Poster

Hi All,
is there a trick in wxPython to skin application to look like this one?
What are pros and cons if any?
Take a look Here

Cheers :)

Stefano Mtangoo 455 Senior Poster

How do I center my text in python? I have a title and a description, and wan't to center it all in my output.

GUI or Console?
If GUI which one? In wxPython, wx.ALIGN_CENTER would do the Job

Stefano Mtangoo 455 Senior Poster

Which graphics module are you using?

You can check Visual Python
www.vpython.org

Stefano Mtangoo 455 Senior Poster

Thank-you very much to ShawnCplus and evstevemd. You've improved my thinking and been of great assistance.

Until Later,

Niche

I'm glad I'm of help :)
U're Welcome

Stefano Mtangoo 455 Senior Poster

Steve's code is almost right :)
The problem is in line 5

line.replace('.','')

The problem with that is that it doesn't store the new string in the variable automatically, so just add a line = in front of that and it should be fine:

You are a genius Paul :)

Stefano Mtangoo 455 Senior Poster

Steve's code is almost right :)
The problem is in line 5

line.replace('.','')

The problem with that is that it doesn't store the new string in the variable automatically, so just add a line = in front of that and it should be fine:

Paul you are a genious

Stefano Mtangoo 455 Senior Poster

I gather any other hashing methods are fine as the next shortest one is 32 characters!

I will appreciate to see your conclusion on the matter before thread marked solved!

Stefano Mtangoo 455 Senior Poster

your current code? Please post it!

Stefano Mtangoo 455 Senior Poster

please use code tags for making your code readable and preserve indentation

Stefano Mtangoo 455 Senior Poster

wxWidgets has very good tutorials for setting up projects with all major IDE's on their website.

Yep! I have never had problems with standard wxWidget library, but rather additions like wxSQLite3

Most libraries will have demo-projects on their website, like boost
Or IDE-specific installs, like OGRE

True, but many don't. So I would like to know how to setup such libraries like lame_enc.dll or akrip32.dll

Stefano Mtangoo 455 Senior Poster

Oops!
Multiple Post :cry:

Stefano Mtangoo 455 Senior Poster

Here is a tip:
Before the for Loop
>> readlines
Then loop into all lines using for loop
>> replace each occurrence of dot with space (or whatever you like)
>> write it to the new file
Here is completely untested code (I have no Python installed)

file1 = open('words.txt', 'r')
file2 = open('output.txt', 'w')
file1_cont = file1.readlines()
for line in file1_cont:
    line.replace('.', ' ')
    file2.write(line)
Stefano Mtangoo 455 Senior Poster

Much appreciated, ardav and evstevemd!
:)

You are welcome buddy :)

Stefano Mtangoo 455 Senior Poster

Try this and hack it!

j = 0
for i in range(2, 9):
    j = pow(i, 2)+j
print "The Final result is %d" %(j, )

BTW this is Python 2.x

Stefano Mtangoo 455 Senior Poster

Try this and hack it!

j = 0
for i in range(2, 9):
    j = pow(i, 2)+j
print "The Final result is %d" %(j, )

BTW this is Python 2.x

Stefano Mtangoo 455 Senior Poster
alert("Field XYZ is empty, please Fill it out!");

You, just make a JavaScript function to handle validation and only allow to submit when things are ok. That will do relieve a server also

Stefano Mtangoo 455 Senior Poster

Since any echo before redirect will cause error, then I think there is some sort of buffering and then redirect while using timer

Mhh! Completely theory that I don't know its validity ;)

Stefano Mtangoo 455 Senior Poster

Why doesnt this code work. I keep getting false even when i type in the correct username and password

Try this (I didn't test it)

$user_name = mysql_query("SELECT * FROM users WHERE username = {'$Entered_UserName'}  AND password =  '{md5($Entered_PassWord)}' ");

         $user_name_password = mysql_fetch_assoc($user_name);

         if($user_name_password)
           {
           	echo True';
           }
         else
           echo 'False';
         }
Stefano Mtangoo 455 Senior Poster
$res = mysql_query("SELECT firstname, lastname FROM mytable");
while($row = mysql_fetch_assoc($res)){
    echo "My First Name: ".{$row['firstname']};
    echo "My Last Name: ".{$row['lastname']};
}

modify it and test and see :)