<mx:LinkButton label="Click here " color="#0000FF" fontWeight="bold"
click='OpenUrl(event)' x="55" y="140" width="254" textDecoration="underline"/>
<fx:Script>
<![CDATA[
import flash.net.*;
import flash.system.*;
protected function OpenUrl(event:MouseEvent):void
{
navigateToURL( new URLRequest( "http://sourcefield.blogspot.com"));
}
Thursday
flex/air open link in new window of system browser
Friday
calculate lrc
public static byte calculateLRC(byte[] ba, int offset, int length)
{
byte lrc = 0x0;
for (int i = offset; i < length; i++)
lrc ^= ba[i];
return lrc;
}
public static byte calculateLRC(string s, int offset, int length)
{
byte[] b = Encoding.ASCII.GetBytes(s);
byte l = calculateLRC(b, offset, length);
return l;
}
public static byte calculateLRC(string s)
{
byte l = calculateLRC(s, 0, s.Length);
return l;
}
binary serializer c
This class is good for creation network transport protocol layer classes.
here is sample of object to serialize
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using CSharp.Core;
using CSharp.Core.Utility;
namespace CCLib.CCEngine
{
namespace COMDATA
{
public class ControlCharacters
{
public const byte STX = 0x2;
public const byte EOT = 0x4;
public const byte NAK = 0x15;
public const byte ACK = 0x06;
public static Char StartOfText = Convert.ToChar(0x02);
public static Char FieldSeparator = Convert.ToChar(0x1C); //Convert.ToChar(28);
public static Char RecordSeparator = Convert.ToChar(0x1D);
public static Char EndOfText = Convert.ToChar(0x03);
public static Char MessageDelimiter = Convert.ToChar(".");
}
public class ControlBytes
{
public static byte StartOfText = 0x02;
public static byte EndOfText = 0x03;
}
/// <summary>
/// Class used for converting data-structures into byte
/// </summary>
public class BinFormatter
{
public static string RemoveContrChars(string s)
{
string rt = String.Empty;
if (!String.IsNullOrEmpty(s))
{
try
{
int si = s.IndexOf(ControlCharacters.StartOfText);
int se = s.IndexOf(ControlCharacters.EndOfText);
int spos = si + 1;
int epos = se - 1;
if (epos > spos) s = s.Substring(spos, epos - spos - 1);
rt = s.Replace(ControlCharacters.FieldSeparator, '|').Replace(ControlCharacters.RecordSeparator,'?');
//replace non printable characters with whitespace
rt = Regex.Replace(rt,"[\x01-\x1F]", "");
}
catch (Exception ex)
{
Logger.prn(ex);
}
}
return rt;
}
public static string Cut(string s)
{
int st = s.IndexOf(ControlCharacters.StartOfText);
int end = s.IndexOf(ControlCharacters.EndOfText);
return s.Substring(st + 1, end - st);
}
public static byte[] AddControlCharsAndLRC(string s)
{
return AddControlCharsAndLRC(Encoding.ASCII.GetBytes(s));
}
public static byte[] AddControlCharsAndLRC(byte[] s)
{
byte[] r = new byte[s.Length + 3];
r[0] = ControlBytes.StartOfText;
s.CopyTo(r, 1);
r[s.Length + 1] = ControlBytes.EndOfText;
r[s.Length + 2] = calculateLRC(r, 1, s.Length + 2);
return r;
}
public static object RawDeserializeStr(string s, Type anytype)
{
ASCIIEncoding encoding = new ASCIIEncoding();
byte[] data = encoding.GetBytes(s);
return RawDeserializeEx(data, anytype);
}
public static object RawDeserializeEx(byte[] rawdatas, Type anytype)
{
int rawsize = Marshal.SizeOf(anytype);
if (rawsize > rawdatas.Length)
return null;
GCHandle handle = GCHandle.Alloc(rawdatas, GCHandleType.Pinned);
IntPtr buffer = handle.AddrOfPinnedObject();
object retobj = Marshal.PtrToStructure(buffer, anytype);
handle.Free();
return retobj;
}
public static byte calculateLRC(byte[] ba, int offset, int length)
{
byte lrc = 0x0;
for (int i = offset; i < length; i++)
lrc ^= ba[i];
return lrc;
}
public static byte calculateLRC(string s, int offset, int length)
{
byte[] b = Encoding.ASCII.GetBytes(s);
byte l = calculateLRC(b, offset, length);
return l;
}
public static byte calculateLRC(string s)
{
byte l = calculateLRC(s, 0, s.Length);
return l;
}
public static byte[] RawSerializeEx(object anything)
{
int rawsize = Marshal.SizeOf(anything);
byte[] rawdatas = new byte[rawsize];
GCHandle handle = GCHandle.Alloc(rawdatas, GCHandleType.Pinned);
IntPtr buffer = handle.AddrOfPinnedObject();
Marshal.StructureToPtr(anything, buffer, false);
handle.Free();
return rawdatas;
}
public string StrFromByte(byte[] des2)
{
ASCIIEncoding utf82 = new ASCIIEncoding();
string uf82 = utf82.GetString(des2);
return uf82;
}
public static string RawSerializeStr(object anything)
{
byte[] des2 = RawSerializeEx(anything);
ASCIIEncoding utf82 = new ASCIIEncoding();
string uf82 = utf82.GetString(des2);
return uf82;
}
public static string sSet(string st, int plen)
{
if (st == "" || st.Length == plen)
{
return st;
}
else
{
char[] pro = Set(st, plen);
return new string(pro);
}
}
public static string CutTill(string st, int plen)
{
if (st.Length > plen)
{
return st.Substring(0, plen);
}
else
{
return st;
}
}
public static char[] Set(string st, int plen)
{
return Set(st, plen, ' ');
}
public static char[] Set(char st)
{
char[] pro = new char[1];
pro[0] = st;
return pro;
}
public static char[] Set(string st, int plen, char white_space)
{
int slen = st.Length;
char[] pro = new string(white_space, plen).ToCharArray();// new char[plen];
int count = slen > pro.Length ? pro.Length : slen;
st.CopyTo(0, pro, 0, count);
return pro;
}
public static string GetStringFromHex(string s)
{
string result = "";
string s2 = s.Replace(" ", "");
for (int i = 0; i < s2.Length; i += 2)
{
result += Convert.ToChar(int.Parse(s2.Substring(i, 2), System.Globalization.NumberStyles.HexNumber));
}
return result;
}
public static string GetLRC(string s)
{
int checksum = 0;
foreach (char c in GetStringFromHex(s))
{
checksum ^= Convert.ToByte(c);
}
return checksum.ToString("X2");
}
}
}
}
binary serialize object c
it useful for creation protocols layer classes and here is example of
binary serializer .
using System.Runtime.InteropServices;
using System.Text;
using CCLib.CCEngine.COMDATA;
namespace CCLib.CCEngine
{
namespace COMDATA
{
public class CApprovalCode
{
#region "Internal structures"
private SApprovalCode struc;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Ansi)]
public struct SApprovalCode
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public char[] ApprovalCode;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public char[] RetrievalRefNumber;
}
public const int struc_size = 18;
#endregion
#region "Properties"
public string ApprovalCode
{
set { struc.ApprovalCode = BinFormatter.Set(value, 6); }
get { return new string(struc.ApprovalCode); }
}
public string RetrievalRefNumber
{
set { struc.RetrievalRefNumber = BinFormatter.Set(value, 12); }
get { return new string(struc.RetrievalRefNumber); }
}
#endregion
#region "Methods"
public CApprovalCode()
{
struc = new SApprovalCode();
struc.ApprovalCode = BinFormatter.Set("", 6);
struc.RetrievalRefNumber = BinFormatter.Set("", 12);
}
/// <summary>
/// Method for serializing structure into string
/// </summary>
public string ToString()
{
StringBuilder sb = new StringBuilder();
sb.Append(BinFormatter.RawSerializeStr(struc));
return sb.ToString();
}
/// <summary>
/// Method for de-serializing structure
/// </summary>
public void Parse(string s)
{
if (s != null && s != "")
{
struc = (SApprovalCode)BinFormatter.RawDeserializeStr(s.Substring(0, struc_size), struc.GetType());
}
}
#endregion
} //end CApprovalCode
}
}
convert object to string
using System;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
using CSharp.Core;
using CSharp.Core.Utility;
// serializing object into byte array
public static byte[] RawSerializeEx(object anything)
{
int rawsize = Marshal.SizeOf(anything);
byte[] rawdatas = new byte[rawsize];
GCHandle handle = GCHandle.Alloc(rawdatas, GCHandleType.Pinned);
IntPtr buffer = handle.AddrOfPinnedObject();
Marshal.StructureToPtr(anything, buffer, false);
handle.Free();
return rawdatas;
}
// serializing object into string
public static string RawSerializeStr(object anything)
{
byte[] des2 = RawSerializeEx(anything);
ASCIIEncoding utf82 = new ASCIIEncoding();
string uf82 = utf82.GetString(des2);
return uf82;
}
convert byte array to string c
public string StrFromByte(byte[] des2)
{
ASCIIEncoding utf82 = new ASCIIEncoding();
string uf82 = utf82.GetString(des2);
return uf82;
}
convert string into array
byte[] s = Encoding.ASCII.GetBytes("convert this string into byte array");
the maximum array length quota 16384 has been exceeded while reading
[Test]
public void CC_Test_HTTPS()
{
//var svc = new Service();
//Console.WriteLine(svc.TransactionReport(args));
ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(IgnoreCertificateErrorHandler);
var endpointAddress = new EndpointAddress("https://dev/CreateAccount/Service.svc");
var wsHttpBinding = new WSHttpBinding(SecurityMode.Transport)
{
MaxReceivedMessageSize = 2147483647,
MaxBufferPoolSize = 2147483647,
ReaderQuotas =
{
MaxStringContentLength = 2147483647,
MaxArrayLength = 2147483647,
MaxBytesPerRead = 2147483647,
MaxDepth = 2147483647
}
};
var s = ChannelFactory<IService>.CreateChannel(wsHttpBinding, endpointAddress);
NewAccountResp newAccountResp = s.CreateAccount(CCTestRequest);
}
Monday
1. "Это трудно". Это в самом деле не просто и требует много размышлений, знаний, опыта, везения и усилий.
2. "Работайте одни". Тут я не хочу соглашаться. Мне реально хочется разделить с кем нибудь хотя-бы программирование. Т.к. на него постоянно не хватает времени. У меня последний месяц на программирование осталось 5% от всего фуллтаймого времени.
3. "Сфокусируйтесь на своих сильных качествах". Это я согласен. Особенно это касается выбора темы для программы. Конечно можно делать менеджеры закладок, но гораздо лучше применять свои знания в хорошо вам знакомых профессиональных областях. Плюсов много — например там меньше конкуренция, хотя зачастую там очень трудоемкие задачи. Я пришел к своей теме, после нескольких лет размышлений.
4. "Фриланс опасен". Мне очевидно, что свой продукт создавать выгоднее.
5. "Ищите рычаг. Сделайте один раз и продавайте всегда". Согласен.
6. "Не стреляйте в луну". Это да. Лучше синица в руках, чем журавль в небе. Хотя прямо сейчас, мой знакомый создает что-то масштабов Фэйсбука.
7. "Продукт в конце. Рынок в начале". Это безусловно надо начинать с исследования рынка. Именно поэтому моя первая программа была неуспешной.
8. "Берите деньги за свою программу". Согласен на все 100%. А ведь начинал с фривары.
9. "Любите сам процесс". Да. Я заметил что полюбил процесс гораздо больше, чем само программирование.
10."Работайте ради своей свободы". Согласен. Это меня очень сильно мотивировало.
11."Станьте "черным поясом" по интернет маркетингу". Ну в определенной мере понимать в нем надо.
12. "Автоматизируйте свою работу". Это безусловно. Не жалея денег.
13. "Чем больше вы публичны, тем быстрее оно пойдет" Это не обязательно. Хотя если Вы очередной Джоэл Спольски, то блог не помешает.
14. "Провал это тоже вариант". Лучше думать о хорошем.
15. "Живите скромно, тратьте деньги на бизнес". Жить скромно трудно. А тратить деньги на бизнес лично мне еще труднее.
16. "Отвергайте рост. Вместо работников ищите фрилансеров". Лично я до сих пор не могу определиться — то ли сотрудника взять, то ли фрилансеров нанять.
С сотрудником проще работать, но трудней его заменить.
Tuesday
constant array in c#
static readonly ArrayList a = new ArrayList() { "1", "2", "3", "4", "5", "6", "7", "8" };
public bool CheckIfContains(uint i)
{
return a.Contains(""+i);
}
Thursday
cut avi files (freeware , mac included)
from developer site:
or mencoder for MACOS
2.After unpacking mencoder run following command in unpacked directory.
(first time is start-time , second is duration.)
>mencoder -ss 00:08:57 -endpos 00:08:12 -ovc copy -oac copy file2cut.avi -o result.avi
Tuesday
template engine .net
using System.Collections;
namespace Business.CustomerServices
{
public class SimpleTemplateEngine
{
public string ReadFile(string f)
{
System.IO.StreamReader file = new System.IO.StreamReader(f);
string testxmldata = file.ReadToEnd(); file.Close();
return testxmldata;
}
public string RenderFile(Hashtable values, string fileName)
{
return Render(values, ReadFile(fileName));
}
public string Render(Hashtable values, string template)
{
foreach (DictionaryEntry entry in values)
{
template = template.Replace("{$" + entry.Key + "}",""+ entry.Value);
}
return template;
}
}
}
Wednesday
cannot convert from 'string' to 'System.Xml.Linq.XElement'
Monday
wcf test client visual studio 2010
using System;
using System.ServiceModel;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Business.CustomerServices;
using Business.WebService;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NUnit.Framework;
namespace BusinessWeb.Tests
{
[TestClass]
public class CreateAccountTester
{
[Test]
[Timestamp]
public void CreateAccount_Test()
{
var endpointAddress = new EndpointAddress(@"http://it003/CreateAccount/Service.svc");
var basicHttpBinding = new BasicHttpBinding();
basicHttpBinding.MaxReceivedMessageSize = 2147483647;
basicHttpBinding.ReaderQuotas.MaxStringContentLength = 2147483647;
var s = ChannelFactory<IService>.CreateChannel(basicHttpBinding, endpointAddress);
// now I can call webservice
NewAccountResp newAccountResp = s.CreateAccount(_newAccountArgs);
Console.WriteLine(newAccountResp.AuthResponse);
}
}
}
Thursday
ninject singleton behavior
using Ninject.Core;
[TestClass]
public class NinjectTestClass
{
[TestMethod]
public void NinjectTestMethod()
{
// ninject mapping
var module = new InlineModule(
m => m.Bind<IDataProvider>().To<TestProvider>().Using(new SingletonBehavior()),
//....
ninject example
using Ninject.Core;
[TestClass]
public class ChangePaymentSourceTest
{
[TestMethod]
public void PaymentSourceChange()
{
// ninject mapping
var module = new InlineModule(
m=>m.Bind<IDataProvider>().To<TestProvider>(),
m=>m.Bind<IFeeCanceller>().To<FeeCanceller>(),
m=>m.Bind<IFeeCreator>().To<FeeCreator>(),
m => m.Bind<IAccountSynchroniser>().To<AccountSynchroniser>(),
m => m.Bind<IPaymentSourceChanger>().To<PaymentSourceChanger>()
);
//creation ninject kernel
var kernel = new StandardKernel(module);
// creation provider- test provider in our case
var provider = kernel.Get<IDataProvider>();
// getting data
IAccountBusinessObject account = provider.GetAccountBusinessObject(new AccountIdentity() { customer = 1, sub = 1 });
IInvoiceOriginator i = provider.GetInvoiceOriginator(1);
UserInfo userInfo = provider.getUserInfo(1);
var changer = kernel.Get<IPaymentSourceChanger>();
i = changer.ChangePaymentSource(userInfo, account,i, 2, 3, 1);
// 5.Synchronise account
var synchroniser = kernel.Get<IAccountSynchroniser>();
synchroniser.Synchronize(account);
Scope scope = provider.BeginTransaction();
provider.SaveInvoiceOriginator(i, scope);
provider.SaveAccountBusinessObject(account, scope);
provider.CommitTransaction(scope);
}
}
Tuesday
Я тут недавно прбежался по регистраторам. Самые дешевые
shareit
4.9% + $1 или 8.9% (мин. $1)
перевод на счет стоит $2
пэйпро
4.9% + $1
перевод на счет стоит $21
PayPro Global
фастспринг
5.9% + $.95 или 8.9%.
(Правда у фастспринга для неамериканских покупателей только карточки и paypal)
FastSpring
Есть еще esellerate и swreg которые еще дешевле, но там как я понял на дешевой комиссии они будут extended download ползователям втюхивать
Avantage
BMT Micro
Plimus
Monday
air logging framework
package Pomodorium
{
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
public class Logger {
public static function Write(s:String): void {
var file:File = File.applicationStorageDirectory.resolvePath('pomodorium.log');
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.APPEND);
fileStream.writeUTFBytes("\n"+s);
fileStream.close();
}
}
}
Thursday
the connection was interrupted
I was working on moving certificates from one server to another,
and when I was doing that over exporting certificates as .SST file I was getting
"The connection was interrupted" error .
I order to fix it I have to export certificates on-by-one as PFX file from another server and import
them on new one.
After this problem has been fixed.
Wednesday
UnicodeDecodeError: 'ascii' codec can't decode byte
import sys
reload(sys)
sys.setdefaultencoding("latin1")
create certificate for iis
1.Downloaded and installed The IIS 6.0 Resource Kit Tools:
http://support.microsoft.com/kb/840671
download link :http://www.microsoft.com/downloads/details.aspx?FamilyID=56fc92ee-a71a-4c73-b628-ade629c89499
2.Created certificate by
C:\Program Files\IIS Resources\SelfSSL\SelfSSL.exe /N:CN=www.mysite.com /V:1000
3.Go to IIS Manager , add certificate for virtual server you will see certificate you have created in a list.
linq Ilist select
var accountTransactions = from dataObject in objectsDataContext.AccountTransactions
where
(dataObject.TransactionId == transactionID || dataObject.ParentId == transactionID) &&
dataObject.StatusId != deletedStatus
select new InvoiceRecord
{
TransactionId = dataObject.TransactionId,
Amount = dataObject.TotalAmountDue,
InvoiceDueDate = dataObject.DueDate,
Tax = dataObject.Tax ?? 0,
AdditionalGracePeriod = dataObject.AdditionalGracePeriod,
StatusId = dataObject.StatusId,
RecordStatus = (int) ScopeRecordStatus.Active
,
paymentApplicableTransaction = (from pats in dataObject.BillingTransactionDetails
where pats.StatusId != deletedStatus
select new PaymentApplicableTransaction
{
AccountTransactionId =
pats.AccountTransactionId
,
BillingTransactionId =
pats.BillingTransactionId
}).OfType<IPaymentApplicableTransaction>()
.ToList()
};
Monday
csharp binary operators sample
public enum EnumInvoiceFlags
{
LateFeeApplied = 1,
DelinquencyApplied = 2,
Unfreezed = 4
}
applying masks:
invoice.Flags = invoice.Flags | (int)EnumInvoiceFlags.DelinquencyApplied; checking if mask has specific value:
if ((invoice.Flags & (int)EnumInvoiceFlags.DelinquencyApplied) != (int)EnumInvoiceFlags.DelinquencyApplied)
vb.net Teleric Recurrence rule parser with boolean operations
Dim RecRule8 As RecurrenceRule = Nothing
If RecurrenceRule.TryParse(dtSchedule.Rows(0)("RecurrenceRule").ToString(), RecRule8) Then
Dim days As RecurrenceDay = RecRule8.Pattern.DaysOfWeekMask
chkWeekDays.Items(0).Selected = ((days And RecurrenceDay.Sunday) = RecurrenceDay.Sunday)
chkWeekDays.Items(1).Selected = ((days And RecurrenceDay.Monday) = RecurrenceDay.Monday)
chkWeekDays.Items(2).Selected = ((days And RecurrenceDay.Tuesday) = RecurrenceDay.Tuesday)
chkWeekDays.Items(3).Selected = ((days And RecurrenceDay.Wednesday) = RecurrenceDay.Wednesday)
chkWeekDays.Items(4).Selected = ((days And RecurrenceDay.Thursday) = RecurrenceDay.Thursday)
chkWeekDays.Items(5).Selected = ((days And RecurrenceDay.Friday) = RecurrenceDay.Friday)
chkWeekDays.Items(6).Selected = ((days And RecurrenceDay.Saturday) = RecurrenceDay.Saturday)
End If
Tuesday
"Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive."
It is recommended that you use Visual Studio to perform the tasks that are required in order to upgrade. If you do not use Visual Studio to perform the upgrade automatically, you must manually edit the Web.config file and must manually associate the application in IIS with the .NET Framework version 4.
Typically the procedures covered in this topic are sufficient for upgrading a Web application, because later versions of the .NET Framework are designed to be backward compatible with earlier versions. However, you should also look in the readme documentation for breaking changes. The behavior of a component that was developed for an earlier version of the .NET Framework might have changed in the newer version of the .NET Framework.
Do not upgrade an IIS application if it has nested applications within it that target earlier versions of the .NET Framework. If an IIS application that targets the .NET Framework 3.5 or earlier is nested within an IIS application that targets the .NET Framework 4, the compiler might report errors when it compiles the nested application. This is because Web.config files inherit settings from files that are higher in the configuration file hierarchy. The .NET Framework 4 is backward compatible; therefore, a nested Web application that targets the .NET Framework 4 can inherit settings from Web.config files that are for earlier versions. But earlier versions of the .NET Framework are not forward compatible; therefore, they cannot inherit settings from a .NET Framework 4 Web.config file. |
To upgrade an application by using Visual Studio
Open the Web site or project in Visual Studio.
If a Visual Studio Conversion Wizard welcome dialog box appears, click Next.
This wizard appears when you open a Web Application Project or a solution. It does not appear when you open a Web Site project that is not in a solution.
If you are converting a project, in the Visual Studio Conversion Wizard, select backup options and click Next in the Choose Whether to Create a Backup dialog box.
Visual Studio upgrades your project file to the Visual Studio 2010 format. If you are upgrading a solution instead of an individual project, Visual Studio upgrades the solution file to the Visual Studio 2010 format.
If you are converting a project, in the Visual Studio Conversion Wizard, click Next in the Ready to Convert dialog box.
If you are opening the Web project on a computer that does not have the .NET Framework 3.5 installed, in the Project Target Framework Not Installed dialog box, select Retarget the project to .NET Framework 4 and click OK.
If you are opening the Web project on a computer that does have the .NET Framework 3.5 installed, in the Web Site targeting older .NET Framework Found dialog box, clear the check box if you do not want to upgrade all Web sites or projects in a solution.
In the dialog box, click Yes.
Visual Studio updates the Web.config file. The changes that are made to the Web.config file are listed in the procedure later in this topic that explains how to update the Web.config file manually. Visual Studio does not update comments. Therefore, after the conversion, the Web.config file might contain comments that reference earlier versions of the .NET Framework.
Visual Studio automatically sets the controlRenderingCompatibilityVersion attribute of the pages element to 3.5. You can remove this setting in order to take advantage of XHTML and accessibility improvements in ASP.NET 4. For more information, see the procedure later in this topic that explains how to update the Web.config file manually.
If you are converting a project, in the Visual Studio Conversion Wizard, click Close in the Conversion Complete dialog box.
If the project is not a local IIS project, associate its IIS application with the Visual Studio when it is deployed to IIS. For more information, see the procedure later in this topic that corresponds to the version of IIS that you are using.
If the IIS application is associated with the .NET Framework 2.0, the site will not work. ASP.NET will generate errors that indicate that the targetFramework attribute is unrecognized.
If the project is a local IIS project and the IIS version is 6.0, associate its IIS application with the Visual Studio by following the procedure later in this topic for IIS 6.0.
If the project is a local IIS project, Visual Studio automatically performs this association. It assigns the application to the first available application pool for the .NET Framework version 4. If no application pool exists, Visual Studio creates one.
Note
By default, the IIS 6.0 Metabase API that Visual Studio uses to assign and create application pools is not available in Windows Vista or Windows 7. To make it available, enable IIS 6 Metabase Compatibility Layer in the Windows Control Panel by selecting Programs and Features and Turn Windows Features On or Off. The following illustration shows the Windows Features dialog box.
If the project includes code that accesses the HttpBrowserCapabilities object (in the HttpRequest.Browser property), test the code to make sure that it works as expected.
The browser definition files that provide information to the HttpBrowserCapabilities object were changed in ASP.NET 4, and the changes are not backward compatible with earlier versions of ASP.NET. If you discover a problem and prefer not to change your code to accommodate the ASP.NET 4 changes, you can copy the ASP.NET 3.5 browser definition files from the ASP.NET 3.5 Browsers folder of a computer that has ASP.NET 3.5 installed to the ASP.NET 4 Browsers folder. The Browsers folder for a version of ASP.NET can be found in the following location:
%SystemRoot%\Microsoft.NET\Framework\versionNumber\Config\Browsers
After you copy the browser definition files, you must run the aspnet_regbrowsers.exe tool. For more information, see ASP.NET Web Server Controls and Browser Capabilities.
To manually upgrade an application's Web.config file from the .NET Framework 3.5 to the .NET Framework 4
Make sure that the application currently targets ASP.NET 3.5.
Note
This topic explains how to convert a Web.config file from the .NET Framework 3.5 to the .NET Framework 4. To upgrade a Web application that is earlier than the .NET Framework 3.5, you must first convert the application to the .NET Framework 3.5. For more information, see Converting to ASP.NET 3.5.
Open the Web.config file in the application root.
In the configSections section, remove the sectionGroup element that is named "system.web.extensions".
In the system.web section, in the compilation collection, remove every add element that refers to an assembly of the .NET Framework.
Framework assemblies generally begin with "System.". Typically these have Version=3.5.0.0 in the assembly attribute. However, some assembly entries that have the 3.5.0.0 version number might refer to assemblies that were installed as part of add-on releases, or to custom assemblies. Do not delete these. If the Web.config file contains any of these references, you must investigate them individually to determine whether a later version is available and whether the version reference must be changed.
Add a targetFramework attribute to the compilation element in the system.web section, as shown in the following example:
In the opening tag for the pages section, add a controlRenderingCompatibility attribute, as shown in the following example:
Many ASP.NET 4 controls render HTML that is compliant with XHTML and accessibility standards. However, the Web site that you are converting might have CSS rules or client script that will not work correctly if Web pages change the way they render HTML. If you want to take advantage of the control rendering enhancements in ASP.NET 4, you can omit this attribute. For more information, see ControlRenderingCompatibilityVersion.
In the system.codedom section, in the compilers collection, remove the compiler elements for c# and vb.
Delete everything between the system.webserver section start and end tags, but leave the tags themselves.
Delete everything between the runtime section start and end tags, but leave the tags themselves.
If you have customized the Web.config file, and if any customizations refer to custom assemblies or classes, make sure that the assemblies or classes are compatible with the .NET Framework version 4.
The following example shows an example Web.config file for a simple Web application that was converted from the .NET Framework version 3.5 to the .NET Framework version 4.
<?xml version="1.0"?>
<!--
Note: As an alternative to hand editing this file you can use the
web admin tool to configure settings for your application. Use
the Website->Asp.Net Configuration option in Visual Studio.
A full list of settings and comments can be found in
machine.config.comments usually located in
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>
<appSettings/>
<connectionStrings>
<add name="NorthwindConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NORTHWND.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>
<system.web>
<!--
Set compilation debug="true" to insert debugging
symbols into the compiled page. Because this
affects performance, set this value to true only
during development.
-->
<compilation debug="true" targetFramework="4.0">
<assemblies>
</assemblies>
</compilation>
<!--
The <authentication> section enables configuration
of the security authentication mode used by
ASP.NET to identify an incoming user.
-->
<authentication mode="Windows"/>
<!--
The <customErrors> section enables configuration
of what to do if/when an unhandled error occurs
during the execution of a request. Specifically,
it enables developers to configure html error pages
to be displayed in place of a error stack trace.
<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->
<pages controlRenderingCompatibilityVersion="3.5"/></system.web>
<system.codedom>
</system.codedom>
<!--
The system.webServer section is required for running ASP.NET AJAX under Internet Information Services 7.0. It is not necessary for previous version of IIS.
-->
<system.webServer>
</system.webServer>
</configuration>
To associate an IIS application with the .NET Framework 4 in IIS 7.0
In Windows, start Inetmgr.
In the Connections pane, expand the server node and then click Application Pools.
On the Application Pools page, select the application pool that contains the application that you want to change.
In the Actions pane, click View Applications.
Select the application whose application pool hat you want to change and then click Change Application Pool in the Actions pane.
In the Select Application Pool dialog box, select an application pool that is associated with .NET Framework version 4 from the Application pool list, and then click OK.
To associate an IIS application with the .NET Framework 4 in IIS 6.0
Register a scriptmap for the application that associates it with the .NET Framework version that you want to run the application under.
For information about how to update scriptmaps for an ASP.NET application, see ASP.NET IIS Registration Tool (Aspnet_regiis.exe). For more information about IIS configuration in IIS 6.0, see Setting Application Mappings in IIS 6.0 (IIS 6.0).
Thursday
linq grouping (groupby subset enumeration)
var grpOrderedFirstLetter = empList.GroupBy(employees =>
new String(employees.FName[0], 1)).OrderBy(employees =>
employees.Key.ToString());;
foreach (var employee in grpOrderedFirstLetter)
{
Console.WriteLine("\n'Employees having First Letter {0}':",
employee.Key.ToString());
foreach (var empl in employee)
{
Console.WriteLine(empl.FName);
}
}
Wednesday
rotate table word
1.Copy your entire table and just paste it into Excel.
2.Select your table IN EXCEL and copy it. There is a good reason for copying it again, but in Excel.
3.Go to a different sheet (or scroll down further so that you have a clean space) and select a cell (like A1)
4.Go to the Edit menu --> Paste Special and click on the box beside "Transpose" and press OK.
5.Your entire table has been turned 90 degrees!
6.Copy the whole thing and paste it back into Word.
Thursday
actionscript save to file and read file
package Package {
import flash.display.Sprite;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.net.registerClassAlias;
import flash.text.StaticText;
import flash.utils.ByteArray;
public class Storage
{
public static function writeObjectToFile(gh:GameChar, fname:String):void
{
var file:File = File.applicationStorageDirectory.resolvePath(fname);
registerClassAlias("Pomodorium.GameChar", GameChar);
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.WRITE);
fileStream.writeObject(gh);
fileStream.close();
}
public static function readObjectFromFile(fname:String):GameChar
{
var file:File = File.applicationStorageDirectory.resolvePath(fname);
//trace(file.nativePath);
var ret:*;
if(file.exists) {
//trace("exists!");
var fileStream:FileStream = new FileStream();
fileStream.open(file, FileMode.READ);
ret = fileStream.readObject() as GameChar;
fileStream.close();
}
return ret;
}
public static function Load(): GameChar
{
return readObjectFromFile('file1') as GameChar;
}
public static function Save(g:GameChar): void
{
writeObjectToFile(g,'file1');
}
}}
Wednesday
javascript find string in string
var s = "foo";
alert(s.indexOf("oo") != -1);
https://developer.mozilla.org/en/Core%5FJavaScript%5F1.5%5FReference/Objects/String/indexOf
Thursday
tf diff format
$>tf diff /format:unified <myfile>
iphone applications source code
2. Colloquy – Порт известного Mac IRС клиента на iPhone. (itunes link) (source code)
3. Diceshaker — Симулятор броска кубиков (дайсов) для фанатов ролевых игр. (itunes link) (source code)
4. Doom Classic — Классический 3Д-шутер.(itunes link) (source code) (build instructions)
5. Freshbooks – Приложение, которое позволяет использовать веб-сервис Freshbooksдля выставления счетов прямо с вашего iPhone. (itunes link) (source code)
6. Gorillas – Классчиеская игра наподобии Вормсов/Танчиков. ИспользуетCocos2D. (itunes link) (source code)
7. Last.fm –Приложение позволяющее использовать персональные радиоканалы сервиса Last.fm(itunes link) (source code)
8. Mobilesynth — Моно синтезатор для iPhone(itunes link) (source code)
9. Molecules – Приложение позволяет просматривать 3Д модели молекул и управлять ими касаниями экрана. (itunes link) (source code)
10. Mover – Приложение, которое позволяет перемещать данные между двумя различными iTouch устройствами (itunes link) (source code)
11. Natsulion — Простенький твиттер клиент. (itunes link) (source code)
12. NowPlaying – Позволяет вам получать местные афиши и смотреть критику идущих показов с сайтов RottenTomatoes и Metacritic (itunes link) (source code)
13. Packlog – iPhone — клиент для популярного сервиса BackPak. (itunes link) (source code)
14. PocketFlix – Приложение позволяет осуществлять поиск и управлять своим аккаунтом в сервисе Netflix. (itunes link) (source code)
15. Sci-15 HPCalc – Инженерный научный калькулятор. (itunes link) (source code)
16. Task Coach – Приложение для управления временем и задачами. (itunes link) (source code)
17. Tubestatus – Расписание лондонских электричек. (itunes link) (source code)
18. Tweejump – Игра-попрыгушка вдохновленная твиттером и игрой Icy Tower. Использует Cocos2D.(itunes link) (source code)
19. Tweetero – Простенький твиттер — клиент с поддержкой загрузки изображений. (itunes link) (source code)
20. Twitterfon – Супер быстрый твиттер клиент (itunes link) (source code)
21. Wikihow – Ридер для популярной вики. (itunes link) (source code available by e-mail from support@wikihow.com)
22. Wordpress – Официальный клиент для движка WordPress. (itunes link) (source code)
23. YourRights – Карманный справочник по вашим правам.(itunes link) (source code)
Update
24. BookShelf — читалка электронных книг для iTouch — устройств. (itunes link) (source code)
25. iOctocat — клиент для популярного хостинга исхоного кода GitHub (itunes link) (source code)
26. Eponyms — база данных медицинских эпонимов (itunes link) (source code)
27. MobileTerminal — терминал для iphone/ipod touch (source code)
28. MobileStudio — несколько продуктов одной компании:
- MobileTextEdit — Текстовый редактор;
- MobilePreview — Просмотрщик фото/картинок;
- Mobile-RSS — RSS Клиент;
- MobileTetrominos — игра типа тетриса;
- MobileFinder – менеджер файлов.
29. iPhone offline map — картографическое приложение для itouch — устройств с возможностью работы с картами в режиме отключения от сети. (source code)
30. iPhone-wireless — сканер wifi-сетей, обещают скоро поддержку так же GSM-вышек и bluetooth — точек. (source code)
31. Waze — программа навигации для iphone, необычная тем, что вы не только пользуетесь картами сервиса, но и сами создаете карту своими поездками закрывая «белые» пятна сервиса и получая бонусные очки. (itunes link) (source code)
32. AppsAmuck — подборка простеньких приложений с исходным кодом для начинающих азработчиков, просто кликните на иконку приложения и следуйте инструкциям.
33. Siphone — бесплатное VoIP — приложение с минималистичным функционалом, использует популярную библитеку pjsip
34. OmniFrameworks — набор инструментов от OmniGroup с открытым кодом для разработки под iPhone и Mac
35. iRdesktop — RDP клиент для iPhone OS. (source code) (itunes link),
36. Battle For Wesnoth – Фентезийная тактическая пошаговая RPG доступная для нескольких платформ ранее, а теперь и для iPhone/iPad. (itunes link) (source code)
37. Artifice – Логическая игра в которой вам необходимо достичь противоположного конца экрана передвигая коробки на своем пути. Использует Cocos2D. (itunes link) (source code)
38. Countitout -Приложение для ведения счета. (itunes link) (source code)
39. Ecological Footprint - Приложение для подсчета вашей экологической эффективности (itunes link) (source code)
40. Fosdem — Приложение календарь для конференции Fosdem(itunes link) (source code)
41. Go Go Lotto –Приложение для генерации билетов Лото (itunes link) (source code)
42. iStrobe -Приложение которое превращает вспышку iPhone 4 в страбоскоп(itunes link) (source code)
43. PlainNote — Простой текстовый редактор (itunes link) (source code)
44. Puff Puff – Красивая игрушка в подводном мире, использует Cocos2D и OpenFeint. (itunes link) (source code)
45. reMail – Емейл клиет с очень быстрым поиском по почте, удален из AppStore, исходные коды доступны. (source code)
46. RobotFindsKitten – Порт классической ASCII — игрушки. (itunes link) (source code)
47. SpaceBubble – Космическая игра, использующая Core Grafics и акселерометр телефона. (itunes link) (source code)
48. Star3Map – Приложение дополненной реальности для поиска созвездий на звездном небе. (itunes link) (source code)
49. Tux Rider – Порт популярной 3Д игры Tux Racer. (itunes link) (source code)
50. Tweetee – Расширенная версия твиттер-клиента Natsulion.(itunes link) (source code)
51. ViralFire — Приложение, в котором вам надо выступать в качестве клетки крови и бороться с вирусами. (itunes link) (source code)
52. Wolfenstein 3D Classic Platinum – Классическая 3д стрелялка. (itunes link) (source code)
53. Xpilot – Классическая игрушка — аркадный шутер. (itunes link) (source code)
54. ZBar –Сканнер баркодов с исходными кодами. (itunes link) (source code)
Читайте так же обзор библиотек с открытым кодом для iphone/ipod touch и обзор игровых движков для этих платформ.
sites that sells
http://akvis.com/en/index.php - photo processing
http://www.facebook.com/MP3TagEditor
http://aquatra.com :
http://automatic-password.com/
Backup Expert - http://backup-expert.com/
Disk Data Recovery - http://data-remedy.com/
DVD Blaster - http://dvd-blaster.com/
File Data Recovery - http://data-cure.com/
FTP Auto Sync - http://ftp-auto-sync.com/
MP3 Tag Editor - http://mp3-tag.com/
Remote Desktop Control - http://remote-desktop-control.com/
Windows Mail Saver - http://windows-mail-saver.com/
http://cssmenutools.com
CSSMenuTools helps to add elegant css menus and widgets to websites without hand coding and javascript/css knowledge.
Dreamweaver extensions:
Accordion Menu Advancer
http://cssmenutools.com/accordion-menu-advancer-dreamweaver/
Horizontal Menu Advancer
http://cssmenutools.com/horizontal-menu-advancer-dreamweaver/
Vertical Menu Advancer
http://cssmenutools.com/vertical-menu-advancer-dreamweaver/
Lightbox Advancer
http://cssmenutools.com/lightbox-advancer-dreamweaver/
ExpressionWeb add-ins:
Accordion Menu Advancer
http://cssmenutools.com/accordion-menu-advancer-expression-web/
Horizontal Menu Advancer
http://cssmenutools.com/horizontal-menu-advancer-expression-web/
Vertical Menu Advancer
http://cssmenutools.com/vertical-menu-advancer-expression/
Lightbox Advancer
http://cssmenutools.com/lightbox-advancer-expression-web/
Website:
http://www.helpsmith.com
Company Overview:
Innovative help authoring tool allowing you to create CHM HTML Help files, Web Help, Printed Manuals, and PDF documents from the same source help project.
Facebook Page:
http://www.facebook.com/HelpSmith
http://www.magicintuition.com/
http://www.djsoft.net/
http://www.techno-sys.com/order.aspx
http://www.softorbits.com/actions/ChristmasPhoto2010.HTML
http://www.watermarkfactory.com/order.HTML
http://music-scanning.com/
make ubuntu business casual
to make ubuntu business casual - make it black remove background: gsettings set org.gnome.desktop.background picture-options ...
-
2010-11-24 Update: Please download latest version of Pidgin , that has this problem fixed , no additional steps required. Here are 3 ways to...
-
$dllPath = "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\...
-
get ez_setup.py and setuptools-0.6c9-py2.6.egg . type: python ez_setup.py setuptools-0.6c9-py2.6.egg and that should get setuptools install...