So we all know of debian’s SSL woes.
Here is the command that I used on boxes to fix it.
rm /etc/ssh/ssh_host_*
apt-get install openssl openssh-server
dpkg-reconfigure openssh-server
So we all know of debian’s SSL woes.
Here is the command that I used on boxes to fix it.
rm /etc/ssh/ssh_host_*
apt-get install openssl openssh-server
dpkg-reconfigure openssh-server
There are a few things that I want to do in the next few months. I want to make a site/app based mostly on an api. In general I just want to use an api extensively, like twistori, which is based on twitter, mostly. Google gadget, igoogle, would like to make one of those. Speaking of google, would not mind trying out google friend connect too. JQuery is something I would like to try, to see how it compares to Prototype/Scriptaculous.
Thats about it for now.
Lately I have been using inline editing in web apps. I really am falling in love with it. By inline, I mean the user just clicks on an object in the interface. Rather than a link, it changes a field into an edit able area, and then when you hit save, it updates the interface, all without updating the page.
General I use prototype’s form serialize and ajax updater to save the change. I like to use an abouslutely positioned dive with a scriptaculous appear effect.
Maybe later I will give a more detailed technical explanation.
I was just looking through some Google Analytics things and thought I would share some stats that I see on the sites that I monitor.
Browsers
I was surprized of how few IE6’s are still around
Screen Resolutions
92 to 98% (depending on site) of screen sizes are 1024×768 or bigger with the most common being 1024×768, 1280×768, and 1280×800
Connection
Around 5% to 10% are not connecting at high speed (DSL, Cable, T1, etc). Cable is more popular than DSL. Not surprisingly, people spend the same amount of time on a site, but people with higher speeds see more pages per visit.
Google allows it’s people to work 20% of their work time on whatever they feel passionate about. Recently, I read a post about 37 signals switching to 4 day work weeks. It got me thinking
If you have the right type of people, it’s good to let them have freedom to play around with stuff, just experiment. One they learn stuff, making them a better employee, it’s cheaper than college or often going to conferences. Another thing is that the people are fresher, feel less bogged down. Just a few random thoughts on that.
I am pretty new to cakephp, I have been using it for a about a month now, mostly with the 1.1 release. Upgraded to 1.2 on this one application. It went okay, it was a simple application. The toughest part was validation and login. For those who have struggled through this as well, getting user logged in and the new validation in 1.2. Here is the source of what I did.
app/models/user.php
class User extends AppModel {
var $name = 'User';
var $useTable = 'users';
var $validate = array(
'username' => array(
VALID_NOT_EMPTY,
'alphanumeric' => array(
'rule' => 'alphanumeric',
'message' => 'Username may only consist of letter and numbers'),
'length' => array(
'rule' => array('between', 6, 20),
'message' => 'Username must be between 6 and 20 characters in length'),
'unique' => array(
'rule' => 'checkUniqueUser',
'message' => 'Username already taken'),
),
'password' => array(
VALID_NOT_EMPTY,
'length' => array(
'rule' => array('minLength', 6),
'message' => 'Password must be at least 6 characters in length'),
),
'email' => array(
'email' => array(
'rule' => 'email',
'message' => 'Invalid Email',
),
'unique' => array(
'rule' => 'checkUniqueEmail',
'message' => 'Email already in use',
),
),
);
//The Associations below have been created with all possible keys, those that are not needed can be removed
var $hasMany = array(
'Comment' => array('className' => 'Comment',
'foreignKey' => 'user_id',
'dependent' => false,
'conditions' => '',
'fields' => '',
'order' => '',
'limit' => '',
'offset' => '',
'exclusive' => '',
'finderQuery' => '',
'counterQuery' => ''
)
);
function checkUniqueUser($data) {
return $this->isUnique(array('username' => $this->data['User']['username']));
}
function checkUniqueEmail($data) {
return $this->isUnique(array(’email’ => $this->data['User']['email']));
}
// The basic login stuff
function validateLogin($data)
{
$user = $this->find(array(’username’ => $data['username'], ‘password’ => md5($data['password'])), array(’id’, ‘username’));
if(empty($user) == false)
return $user['User'];
return false;
}
}
?>
app/controllers/users_controller.php
class UsersController extends AppController {
var $name = 'Users';
// This is to know
function login()
{
if(empty($this->data) == false)
{
if(($user = $this->User->validateLogin($this->data['User'])) == true)
{
$this->Session->write(’User’, $user);
$this->Session->setFlash(’You\’ve successfully logged in.’);
$this->redirect(’/');
exit();
}
else
{
$this->Session->setFlash(’Sorry, the information you\’ve entered is incorrect.’);
exit();
}
}
}
function logout()
{
$this->Session->destroy(’User’);
$this->Session->setFlash(’You\’ve successfully logged out.’);
$this->redirect(’/');
}
function view($id = null) {
if (!$id) {
$this->Session->setFlash(__(’Invalid User.’, true));
$this->redirect(array(’action’=>’index’));
}
$this->set(’user’, $this->User->read(null, $id));
}
function add() {
if (!empty($this->data)) {
$this->User->create();
if ($this->User->save($this->data)) {
$this->Session->setFlash(__(’The User has been saved’, true));
$this->redirect(array(’action’=>’index’));
} else {
$this->Session->setFlash(__(’The User could not be saved. Please, try again.’, true));
}
}
}
}
?>
app/app_controller.php
class AppController extends Controller {
var $helpers = array('Html', 'Form', 'Javascript', 'Ajax');
function checkSession()
{
// If the session info hasn't been set...
if (!$this->Session->check('User'))
{
$this->Session->setFlash('The URL you\'ve followed requires you login.');
$this->redirect('/users/login');
}
}
}
?>
And then just call $this->checkSession() in your controllers to force a login
I have to go through a bunch of templates and change the text in them. Every template is different and require personal attention. This is a little snippet from my shell for those of you who know bash.
for I in `grep -n -r -i "bill_of_sale" * | cut -d ":" -f 1 | sort -u ` ; do gvim $I ; done
Not so fun.
So it seems that we are currently in the peak of Web 2.0. It seems that the Web 2.0 form of thinking is now permeating businesses and more and more web 2.0 apps are aimed for businesses.
Before we begin on this road, we should specify something, Web 2.0 is loosely defined, Web 3.0 is hardly defined. It’s like a crap shout of what people think is going to happen. Lots of people like it will involve a form of artificial intelligence. Like you can search for a string like “I want to see a funny movie and eat at a buffet” and google will return movie listings and close by buffets. Yet others think it will be faster connections to the internet. Yet others think it will be greater advances in graphics.
Those things may all happen. Here is what I think. It will be the rise of the Semantic Web. The real basic definition is a set of design principles for data. I think the big think will be the information sharing between web apps. That’s my pick
I have found the keyboard shortcuts in gmail very useful. They really have spend up how I use gmail. I would like to start using keyboard shortcuts in my web apps, here is how I intend to do it, with prototype
Event.observe(window, 'load', function() {
Event.observe(document, 'keypress', function(e){
var code;
if (!e) var e = window.event;
if (e.keyCode) code = e.keyCode;
else if (e.which) code = e.which;
var character = String.fromCharCode(code);
alert('Character was ' + character);
});
});
Pretty cool I think, you replace the alert with whatever you are doing
Lately I have been thinking about my work environment. On Friday I was trying to focus on something and although I was largely unbothered, I continual had people walking around me, heard people have conversations, heard phones ringing. Tons of things to take my focus.
Office settings tend to not work for programmers. It’s too easy for somebody to come ask them a question or call their extension and ruin the last and next 15 minutes of focus for that.
Working alone seems like a good idea. I have tried it a few times. It’s cool, but at times lonely. And you can’t throw ideas off each other like you can in a group setting.
Large groups have never worked for me, usally to unorganized and you spend too much time with analysis paralysis.
What works for me is a small ground, 2 to 4 people in a place where people can’t interrupt them. The small group is easy to organize, quick to get working. It’s nice to be able to talk with someone to bounce ideas off of them from time to time. I really like the library reading room, it’s quiet enough, but you can talk softly if you need to, but you should not need to talk too much.