Skip to content

Instantly share code, notes, and snippets.

View hexbinoct's full-sized avatar

user77 hexbinoct

  • Pakistan
View GitHub Profile
public class WaitC
{
int m_hour, m_minute;
int m_waitMilliSeconds = 0;
public string TargetDailyTime {
get {
return $"{m_hour.ToString("00")}{m_minute.ToString("00")}";
}
set {
@hexbinoct
hexbinoct / System.ini
Created August 8, 2022 16:27
Rainmeter custom System.ini with bigger fonts
; Lines starting ; (semicolons) are commented out.
; That is, they do not affect the code and are here for demonstration purposes only.
; ----------------------------------
[Rainmeter]
; This section contains general settings that can be used to change how Rainmeter behaves.
Update=1000
Background=#@#Background.png
; #@# is equal to Rainmeter\Skins\illustro\@Resources
BackgroundMode=3
{
"workbench.colorCustomizations": {
"statusBar.background" : "#013585",
"statusBar.noFolderBackground" : "#212121",
"statusBar.debuggingBackground": "#263238",
"titleBar.activeBackground": "#0d1fc4da",
"titleBar.border": "#2e0303",
"titleBar.activeForeground": "#afffff",
// "activityBar.activeBackground": "#006eff",
"activityBar.background": "#101394"
in an mdi app, add 2 seperate forms form1 and form2, put a lable in form2, and Anchor it to bottom. start the app, show form1 as max, now show form2, because form1 was max, form2 will also show as max, you will see label in form2 at the correct place. Now, in code, goto the load event of form2, just type label1.Text="hi". Now run the app again, show form1 maximized, and now show form2, it will open maximized, but the anchoring of label will be disturbed, now its not where it was supposed to be, now its distance from top of the form is what it was in the designer.
Now if you move the statement label1.Text="hi" from form's Load event to Shown event, the anchoring bug is disappears.
@hexbinoct
hexbinoct / csvsplit.cs
Created November 17, 2020 07:34
Split csv line with commas and quotes in data
public static List<string> single_line_process2(string line)
{
List<string> lineparts = new List<string>();
List<char> this_section = new List<char>();
bool quoteson = false;
//Action<int> act = (int a) =>{ a = 6; };
Func<int, bool> islineend = (int i) => { return i >= line.Length - 1 ? true : false; };
Action<char> addtosection = (c) => { this_section.Add(c); };
@hexbinoct
hexbinoct / github-troll.md
Created October 28, 2020 09:25 — forked from lrvick/github-troll.md
Trolling Github's DMCA repo with their own security flaws.
public class InvoiceItems
{
public InvoiceItems()
{
}
public double Discount { get; set; }
public int InvoiceType { get; set; }
public string ItemCode { get; set; }
public string ItemName { get; set; }
@hexbinoct
hexbinoct / code128visualbasic.vb
Created November 1, 2018 17:20
Visual Basic .net code to convert input to Code128 barcode font.
'taken from https://grandzebu.net/informatique/codbar-en/code128.htm please visit their website for more information.
'code below is working fine in vb.net, original code was older version, before .net days I think.
'imp link
'https://docs.microsoft.com/en-us/dotnet/visual-basic/programming-guide/language-features/data-types/type-characters
'type characters while declaring variables
'symbol Type Example
'% Integer Dim L%
'& Long Dim M&
'@ Decimal Const W@ = 37.5
@hexbinoct
hexbinoct / gdrive_download.txt
Created June 16, 2018 09:13
download file from google drive using WGET (for linux console)
got the help from this link, good suggestions:
https://gist.github.com/iamtekeste/3cdfd0366ebfd2c0d805
what worked for me:
what I got from google drive (shareable link) was this:
`https://drive.google.com/open?id=ID`
changed it to:
`wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=ID' -O FILENAME`
herdsize = input("Enter herd size:")
records = {} #initialize record where cow names and data will be stored
minimumdata = {} #record data which is below minimum yield
totaldays = 2
minimumyield = 5 #litres
def Processing():
for i in range(1,totaldays+1):
print("Day " +str(i) +":")
print("-----------")