Slashdot Mirror


User: AdamPiotrZochowski

AdamPiotrZochowski's activity in the archive.

Stories
0
Comments
71
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 71

  1. Re:SVN etc. on How Do You Manage Dev/Test/Production Environments? · · Score: 1

    svn export is a terrible way to update live site.

    - slow link or large website: svn export will take a long time, your users will love you
    - certain apps will kill user sessions on code reload. Specifically I am looking at you Microsoft, with your global.asa / global.asx (out of open source PHP seems best. Not sure how Django/RoR enjoy code changes to pages that are already running)

    Best setup I am aware of:

    Point your website to something like ../[website]/live
    Checkout your website to ../[website]/checkout
    run remote svn udpate: ssh [server] -p [port] -u [user] svn update ../[website]/checkout
    trick: you can force export from checked out folder
    run remote svn export: ssh [server] -p [port] -u [user] svn export ../[website]/checkout ../[website]/r[evision]
    note: you export to a new folder, that is marked explicitly as specific revision number
    symlink ../[website]/live into latest ../[website]/r[evision]
    trick: this way, if website gets broken, you change symlink to revert to a known stable version

    This is safe on bandwidth (svn checkout between servers), fast atomic upgrade on the server (since symlink is changed once export is completed).

  2. Re:mysql_escape_string, mysql_real_escape_string, on PHP Application Insecurity - PHP or Devs Fault? · · Score: 2, Insightful
    SELECT * FROM myData WHERE CONTAINS (column, 'FORMSOF (INFLECTIONAL, ?)')

    Parameters are intended for user input. I certainly hoping you aren't allowing users to type functions in directly...


    For one of the servers I worked on this was the syntax for full text search. you would do CONTAINS ( column , param ) . The argument param was a string that contained additional properties for the full text search engine. One could add things like weights associated with words and phrases (hence double quotes), or ask to search for word variation (search for 'good' also matches 'best', since they are related). Ofcourse, this was all happening in one string, that param, so you had to, yet again, format your own string.

    I am not advocating against using parametered sql calls, actually they are great, but I fear that on some level they are not much better than the magic_quotes=on, I fear as if they were an escape for lazy developers : use always, and your code will be unhackable. That was the premise of magic_quotes, it made developers feel safe, as if magically their code was unbreakable.

    Now, for stored procedure calls, especially with parameters that double as both input and ouput, the parameter binding is the only way to go.

    Cheers
  3. Re:mysql_escape_string, mysql_real_escape_string, on PHP Application Insecurity - PHP or Devs Fault? · · Score: 4, Interesting
    FIRST : stop forcing prepared binded statements for all :

    I dont mind prepared statements for when they are usefull, but they dont always work properly. And actually there are many cases where using them you actually lose power. Lets start with a simple example of the LIKE clause :

    SELECT * FROM titles WHERE notes LIKE ?

    For the unfamiliar, like clause allows me to do partial searches over strings (char/varchar in the sql world). The LIKE clause search string syntax is something of a simplified regular expression. This means that characters that usually have one meaning gain another one. For example the percentage sign becomes a wildcard (think dos/bash filename matching with '*', or regexp with '.*'). For example, all string starting with 'word' we would just search for 'word%'. Great, but how does prepare/binded statement know if the given percentage is to be escaped or not. It doesnt. So you end up doing own user parsing. You are back to square one. You need to still parse user input, so whats the point of binded/prepared statement? Another example is using power provided through fulltext index. Generally, string searching is slow. In SQL world we do an index, a cache to speed up looking. Strings have indexes, but that only speeds up searching for string that start with something (like in above example LIKE 'word%') but what if we want to search for something purely inside the string ?? then we could do LIKE '%word%' but thats slow, on the other hand, we could speed this up by various smart caching and indexing of the contents of the string. This smart indexing we call 'full text'. For example to see if a column contains some word or phrase we could just do

    SELECT * FROM myData WHERE CONTAINS (column, ?)

    all ok, right? NOPE, because it also could be :

    SELECT * FROM myData WHERE CONTAINS (column, 'FORMSOF (INFLECTIONAL, ?)')

    To explain slightly, the second examples tries to find words that are not exact, but very close. So for word 'good' another word 'best' could be used as an alternative (with a lower relevancy ranking). Great power?? Yes, but the first time the sql expects the query in the form CONTAINS ( notes , ' "word" ') notice single and double quotes while later its CONTAINS(notes, 'FORMSOF (INFLECTIONAL, word)') notice, no quotes allowed...

    and dont even get me started with the

    SELECT * FROM myData WHERE column IN ( ? )

    The IN clause is a speed over a series of OR statements. I could write WHERE column = 1 OR column = 2 OR column =3 or I could just do it with WHERE column IN ( 1,2,3) . And now the question for the binding gurus. How do I do it with prepared statements ?? Do I create a loop and both generate the SQL and fill a flat array with the right amount of paramenters WHERE column IN ( ? , ? , ? , ? ) , or do I just send arrays within arrays.

    SECOND : parameter binding through naming :

    cant wait for when parameter binding can be done in a templated fashion, so that no longer order of the columns matters, currently the way you fill prepared statement with data matters by order of the data. It all should be done with associative arrays.

    $sth = $__db->prepare ( "select * from myData where cond1 = ? and cond2 = ? " ) ;
    $res =& $__db->execute ( $sth , array ( $userInput1 , $userInput2 ) ) ;

    it should be done more like

    $sth = $__db->prepare ( "select * from myData where cond1 = ?userInput1 and cond2 = ?userInput1 " ) ;
    $res =& $__db->execute ( $sth , array ( "userInput1" => $userInput1 , "userInput2" => $userInput2 ) ) ;

    There is no special need to input more -- if you want, use the first method just pass non associative array, and library should know to handle param binding in old way -- but for any larger querry, with dozens of parameters, this will be a big boon in readab

  4. Re:Don't overlook popularity on File Systems Best Suited for Archival Storage? · · Score: 1
    At work we used rar to compress nightly all of the source code, inluding each devs own copy. We had 2gb of source code compressed down to 100megs, all because rar has much better compression methods, and as another posted, a better file ordering mechanisms.

    The command we used:

    rar a -m5 -s -mc63:128t -mdg -mcc -en -tsm0 -tsa0 -tsc0 -ri1:10 ${todaysDate}.rar "*"

    -m5 == maximum compression
    -s == solid archive, the real saver for multiple copies of same file
    -mc63:128t == text compression (PPM algorithm), the real saver for source files
    -mcc == image compression (our source also had images)
    -mdg == increase the dictionary size to max
    -en == dont include end of archive
    -ts[mac]0 == dont include file modiciation/activity/creation dates
    -ri1:10 == be nice to the system, sleep 10ms for every file operation

    There are other commands we could have used, storing ntfs file properties / permissions / compression bits / junctions, but we didnt need a backup for system recovery sense, but as belts and suspenders. Afterall, there was source control as well.

    The only other compression software that can rival this power is 7z, but I have not used this alot.

    The only other compression software that can rival compression is the paq6, unfortunatelly its still experimental so have not used alot of it.



    cheers

  5. Re:Fallout on Games Can Make Us Cry · · Score: 1

    Septerra Core I tried playing but could not stand the fighting system... Not the recharging turn real time based system, but stupid things...

    Picture this, (first stage) there is a wolf scouting an area. Its all real time, I sneak past it, but eventually it notices me. So we are to fight, and it becomes a gentelmen's duel, I walk to my predefined position to fight, so does the wolf, we pass each other, say hello, arrive at the right spot and then start a fight. It felt like playing a game designed in middle 80s.

    Someone tried telling me that this is common in rpg games in the console world.

    out of curiousity, if I may, what was with Fallout that you did not like?

  6. Fallout on Games Can Make Us Cry · · Score: 1, Redundant

    Point me a person who has played Fallout and did not have emotional impact at the end of the game. Its truly one of the better RPGs developed.

  7. Re:Learning A Language in an Afternoon on Computer Science Curriculum in College · · Score: 1

    -- Language Syntax/Grammar vs Libraries --
    You are talking here about specific library usage. What about collations of the strings? or is this some cripple string that is ASCII only?

    When you talk about language learning, what do you mean? To some (?most?) people 'language learning in an weekend' refers to learning the syntax/grammar of the language. Granted, this does not make someone a proficient coder, but, on the other hand, it is enough to join a programming team, read code, fix code, modify code. Within a week or two programmer gets to have a feel of the language libraries and the project he is working on.

    Look at C++, what does it mean to know C++? STL? Boost? Glib? or are we talking about graphical C++ programming, g--/qt/wx/tk/elib?

    Actually larger projects end up with own libraries that one must learn on top of the language anyways. Often larger projects have so many own libraries that half of the language libraries are ignored. Whats the point of learning language libraries when you need to know project libraries with bigger urgency and need?

    -- Programmers and Proper Coding --
    A new programmer should read the code he is to work on and follow the programming style used within the project. That is unless he is 100% sure that the rest of the team is wrong, at which time, he should only do own programming style when is sure that all of the project will also change its style.

    -- Programmers and Readability --
    A new programmer should write well understood code, I dont know C#, but some languages have constants to avoid magic values:
          string1.Compare(string2, string.CompareCaseInsensitive) == 0

    -- Programmers and Efficiency --
    One should look into time of a coder and time won by efficiency vs the time lost to maintainance. Usually its cheaper to buy extra hardware than to worry about optimizations, There are very few places in the whild where efficiency of code is unnatainable with extra hardware (either red tape business bureaucratic rules, or hard real time constrains).

    ofcourse, the rule for optimizations is 'dont', the rule for master programmers for optimizations is 'not yet'.

    Adam Piotr Zochowski

  8. Ontario Highschool Fun on Introduction to Competitive Programming · · Score: 1

    In Ontario (Canadian province in case you are wondering) there is highschool competition organized by the ECOO (Educational Computing Organization of Ontario) http://www.ecoo.org/ecoocs/Contests.html. when I took part in them there was no age restriction, I took part in all of them once I knew of their existance.

    Its generally is in teams of 4 and you are provided a set of 4 problems and have 2 hours to solve them. 4 people 4 problems, does not sound bad, until you notice you have 30mins to code and test. There are bonus points for handing in sollutions earlier (the faster you do, the better bonus), also, there is bonus for flawless first attempt.

    As per the language, I dont think there is a restriction. First year we wrote in QuickBasic (closest to my c64 basic), the other years we wrote in Turing (another Ontario specific thing, Turing is a language developed for Ontario Highschools by HoltSoft / University of Toronto http://www.holtsoft.com/turing/).

    Choose a language you know well and dont have alot of trouble getting to work with. One year a team showed up with their own pc (requirement at higher levels), but could not work with their tools.

    Some questions are simple, here are some I remember:
    1) draw a star provided you know the number of spikes
    2) game of life
    3) kernel / process simulation

    It is assumed you know what a highschool student should know, hence trigonometry is not explained, but for game of life or the kernel/process simulation the problem was explained in detail.

    One question we were given (third stage) was:
    1) here is a formula for volume of tetrahedron
    2) here are 4 points, calculate the volume
    3) here is another point, tell us if this point lies within the tetrahedron
    we were at a loss, how were we to know if the point lies or not? My friend who had this problem (I had kernel/process simulation, but was writting way too verbose code that amounted to nothing) knew that answer lies within the question, and tried to get us to help him, but 4 people 4 problems, everyone had own thing to do.

    So what we did? cheated... ;D ... we calculated the volume, and then just always said 'yes' that the 5th point was within. We got volume properly on all counts and 3 of the points properly. The Judge told us that our neighbouring team coded 'no' for the answer, hence got only 2 of the points right and was contemplating weather to rerun the test (judges have alternative data sets for second runs) and hope if they could get better results ;D.

    For Canadian Highschoolers there is another contest being run, this time by one of the Worlds best computer universities, the University of Waterloo (watcom = Waterloo Compilers, Sybase and RIM are also Waterloo graduate startups). Its called Canadian Computing Competition http://cemc.uwaterloo.ca/ccc/index.shtml. Unfortunatelly I never took part in this as no one at my school knew of it, and when I became informed it was too late.

    Finally, for university studs there is the ACM competition, the mother of all computer competitions. Checkout the problems archive, if you solve one question a day you will have years of fun http://www.inf.bme.hu/contests/tasks/

    Both in my highschool and my university people who were interested in competition banded together and ran clubs that were mentored by knowledgable people who were out to help us.

    In highschool by last grade we coded basic stuff in ASM, C, C++, Watcom Basic, QBasic, Watcom Pascal, Borland/Turbo Pascal, Turing, OOTuring. I with my friend for class project did simple statistics based AI in bp. Heck, we went through all sorting methods. I had nothing to do at University for first 2 years, computer programming wise.

    ahh, those were the times...

  9. Re:Not OSS but free on Open Source Collaborative and Presentation Tools? · · Score: 2, Interesting

    not free, needs windows
    not real time collaborative, netmeeting can have only one cursor in a file
    not real time collaborative, wiki wont let you see real time as someone else is typing

  10. Re:Oops, forgot a doosy on Miyamoto Says Today's Games Too Long · · Score: 1

    dark fury nicely ties pitch black with the main chronicles of riddick.

    We learn why Toombs is so keen on getting Riddick
    We learn why Riddick separated and went to hidding

    etc, etc... and it has real voice acting, although I do agree, as
    an anime the graphics artists tried to be artists and some of the
    shots come out looking broken and bad.

  11. Re:Oops, forgot a doosy on Miyamoto Says Today's Games Too Long · · Score: 1

    both movies? I though there are three, atleast I seen three of them:

    Chronicles of Riddick : Pitch Black ( http://imdb.com/title/tt0134847/ )
    Chronicles of Riddick : Dark Fury ( http://imdb.com/title/tt0407658/ )
    Chronicles of Riddick : The Chronicles( http://imdb.com/title/tt0296572/ )

  12. Re:I dare disagree. on Miyamoto Says Today's Games Too Long · · Score: 1

    how about them decent RPGs (Baldur's Gate, Kotor, Fallout, Planescape Torment, Arcanum, Ice Wind Dale) or decent RTS (where single level can take you hours to pass)??

  13. Re:Why must... on First look at new Battlestar Galactica Episodes · · Score: 1
    ... killed by SciFi : Sliders, SG-1, Andromeda, etc....


    Fox tried to kill Sliders, saved by SciFi http://www.sliders.net/
    StarGate : SG1 - still running http://www.tvtome.com/StargateSG1/
    UPN tried to kill Andromeda saved by sci fi

    three out of three wrong...

    --
    /apz, Wait for that wisest of all counselors, Time. -- Pericles
  14. Re:Once again: Bind CAPSLOCK to Control on Poor Man's Kinesis Keyboard: The K'nexis Keyboard · · Score: 1

    real people use a low level keyboard rewriter tool from
    http://www.sysinternals.com/ntw2k/source/ctrl2cap. shtml

    its from sys internals, the best windows hackers out there,
    same people who brought junction with source for win2k+ ntfs,
    reg/file mon, process explorer. On top it comes with source!

    --
    /apz, Avert misunderstanding by calm, poise, and balance.

  15. Re:Such a sad choice of editor... on Poor Man's Kinesis Keyboard: The K'nexis Keyboard · · Score: 1

    most people I know press alt with thumb, afterall, its so close to space, and there is two of them, press alt with one hand, the needed key with the other, hence alt-f is right-alt with thumb and f... vice versa, alt-o, left alt with thumb and o...

    also, when it comes to the colon or brackets I have found it simpler to just move my hand a row, press shift with right hand (pinky and the one next to it) and press colon or brackets with indexing or the middle finger.

    I dont know if this is most efficient, propably not, but I have yet to have a problem due to key presses. Now, sitting position, chair, desk, a combination of that gave me bad wrist pains...

    --
    /apz, typying more online than speaking outloud in the real world... ;D

  16. Re:Lynx is safe on There Is No Safe Web Browser · · Score: 1

    there is also a browser called 'links' which is also vt100, but has rudinamentry support for javascript and tables and frames.

    are there any other ones besides lynx and links?

  17. Re:KISS on Beyond Relational Databases · · Score: 1
    you can't have where some_function(c)=value and expect the DB to use the index on c


    just to nit pick, but some sql let you do this, kinda.

    Add a new column where the value is computed. Its something along the lines of:

    alter table [table] add new_column_name as someFunction(c);

    Now add index on that column. The trick is that the function has to be deterministic, meaning, work in a predictable fashion such that sql knows for 100% all the conditions when the result of someFunction would change, and only update index when any of such conditions is met.

    If you cannot add index then your function is not predictable/deterministic and the function is called everytime you read a row, not something I would recommend.

    Besides having index on a function you can also achieve indexes over aggregates with use of materialized views. Such index will be reused whenever possible even when materialized view is not directly refered to.

    --
    /apz, sql is god, its that all implementations suck
  18. Re:Research? on Linux Friendly One-Time Credit Card Providers? · · Score: 1


    I do not require it to be open source, I see I should have not put
    that into the discussion since it was a stupid digression that only
    derailed the main problem. Flash is only x86 Linux. Period.

    also, I did not mention GPL, also, configure/make is the standard BSD
    way as well IIRC. Finally, if there were Flash for xBSD, you too would
    be dissapointed if you could not get your flash to run on your ultra5
    sparc, or any other box, except the x86.

    --
    /apz, Blessed are the young, for they shall inherit the national debt.

  19. Re:Research? on Linux Friendly One-Time Credit Card Providers? · · Score: 1


    no, I dont care for open source, if it only would work on all major
    architectures. I do not ask for c64 linux support of flash.

    maybe my snide remark for the configure/make was unwarrented, I dunno
    but I really dislike when people say linux supported when they only
    mean x86 linux while ignore all the other architectures. Is it really
    that hard for commercial entities to say 'x86 Linux' supported?

    --
    /apz, Honk if you are against noise pollution!


  20. Re:Linux friendly? on Linux Friendly One-Time Credit Card Providers? · · Score: 1


    Download the plugin? I will gladly run a plugin that would work
    on the Linuxes I touch : ultraSparc/Alpha/Mips/PowerPPC.

    --
    /apz, ahem, Linux != x86

  21. Re:Research? on Linux Friendly One-Time Credit Card Providers? · · Score: 1


    Where do I select my cpu? or does this one download work on both sparc/powerppc?
    It does not look like the usual linux friendly configure/make/make install

    If there were a Linux friendly test, this would not pass...

    --
    /apz, remember kids, Linux != x86

  22. Re:Dont forget about Poland on IBM to Lose 13,000 Jobs · · Score: 1


    Splab (574204) on 2005-05-05 06:29
    \ \ I know from good sources that the reason why Motorola is moving to Poland is
    \ \ the people there have good education - but unlike India and China they have
    \ \ been raised to make decisions and follow through.


    I dont know what are your 'good sources' but this whole things sounds overtly wierd

    mboverload (657893) on 2005-05-05 07:05
    \ What does that mean? I'm sure Indians are probably just as capable of deciding
    \ something as you.


    I can think of one myth he might have meant:
    in asia everyone learns by memorization, they remember all known sollutions, but get
    stuck trying to find a new one to a new problem. In Asia people are automatons.

    but it makes no sence with the 'follow through'. And if he were to imply the lack of
    work ethics in asia then he is badly mistaken. I have nothing but admirations to the
    Chinese and Indian, and would wish people elsewhere would be just as determined.

    --
    /apz, Life is a game. Money is how we keep score. -- Ted Turner

  23. Re:Dont forget about Poland on IBM to Lose 13,000 Jobs · · Score: 0, Offtopic


    \ \ just as many drunks but much cheaper
    \ Having drunks drink cheaper booze is not a good thing.

    true true, I am always saddened when I see people drink 'denaturat', or the drunks
    who piss on everything, even historical buildings, just because taking extra steps
    to a restroom is too much.
    denaturat : http://en.wikipedia.org/wiki/Denatured_alcohol

    what I was alluding to is that there are drunks everywhere, Germany, Ireland,
    etc, so Poland aint too bad. Sure some might drink vodka in glasses instead
    of shots, but those are freaks.


    \ \ lots of beautifull clean land
    \ Didn't you mention Cracow in your post?

    just throw a stone any way and it will land on a clean land... Sure Metropolities
    are not too clean, but such is the case with any city, and definitelly Cracow is
    not the worst. But we have beautifull high mountains Tatry, the forested mountains
    in Bieszczady, the 1000 lakes in Mazury. Heck, Mazury is referred to as 'the green
    lungs' for a reason.

    Poland has everything in moderation. Its not raining non stop like it is in England,
    its hot enough on summer days, but not so hot as in mediterranean countries where you
    need sciestas. Winters are not as bad as scandinavic winters. And Poland is not
    overpopulated like Netherlands. Poland does not have problems with influx of
    immigrants, problems that are well appearent in France or Germany and Holland. Poland
    is also a very good link to other countries of slavik descent such asRussia / Ukraine
    Lithuania / Belarus / Czech / Slovakia / Bulgaria / Croatia / Yugoslavia ... etc)


    \ The only benefit Poland has is being pretty cheap, but nowhere as cheap as India

    Poland is cheap, but not that cheap, true. But also poland is in the central Europe,
    you only get 1hr time difference with England, much easier to coordinate work. Poland
    also has been much closer to europe, there is less chance for breaking local
    Savoir-faire customs. The less faux-pas/gaffes in a meeting the better.


    \ On the other hand, we are world leaders where it comes to bureaucracy, stupid laws
    \ and corruption.

    true, Poland does not have a transparent goverment, and there are many red tapes one
    needs to clear, but so is the case when dealing with Chinese (not sure about Indian,
    but possibly too). Have a chinese/indian company break a contract with you, see
    how well you fare out trying to hold them in their country to the contract they
    signed with you.

    I agree, saying that Poland is not as corrupt as 'point finger anywhere eastward' is
    not necessarilly a plus.



    \ Like every major company that moved its manufacturing into Poland has either
    \ already left or is contemplating leaving. Low labor costs are not everything.

    actually, its all about low costs, but not just labour. Factor in the costs of
    corruption, costs of educating, costs of opening up factories, costs of operation.
    But its all about costs, sure labour costs offset alot, but not everything.Corruption
    of the goverment adds to the costs (could also be considered a perk, but its a
    dangerous road to partake)

    Look at Ukraine, they got lower labour costs than many countries but due to their
    corruption and instability they are not flooded with work offers... yet. This could
    be changing soon.


    \ I'm speaking mostly about automobile industry here -- but when it comes to
    \ assembling PCs, we got a case when a company had to export their wares to the
    \ Czech republic, "buy" them from itself and import them back -- all to avoid
    \ a certain law idiocy.

    there are many wierd law idiocies that one has to avoid, but such is the case with
    many countries.

    In Canada its cheaper to buy a broken car and have a mechanic fix it for you, than to
    have the same mechanic buy

  24. Dont forget about Poland on IBM to Lose 13,000 Jobs · · Score: 5, Interesting


    IBM is expanding in Poland, hiring almost 200 people in Cracow alone, and so are
    many other big name companies like Motorolla, KPMG, Lufthansa, 3M, Phillips:

    http://miasta.gazeta.pl/krakow/1,35798,2689839.htm l

    everyone in europe is moving to Poland, its as nice as Ireland, just as many drunks
    but much cheaper, people are educated, and lots of beautifull clean land.

    --
    /apz, Don't kid yourself. Little is relevant, and nothing lasts forever.

  25. Re:Already done on Finnish Firm Claims Fake P2P Hash Technology · · Score: 1


    except amule, or ed2k network to be precise as it accounts for
    emule/amule/edonkey/kademelia/overnet/sharaza , all rely on md4
    hashes in cojunction with file sizes to identify uniqly files.

    Sure, md4 is not considered safe, but still not that easy to fake.
    In other words, NSA or super computers can do it, but it would
    be a high cost to do so for each britney song out there.

    Furthermore, ed2k networks use additional hashes for each
    file 'part'. I am not sure if these file parts are later built
    into TigerTree hashes or not, but obviously this is a hurdle.

    If anything this is mostly an attack on Kaazzaa which employs
    own hashing method dubbed : 'sig2dat'

    --
    /apz, Nuclear war can ruin your whole compile - Karl Lehenbauer