Skip to content

Instantly share code, notes, and snippets.

View musoftware's full-sized avatar
🌏
Working from home

Musoftware musoftware

🌏
Working from home
View GitHub Profile
@musoftware
musoftware / program1.java
Created June 10, 2017 21:45
The first Java program
import java.lang.*;
public class First {
public static void main(String[] args) {
System.out.println("This is my first Java program.");
}
}
/*
@musoftware
musoftware / readonly.cs
Created June 10, 2017 15:40
ReadOnly ReAssign
using System;
class Program
{
class _class
{
public readonly int readOnly = 1;
public _class() { }
public _class(int newValue)
{
@musoftware
musoftware / bigHash.cs
Created May 20, 2017 21:20
BigHashSet for x86
public class BigHashSet<T>
{
int count = 0;
private List<HashSet<T>> hashes = new List<HashSet<T>>();
public void Add(T item)
{
int pos = count / 10000000;
if (pos >= hashes.Count)
{
hashes.Add(new HashSet<T>());
@musoftware
musoftware / controller.php
Last active February 5, 2017 08:56
Load Users into Dropbox CakePHP
$users = $this->Posts->Users->find('list', ['limit' => 200]);
$this->set(compact('users'));
@musoftware
musoftware / 0_reuse_code.js
Created February 5, 2017 08:50
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@musoftware
musoftware / v.php
Created February 3, 2017 20:45
cakephp validate Link
$validator
->requirePresence('link', 'create')
->notEmpty('link')->add('link', 'validFormat', [
'rule' => array('custom', '_^(?:(?:https?|ftp)://)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)(?:\.(?:[a-z\x{00a1}-\x{ffff}0-9]+-?)*[a-z\x{00a1}-\x{ffff}0-9]+)*(?:\.(?:[a-z\x{00a1}-\x{ffff}]{2,})))(?::\d{2,5})?(?:/[^\s]*)?$_iuS'),
'message' => 'Please enter a valid link.'
]);
@musoftware
musoftware / xpath
Created January 2, 2017 14:35
XPath
var xpath_any_attr_equal = "//button[.='OK']";
var xpath_any_element_equal = "//*[text='OK']";
@musoftware
musoftware / SeleniumWaitLoading.cs
Created January 2, 2017 14:33
Selenium Wait Loading
private void WaitLoading(IWebDriver driver)
{
try
{
IWait<IWebDriver> waitload = new WebDriverWait(driver, TimeSpan.FromMinutes(15));
waitload.Until<bool>((IWebDriver driver1) => ((IJavaScriptExecutor)driver).ExecuteScript("return document.readyState", new object[0]).Equals("complete"));
}
catch
{
throw;
@musoftware
musoftware / MySQL.md
Last active December 1, 2016 17:06
Fast Search In Database Mysql

** MySQL

disadvantage

  • slow in FULL TEXT

to make it fast use ndb cluster as DB Engine and merge many servers

@musoftware
musoftware / test.md
Last active January 22, 2025 15:26
180+ Sample Test Cases for Testing Web and Desktop Applications

#This is a testing checklist for web and desktop applications.

Make testing checklist as an integral part of test cases writing process. Using this checklist you can easily create hundreds of test cases for testing web or desktop applications. These are all general test cases and should be applicable for almost all kind of applications. Refer these tests while writing test cases for your project and I’m sure you will cover most testing types except the application specific business rules provided in your SRS documents.

Though this is a common checklist, I recommend preparing a standard testing checklist tailored to your specific needs using below test cases in addition with application specific tests.

###Importance of Using Checklist for Testing: – Maintaining a standard repository of reusable test cases for your application will ensure the most common bugs will be caught more quickly. – Checklist helps to quickly complete writing test cases for new versions of the application. – Reusing test cases help to