Showing posts with label Tutorials. Show all posts
Showing posts with label Tutorials. Show all posts

Monday 1 June 2020

showModalDialog Polyfill - Implementation

Hello prog.NET,

Did you used "Window.showModalDialog()" on your code? If that so, you must be have a problem with solution for implementation on other browsers except IE "Internet Explorer" because it was blocked or removed by dev browser;

example "Firefox" | "Chrome"
https://developer.mozilla.org/en-US/docs/Web/API/Window/showModalDialog

This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

This method was removed in Chrome 43 and Firefox 56.


Here'e i will give you another solution for that method.

When your web application using "Window.showModalDialog()" but it's not support for other browser an you did't want to changed, you can used showModalDialog Polyfill by niutech.
https://github.com/niutech/showModalDialog

showModalDialog Polyfill
This is a window.showModalDialog() shim using a modal HTML5 dialog element and ECMAScript 2015 Generators or ECMAScript 2017 Async/Await. It was tested in the latest Google Chrome and in the latest Mozilla Firefox with the dom.dialog_element.enabled preference set to true in about:config.


but code in that web doesn't completed for me, because i tested on Firefox the dialog position is not fixed and here'e i'm give the solution. I'm using ASP.NET for example;

CSS Code

dialog {
position: fixed;
top: 50%;
transform: translate(0, -50%);
}
.overlay{
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 10;
background-color: rgba(0,0,0,0.5); /*dim the background*/
}


Project Interface



WebModalDialog-ASPNet


Remarks;
- showModalDialog Polyfill - Implementation
- showModalDialog Polyfill not working on firefox
- showModalDialog Polyfill dialog position
- Solution / alternative showModalDialog on firefox or chrome


Noted;
  • The dialog tag defines a dialog box or subwindow.
  • The dialog element makes it easy to create popup dialogs and modals on a web page.

Browser Support

Thankyou, i hope this article are helpful.
Remember for best solution is using Bootstrap.
https://getbootstrap.com/docs/4.0/components/modal/

Thursday 7 November 2013

How to Detect Listen port Bitvise Ssh Client

Hi, finally i'm back to share posting "How to Detect Listen port Bitvise Ssh Client".

Why I'm share this posting?
Because i'm always use Bitvise to access my VPS on desktop, and i has build application that used Bitvise SSH. Then i have problem how to detect listen port of my bitvise profile is connected or not. I'm already looking on google how to that, but at the end I can not found it. So I have an idea with used third party application, that's "Paping".
What is Paping
Paping (pronounced pah ping) is a computer network administration utility used to test the reachability of a host on an Internet Protocol (TCP/IP) network and to measure the time it takes to connect to a specified port.

Syntax: paping [options] destination
Options:
  • -?, --help
  • -p, --port N
  •  -t, --timeout
  • -c, --count N
Bitvise services socks is TCP/IP listen interface, so that why i use paping command.
SSH port forwarding https://www.bitvise.com/port-forwarding


As you can see my SSH port forwarding is listen on 127.0.0.1 port 1081, below is the log if my SSH server success connected.
Question is how to automation my ssh with other application.
Oke let's begin, you must read our current article :
Our Application :
After that open our project "RedirectStandardOutput-Paping" , do some modified in Method OutputHandler 
I will send command paping to ping localhost/127.0.0.1 with port 1081
Command : 127.0.0.1 -p 1081

public void OutputHandler(object sendingProcess, DataReceivedEventArgs outLine)
        {
            SetText(outLine.Data);
//Add if conditional
if(outLine.Data.Contains("Connected")) MessageNox.Show("Your SSH Connected");
else(outLine.Data.Contains("Connection timed out")) MessageNox.Show("Your SSH Disconnected");
        }

Finally , rebuild your project.
Thank You

Wednesday 24 July 2013

How to use [eMo]Web Browser Optimizer ?

Optimize Browser Memory with [eMo]Web Browser Optimizer :
[eMo]Web Browser Optimizer opens as a small window listing all main browsers on the interface, along with a check-box. You just need to "check" the respective check-box of every browser you want to optimize.

YouTube - In Action
How to use [eMo]Web Browser Optimizer ?

Easy Steps are Here :

Step 1. Check the respective browser.
If you don’t find your browser listed there, you can tick the “Other” option. This will open a new window where you can find a drop-down listing some other browsers like Avant Browser, Comodo Dragon, K-Meleon etc.



Choose the desired browser of you can type the name of process your browser in Taskmanager and then press button "OK".

Step 2. Choose and Select optimization time.
Optimization Time : to set the length of time optimization.

Step 3. Click "On" optimization memory.
Click on "On" radio button on the main program window. [eMo]Web Browser Optimizer will then immediately start optimizing your browser’s memory.

Sunday 30 June 2013

Create Your Own URL Shortener With "YOURLS"


Create Your Own URL Shortener With "YOURLS"

* What is Yourls

YOURLS stands for Your Own URL Shortener. It is a small set of PHP scripts that will allow you to run your own URL shortening service (a la TinyURL or bitly).

Running your own URL shortener is fun, geeky and useful: you own your data and don't depend on third party services. It's also a great way to add branding to your short URLs, instead of using the same public URL shortener everyone uses.



Ok Lets Start the Tutorials,...

Create Your Own URL Shortener With "YOURLS" in Action - YouTube

Setup

1. You must have domain hosting for "URL Shortener"
Or you can sign up on IdHostinger

2. Download YOURLS from Github
In here I used the latest realease

3. Setup your domain hosting and Go Database management, create new database
Example :

4. Import / Setup Website template with file Yourls.zip


Configuration

1. After finish install / import Yourls, Go to File Manager >> Folder "User"
Example :

2. Duplicate , Rename and Edit file config.php
Settings as

/** MySQL database username */
define( 'YOURLS_DB_USER', 'your db user name' );

/** MySQL database password */
define( 'YOURLS_DB_PASS', 'your db password' );

/** The name of the database for YOURLS */
define( 'YOURLS_DB_NAME', 'yourls' );

/** MySQL hostname.
** If using a non standard port, specify it like 'hostname:port', eg. 'localhost:9999' or '127.0.0.1:666' */
define( 'YOURLS_DB_HOST', 'localhost' );

/** MySQL tables prefix */
define( 'YOURLS_DB_PREFIX', 'yourls_' );

** If you define it to "http://site.com", don't use "http://www.site.com" in your browser (and vice-versa) */
define( 'YOURLS_SITE', 'http://site.com' );

3. And then Go to your domain name "/admin" , setup Yourls domain

Wait for installing complete ,,..
Thats the and of tutorial, Create Your Own URL Shortener With "YOURLS"
You can test it,. Simple

Thank You ^__^

Wednesday 29 May 2013

Combine MDMA Design with "AutoIt" Script


On Pass Tutorial I was share about >> Design your MDMA : mobile data monitoring application , Now I will show you How to Combine MDMA Design with "AutoIt" Script. Why I use AutoIt Script ?? Because it is simple way calling scipt and small project.

AutoIt >> posting

Index of /autoit3/docs/functions
https://www.autoitscript.com/autoit3/docs/functions/

Lest see what It can use,...

1. Design your mdma design and open with Resource Hacker

Sample design >> Download

2. Added some control with ID
- Right Click on Form - Insert Control / Ctrl + I
In here I added Control Button "Route" with ID : 5

3. Open mdma-AutoItScript.au3

mdma-AutoItScript.au3 >> Download

On that script I was give some information, remember to make the same ID.

4. Compile mdma-AutoItScript.au3



Thank You

mdma_project

Thursday 23 May 2013

Speed up your Eclipse IDE

When we use the Eclipse was heavy due to the performance of the laptop rather large memory usage. To reduce memory usage and make-eclipse eclipse faster, here are effective methods what I was try :

* Clean up history and indexes
* Remove structured text validation
* Do not use subclipse plugin
* Configure appropriate start-up arguments

1. Clean up history and indexes

Cleaning up history and indexes reduce the load on RAM, and overall HDD usage as well. This result in very high impact on performance. To remove the indexes and history folders, please cleanup all files/folders inside these two folders:

For cleaning up indexes

{workspace path}\.metadata\.plugins\org.eclipse.jdt.core

For cleaning up history

{workspace path}\.metadata\.plugins\org.eclipse.core.resources\.history

Here {workspace path} is the path of eclipse workspace where you create all projects.
Please note that deleting the files from above both folders does not impact any of your project sourcecode in any way.

2. Remove structured text validation

This one also makes a lot of impact. Validation here is necessarily means multiple things eclipse do with your sourcecode files in background to check their validity. These are sometimes very much un-necessary and annoying too. I have worked on some projects consisting of lots of XML/XSLT and WSDL files, and some of these files always showing some red flags. But they created any problem in runtime, and in fact most of time, if was actually correct way to do things as well.

You can turn off these validations (for all types which you feel un-necessary) and enjoy a performing eclipse.

To turn off these text validations, open Windows > Preferences and in search bar type “validation”. It will list down all files types and applied validations on them. Disable whichever you feel un-necessary. And click OK.

3. Do not use subclipse plugin

This technique is really effective but hard to follow. It says that you should use your code in eclipse only for writing/modifying and executing. All other things related to SVN/perforce or any code repository should be done outside eclipse. This can be from a command line tool or any visual client.

Subversion plugin uses too much system resources and effects eclipse performance badly.

4. Configure appropriate start-up arguments

In your eclipse.ini file (inside eclipse installation folder) change the default -Xms40m -Xmx256m arguments as per your needs. This option defines the minimum and maximum memory usage bounds which are passed to java virtual memory to manage eclipse application’s memory allocation tolerance. You should not set them to maximum available because you need other softwares to run in parallel.

My sample config :
  

-startup
plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.200.v20120913-144807
-product
com.android.ide.eclipse.adt.package.adtproduct
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xverify:none
-Xquickstart
-server
-Xmn128m
-Xms512m
-Xmx1024m
-Xss2m
-XX:PermSize=128m
-XX:MaxPermSize=128m
-XX:+UseParallelGC

-Xquickstart
You can use -Xquickstart for initial compilation at a lower optimization level than in default mode. Later, depending on sampling results, you can recompile to the level of the initial compile in default mode. Use -Xquickstart for applications where early moderate speed is more important than long run throughput. In some debug scenarios, test harnesses and short-running tools, you can improve startup time between 15-20%.

-Xverify:none
You can use -Xverify:none if you want to skip the class verification stage during class loading . Using -Xverify:none disables Java class verification, which can provide a 10-15% improvement in startup time. However corrupted or invalid class data is not detected when this option is specified. If corrupt class data is loaded, the Java Virtual Machine (JVM) might behave in an unexpected manner, or the JVM might fail. But this can only happen, when you are making byte code modifications youself.

-server | -client
Java HotSpot Technology in the Sun-based Java Development Kit (JDK) Version 1.4.2 introduces an adaptive JVM containing algorithms for optimizing byte code execution over time. The JVM runs in two modes, -server and -client. If you use the default -client mode, there will be a faster start-up time and a smaller memory footprint, but lower extended performance. You can enhance performance by using -server mode if a sufficient amount of time is allowed for the HotSpot JVM to warm up by performing continuous execution of byte code. In most cases, use -server mode, which produces more efficient run-time execution over extended periods. You can monitor the process size and the server startup time to check the difference between -client and -server.

Ok that all the tips
Thank You 'How To Do In Java'

Friday 22 March 2013

How to Configure Control your PC with Unified Remote


If before I share and explain about Unified Remote , Now I want to give your tips How to Configure Control your PC with Unified Remote . It will be add more percentage of your presentation . Before I begin the steps, read a little excerpt below ^_^ .

What is Unified Remote

Unified Remote is an app that lets you control your entire Windows computer from your Android device. In short, it turns your device into a WiFi or Bluetooth remote control for all the programs on your computer. It is easily the most feature-filled PC remote available. With our app you can control a wide range of applications, including simple mouse and keyboard, media players, and other external hardware that can be connected to your computer. Check out our hardware section for a list of officially support hardware extensions. We also provide extensive capabilities for users to create their own custom remotes for their needs.
Unified Remote Client App

The client app runs on your device. Currently we support Android and Windows Phone. We aim to release apps for even more platforms in the future, such as iPhone, Windows 8, HTML5/JS.
Unified Remote Server App

The server application runs on your computer. Currently we only support Windows. We are currently working on a new server, which will be compatible on Windows, Linux, and OSX.



Ok, if you finish read that information.... Let’s check it out..
  1. Configure on your PC
  • Download and Install Unified Remote for PC
Installer : Official | Dropbox | Google Drive

Screenshot of Configuration:

* on right picture that's show the ip address of WiFi connection with WiFi Hotspot my Android
 
Wifi Connection

  1. Configure on Android
Download from this post >> Control your PC with Unified Remote for Windows Phone and Android
  • Turn on | Create | : Tethering & portable hotspot

And then connect your pc with WiFi Hotspot from Android, see picture 'Wifi Connection'
2. Configure Unified Remote on Android

* Go to 'Server' - Select Automatic search
if if the client PC is not detect : Choose - manual and create configuration like on image.
"equate the ip from your PC to Unified Remote Android and password from wifi"

* Go to 'Remotes' - Select the 'Server' name that you have to Connect

Thats all How to Configure Control your PC with Unified Remote ^_^
Thank You

Note :
Buy the full version of Unified Remote and you’re getting access to more functions and apps to control. You’ll get things like custom remotes, Hulu desktop controller, Hulu web controller, Netflix support, XBMC support and so, so much more.