Wednesday, January 01, 2014

Моята библиотека и Amazon Kindle

След като се мъчих известно време да си свалям книги и да ги качвам през Calibre реших, че трябва нещо да бъде направено за да мога да си свалям книгите директно от четеца, все пак браузъра е доста добър.
Във форума на читанка намерих нещо което би работило, то беше леко неудобно, не можеш да търсиш и интерфейса е друг. Все пак целта ми бе да имам вариант на читанка където да си свалям книгите в mobi.
Така реших да направя простичък скрипт и да го сложа на хостинга на фирмата на баща ми.

Ето тук в github пускам сорса. https://github.com/jovchev/chitanka-mobi

В момента е хостнато на http://bb.bulexpo-bg.com

Friday, July 17, 2009

Some post

Thursday, March 12, 2009

Planing a trip to Sicily

We, me and my girlfriend, have decided to go to Italy and spend there the beginning of May.
There were quite a few plans for the last week:
  1. Fly to Naples and have all the vacation around Naples, see the Vesuvius, Pompeii, Capri and just take it easy.
  2. Fly one way to Rome, take the train to Naples spend 2 days there, then take a ship overnight to Palermo, spend the rest of the time traveling around Sicily and come back with one way from Palermo.
  3. Fly to Palermo and spend all the time traveling around Sicily. I saw a blog entry by Jeff Berk. Thanks Jeff.
Well this was the initial plan yesterday we have agreed on the last choise. Money wise it would be the same as 1 and 2, but we can concentrate on one area and take it more easy.

No we are trying to get nice hotels and places and organize the trip.

I have already found the rent a car within our budget.

We have started looking for a hotels and where is possible to stay.

Labels: , ,

Tuesday, July 08, 2008

ItemTemplate when in WebControl or WebPart

I have been working on a project to build webparts for MOSS and some of them are using Repeater controls.

Well when using repeaters in normal life, like in ASPX or ASCX pages, you define the ItemTemplate and other template parts directly in the ASPX or ASCX, but when you are creating Web Part or Web Control, then you have to do more or less everything in CreateChildControls.

Well I have tried for the Repeater to use custom class that implements ITemplate and then add attach this one to the Repeater.ItemTemplate, well this work at first, but then I had the next situation, I needed something like this:

<asp:Repeater onItemDataBound="">
<ItemTemplate>
<asp:LinkButton onCommand="btnOnCommand" ID="btn"/>
</ItemTemplate>
</asp:Repeater>

Then get the button object in ItemDataBound, attach something in the CommandArgument. Then handle the click. Well this did not work well when I had the separate class for the ItemTemplate.

I had to come with better solution, well what I did, was I created one website project with VS and precompiled it so that it is not updateable. Then used the one of the greatest tools for .NET development Reflector.NET and disassembled the compiled code.

Here it is what I have found, how it is done and how it should be done:



repeater.ItemTemplate = new CompiledTemplateBuilder(
new BuildTemplateMethod(this.bulildItemTemplate));

private void buildItemTemplate(Control __ctrl)
{
IParserAccessor accessor = __ctrl;
LinkButton button = this.buildButton();
accessor.AddParsedSubObject(button);
}
private LinkButton buildButton()
{
LinkButton button = new LinkButton();
button.TemplateControl = this;
button.ApplyStyleSheetSkin(this);
button.ID = "btn";
button.Text = "text";
button.Click += new EventHandler(this.btn_click);
return button;
}

I have found the CompiledTemplateBuilder extremely useful class this was really great solution.

Labels: , , ,

Thursday, May 22, 2008

My CRM problems when importing entities

As I mentioned in the previous post I had problems with the CRM after importing entities. Now I have found the problem, the entity in question had Relation to custom entity in the other CRM that I did not include in the export package. This caused the problem that the attribute from the relation was not found and all the troubles.

So when you export the entities from MS CRM always export all related entities, but at the import phase import only those what you need.

Labels: , ,

MS CRM 4.0 prepare for diagnostics and debugging

I am working on project where we are making quite a few integrations to the CRM. And yesterday I got into a trouble.

A colleague of mine has created on his development machine few new entities. I exported the customizations and then imported them in my CRM development, and here is started. One of the entities was not showing the Icon, I couldn't open the new form, I couldn't do anything with that entity. I have tried to delete the customization and again nobody. Like a friend said "A BIIIG PROBLEM".

Here is how I have solved it.

  1. Turned on the development error in the web.config.

    <appSettings>

    <add key="DevErrors" value="On"/>

  2. Turned on the tracing http://support.microsoft.com/kb/907490
  3. Then it seems that I had to recreate two attributes that were added and then deleted, but somehow the CRM new about them even when the entities were exported.

So good luck to you too when you are looking for errors with the CRM.

Labels: , , ,

WCF web serivce host and polymorphism

Well I have been working on the project with WCF web service with some polymorphism to make it extensible.
So here it is the situation:
Projects
- Library project - contains few interfaces and the base classes for the entities that are exposed so let's say that there we have
[IDataContract]
public abstract class Entity
- WCF web service project - contains interface for the web service and the actual web service
[IServiceContract]
public interface IMyService
{
public Entity GetEntity(Guid ID);
}

The service itself loads from the database what type of Entity to instantiate and does that using Reflection
- Email project - this is the first project that references the Library project and inherits from the Entity class.
public EmailEntity:Entity

so everything worked just fine when using the development server, but the troubles began when I decided to host the web service in IIS 6.

I have made the svc file, the correct web.config, and I got WSDL, created client application, and when I have tried to call GetEntity ops I got exception, kind a strange one.
I have used the Object Browser in VS to check what is wrong, and here it was - there was no EmailEntity type. Well this was normal, the web service did not know anything about that type at the compilation. I have started to dig and here is what I have found.
If you use KnownType attribute in the code then you can inform the web service that the EmailEntity is avaliable, but in the code....
So looked a bit more and found

<system.runtime.serialization>

<dataContractSerializer>

<declaredTypes>

<add ......

    <knownType

type="Email.EmailEntity,Email,Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />

</add>

</declaredTypes>

</dataContractSerializer>

</system.runtime.serialization>

This was the way to expose the type just in the configuration.

Labels: , , ,

Sunday, November 19, 2006

Test for a parent

We have had really nice discussion yesterday. It was about how to protect the children from being not taken enough care.

Today if you want to drive a car you need a driving license. If you want to get a job you need a Masters degree. But if you want to become a parent you need nothing, just make the baby wait until it is born, and then what?

This question "Then what?" occurs every day in front of every parent from time to time. One gets fired , one gets moved to work in another city, one gets sick, and "Then what?". This is a question that some of us ask them self, what to do with my child, how to explain to him/her that he/she must leave all his friends, or that we can't have the usual vacation or ...

Kids need to have training and to be prepared to be a parent. Now in schools there are some sort of lessons about that, but they are in the last grades, at the time when some of their classmates already have babies.

I think that this parent lessons must start when the children are about 10 years old, and they have to be graded, and they have to take tests on the matter, and this must be mandatory for everybody, like a math, but math starts from first grade and sometimes is over in 8 grade. This lessons should start in the 5 grade and last until the end of the school.

And there is even more. On basis how well one did on that parenting tests, they are supervised when they have a baby. "WOW privacy, right to have a baby". There is no such right like on to have a baby. This is not stated anywhere. Some people take this just lets bring another member to this society, but they don't take or realize the responsibility that takes to grow this new member is a good person, to protect him, to take care of him.

So if someone fails the parenting test, they still may have a baby but the society must supervise them.
Someone doesn't want to take the test well then, lets install cameras and microphones in theirs homes, limit their movement with some type of parole and put them on probation and in 1-2-3 years take parts of their limited freedom, and at the end lets say after 3 years grant them the right "Be a parent".
For the people that have successfully taken the test just grant them that right after the test.

In this way we can prevent some of the child suffering at least in the developed countries.

Sunday, August 13, 2006

Hot spot in Budapest

I am writing this from Budapest Airport Terminal 1, this is a terminal for budget airlines.
I have to wait few hours until my next flight and there is no enough time to go to the city. So I have decided to test for hot spots.

And surprise there were two of them. One is T-Mobile, they like usual want money and try to charge big time, and the second is Pannon hot spot. Great one quite fast speed, there is not charge for using it. I successfully made few calls by Skype and checked in the changes what I have made in the plane on the project that I am working on. The access is just wonderful, no any firewall, proxy's and other shits like this.