House for rent in Saigon

Nhà trống nguyên căn 1 trệt 3 lầu. 4 phòng ngủ, 3WC.
Diện tích sàn 68m2 (4×17). DTSD 260m2.
Địa chỉ 17/6 Mê Linh, P.8, Q. Bình Thạnh.

House for rent in Ho Chi Minh city, 4 floors, 260sqm, 4 bedroom, 3 bathroom, no furniture.
Address 17/6 Me Linh, ward 8, Binh Thanh district, HCMC.

Contact: o9o 2525 1oo.

Me Linh

Advertisements
Posted in Uncategorized | Leave a comment

T-SQL – Avoid deadlock and workaround in SQL Server

>Here are some tips on how to avoid deadlocking on your SQL Server:

  • Ensure the database design is properly normalized.
  • Have the application access server objects in the same order each time.
  • During transactions, don’t allow any user input. Collect it before the transaction begins.
  • Avoid cursors.
  • Keep transactions as short as possible. One way to help accomplish this is to reduce the number of round trips between your application and SQL Server by using stored procedures or keeping transactions with a single batch. Another way of reducing the time a transaction takes to complete is to make sure you are not performing the same reads over and over again. If you do need to read the same data more than once, cache it by storing it in a variable or an array, and then re-reading it from there.
  • Reduce lock time. Try to develop your application so that it grabs locks at the latest possible time, and then releases them at the very earliest time.
  • If appropriate, reduce lock escalation by using the ROWLOCK or PAGLOCK.
  • Consider using the NOLOCK hint to prevent locking if the data being locked is not modified often.
  • If appropriate, use as low of an isolation level as possible for the user connection running the transaction.
  • Consider using bound connections.

However, deadlock still occurs sometimes.So we have to deal with it by re-submit the transaction again. See below sample:

Declare @Count int = 0
Declare @MaxErrorAllow int = 3
While @Count < @MaxErrorAllow
Begin
      Begin try
            Update TableTest Set NAME = ‘test’ where ID = 5
            break
      End try
      Begin Catch
            Set @Count = @Count + 1      
            print ERROR_MESSAGE() + convert(varchar(100),GetDate())
            waitfor delay ’00:00:05′ — Delay 5 second before UPDATE again
      End Catch
End
Posted in database | Leave a comment

Dropbox – Lưu trữ, chia sẻ, đồng bộ hóa thư mục trên nhiều máy tính.

>Ổ đĩa trực tuyến Dropbox – Lưu trữ, chia sẻ, đồng bộ hóa thư mục trên nhiều máy tính.

Đây là 4 ưu điểm để bạn chọn Dropbox làm nơi lưu trữ dữ liệu trực tuyến của mình: Luôn luôn đồng bộ với một thư mục trên máy hoặc trên nhiều máy; tốc độ up/download nhanh, độ an toàn cao (có sao lưu dự phòng ở máy chủ); hỗ trợ cả Windows lẫn Mac OS X và Linux.

Với dịch vụ lưu trữ file trực tuyến mang tên Dropbox, bạn được cung cấp miễn phí 2 GB không gian lưu trữ miễn phí, không bị giới hạn băng thông download, và điều thú vị hơn hết là tất cả các tập tin khi được lưu trữ vào thư mục mang tên My Dropbox trên máy tính cá nhân sẽ được tự động đồng bộ hóa với các máy tính khác có cài đặt sẵn Dropbox. Những điều hấp dẫn mà Dropbox mang đến cho bạn:

– Ngoài 2 GB không gian lưu trữ hoàn toàn miễn phí và không bị giới hạn băng thông download, bạn có thể nâng cấp lên tài khoản có thu phí với dung lượng 50 GB có giá 9,99 USD/tháng hay 99 USD/năm.

– Tất cả mọi thao tác như tạo, chỉnh sửa, xóa… nếu được thực hiện trong thư mục My Dropbox sẽ được tự động được đồng bộ hóa (upload) với máy chủ của dịch vụ và với máy tính khác đang online có cài Dropbox.

– Tốc độ upload nhanh, có thể download từng tập tin hay cả thư mục lưu trữ. – Độ an toàn cao (dữ liệu được mã hóa với thuật toán AES-256 trước khi lưu trữ), ngay cả khi tập tin bị xóa và không còn nằm trên ổ cứng, Dropbox vẫn để dành một bản sao trên máy chủ để đề phòng bất trắc, việc chia sẻ được tiến hành dễ dàng và nhanh chóng.

Link download: http://db.tt/xshDEHH
hoặc https://www.dropbox.com/referrals/NTM4Mjk5MTg5

Xem hướng dẫn

Posted in software_tutorial | Leave a comment

Vượt tường lửa (firewall)

>

Sử dụng các proxy/socks:
Để tìm được các proxy/socks, bạn có thể truy cập vào một số trang proxy miễn phí như http://sockslist.net/ , http://www.checker.freeproxy.ru/checker/last_checked_proxies.php ,
Khi truy cập vào, bạn sẽ nhận được một danh sách các địa chỉ IP và cổng (IP Address:Port) theo định dạng: 123.123.123.123:1234, phía trước dấu hai chấm : là địa chỉ IP, và phía sau là cổng.
Sau khi có địa chỉ rồi, bạn vào thiết lập của trình duyệt như sau:
– Firefox: Tools > Options > Advanced > Networks > Settings > Manual Proxy
Configurations > Socks Host.
– Internet Explorer: Tools > Internet Settings > Connections > Lan Settings >
Use a Proxy Server for you LAN.
– Chrome: Options > Under the Hood > Change Proxy Settings > Connections > Lan
Settings > Use a Proxy Server for you LAN.
– Opera: Tools > Preferences > Advanced > Networks > Proxy Servers.
Sau đó bạn điền địa chỉ IP và port vào, OK để bắt đầu sử dụng.
Sử dụng Opera Tor
OperaTor là trình duyệt dựa trên Opera nhưng có thêm tính năng tự tìm và sử dụng các proxy, nhờ vậy bạn có thể truy cập vào bất cứ trang web bị chặn nào. Khi truy cập, bạn có thể gặp phải ngôn ngữ lạ do Opera dùng proxy của nước đó, bạn kéo trang web xuống để chọn lại tiếng Anh. Tải OperaTor:
Sử dụng Hotspotshield
Hotspot Shield là một chương trình VPN client miễn phí. Nó kết nối máy tính chúng ta với một mạng riêng ảo và các dữ liệu được mã hóa để bảo đảm vấn đề bảo mật. Máy tính sẽ dùng 1 IP của US để kết nối vào mạng với tốc độ không hề thay đổi như không dùng Hotspot Shield.
Trước hết bạn download Hotspot Shield bản mới nhất tại đây: 5.48 Mb
ftp://mydati.com//download/hss-win/HSS-1.37-install-anchorfree-76-conduit.exe
Quá trình cài đặt rất dễ dàng. Nếu có xuất hiện hộp thoại hỏi về cài đặt driver thì bạn chọn Continue Anyway.
Khi cài đặt xong và chạy chương trình, khi icon Hotspot Shield ở thanh taskbar chuyển sang màu xanh thì máy tính của bạn đã được tham gia VPN và có thể truy cập vào facebook.
Nếu icon Hotspot Shield ở thanh taskbar là màu đỏ thì hãy turn on Hotspot Shield bằng cách right click vào icon Hotspot Shield chọn Connect/On.
Posted in configuration, internet | Leave a comment

WCF Bindings needed for HTTPS

>

I just finished writing my first production WCF application, which worked very well until I deployed it to our production environment.  All of a sudden none of the WCF calls would work, and I would get a JavaScript “TestService is not defined” error.  When I look inside the JS service reference (in debug mode), I got the following error:
Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]
So apparently my WCF service registered itself as HTTPS (since it is over SSL), but my binding was only configured for HTTP.  The solution is to define a custom binding inside your Web.Config file and set the security mode to “Transport”.  Then you just need to use the bindingConfiguration property inside your endpoint definition to point to your custom binding.  The entire HTTPS-enabled system.serviceModel section is below:
<system.serviceModel>
<behaviors>    
<endpointBehaviors>
<behavior name="TestServiceAspNetAjaxBehavior">
<enableWebScript />
behavior>
endpointBehaviors>
behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
<services>
<service name="TestService">
<endpoint address="" behaviorConfiguration="TestServiceAspNetAjaxBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="TestService" />
service>
services>
<bindings>
<webHttpBinding>
<binding name="webBinding">
       <security mode="Transport">
       security>
     binding>
webHttpBinding>
bindings>
system.serviceModel>
Hopefully this will help someone who has the same problem.
Posted in .NET, asp.net, configuration, WCF | Leave a comment

Eight Things Your Employees Want From You by Melissa Raffoni

>

I often have to remind the dedicated, smart CEOs I work with that leading takes time and energy. Directing the feelings, attitudes, actions, and behaviors of a team is a big task. Often, I also hear the secrets of these CEOs’ employees, about what truly aggravates them and what they love about their bosses. To keep top executives on track, I’ve created this list of what employees want their leaders to do.
1. Tell me my role, tell me what to do, and give me the rules. Micromanaging? No, it’s called clear direction. Give them parameters so they can work within broad outlines.
2. Discipline my coworker who is out of line. Time and time again, I hear, “I wish my boss would tell Nancy that this is just unacceptable.” Hold people accountable in a way that is fair but makes everyone cognizant of what is and isn’t acceptable.
3. Get me excited. About the company, about the product, about the job, about a project. Just get them excited.
4. Don’t forget to praise me. Motivate employees by leveraging their strengths, not harping on their weaknesses.
5. Don’t scare me. They really don’t need to know about everything that worries you. They respect that you trust them, but you are the boss. And don’t lose your temper at meetings because they didn’t meet your expectations. It’s often not productive. Fairness and consistency are important mainstays.
6. Impress me. Strong leaders impress their staffs in a variety of ways. Yes, some are great examples of management, but others are bold and courageous, and still others are creative and smart. Strong leaders bring strength to an organization by providing a characteristic that others don’t have and the company sorely needs.
7. Give me some autonomy. Give them something interesting to work on. Trust them with opportunity.
8. Set me up to win. Nobody wants to fail. Indecisive leaders who keep people in the wrong roles, set unrealistic goals, keep unproductive team members, or change direction unfairly just frustrate everybody and make people feel defeated.
Your job is to make it practical for people to succeed. When you do this, everybody wins.
Melissa Raffoni
Posted in chicken_soup, English | Leave a comment

Did Your Boss Thank You For Coding Yourself to Death?

>

Programmers love to work long hours! There I said it, c’mon admit it, your job/boss doesn’t make you do it, we do it to ourselves. Alright, I’ll concede, maybe not all programmers love long hours, but surely with the amount of overtime that is prevalent in this industry at least half of us must love it. Right?

I can hear the excuses already. “No, no that’s not it, we just love working with cool tech and don’t want to leave a problem unsolved. It is actually a good thing it’s what makes us awesome!

I say – you’re not seeing the forest for the trees. Here is some perspective, you’re not doing this for yourself, you’re doing it for “the man“. Admittedly he might be a nice man, but you don’t owe him slavish commitment. Here is even more perspective, how often are you actually playing with interesting problems and cool tech and how many times are you churning out code desperately trying to get something delivered and meet some arbitrary deadline that someone has assigned to you? But hey, you’re a business savvy developer, you’re helping the company succeed, your manager has explained the financial situation to you – it has to be done, we’re relying on you. Well, unless that same manager is right there with you, entertaining you with amusing anecdotes at 2 am, his words are worthless.

Let me tell you a story that a friend once told me. It is about a brilliant developer – lets call him John.

John was a superstar, a one in a million programmer. He had an uncanny ability to understand and write code and was 20 times more productive than anyone else. One day the company got a big contract that needed a fast turn-around. The client sent a massive spec document – to everyone’s dismay. John came to the rescue, he took the spec home and noone heard from him for 3 days. When he came back to work, he looked like hell, but he had gone through the whole spec and had an outline of the solution already finished. Except for one bit which was impossible to implement, though the spec said otherwise – even the client didn’t realise this, but John picked it up. Amazing!

When I first heard that story, I was pretty impressed, my first question was, “So, where is this guy now?“. To which my friend replied – “He is dead, too much hard living!“. Too much hard coding would be more like it. Kinda takes the wind out of that story a little bit – John was in his early 30s.

Programmers take a perverse pleasure from sharing death-march war stories. Even when we do it with disgust, it is a disgust tinged with pride – daring our peers to do “better“. But it is a bit like those guys who wear their pants so low you can see ALL of their underwear or the people who take up smoking for the “trendy image“. They and their friends think it’s cool – everybody else thinks it’s stupid.

Making A Bad Situation Worse

I can see the necessity of occasionally putting in some extra effort and burning the midnight oil at work for a day or two. But when “occasionally” turns to “often“, when your boss stops thanking you profusely for your efforts and just treats it as norm, this is when we’re all in trouble. It sets bad expectations, not just for you, for the whole industry. Humans are like dogs, we’re eminently susceptible to positive and negative reinforcement. And this whole industry has been conditioned by years of death-marches to the point where it even rewards this behaviour. Every time we give-in to the long hours argument, we continue to negatively reinforce this trend.

It doesn’t help that we’re herd animals, you only need to get one person and everyone else wants to conform. Guilt comes into the equation – “we can’t leave our mates by themselves to do the hard-yards, we gotta help them“. The more people conform, the more pressure on the rest of the herd to do so until the whole team is chugging coke and eating pizza at midnight. But how do they suck even one person in, where is that famed programmer independence. We’re happy to “stick it to the man” and do whatever we want in school, but as soon as we’re in the workforce all bets are off. It is puzzling.

Interestingly, sometimes these gargantuan efforts aren’t even tracked properly, as it would make the project look bad. So they “cook the books“, as far as the client is concerned everybody is doing 40 hours a week (i.e. they get billed for 40 hours) and the project is coming in on schedule (maybe), never mind the other 40 hours that everyone on the team puts in. OK, maybe they’ll track the real effort in a “second set of books“. Accountants go to jail for these kinds of shenanigans, but our industry expects it – nay almost demands it.

The Sustainable Pace Effort

Most Agile processes talk about sustainable development pace. But, I’ve seen even self-confessed agile teams knuckle under and put in the hours, you know, for the greater good and all. They were still agile though, and don’t you dare say otherwise.

When I think about this stuff I am always reminded of lawyers. You come in as a new lawyer and you put in massive amounts of effort and time, it is the accepted way to get ahead in that industry. No developer wants to be compared to lawyers, but often the situation is similar except you’re not going to get ahead by doing a lot of overtime as a developer (unless you’re working for a big 4 consulting company and then you might as well be a lawyer :)). So, lawyer vs programmer, which one is the chump?

Studies about productivity declines when working more than 40 hours a week surface with disturbing regularity. As a developer your creativity declines, you make more mistakes, you miss existing issue etc., to the point where you’re doing more harm than good. Should I even mention the health concerns when you spend that much time engaged in the same activity (they even had rules about spending too much time at work in the Soviet Union, and those guys were all about putting in the time for the good of the people). What about diet, you can only survive on coke for so long – poor John couldn’t even make it to 40.

Can you tell that I am against long hours and death marches yet :)? Maybe one of these days I’ll tell you how I got my wake-up call, it is an interesting story. Herding cats is easy compared to getting developers to make a concerted effort in the same direction, it is something I both love and hate about our people (programmers) :). But I do wish that once in a while all the smart developers just took a stand to eliminate at least one of the truly crappy and counter-productive trends in our industry. As far as I am concerned, smart programmers don’t like to work long hours and won’t be pressured into it – there is more to life.

Image by Tattooed JJ
Source: skorks.com
Posted in my_life | Leave a comment