Pesquisa

quinta-feira, 9 de outubro de 2014

Visual Studio - Productivity Power Tools

Problemas no UpdatePanel com o IE10 - __dopostback is undefined

ASP.NET pode não reconhecer as versões mais recentes de alguns navegadores, e, consequentemente, tratá-los como navegadores antigos. (Basicamente: no JavaScript.)
A correção é fazer com que os arquivos de definição do navegador sejam atualizados.
Você pode instalar uma correção para todo o servidor ou apenas corrigir projetos individuais.
Hotfixes são disponíveis nos links abaixo para download.
NET 4 - http://support.microsoft.com/kb/2600088
NET 2.0 - http://support.microsoft.com/kb/2600100


Fonte: http://goo.gl/qU9I9t

domingo, 15 de junho de 2014

PC-Driven LED Display

Here is a circuit to generate sequentially running light effects using a simple program written in C.
The output of the program is taken from the LPT port of a PC and then fed to the interfacing circuit for the LED display.
The outputs of the interfacing circuit are decoded, inverted, and then connected to LEDs through optocouplers.

Aqui está um circuito para gerar sequencialmente efeitos de luz usando um simples programa escrito em C.
A saída do programa é feita a partir da porta LPT de um computador e, em seguida, alimentado para o circuito de interface para os LEDs.
As saídas do circuito de interface são decodificados, invertido, e depois ligado a LEDs através de optoacopladores.

Fig. 1: Interfacing circuit for PC-driven LED display

The interfacing circuit along with the 25-pin parallel port is shown in Fig. 1. IC1 (74LS138) is a high-speed 1-of-8 decoder/demultiplexer. In the circuit, only five outputs (pins 10 through 14) of IC1 are used. These outputs are inverted using  NOT gate IC2 (7404). Optocouplers IC3 through IC7 (MCT2E) are used to prevent the circuit from damage in the event of short circuit in the load.  Thus the loads comprising LED blocks LB1 through LB5 are isolated from the interfacing circuit including the PC. Each LED block contains a number of LEDs connected in series.

The LEDs can be arranged, for instance, to display a sequential running light and fountain pot as shown in Figs 2 and 3. The colour of LED blocks can be green and red alternately.

Fig. 2: LED block arrangement for sequentially running light

Fig. 3: LED block arrangement for fountain pot

The program can be compiled and run through Turbo C compiler. In the program, the function outport(p,x) is used, where ‘p’ is the address of the controller port and ‘x’ is the value sent to it. Here, controller port  LPT1 is used, whose base address is 378H. If LPT2 is to be used, the base address must be 278H. When the delay time delay() is increased, the running speed of LEDs decreases and vice versa.

In the circuit, 100-ohm fixed resistors R6 through R10 can be replaced with 100-ohm or 200-ohm presets for decreasing and increasing the intensity of LEDs.

The program for LED display is as follows:

This circuit costs around Rs 100.

Fonte: http://electronicsforu.com/electronicsforu/circuitarchives/view_article.asp?sno=1255&article_type=1&id=1080&tt=unhot&b_type=new#.U54n5vldV1Z

sexta-feira, 27 de dezembro de 2013

Softwares muito úteis

Lista de softwares muito úteis para desenvolvedores e analistas de software. Lista baseada no post “Scott Hanselman's 2014 Ultimate Developer and Power Users Tool List for Windows

NimbleText
NimbleText is a powerful tool that makes it easy to manipulate text and data.
http://nimbletext.com/

AutoHotkey - Automation. Hotkeys. Scripting.
Fast scriptable desktop automation with hotkeys. Creating your own apps and macros has never been easier.
http://www.autohotkey.com/

LINQPad
LINQPad lets you interactively query databases in a modern query language: LINQ.
http://www.linqpad.net/

LINQ Tools
There are a number of mostly free tools that come in handy both from a usability and a learning experience.
http://www.thinqlinq.com/Post.aspx/Title/LINQ-Tools

dotPeek - Free .NET Decompiler and Assembly Browser
dotPeek is a free-of-charge .NET decompiler from JetBrains, the makers of ReSharper and more developer productivity tools.
http://www.jetbrains.com/decompiler/

Fiddler
The free web debugging proxy for any browser, system or platform
http://www.fiddlertool.com/

WinMerge
WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
http://winmerge.org/

NCrunch is an automated concurrent testing tool for Visual Studio.
It intelligently runs automated tests so that you don't have to, and gives you a huge amount of useful information about your tested code, such as code coverage and performance metrics, inline in your IDE while you type.
http://www.ncrunch.net/

Query Express
Query Express is a simple Query Analyzer look-alike, but being small and free it can be run where the SQL Server client tools are not installed or licensed. This makes it especially useful as a query tool for MSDE and SQL Express. It also connects to Oracle and other OLE-DB compliant databases.
http://www.albahari.com/queryexpress.aspx

dbForge SQL Complete
dbForge SQL Complete is a useful add-in for Microsoft SQL Server Management Studio and Microsoft Visual Studio. Free and advanced paid editions of the SQL code formatter offer powerful autocompletion and formatting of T-SQL code that replaces native Microsoft T-SQL Intellisense.
http://www.devart.com/dbforge/sql/sqlcomplete/

ClipX
ClipX is a tiny clipboard history manager. It is sweet, it is free, use it.
http://bluemars.org/clipx/

Log Parser Lizard GUI - FREE Query Software
Log Parser is wonderful because it effectively lets you run SQL queries against text files
http://www.lizard-labs.net/log_parser_lizard.aspx

Fonte: Scott Hanselman's 2014 Ultimate Developer and Power Users Tool List for Windows

sábado, 14 de dezembro de 2013

CREATE DATABASE permission denied in database 'master'

1.  shut down SQL Server from services

2.  open cmd window (as admin) and run single-user mode as local admin with this command:
"c:\Program Files\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Binn\sqlservr.exe" -m -s SQLEXPRESS

3.  open another cmd window (as admin)

4.  open sqlcmd:
sqlcmd -S .\SQLEXPRESS
Now add the sysadmin user:
a.  sp_addsrvrolemember 'domain\user', 'sysadmin'
b.  GO

5.  now Ctrl+C the single-user mode from the first cmd window to kill SQL Server.  Now restart it from services the normal way.  Log into Management Studio and the user you created should be listed under logins with the credential of "sysadmin."

Fonte: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/76fc84f9-437c-4e71-ba3d-3c9ae794a7c4/sql-express-2008-r2-create-database-permission-denied-in-database-master?forum=sqlexpress

sábado, 7 de setembro de 2013

Gerando números aleatórios

Ao criar dois objetos Randon, no mesmo milisegundo, ocorrerá um problema. Todos os números gerados por ambos os objetos serão iguais.
A solução para isso é utilizar o método Sleep para dar um tempo de 3 milisegundos entre a criação de cada uma das instâncias dos objetos Randon, ou utilizar o mesmo objeto para gerar o outro número.

Random r1 = new Random();
Random r2 = new Random();
int a1 = r1.Next();
int a2 = r2.Next();

As variáveis a1 e a2 terão o mesmo valor.

Random r1 = new Random();
System.Threading.Thread.Sleep(3);
Random r2 = new Random();
int a1 = r1.Next();
int a2 = r2.Next();

As variáveis a1 e a2 terão valores diferentes.

Random r1 = new Random();
int a1 = r1.Next();
int a2 = r1.Next();

As variáveis a1 e a2 terão valores diferentes.

terça-feira, 20 de agosto de 2013

Fazendo uma requisição web

Através da classe HttpWebRequest é possível fazer uma requisição à qualquer página da web, podendo pegar todo o seu conteúdo HTML.

domingo, 26 de agosto de 2012

Foco após requisição Ajax

Para não perder o foco após uma requisição ajax do updatepanel é possível utilizar a função EndRequest.

var ID;

Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);

$("input.campo-texto1").live("focus", function () {
ID = $(this).attr('id');
});

function EndRequestHandler(sender, args) {
$('#' + ID).focus();
}