Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

2007-12-17

Home <--> Work synchronization

What's a pity that major hosters do not offer free version control system. Google, sourceforge - that's all for programming projects.

I'd like to have some simple solution for the synchronization of small notes and todo lists at home and work computers.

I've come across OpenSVN project. The rules contain almost no restrictions on contents. It's slow, but it's quite enough for files <10ะบ. Well, I hope that it will be no more bugs with backups ).

At the work computer with constant connect to Internet I've set up a scheduler, now I'm sure that I Can download everything at the home one, if needed.

2007-12-03

Unpleasant Jabber

Oh my.. because of the latest problems with icq protocol changes I had to change icq transport to jabber.snc.ru. Well, it works quite good... but I'm constantly getting into small fixes with it - and this is with my small contact list in fifty persons.

Boring stuff...

Contacts that were located on icq server loaded automatically so I had a heap of monstrosity records like XXXXXXXX@picq.jabber.snc.ru. Everything had to be renamed manually. Icq contacts that were located only in jabber just remained at @icq.jabber.snc.ru, I had to move them manually too. After all that I had to confirm authorization for each contact and got the response.

It's stupid.

Also I've found that if I'll want to jump down from the server it will be somewhat problematic. Quick contact list transfer service does not want to work either with my main account at jabber.snc.ru, nor with experimental one at xmpp.org.ru. It works only with abandoned jabber.ru.

2007-11-23

Linux on Laptops

While choosing and tuning my notebook I searched the whole Internet about how Linux works on computers from different vendors.

I did not like:

IMHO plain text is not very good for the description of the supported hardware. Why there is not a site where the user is prompted to place a pre-defined set of ticks and to write a comment, if necessary?

Since it's great to see comparative tables for different laptops or distributions.

2007-10-05

I believe

With simple, consistent code, change analysis is a breeze. A simple trace through the layers of code with a text-search tool will generally reveal exactly what needs to be changed, and where. A solid test plan will identify what changes broke the system and how, and allow developers to respond appropriately.

No, it’s not fun and not challenging. It’s just good software


http://de.worsethanfailure.com/Articles/The-Mythical-Business-Layer.aspx

2007-07-26

Mailing List Archive in RSS

Big thanks to Fredrik Carlsson for the responsiveness and the efficient job.

Messages from some mailing lists can be seen not only through web http://archive.netbsd.se, but through any rss-reader.

And now thanks to the fresh-added tag <pre> around the contents it's properly reflected in google-reader.

2007-07-05

Google, google - save our soils.

There is a lot of computer dictionaries, there is a lot of programs, which easy translate a word when the mouse is moved to it, there is a lot of on-line dictionaries and translators, it's all great and wonderful.

But I'd like to have a list of everything I translate, to see the statistics in order to learn by heart the most often forgotten words after all. May be some flash cards should be formed by them, it seems there is such way of words learning already.

I need such web service, I need corresponding script for greasemonkey I need corresponding dictionary for my computer with the necessary possibility of quickly translation a word under the mouse, I need pdf dictionary integrated with a book reader... and so that all this has a common base of made requests.
Is there anything similar?

So far I've created a little script for we, using http://lingvo.yandex.ru. As least, I'll bind a database to it, it will be happiness yet.

The code
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, urllib2, libxslt, libxml2
from html5lib import html5parser

# http://www.dbforums.com/archive/index.php/t-1419974.html
# by John J. Lee
class DumbProxyPasswordMgr:
def __init__(self):
self.user = self.passwd = None
def add_password(self, realm, uri, user, passwd):
self.user = user
self.passwd = passwd
def find_user_password(self, realm, authuri):
return self.user, self.passwd

def word2url(word):
return "http://lingvo.yandex.ru/en?text=%s"%word

def download(url):
proxy= urllib2.ProxyHandler({"http" : "http://proxy:8080"})
proxy_auth_handler = urllib2.ProxyBasicAuthHandler(DumbProxyPasswordMgr ())
proxy_auth_handler.add_password(None, None, 'user', 'password')
opener = urllib2.build_opener(proxy,proxy_auth_handler)
urllib2.install_opener(opener)
src = urllib2.urlopen(url)
return src.read()

def html2xml(src):
p = html5parser.HTMLParser()
doc = p.parse(src,'utf-8')
return doc.toxml()


def decodeYaXML(src):
styledoc = libxml2.parseFile("decode.xslt")
style = libxslt.parseStylesheetDoc(styledoc)
doc = libxml2.parseDoc(src)
result = style.applyStylesheet(doc, None)
content = style.saveResultToString(result)
style.freeStylesheet()
doc.freeDoc()
result.freeDoc()
return content

if __name__ == '__main__':
if len(sys.argv) < 2:
print "usage %s word"%sys.argv[0]
sys.exit()
word = sys.argv[1]
result = decodeYaXML(html2xml(download(word2url(word))))
print result.decode('utf-8','replace').encode('cp866','replace')



The contents of decode.xslt file is trivial everybody can write it to one's heart's content.

Monsieur being a good judge of perversion can appreciate the last row.

2007-03-27

Web: shamanism

Good heavens!
To make a fixed block be still when you scroll a page in Microsoft Explorer, you have to fix a page background(!)
body
{
background: url('/n.gif') no-repeat;
background-attachment: fixed;
}

2006-09-14

Automatization

At last, I had enough time to automate the site update. The problem is quite simple - there is a certain number of html pages, which should be changed at a local server from time to time, then wait for the confirmation of the maden changes and send it to the Internet. I would like to have one big button for that purpose, because I'm lazy to synchronize sites, get accustomed to an external tool... since the problem is exactly for make utility. The only trouble is that I've completely forgotten what does the magic symbols ($@ $^ and so on) mean.

But there is more easy way.

By chance I came across Martin Fowler article about the magic rake utility, used for building projects in ruby. More fifteen minutes of ruby functions googling and voila:

require 'rake' 
require 'find'

task :default => :copychanges
task :copychanges do
print "all done"
end

Find.find('src/') do |srcfile|
target = srcfile.sub(/^src/,'data')
changes = srcfile.sub(/^src/,'changes')
file target => srcfile do
if test(?f, srcfile)
cp srcfile, target cp srcfile, changes
else
mkdir_p target mkdir_p changes
end
end
task :copychanges => target
end



Make changes in the folder src/, store the copy in the folder data/, by rake command new changes are moved to the folder changes.

2006-05-11

Usability: Pager


"The real danger is not that computers
will begin to think like men,
but that men will begin to think like computers."

Harris, Sydney J. American journalist


The standard behavior: there are 21 photos, it is required to place this treasure at a site. It's not cosher to dump all at once, it should be divided for separate pages, say, 10 photos per page. As a result on the last 3d page will be a single photo, which is not convenient. To look at one or two photo one should go to a link... wait...

The situation became worse when working with mail through web. Marking 11 messages as «read» takes the same time as for 20 messages.

Although it will take a programmers 15 minutes to place at the last page on 30 % more items, if it allows to avoid transferring remains to the next page.

2006-05-03

Web: Google mobile proxy

It's a miracle. I've logged in my gmail account through web interface from PDA and discovered an interesting google service. It seems, everybody already knows about it but I've found it just now — it's a proxy server optimizing pages for mobile devices. It is easy to use — just print http://www.google.com/gwt/n?u= and after the equals sign write the required site address.

Here, just now I've painted for my PDA a javascript page automatizing this thing. It's so good to be a programmer!


<html>
<head>
<script>
function go(form) {
var url = form.url.value;
if(url.substring(0,7) != "http://")
url="http://"+url;
window.location = "http://www.google.com/gwt/n?u="+url;
}
</script>
</head>
<body style="text-align:center">
<form>
<input name="url" type="text"/>
<input type="button" value="go" onclick="go(this.form)"/>
</form>
</body>
</html>

2006-04-21

The programming: InnerHTML

Funny, did not know about it.


<script language="JavaScript" type="text/javascript">
elemenet=document.getElementById("ID_ELEM");
element.innerHTML = "Here <i>may be<b>any</b></i> HTML text."
</script>


Web page contents can be free and easy changed in dynamics. Cross-browser enough.