Zerobin with QRCode

Rédigé par Sozezzo - - Aucun commentaire

A minimalist, opensource online pastebin-like where the server has zero knowledge of pasted data. Data is encrypted/decrypted in the browser using 256 bits AES...

 http://sebsauvage.net/wiki/doku.php?id=php:zerobin

with so many features  BUT without QR Code.

We can be sometime lazy to type URL on "Smartphone", but the "Smartphone" can read QR Code.

 

We use version alpha 0.19, GitHub access to source code.

 

Basic requirements:

  1. Not too much change the original code;
  2. Not compromise security;
  3. Easy to understand;

Lire la suite de Zerobin with QRCode

Create a XML select from a table definition.

Rédigé par Sozezzo - - Aucun commentaire

Transform table definition to XML select, it can be useful when we need to create many XML select or re-create it.

Result:


SELECT

  [Message].value('(msg_Customers/Customers/CustomerID)[1]', 'nchar(5)') as [CustomerID]

, [Message].value('(msg_Customers/Customers/CompanyName)[1]', 'nvarchar(40)') as [CompanyName]

, [Message].value('(msg_Customers/Customers/ContactName)[1]', 'nvarchar(30)') as [ContactName]

, [Message].value('(msg_Customers/Customers/ContactTitle)[1]', 'nvarchar(30)') as [ContactTitle]

, [Message].value('(msg_Customers/Customers/Address)[1]', 'nvarchar(60)') as [Address]

, [Message].value('(msg_Customers/Customers/City)[1]', 'nvarchar(15)') as [City]

, [Message].value('(msg_Customers/Customers/Region)[1]', 'nvarchar(15)') as [Region]

, [Message].value('(msg_Customers/Customers/PostalCode)[1]', 'nvarchar(10)') as [PostalCode]

, [Message].value('(msg_Customers/Customers/Country)[1]', 'nvarchar(15)') as [Country]

, [Message].value('(msg_Customers/Customers/Phone)[1]', 'nvarchar(24)') as [Phone]

, [Message].value('(msg_Customers/Customers/Fax)[1]', 'nvarchar(24)') as [Fax]

FROM   [Customers]

WHERE  [Message].exist('/msg_Customers/Customers') = 1

 

Lire la suite de Create a XML select from a table definition.

Calculation SQL Table size

Rédigé par Sozezzo - - Aucun commentaire

We have many ways to obtain the size of all tables using SQL Server.

This is a nice solution but we do not really need to use temporary table.

http://therightstuff.de/2007/11/19/How-To-Obtain-The-Size-Of-All-Tables-In-A-SQL-Server-Database.aspx

If we run the script twice, we have an error.

Well, this version uses a variable and we have another solution.

Lire la suite de Calculation SQL Table size

Convert XML to table and table to XML

Rédigé par Sozezzo - - Aucun commentaire

We have a lot of articles about how to do but most of the time it is too much information.

This article tries to answer 2 questions!

How can we create XML column from a SQL query?
How can we create a table from XML column?

 

This example use NorthWind database:

https://northwinddatabase.codeplex.com/releases/view/71634

Lire la suite de Convert XML to table and table to XML

Representational State Transfer (REST)

Rédigé par Sozezzo - - Aucun commentaire

REST is an architectural style for designing networked applications. It is an alternate to using complex mechanisms like COBRA, RPC, and SOAP to connect between client and server. REST makes communication between remote computers easy by using the simple HTTP protocol which support for CRUD (Create, Read, Update, and Delete) operations on the server. In a way, our World Wide Web is also based on the REST architecture.

Figure 5-10: Process view of a REST-based Architecture

Lire la suite de Representational State Transfer (REST)

Add a reference reference programmatically vba-Excel

Rédigé par Sozezzo - - Aucun commentaire

Ce code vous permet d'ajouter une référence à une bibliothèque spécifique en temps d'exécution.
C'est très utile quand on partage les classeurs entre différentes versions d'Excel.

J’ai vu cette page :
http://www.vbaexpress.com/kb/getarticle.php?kb_id=267

On a toujours les «MAIS ».

Mais, comment peut-on trouver le GUID?

1. Ouvrir le «References – VBA Project » 

On va ajouter le « Microsoft SQL Distribution Control 10.0 »

2. Ouvrir le « Regedit » et chercher la référence par le nom.

3. Copier la clef

HKEY_CLASSES_ROOT\TypeLib\{4AC4D38E-B5C0-4224-B98D-946D58684F39}

Lire la suite de Add a reference reference programmatically vba-Excel

Liste de champs des tables

Rédigé par Sozezzo - - Aucun commentaire

Créer le même code à adapter à chaque table selon les champs et le type.

Cela peut être une activité assez plate. On peut créer un code qui crée notre code. Peut-on appeler une métacreation, ou métacodification, mais, peut-être, il n'existe pas ce mot en français.

Alors, ce SQL script nous liste les champs de tables, et après, c'est une autre histoire.

BEGIN TRY DROP TABLE #TMP END TRY BEGIN CATCH END CATCH;
SELECT
     TABLE_SCHEMA
    ,TABLE_NAME
    ,ORDINAL_POSITION AS rownumber
    ,COLUMN_NAME AS 'ColumnName'
    ,DATA_TYPE + CASE WHEN CHARacter_maximum_length IS NOT NULL THEN '(' + CAST(CHARacter_maximum_length AS NVARCHAR(100)) + ')' ELSE '' END AS 'DataType'
    ,IS_NULLABLE
INTO #TMP
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = @SchemaSource AND TABLE_NAME = @TableSource;

Lire la suite de Liste de champs des tables

Finding Table and Primary Key and Foreign Key

Rédigé par Sozezzo - - Aucun commentaire

SQL Server does not help to easily determine the dependencies between tables.
This research presents the parent table and the child tables and columns used.

 

https://msdn.microsoft.com/en-us/library/ms179610.aspx
http://stackoverflow.com/questions/925738/how-to-find-foreign-key-dependencies-in-sql-server
 

well, however, we have many databases with bad design that didn’t have foreign keys defined but that did have related data.

Lire la suite de Finding Table and Primary Key and Foreign Key

Metodo 1 - como baixar musica do Youtube

Rédigé par Sozezzo - - Aucun commentaire

Existe enumeras maneiras de baixar musicas do youtube.

Metodo zero instalação: Não precisa instalar nada. O processo se resume em copiar o endereço do video e usar um site que converte o video para ser baixado.

 

http://www.youtube-mp3.org/

Estes outros sites funcionam basicamente da mesma maneira.
http://savedeo.com/
http://savefrom.net/
https://www.dredown.com/youtube
http://www.clipconverter.cc/
http://deturl.com/
http://keepvid.com/
http://www.tubeoffline.com/

 

Lire la suite de Metodo 1 - como baixar musica do Youtube

Récuperer les utilisateurs orphelins

Rédigé par Sozezzo - - Aucun commentaire

Après restaure la base de données MS SQL, il est possible que certains utilisateurs de la base de données soient orphelins. Alors, voici les SQL scripts pour les réparer.

 

Répare tous les utilisateurs orphelins de toutes bases de données:


DECLARE @sql as nvarchar(max);
SET @sql = '
USE[?];PRINT''Database: ''+db_name();DECLARE @username VARCHAR(25);DECLARE
GetOrphanUsers CURSOR FOR SELECT UserName=NAME FROM sysusers WHERE issqluser=1AND(sid IS
NOT NULL AND sid<>0x0)AND SUSER_SNAME(sid)IS NULL ORDER BY NAME;OPEN GetOrphanUsers;FETCH
NEXT FROM GetOrphanUsers INTO @username;WHILE @@FETCH_STATUS=0BEGIN IF @username=''dbo''
EXEC sp_changedbowner''sa'';ELSE BEGIN BEGIN TRY EXEC sp_change_users_login''update_one''
,@username,@username;END TRY BEGIN CATCH PRINT''Fail to fix database user: ''+@username;END CATCH
;END FETCH NEXT FROM GetOrphanUsers INTO @username;END;CLOSE GetOrphanUsers;DEALLOCATE
GetOrphanUsers;';
EXEC sp_MSforeachdb @sql

Lire la suite de Récuperer les utilisateurs orphelins

Fil RSS des articles