Skip to content

Instantly share code, notes, and snippets.

View radityopw's full-sized avatar

radityo radityopw

View GitHub Profile
<?php
$con = mssql_pconnect("server","user","pass");
if (!$con || !mssql_select_db('database', $con)) {
die('Unable to connect or select database!');
}
$fp = fopen($_FILES['upload']['tmp_name'], 'rb');
$file_content = fread($fp, filesize($_FILES['upload']['tmp_name']));
fclose($fp);
<?php
$con = mssql_pconnect("server","user","pass");
if (!$con || !mssql_select_db('database', $con)) {
die('Unable to connect or select database!');
}
$sql = "SELECT type, data FROM FILES WHERE name = '".$namefile."'";
$res = mssql_query($sql,$con);
@radityopw
radityopw / wsrp_hoho.java
Created February 8, 2013 15:43
wsrp url extract.....
String url = p2.encodeURL(p1.getContextPath()+"/AppContext/img/display.jsp");
String[] urltemp = url.split("&");
for(int i=0;i<urltemp.length;i++){
String uTemp = urltemp[i];
if(uTemp.trim().substring(0, 8).equals("wsrp-url")){
url = uTemp.replaceAll("wsrp-url=", "");
url = url.replaceAll("%3A", ":");
url = url.replaceAll("%2F", "/");
break;
}
@radityopw
radityopw / Dicoba.java
Created January 10, 2016 01:41
simple class dicoba
package dicoba;
/**
*
* @author radity
*/
public class Dicoba {
public String masukin(){
return "hello";
CREATE TABLE [dbo].[person_cluster](
[id] [int] IDENTITY(1,1) NOT NULL,
[nama] [varchar](50) NOT NULL,
[umur] [int] NOT NULL,
CONSTRAINT [PK_person_cluster] PRIMARY KEY CLUSTERED
(
[id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
use clustered_vs_non_clustered
set statistics IO on
SET STATISTICS TIME ON
select top 10000 * from person_cluster
where id > 21
order by id
use clustered_vs_non_clustered
set statistics IO on
SET STATISTICS TIME ON
select top 10000 * from person_non_cluster
where id > 21
order by id
use clustered_vs_non_clustered
set statistics IO on
SET STATISTICS TIME ON
select top 10000 * from person_cluster
where umur > 25
order by umur
use clustered_vs_non_clustered
set statistics IO on
SET STATISTICS TIME ON
select top 10000 * from person_non_cluster
where umur > 25
order by umur
use clustered_vs_non_clustered
set statistics IO on
SET STATISTICS TIME ON
select * from person_cluster
where id between 1 and 54
order by id