Search Results

Search found 5 results on 1 pages for 'margus'.

Page 1/1 | 1 

  • Symbolic Regular Expression Exploration

    - by Robz / Fervent Coder
    This is a pretty sweet little tool. Rex (Regular Expression Exploration) is a tool that allows you to give it a regular expression and it returns matching strings. The example below creates10 strings that start and end with a number and have at least 2 characters: > rex.exe "^\d.*\d$" /k:10 This is something I could use to validate/generate the Regular Expressions I have created with both UppercuT and RoundhousE. Check out the video below: Margus Veanes - Rex - Symbolic Regular Expression Exploration Margus Veanes, a Researcher from the RiSE group at Microsoft Research, gives an overview of Rex, a tool that generates matching string from .NET regular expressions. Rex turns regular expres...

    Read the article

  • Applying for internship

    - by Margus
    At the moment I'm thinking about applying for internship at Eesti Energia. I seem to be eligible, but before contacting them I need to learn how to compile an informative and complete CV and cover letter. I do not consider myself as shallow minded, but also I'm not sure how to convincingly justify the stand of interest and how internship will help me in my future career. Course of life Tallinna Tehnikagümnaasium 2003 - 2006 Tallinna Tehnikaülikool 2006 – 2009 Military service at Signal Batallion Tallinna Tehnikaülikool 2010 – ... I started my academic career as Computer and Systems Engineer, but as I excelled in programming classes, I changed my major to Software Engineer and taken my specialty in web applications and logic. Nowadays I mainly use Java, Mathematica and C# to solve problems. For 2 times, I have taken part in ACM International Collegiate Programming Contest, where my team won the nationals and did pretty well in Europe. Also as part of notable thing in my academic career, my team wrote the Kalah game AI, that won in University's main programming class AI tournament. My hobbies are mind games and occasional problem solving. Few years ago I also competed in International Checkers EM (requires being in top 3 in nationals) as part of cadet and junior age group - I did not come close to winning, but I exceeded about half of the players each time. In high school and gymnasium I took part and later was the captain of team, that passes regionals and made it to top 3 of nationals (and later won) in (blitz) russian checkers. That was impressive because, it was a team effort as we only had (depending on year) 2-3 strong players. Although I started programming exactly 9,5 years ago I have no work experience. Well actually thats not true, as I completed my army duty, I was hired for a year (days still counting) to be apart of communicational (emergency) infrastructure action group where I'm the teams IT specialist (it's more complicated). So I consider myself to be aware of: rough conditions, teamwork, high stress tolerance, being on time and what responsibility means. As negative things I can mention: I do not have drivers licence. Although only Estonian and English are noted as requirements, then Russian is most likely required as well and I barely understand some of it. Reasons why I want to apply there, are: I need to do at least 4-6 week traineeship and it's in the right field I have the requirements and tasks seem easy enough Company is well known and has fairly good reputation Family and friend think, that it would be acceptable place to work Myriad of options to do final thesis about open up Work place is located in the same city I live atm. At moment, I see myself having a hard time explain why I would prefer it or where I see myself in 10 years if I was offered a job there. Question I have some idea how Curriculum Vitæ should look like, or I can google for template, but I'm not sure how to write informative one. Last I did one, it looked like: picture + contact information + education. Vaguely I only remember, that cover letter should be custom tailored for each place you apply containing ...

    Read the article

  • How to use webbrowser control DocumentCompleted event in C# ?

    - by Margus
    Before starting writing this question, i was trying to solve following // 1. navigate to page // 2. wait until page is downloaded // 3. read and write some data from/to iframe // 4. submit (post) form The problem was, that if a iframe exists on a web page, DocumentCompleted event would get fired more then once (after each document has been completed). It was highly likely that program would have tried to read data from DOM that was not completed and naturally - fail. But suddenly while writing this question 'What if' monster inspired me, and i fix'ed the problem, that i was trying to solve. As i failed Google'ing this, i thought it would be nice to post it here. private int iframe_counter = 1; // needs to be 1, to pass DCF test public bool isLazyMan = default(bool); /// <summary> /// LOCK to stop inspecting DOM before DCF /// </summary> public void waitPolice() { while (isLazyMan) Application.DoEvents(); } private void webBrowser1_Navigating(object sender, WebBrowserNavigatingEventArgs e) { if(!e.TargetFrameName.Equals("")) iframe_counter --; isLazyMan = true; } private void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { if (!((WebBrowser)sender).Document.Url.Equals(e.Url)) iframe_counter++; if (((WebBrowser)sender).Document.Window.Frames.Count <= iframe_counter) {//DCF test DocumentCompletedFully((WebBrowser)sender,e); isLazyMan = false; } } private void DocumentCompletedFully(WebBrowser sender, WebBrowserDocumentCompletedEventArgs e){ //code here } For now at least, my 5m hack seems to be working fine. Maybe i am really failing at querying google or MSDN, but i can not find: "How to use webbrowser control DocumentCompleted event in C# ?"

    Read the article

  • Closing a hook that captures global input events

    - by Margus
    Intro Here is an example to illustrate the problem. Consider I am tracking and displaying mouse global current position and last click button and position to the user. Here is an image: To archive capturing click events on windows box, that would and will be sent to the other programs event messaging queue, I create a hook using winapi namely user32.dll library. This is outside JDK sandbox, so I use JNA to call the native library. This all works perfectly, but it does not close as I expect it to. My question is - How do I properly close following example program? Example source Code below is not fully written by Me, but taken from this question in Oracle forum and partly fixed. import java.awt.AWTException; import java.awt.Dimension; import java.awt.EventQueue; import java.awt.GridLayout; import java.awt.MouseInfo; import java.awt.Point; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; import javax.swing.JLabel; import com.sun.jna.Native; import com.sun.jna.NativeLong; import com.sun.jna.Platform; import com.sun.jna.Structure; import com.sun.jna.platform.win32.BaseTSD.ULONG_PTR; import com.sun.jna.platform.win32.Kernel32; import com.sun.jna.platform.win32.User32; import com.sun.jna.platform.win32.WinDef.HWND; import com.sun.jna.platform.win32.WinDef.LRESULT; import com.sun.jna.platform.win32.WinDef.WPARAM; import com.sun.jna.platform.win32.WinUser.HHOOK; import com.sun.jna.platform.win32.WinUser.HOOKPROC; import com.sun.jna.platform.win32.WinUser.MSG; import com.sun.jna.platform.win32.WinUser.POINT; public class MouseExample { final JFrame jf; final JLabel jl1, jl2; final CWMouseHook mh; final Ticker jt; public class Ticker extends Thread { public boolean update = true; public void done() { update = false; } public void run() { try { Point p, l = MouseInfo.getPointerInfo().getLocation(); int i = 0; while (update == true) { try { p = MouseInfo.getPointerInfo().getLocation(); if (!p.equals(l)) { l = p; jl1.setText(new GlobalMouseClick(p.x, p.y) .toString()); } Thread.sleep(35); } catch (InterruptedException e) { e.printStackTrace(); return; } } } catch (Exception e) { update = false; } } } public MouseExample() throws AWTException, UnsupportedOperationException { this.jl1 = new JLabel("{}"); this.jl2 = new JLabel("{}"); this.jf = new JFrame(); this.jt = new Ticker(); this.jt.start(); this.mh = new CWMouseHook() { @Override public void globalClickEvent(GlobalMouseClick m) { jl2.setText(m.toString()); } }; mh.setMouseHook(); jf.setLayout(new GridLayout(2, 2)); jf.add(new JLabel("Position")); jf.add(jl1); jf.add(new JLabel("Last click")); jf.add(jl2); jf.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { mh.dispose(); jt.done(); jf.dispose(); } }); jf.setLocation(new Point(0, 0)); jf.setPreferredSize(new Dimension(200, 90)); jf.pack(); jf.setVisible(true); } public static class GlobalMouseClick { private char c; private int x, y; public GlobalMouseClick(char c, int x, int y) { super(); this.c = c; this.x = x; this.y = y; } public GlobalMouseClick(int x, int y) { super(); this.x = x; this.y = y; } public char getC() { return c; } public void setC(char c) { this.c = c; } public int getX() { return x; } public void setX(int x) { this.x = x; } public int getY() { return y; } public void setY(int y) { this.y = y; } @Override public String toString() { return (c != 0 ? c : "") + " [" + x + "," + y + "]"; } } public static class CWMouseHook { public User32 USER32INST; public CWMouseHook() throws UnsupportedOperationException { if (!Platform.isWindows()) { throw new UnsupportedOperationException( "Not supported on this platform."); } USER32INST = User32.INSTANCE; mouseHook = hookTheMouse(); Native.setProtected(true); } private static LowLevelMouseProc mouseHook; private HHOOK hhk; private boolean isHooked = false; public static final int WM_LBUTTONDOWN = 513; public static final int WM_LBUTTONUP = 514; public static final int WM_RBUTTONDOWN = 516; public static final int WM_RBUTTONUP = 517; public static final int WM_MBUTTONDOWN = 519; public static final int WM_MBUTTONUP = 520; public void dispose() { unsetMouseHook(); mousehook_thread = null; mouseHook = null; hhk = null; USER32INST = null; } public void unsetMouseHook() { isHooked = false; USER32INST.UnhookWindowsHookEx(hhk); System.out.println("Mouse hook is unset."); } public boolean isIsHooked() { return isHooked; } public void globalClickEvent(GlobalMouseClick m) { System.out.println(m); } private Thread mousehook_thread; public void setMouseHook() { mousehook_thread = new Thread(new Runnable() { @Override public void run() { try { if (!isHooked) { hhk = USER32INST.SetWindowsHookEx(14, mouseHook, Kernel32.INSTANCE.GetModuleHandle(null), 0); isHooked = true; System.out .println("Mouse hook is set. Click anywhere."); // message dispatch loop (message pump) MSG msg = new MSG(); while ((USER32INST.GetMessage(msg, null, 0, 0)) != 0) { USER32INST.TranslateMessage(msg); USER32INST.DispatchMessage(msg); if (!isHooked) break; } } else System.out .println("The Hook is already installed."); } catch (Exception e) { System.err.println("Caught exception in MouseHook!"); } } }); mousehook_thread.start(); } private interface LowLevelMouseProc extends HOOKPROC { LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT lParam); } private LowLevelMouseProc hookTheMouse() { return new LowLevelMouseProc() { @Override public LRESULT callback(int nCode, WPARAM wParam, MOUSEHOOKSTRUCT info) { if (nCode >= 0) { switch (wParam.intValue()) { case CWMouseHook.WM_LBUTTONDOWN: globalClickEvent(new GlobalMouseClick('L', info.pt.x, info.pt.y)); break; case CWMouseHook.WM_RBUTTONDOWN: globalClickEvent(new GlobalMouseClick('R', info.pt.x, info.pt.y)); break; case CWMouseHook.WM_MBUTTONDOWN: globalClickEvent(new GlobalMouseClick('M', info.pt.x, info.pt.y)); break; default: break; } } return USER32INST.CallNextHookEx(hhk, nCode, wParam, info.getPointer()); } }; } public class Point extends Structure { public class ByReference extends Point implements Structure.ByReference { }; public NativeLong x; public NativeLong y; } public static class MOUSEHOOKSTRUCT extends Structure { public static class ByReference extends MOUSEHOOKSTRUCT implements Structure.ByReference { }; public POINT pt; public HWND hwnd; public int wHitTestCode; public ULONG_PTR dwExtraInfo; } } public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { @Override public void run() { try { new MouseExample(); } catch (AWTException e) { e.printStackTrace(); } } }); } }

    Read the article

  • Tool for analyzing java core dump

    - by margus
    If i make java core dump with gcore then what is the best tool to analyze it? I need to be able make jmap, jstack, jstat etc and also i need to see values of all variables. Something that can take core dump as frozen JVM.

    Read the article

1