Skip to content

Instantly share code, notes, and snippets.

@hugo-dc
hugo-dc / call_browser.abap
Created April 11, 2014 18:16
Call Browser
REPORT ZBROWSER .
call method cl_gui_frontend_services=>execute
exporting
document = 'http://hugo-dc.com'
exceptions
others = 1.
@hugo-dc
hugo-dc / pil_raw_encoder.md
Created October 14, 2014 04:46
pil_raw_encoder.md

Raw Encoder

1 1-bit bilevel, stored with the leftmost pixel in the most significant bit. 0 means black, 1 means white.

1;I 1-bit bilevel, stored with the leftmost pixel in the most significant bit. 0 means white, 1 means black.

@hugo-dc
hugo-dc / sshot.hs
Created February 18, 2015 19:04
Screenshot with Haskell
import Graphics.Win32.Window
import Graphics.Win32.GDI.Bitmap
import Graphics.Win32.GDI.HDC
import Graphics.Win32.GDI.Graphics2D
main = do desktop <- getDesktopWindow -- Grab the Hwnd of the desktop, GetDC 0, GetDC NULL etc all work too
hdc <- getWindowDC (Just desktop) -- Get the dc handle of the desktop
(x,y,r,b) <- getWindowRect desktop -- Find the size of the desktop so we can know which size the destination bitmap should be
-- (left, top, right, bottom)
newDC <- createCompatibleDC (Just hdc) -- Create a new DC to hold the copied image. It should be compatible with the source DC
@hugo-dc
hugo-dc / puzzle.py
Last active August 29, 2015 14:18 — forked from jdavis/puzzle.py
def cons(x, y):
return lambda f: f(x, y)
def car(x):
# Fill out this function
pass
if car(cons(1, 5)) == 1:
print 'Solved!'
else:
@hugo-dc
hugo-dc / grupo_de_vendedores_value_help.abap
Last active September 26, 2015 05:18
Value Help for VKGRP
DATA:
ti_tvgrt LIKE tvgrt OCCURS 0 WITH HEADER LINE.
DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.
DATA: BEGIN OF t_value OCCURS 0,
vkgrp LIKE tvgrt-vkgrp,
buzei LIKE tvgrt-bezei.
DATA: END OF t_value.
@hugo-dc
hugo-dc / recommended.abap
Last active September 27, 2015 19:08
Campo en selection screen como recomendado
@hugo-dc
hugo-dc / ranges.abap
Created October 27, 2011 15:40
ABAP Ranges
begin of bukrs occurs 0,
SIGN(1) type c, " I= Include E=Exclude
OPTION(2) type c, " EQ= Equals BT= Between NE= Not Equals
LOW like bukrs,
HIGH like bukrs,
end of bukrs.
@hugo-dc
hugo-dc / messtab.abap
Last active September 29, 2015 05:47
Messtsab messages
MESSAGE ID messtab1-msgid
TYPE messtab1-msgtyp
NUMBER messtab1-msgnr
WITH messtab1-msgv1 messtab1-msgv2 messtab1-msgv3
messtab1-msgv4.
LOOP AT MESSTAB.
select single * from t100 where sprsl = messtab-msgspra
and arbgb = messtab-msgid
and msgnr = messtab-msgnr.
@hugo-dc
hugo-dc / field-symbols.abap
Last active September 29, 2015 07:27
Field-Symbols
REPORT ztest.
DATA:
v_01 TYPE i VALUE '5',
v_02 TYPE i VALUE '10'.
FIELD-SYMBOLS: <value> TYPE i.
ASSIGN ('V_02') TO <value>.
@hugo-dc
hugo-dc / wp_changer.py
Created February 13, 2012 23:33
Change desktop wallpaper on Windows
import ctypes
ctypes.windll.user32.SystemParametersInfoA(20, 0, "myimage.jpg" , 0)