Pesquisa

sábado, 8 de novembro de 2014

Criando Sequence no Oracle

Como criar Sequence no Oracle de forma "automática".

declare 
  cnt number;
begin
  for r in (select SEQUENCE_NAME from all_sequences where sequence_owner = 'DATABASE') loop
    dbms_output.put_line('drop sequence ' || r.Sequence_name || ' ;');
  end loop;
end;

declare 
  cnt number;
begin
  for r in (select table_name from all_tables  where owner = 'DATABASE' and SUBSTR(table_name,0,2) <> 'DM') loop
    dbms_output.put_line('create sequence sec_' || SUBSTR(r.table_name,0,26) || ' minvalue 1 maxvalue 9999999999 start with 1 increment by 1 nocache cycle;');
  end loop;
end;

Fonte: Rodrigo Araujo

domingo, 2 de novembro de 2014

Como gerenciar o IIS por programação?

Aqui está um trecho de código que irá guiá-lo criando o objeto DirectoryEntry e chamar o método Invoke (...) com o parâmetro adequado para fazer a operação específica com o pool de aplicativos do IIS:

const string APPLICATION_POOL_URL = "IIS://KUNAL-CHOWDHURY.COM/W3SVC/AppPools/BlogPool";
var directoryEntry = new DirectoryEntry(APPLICATION_POOL_URL, USERNAME, PASSWORD);

// call to stop the Application Pool
directoryEntry.Invoke("Stop", null);

// call to start the Application Pool
directoryEntry.Invoke("Start", null);

// call to recycle the Application Pool
directoryEntry.Invoke("Recycle", null);

Fonte: http://www.kunal-chowdhury.com/2013/08/how-to-manage-iis-application-pool.html

domingo, 26 de outubro de 2014

Abrindo arquivo no Windows Forms

Para abrir um arquivo no windows forms.

String caminhoArquivoPDF = String.Format(“{0}\\Ajuda\\{1}”, Application.StartupPath, “ajuda.pdf”
);

if (File.Exists(caminhoArquivoPDF))
System.Diagnostics.Process.Start(caminhoArquivoPDF);

Lembrando que no modo debug não ira funcionar somente quando estiver publicado. Isso ocorre por causa do caminho do arquivo.

Para colocar o arquivo você terá que adicionar normalmente mas depois fazer o seguinte :

Nas propriedades do arquivo, mude o Build Action para “Content”;
Pronto! O arquivo vai aparecer em “Application Files” na configuração do ClickOnce

Sem isso o arquivo não ira aprecer no “Application Files” e não vai funcionar.

sexta-feira, 10 de outubro de 2014

O novo e melhorado C# 6.0

A versão 6.0 do C# passou por muitas melhorias e aprimoramentos no decorrer do seu desenvolvimento. Aqui está um resumo completo sobre o que esperar e do que procurar de novidades.

http://msdn.microsoft.com/en-us/magazine/dn802602.aspx

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