Wednesday

temporary file stream c#

  
public class TempFileStream : FileStream
{
public TempFileStream()
: base(Path.GetTempFileName(), FileMode.Create, FileAccess.ReadWrite, FileShare.Read, 4096, FileOptions.DeleteOnClose) { }
public TempFileStream(FileAccess access)
: base(Path.GetTempFileName(), FileMode.Create, access, FileShare.Read, 4096, FileOptions.DeleteOnClose) { }
public TempFileStream(FileAccess access, FileShare share)
: base(Path.GetTempFileName(), FileMode.Create, access, share, 4096, FileOptions.DeleteOnClose) { }
public TempFileStream(FileAccess access, FileShare share, int bufferSize)
: base(Path.GetTempFileName(), FileMode.Create, access, share, bufferSize, FileOptions.DeleteOnClose) { }
}


Friday

Главное, что я понял

Главное, что я понял — это то, что в человеке заложено огромное количество сил и энергии. Если мы несем ответственность за свою жизнь, то мы эти силы направляем на вполне позитивные, правильные вещи — бизнес, карьера, построение качественной личной жизни. Если же мы предпочитаем пассивное времяпровождение — то нам остается интернет, ТВ, пиво и прочие прелести потребительского образа недожизни. Каждому — свое.

Но силы есть у всех.

Thursday

how to create the perfect blog post

Perfect blog post must include following elements (from 1 to 13):

1.Big catchy header in 30px font size

2.First copy of social links and comments (there are should be two sets one in the beginning of the article and another at the end)

3.Short introduction into problem in big letters 20px
with question but without giving actual response but giving answers on the main questions.
For example :
Almost every time I speak on the topic of [MainTopic], someone asks,
How often do I need to do [MainAction] to build [MainTopic]?
The truth is, my opinion has changed over the years.

4.Short Video - this element is good to hold user on the page for some time
Should be no longer then 3 minutes.


5.Main Text 3 paragraphs 16 pixels font size.

6.Paragraph with link on popular site gizmodo for ex. with title like on the site and target blank

7.Last conclusive paragraph with asking to watch the video and comment
Before you watch the video, take a guess at what you think it is and leave a comment below.
Then watch the video (it's less than three minutes long) and come back and tell me if you were right.


8.Last question 24 px italic what do you think leave comment , etc....
for example:
Question: What do you think could be more important than blogging frequency for building a platform? You can leave a comment by clicking here.

9.Final actions island , gray background island with all link you want user to go
<div style="background-color:#eaeaea; border:1px solid #D5D5D5; font-family:arial,helvetica,sans-serif; font-size:15px; line-height:20px; margin-bottom:20px; margin-top:8px; padding:15px 20px;">
Search on Google, it's fun <a target="_blank" title="Use google" href="http://www.google.com">google</a>.
Also, buy things on amazon <a target="_blank" title="buy at amazon" href="buy at amazon.com">Amazon</a>.
Nike I personally recommend. <a target="_blank" title="Nike" href="www.nike.com">Nike...</a>.
</div>


10.Second set of social links

11.If you are posting affiliate links , add disclosure in small letters .
Disclosure of Material Connection: Some of the links in the post above are "affiliate links." This means if you click on the link and purchase the item, I will receive an affiliate commission. Regardless, I only recommend products or services I use personally and believe will add value to my readers. I am disclosing this in accordance with the Federal Trade Commission's <a href="http://www.access.gpo.gov/nara/cfr/waisidx_03/16cfr255_03.html" target="_blank">16 CFR, Part 255</a>: "Guides Concerning the Use of Endorsements and Testimonials in Advertising".


12.Links on [previous] and [next] post.

13.Actual comments

Check out my next post about how to turn work into game.

Wednesday

biztalk schema reference is not a valid reference or does not exist in the current project

This error may occur when WCF service added to Biztalk by "Add service reference" but this service should be added by using the Add Generated Items wizard.


This wizard capable to import all xsd files into Biztalk project and create correct schemes.


Tuesday

how to find assembly in gac

to find if assembly installed in GAC run visual studio command line and in opened window type following
 
C:\Windows\system32>gacutil -l | find "MyAssembly"

This will return all assemblies that has MyAssembly in name.

Also here is link on gacutil command line options

microsoft.biztalk.interop.ssoclient error

I was trying to configure biztalk 2013 sftp adapter and was getting this error in EventLog
Reason: "System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.BizTalk.Interop.SSOClient, Version=7.0.2300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
It turns out that there is no BizTalk Interop SSOClient in the GAC

 
C:\Windows\system32>gacutil -l | find "Microsoft.BizTalk.Interop.SSOClient" 
  Microsoft.BizTalk.Interop.SSOClient, Version=5.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL 
  Microsoft.BizTalk.Interop.SSOClient, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35 


I resolved this problem by finding ESSO on Biztalk DVD and manually upgrade SSO and this resolved the problem :
 
C:\Windows\system32>gacutil -l | find "Microsoft.BizTalk.Interop.SSOClient" 
  Microsoft.BizTalk.Interop.SSOClient, Version=7.0.2300.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL 


select count from all tables in database

To get count of records in all database please use following query:
 

--DROP table #counts
CREATE TABLE #counts
(
table_name varchar(255),
row_count int
)

EXEC sp_MSForEachTable @command1='INSERT #counts (table_name, row_count) SELECT ''?'', COUNT(*) FROM ?'
SELECT table_name, row_count FROM #counts ORDER BY table_name, row_count DESC


test smtp server with powershell

Send-MailMessage -SMTPServer smtp.domain.com -To [email protected] -From [email protected] -Subject "This is a test email" -Body ...