?

Log in

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

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

[ << Previous 20 ]
Tuesday, December 31st, 2013
12:41 pm
Kostamus сайт объявлений г.Костомукша
Kostamus сайт объявлений г.Костомукша http://kostam.us
Monday, August 13th, 2012
7:05 am
Removing duplicated web parts after page layouts feature reactivation

using System;using System.Collections.Generic;using System.Linq;using System.Text;using Microsoft.SharePoint;using Microsoft.SharePoint.WebPartPages;using System.Web.UI.WebControls.WebParts;using System.Xml;using System.Security.Cryptography;using System.IO;namespace RemoveDuplicatedLayoutsWebParts{        class Program        {                static void Main(string[] args)                {                        using (SPSite site = new SPSite(args[0]))                        {                                SPList list = site.GetCatalog(SPListTemplateType.MasterPageCatalog);                                SPListItemCollection items = list.Items;                                // find the right Page Layout                                foreach (SPListItem item in items)                                {                                        List<string> webParts = new List<string>();                                        if (item.File.ServerRelativeUrl.Contains("Cargotec.CMS.PageLayouts") && !item.File.ServerRelativeUrl.EndsWith("txt"))                                        {                                                try                                                {                                                        Console.WriteLine("Proceed: " + item.File.ServerRelativeUrl);                                                        var previousWps = new List<String>();                                                        SPFile file = item.File;                                                        if (file.CheckOutType == SPFile.SPCheckOutType.None) file.CheckOut();                                                        // get the Web Part Manager for the Page Layout                                                        SPLimitedWebPartManager wpm = file.GetLimitedWebPartManager(PersonalizationScope.Shared);                                                        foreach (System.Web.UI.WebControls.WebParts.WebPart wp in wpm.WebParts.Cast<System.Web.UI.WebControls.WebParts.WebPart>().ToList())                                                        {                                                                Console.WriteLine("Checking web part: " + wp.Title);                                                                wp.ExportMode = WebPartExportMode.All;                                                                var xml = GetXml(wp, wpm);                                                                //Console.WriteLine("-------------------------------------------");                                                                //Console.WriteLine(xml);                                                                //Console.WriteLine("-------------------------------------------");                                                                if (previousWps.Contains(xml))                                                                {                                                                        Console.WriteLine("Deleting web part: " + wp.Title);                                                                        wpm.DeleteWebPart(wp);                                                                }                                                                else previousWps.Add(xml);                                                        }                                                        file.CheckIn("removed duplicates");                                                        file.Publish("removed duplicates");                                                }                                                catch (Exception ex)                                                {                                                        Console.WriteLine(ex.Message);                                                }                                        }                                }                        }                        Console.WriteLine("Finished");                        Console.ReadKey();                }                static bool Contains(List<System.Web.UI.WebControls.WebParts.WebPart> wps, System.Web.UI.WebControls.WebParts.WebPart wp, SPLimitedWebPartManager wpm)                {                        foreach (var wpOld in wps)                        {                                if (GetXml(wp, wpm) == GetXml(wpOld, wpm)) return true;                        }                        return false;                }                static string dllLink = " <Assembly>Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>" + System.Environment.NewLine;                static string dllLink2 = "<TypeName>Microsoft.SharePoint.WebPartPages.ContentEditorWebPart</TypeName>" + System.Environment.NewLine;                static public string GetXml(System.Web.UI.WebControls.WebParts.WebPart wp, SPLimitedWebPartManager wpm)                {                        using (var sw = new StringWriter()) {                                using (var xw = new XmlTextWriter(sw))                                {                                // Build Xml with xw.                                        wpm.ExportWebPart(wp, xw);                                        xw.Flush();                                }                        return sw.ToString().Replace(dllLink, "").Replace(dllLink2, "");                        }                }        }}

Wednesday, July 4th, 2012
12:07 pm
Маленькие заметки.

Привет.

Выдался свободный вечерок, решил порукоблудствовать с клавиатурой.

В последнее время стал много спать. Ложусь в 11 с аудиокнижкой и засыпаю к 12 ти.

Никакого компьютера и недосыпа. Крайне интересные ощущения. Мозг все время чистый как будто пропылесошенный.

На работе много работаю с индусским кодом и это опять подвигло мою жизнь от динамики к статике. Я не представляю, что было бы, если бы все было на питоне. Проект было бы не возможно рефакторить и изменять. А баги ловили исключительно в продакшн. Да и перечитываю Вирта вечерами, так опять пришел ко мнению, что язык должен быть близок к железу, а на нем надо делать предметно ориентированный UI и/или DSL. А большинство языков типо Питона сейчас являются этакими DSL для программирования. Вообще много мыслей по этому поводу, но ракрывать некогда.

После просмотра сессий про GO с Google IO и начав про него думать внезапно осознал, что все это время, в своем доморощенном проекте который изначально был запрототипирован на GO, пытался повторить горутины на питоне с помощью джоб менеджеров, субпроцессов и т.п. Что прикольно, я даже начал писать свой шедулер..И после 2х месяцев мой проект так и застрял и не смог повторить того что на go я написал за 2 недели.

Из интересных языков типа кложа и хаскель, осознал что более их изучать не хочу так как вместо программинга трачу время на изучение, да и лень к томуже.

Написав немного кода на голом С увидел что света в конце тоннеля нет и что хеадер файлы и прочий антиквариат меня загонит в могилу.

Скоро отпуск и думаю переведу весь хоум программинг на GO. Ибо программирование на статике, при помощи интерфейсов без таксономий ооп с простым подходом к конкарренси это все мое.

Вывод: спите больше.

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/ Устанавливаем джангу.

оргазмируем

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.]

[ << Previous 20 ]
About LiveJournal.com