You are viewing [info]hodzanassredin's journal

Разное о программированиии и не только Костомукша объявления kastore.ru
 
[Most Recent Entries] [Calendar View] [Friends]

Below are the 20 most recent journal entries recorded in hodzanassredin's LiveJournal:

    [ << Previous 20 ]
    Sunday, February 12th, 2012
    1:18 pm
    Сказ про то как Ходжа Нассредин время добывал.

    Привет.


    Как некоторые знают, в последнее время у меня начались сильные проблемы со временем. В частности, его перестало хватать на написание личных проектов. Тем не менее, продолжая писать код, стал замечать довольно сильные изменения в стиле работы и моем отношении к ней. Итак для примера берем проект, который в данный момент переживает свою 2ю полноценную инкарнацию и наверное 5ю минорную. Суть проекта все таже, изменялись только технологии и в последнее время подход к делу.

    Как же происходил процесс работы когда я имел достаточно времени?

    Постоянно открыт твиттер(до этого были rss фиды). Как следствие переодически открывались статьи и начиналось все что угодно но только не программирование. Я постоянно жил под влиянием серебрянных пуль, прочитаешь статью и чувствуешь, что отстаешь и надо бежать догонять.Проект как правило начинался с долгого выбора на чем же писать: рельсы рельсы, шпалы, шпалы, джанги, питоны, хаскели, ерланги, го, ноде жс и т.д. и т.п. Составлялись майнд мапы и делался тщательный анализ как правило заключавшийся в том чтобы найти причины, почему я должен использовать очередную серебрянную пулю а ля хаскель. И так по каждому пункту от фреймворков до бд.За этим ачинался процесс работы над проектом. Все шло строго сверху-вниз и выливалось в нехилый оверенжениринг. То мне надо ddd, то dddd, то акторы, то mq, то еще что. Архитектура тщательно обдумывалась, отвергалась и
    изменялась. Далее обычно поднимался сервер и настраивался енвайронмент типа для CI и итеративного программирования. Создавался проектана битбакете или ассембле. Выбиралась IDE или очередной крутой текстовый редактор. Наконец мы дошли до разработки. Как правило если проект на c# то создавалась гигантская доменая модель и мильон интерфейсов и т.п. Если же проект на каком-нибудь хаскель или го, nо начиналась ебата по поиску библиотек или написанию своих для инфраструктуры. Тратилось гигантское время на изучение самих текстовых редакторов, языков и т.п. Все это безусловно было полезно с точки зрения образования, но бесполезно с точки зрения достижения целей. В силу того, что все эти действия, описанные выше, съедали кучу времени и на написания кода оставалось черезвычайно мало времени, поэтому сам код писался, через поиск в гугле и копи пастой. Когда, что-то не работало то пытался найти быстрый воркараунд в простонародье именуемый костылем. Каждая проблема сопровождалась легкой депрессией, ведь как правило код писался в свободное от работы время и по сути отнимал отдых. Каждая задержка была серпом по яицам. В конце концов я полностю терял оптимизм и  интерес.

    А теперь рассмотрим текущую ситуацию. В данный момент, у меня с трудом набирается 15 минут свободного времени, по вечерам, на программирование. Первое отличие: я вообще перестал читать информацию из интернет посвященную программированию. Никакого пуша, только поиск по конкретным вопросам. Второе: я перестал отвлекаться, так как нет особого смысла садиться программирвоать 15 минут и параллельно что-либо читать. Вместо этого, я или серфю или пишу код. То есть, все стало раздельно, никакого смешения. Cтал прагматичен в выборе тулов и языков. В данном проекте, я думал над выбором 5 минут.
    Изначальные требования: интерактивность разработки (устал я от компиляций и т.п.) простота, большой код бейс на интеграцию с сайтами рунета аля мейл ру, вк, платежные системы, наличие библиотек для обработки текста. Учитывались и личные предпочтения. Под эти критерии подошел только питон с джангой. Да да, я все его ругаю, но раз за разом возвращаюсь к нему.

    Главное изменение в программировании это разработка снизу вверх. Я теперь стартуя проект, пишу его в IDLE без всяких редакторов и т.п. Начинаю с инфраструктуры, то есть в моем случае работа с различными внешними апи. Я с консоли все пробую, как получилось
    пишу простенький АПИ сохраняю в файл, кидаю в дропбокс. Уже на втором этапе, когда я дохожу до сайта, я беру тектовый редактор, git и начинаю уже интеграцию всего этого кода в общую структуру. Раньше я пытался быстро сделать рабочий прототип и ждать когда на меня посыпятся деньги, то теперь я вообще не читаю стартап шит, и меееедлееенно делаю проект который возможно даже не имеет перспектив. Но зато делаю его хорошо и с наслжадением самим процессом создания. Депрессия исчезла.

    Можно писать еще долго, но я ограничусь краткой суммой: разрабтка снизу вверх, неторопливость, прагматичность, не

    смешивание различных режимов работы.

    Thursday, March 24th, 2011
    3:06 pm
    Как победить все грабли запуска Django 1.3 на windows 7 x64

    1. Ставим python 2.7

    2. Запускаем regedit как администратор.

    3. Копируем все

    из HKEY_LOCAL_MACHINE\SOFTWARE\Python

    в HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python

    4. Удаляем все разделы содержащее кириллические символы в названии из HKEY_CLASSES_ROOT\MIME\Database\Content Type

    5. Устанавливаем PIL-1.1.7.win-amd64-py2.7.‌exe отсюда http://www.lfd.uci.edu/~gohlke/pythonlibs/

    6/ Устанавливаем джангу.

    оргазмируем

    Tuesday, February 8th, 2011
    7:47 am
    cryptocipher install fix

    cabal install cryptocipher
    Resolving dependencies...
    Configuring cryptocipher-0.2.3...
    Preprocessing library cryptocipher-0.2.3...
    Preprocessing executables for cryptocipher-0.2.3...
    Building cryptocipher-0.2.3...
    [1 of 8] Compiling Number.Serialize ( Number/Serialize.hs, dist/build/Number/Serialize.o )
    [2 of 8] Compiling Number.Generate  ( Number/Generate.hs, dist/build/Number/Generate.o )
    [3 of 8] Compiling Number.ModArithmetic ( Number/ModArithmetic.hs, dist/build/Number/ModArithmetic.o )
    [4 of 8] Compiling Crypto.Cipher.DSA ( Crypto/Cipher/DSA.hs, dist/build/Crypto/Cipher/DSA.o )
    [5 of 8] Compiling Crypto.Cipher.RSA ( Crypto/Cipher/RSA.hs, dist/build/Crypto/Cipher/RSA.o )

    Crypto/Cipher/RSA.hs:103:35:
        No instance for (Control.Monad.Error.Class.Error Error)
          arising from a use of `>>=' at Crypto/Cipher/RSA.hs:103:35-56
        Possible fix:
          add an instance declaration for
          (Control.Monad.Error.Class.Error Error)
        In the expression: dp pk c >>= unpadPKCS1
        In the definition of `decrypt':
            decrypt pk c
                      | B.length c /= (private_sz pk) = Left MessageSizeIncorrect
                      | otherwise = dp pk c >>= unpadPKCS1
                      where
                          dp = if private_p pk /= 0 && private_q pk /= 0 then
                                   dpFast
                               else
                                   dpSlow
    cabal: Error: some packages failed to install:
    cryptocipher-0.2.3 failed during the building phase. The exception was:
    ExitFailure 1

    FIX: cabal install mtl

    Monday, February 7th, 2011
    10:53 am
    Saturday, February 5th, 2011
    9:14 am
    Thursday, January 20th, 2011
    12:23 am
    Замена TextMate для Ubuntu в 4 строки

    sudo apt-get install gedit-plugins

    sudo apt-add-repository ppa:ubuntu-on-rails/ppa

    sudo apt-get update

    sudo apt-get install gedit-gmate

     

    Долгое время пытался найти замену TextMate и использовать для работы vim и emacs но к сожалению так и не смог избавится от мысли что копаюсь в антиквариате. Gedit сейчас выступает моей основной ide. 

    Thursday, January 13th, 2011
    8:34 am
    Wednesday, January 12th, 2011
    5:11 am
    Sunday, January 2nd, 2011
    5:35 pm
    Monday, December 27th, 2010
    6:24 am
    Thursday, December 2nd, 2010
    11:09 am
    Tuesday, November 23rd, 2010
    12:18 pm
    Facebook Alternative Diaspora Launches Their Private Alpha With Some Bet Hedging
    MG Siegler

    1 hour ago

    We’ve been tracking the progress of Diaspora, the open-source Facebook alternative, since before the project even started. That’s because the idea got so much buzz on the crowdsourced micro-funding site Kickstarter, that they were able to turn a goal of raising $10,000 in 39 days into $200,000 from 6,500 backers in the same timeframe. But with such high expectations, you have to deliver. And many expressed doubts that the small team of college students could do that.

    After the money came in, the team sequestered themselves for the Summer to work on the project. Despite some hiccups, they were able to unveil the source of the project in September to mixed reviews. Meanwhile, a user-facing alpha launch was promised for October. That came and went, and they pushed the launch to Thanksgiving. Well, we’re two days away from turkey day, and Diaspora has delivered this time.

    As the company notes on their blog, the first batch of private alpha invites are going out today. They note that each week they’ll be adding more people to the test, starting with those who contributed to the service’s funding.

    Says the team:

    We are proud of where Diaspora is right now. In less than five months, we’ve gone from nothing to a great starting point from which the community can keep working. We’ve spent a lot of time thinking about how people can share in a private way, and still do all the things people love to do on social networks. We hope you’ll find it fun to use and a great way to keep in touch with all the people in your life.

    Interestingly enough, it sounds as if Diaspora is heavily predicated on lists, which they call “aspects”. This is interesting because Facebook is going in the opposite direction, as CEO Mark Zuckerberg has made it clear that people on their service don’t want to make lists. In fact, their entire new Groups project is a way to make it so you don’t have to make lists. “We think that aspects are a simple, straightforward, lightweight way to make it really clear who is receiving your posts and who you are receiving posts from,” writes Diaspora.

    But the service is also quick to hedge their bets. “It isn’t perfect, but the best way to improve is to get it into your hands and listen closely to your response,” they note about the aspects idea. They then go on to list five things they know they could do better, including: security, better APIs, better documentation, easier upgrades, and cleaner code. Yeah, that’s quite a few major things.

    Our work is nowhere close to done. To us, that is the best part. There are always more things to improve, more tricks to learn, and more awesome features to add,” they conclude.

    As you can see in the alpha site graphic below, they’re smartly playing towards some of the things people complain about the most with regard to Facebook: choice, ownership, simplicity.

    Monday, November 22nd, 2010
    12:25 am
    Facebook Vies To Become Your Homepage – And Why That’s A Big Deal
    Robin Wauters

    14 hours ago

    It’s a very old trick, and arguably a mighty effective one. Ask people to set your website as their homepage, and it will become their entry point to the Web, the very first thing they’ll see when they open their browser. Venturebeat noticed that Facebook started prompting visitors to set the site as their homepage before the weekend, by means of a bar at the top that actually shows some pictures and names of your Facebook friends.

    Others have reported to see the bar popping up as well, and reader Ryan Merket from Appbistro just checked in to tell us that he’s seen it as well. You can see two other pop-up messages below, and you’ll notice that they differ from the one embedded above.

    From the looks of it, Facebook is A/B testing this with a small subset of users, and trying out a variety of messages and pop-up layouts to figure out which one yields the best results.

    This is undeniably a significant move, particularly when it will roll out to the site’s roughly 500 million active users in full. Keep in mind that Google and other search engines benefit greatly from being a genuine starting point to the rest of the Web, which is why so many people select such services to come up as soon as they open their Web browser.

    Being people’s homepage is good for branding, great for ‘stickiness’ and phenomenal for traffic.

    But for many people, social networking sites are slowly taking over at least part of the role of search engines, which is mainly to retrieve information. When you can tap your entire social graph for answers to your queries, sites like Facebook have the ability to push aside search engines like Google as the first site that springs to mind when people think about surfing the WWW to find information, connect to other people, communicate with friends, and so on.

    I can easily see why more and more people would eventually switch to Facebook as their homepage of choice, and actively prompting them to do so might be just what some Facebook users need to actually configure their browsers to do just that.

    Come to think of it, I’m wondering why Facebook hasn’t been doing this forever.

    Facebook’s traffic is still very much not going anywhere but up, but the social network could still see a massive bump in total pageviews and time spent on the site if they can convince even just a tiny percentage of their total user base to set Facebook.com as their homepage.

    That said, you’ve set TechCrunch as your homepage, right?

    12:23 am
    Facebook Removing Gmail From List Of Third Party Email Providers
    Alexia Tsotsis

    Nov 20, 2010

    Something is up on the Facebook vs. Google data reciprocity front. It looks like Facebook is removing Gmail from the list of third party email providers on  “Find Friends”, whereas we were seeing direct link downloads to Gmail contacts still offered as an option just a couple of days ago.

    It gets stranger. Some new users who sign up with their Gmail accounts can still see the option to add friends from Gmail, but when I tried to import contacts I got the below “Everyone on this contact list is already on Facebook or has already been invited” message. In other words it didn’t work.

    Signing up with a non-Gmail account eliminates the option entirely even though you still have the capability to manually download and upload your contact files. This seems to be the latest development in the ongoing Facebook vs. Google slap fight, even though it’s not exactly clear who slapped whom.

    Here’s our ongoing tally:

    1. Google To Facebook: You Can’t Import Our User Data Without Reciprocity
    2. Data Protectionism Begins In Earnest
    3. Facebook Finds A New Way To Liberate Your Gmail Contact Data
    4. Google’s Response To Facebook’s Response To Google’s Facebook API Ban
    5. Google Gets Feisty, Kicks Data Portability Fight With Facebook Up A Notch
    6. Google No Longer Claims Facebook Will “Trap” Users. Or Do They?

    I’ve contacted both Facebook and Google for more information and will update this post when they respond. For the record, Mark Zuckerberg called Gmail Priority Inbox “pretty cool” onstage at Web 2.0 Summit after Facebook announced their own email product last week.

    Update: Word from Google is that nothing has changed from its side. Atul Arora also points out that the Gmail contact import button is now gone from Facebook property Friendfeed as well.

    Before …

    After.

    Thursday, November 18th, 2010
    1:41 am
    Kinect прикрутили к роботу клево

    Kinect sensor bolted to an iRobot Create, starts looking for trouble

    By Paul Miller posted Nov 17th 2010 9:38PM

    While there have already been a lot of great proof-of-concepts for the Kinect, what we're really excited for are the actual applications that will come from it. On the top of our list? Robots. The Personal Robots Group at MIT has put a battery-powered Kinect sensor on top of the iRobot Create platform, and is beaming the camera and depth sensor data to a remote computer for processing into a 3D map -- which in turn can be used for navigation by the bot. They're also using the data for human recognition, which allows for controlling the bot using natural gestures. Looking to do something similar with your own robot? Well, the ROS folks have a Kinect driver in the works that will presumably allow you to feed all that great Kinect data into ROS's already impressive libraries for machine vision. Tie in the Kinect's multi-array microphones, accelerometer, and tilt motor and you've got a highly aware, semi-anthropomorphic "three-eyed" robot just waiting to happen. We hope it will be friends with us. Video of the ROS experimentation is after the break.

    Monday, November 15th, 2010
    9:35 am
    Benchmarks 2: snap,happstack,yesod,manos,nginx,go http lib.

    all haskell compiled with threaded and run with +RTS -A4M -N4 -qg0 -qb -g1

    tested with httperf --hog --num-conns 1000 --num-calls 1000 --burst-length 20 --port 3000 --rate 1000 --uri=/pong

    snap (from cabal)7038.1 req/s

    happstack (from darcs) 2715.3 req/s

    yesod (from cabal) simple = error

    yesod (from cabal) dev = error

    yesod (from cabal) wai snap = 1322.2 req/s

    manos(mono 2.8) = error

    go = 3693.8 req/s(186 errors)

     

    nginx static = 14993.4 req/s(112 errors timeout)

    snap static = 4701.2 req/s

     

    Friday, November 12th, 2010
    1:30 am
    “Flash Is Great.” — Anonymous Flash Developer
    MG Siegler

    8 hours ago

    I used to think that Android fanboys worked themselves into the biggest tizzy when you suggest their favorite device of the week may not be the absolute bee’s knees. I was wrong. Flash fanboys are much worse. They’re worse not only because they go absolutely ape-shit if you disrespect their platform, but also because at the end of the day at least Android fans have a leg to stand on. At least their object of love is ultimately pretty good and has a bright future. Flash? Yeah…

    Adobe’s CTO paints a rosy picture of the platform. But that’s his job. The reality is what many of us see with our own eyes: Flash is a massive pain point in our day to day computing. If it’s not crashing our browsers left and right, it’s causing our computers to cook our thighs (or worse). If it’s not draining our batteries 33 percent faster, it’s opening gaping security holes.

    Let’s look at just the most recent headlines. Yesterday, Apple released the latest OS X update, 10.6.5. A huge portion of the update was dedicated to security updates. Of those, a full 42 percent were security patches related to Flash.  Should anyone be surprised that Apple has decided to no longer bundle it with OS X?

    Meanwhile, Flash is now fully baked into Google’s Chrome browser. If you read the update notes or bug reports on the various channels, you’ll see that a massive number are related to Flash.

    What about Flash on other devices? It’s the killer feature of the new Samsung Galaxy Tab, right? Wrong. Even the most glowing reviews of the new tablet rip its Flash support.

    Meanwhile, on the smartphone side of things, Adobe just released an update for Flash for Android likely ahead of the 2.3 roll-out. Does it fix any of the performance issues? Nope. I’m using it right now. Playback is still jittery as hell.

    So you’ll forgive me if when Kevin Lynch announces all these great-sounding things about Flash that are just around the corner, I’m highly skeptical. How long have we been promised Flash on mobile devices? 5 years? It’s still not where it needs to be. Hell, it’s not where it needs to be on the desktop.

    The fact of the matter is that if everything was peachy keen in the state of Flash, Adobe wouldn’t have anything to worry about. Apple could go on the offensive against them, but it wouldn’t matter. Nothing would change. But things are changing. And Adobe is scared to death.

    But all of these reports across various sectors must be wrong. Flash is just great. People are screaming about how wonderful it is. It’s a pure coincidence that they all happen to be Flash developers.

    1:16 am
    Exclusive: Samsung 'flagship' phone with Gingerbread and huge display coming in early 2011 (update)

    Exclusive: Samsung 'flagship' phone with Gingerbread and huge display coming in early 2011 (update)

    By Chris Ziegler posted Nov 11th 2010 9:13PM

    Okay, so you're not feeling Samsung's Nexus S. We'd say that's a little premature, but still, we get it. We understand. How about this, then? Is this more to your liking? We've just been tipped with a few morsels on what should become Samsung's flagship Android device early next year -- February, to be specific, suggesting we could see an unveiling at MWC -- and it's looking promising. Different parts of the slide deck describe it as having either a 4.3- or 4.5-inch "sAMOLED2" display, presumably standing for "Super AMOLED 2" and implying that Sammy's made some advancements over the screens we've been seeing on the Galaxy S series this year. It'll naturally have Android Gingerbread and be equipped with an 8 megapixel camera capable of 1080p video capture, 14.4Mbps HSPA, Bluetooth 3.0, a 1.2GHz core of some sort, and 16GB of storage onboard. The deck describes it as having an "ultra sleek design," and judging from the side shot, we'd tend to agree. So who's holding out for this?

    Update: We're confident that the above slide comes from Samsung, but one of the pictures therein is most definitely not of a new Samsung phone -- but rather a VoIP handset by Apiotek from several years ago. Considering the image in question pops up right away in a Google Image search for "ultra slim phone," we're inclined to think Samsung got a little hasty putting together the PowerPoint this time round. [Thanks, Nathan H.]

    Thursday, November 11th, 2010
    3:19 am
    Написал выполнение взаимной рекурсии без рекурсии на c#(trampoline из clojure)

    Вчера мне при попытках разобраться с вложенной рекурсией посоветовали посмотреть на функцию trampoline в clojure. Для лучшего понимания я ее переписал на c#. Определение trampoline в clojure здесь (http://pramode.net/clojure/2010/05/08/clojure-trampoline/).

     

     

    using System;

     

    namespace Trampoline

    {

        class Program

        {

            static void Main()

            {

                //Console.WriteLine(FunA(100000));//stack overflow

                Console.WriteLine(Trampoline(FunAT(100000)));

                Console.ReadLine();

            }

     

            public static long FunA(long n)

            {

                return n == 0 ? 0 : FunB(n - 1);

            }

     

            private static long FunB(long n)

            {

                return n == 0 ? 0 : FunA(n - 1);

            }

     

            public static object FunAT(long n)

            {

                if (n == 0) return 0;

                return new Func<object>(() => FunBT(n - 1));

            }

     

            private static object FunBT(long n)

            {

                if (n == 0) return 0;

                return new Func<object>(() => FunAT(n - 1));

            }

     

            private static long Trampoline(dynamic result)

            {

                while (true)

                {

                    if (result is Func<object>)

                    {

                        result = result.Invoke();

                    }

                    else

                    {

                        return result;

                    }

                }

            }

     

        }

    }

     

    А теперь надо подумать поможет ли мне это с вложенной рекурсией по типу функции Аккермана. 

     

    Wednesday, November 10th, 2010
    4:42 am
    Сравнение Erlang и Clojure в несколько строк.

    Erlang: The Movie  <=> Clojure: The Podcast  :-)

    Erlang распределенный, Clojure нет.

    Агент в ерланг это легковесный поток, над потоками стоит шедулер.

    Агент в кложа это объект и вы асинхронно можете посылать сообщение (функцию) этому объекту. Каждый объект имеет очередь и по очереди обрабатывает сообщения. Не надо путать агентов с потоками. Агент это просто объект и вы можете иметь миллионы в памяти безо всякой нагрузки. Обработка сообщений агентов распределяется по пулу потоков. Шедулера нет.

    Короче говоря если вы посылаете агенту сообщение с бесконечным циклом, то тред в котором он будет выполнятся заблокируется. В ерланг оно понятно таких проблем нет.

[ << Previous 20 ]
About LiveJournal.com