Skip to content

Instantly share code, notes, and snippets.

@FlameWert
FlameWert / PY0101EN-5-1-Numpy1D.ipynb
Created February 10, 2020 18:28
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / Get Path.md
Created February 8, 2020 01:28
Various ways to get location of an exe file of a C# app

If running program via Task Scheduler

string path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetEntryAssembly().Location);

Other Ways

string path = System.IO.Path.GetDirectoryName(Application.ExecutablePath);

sring path = Application.StartupPath`

string path = System.IO.Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName);

@FlameWert
FlameWert / PY0101EN-4-2-WriteFile.ipynb
Created February 7, 2020 21:05
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-4-1-ReadFile.ipynb
Created February 7, 2020 20:56
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-3-4-Classes.ipynb
Created February 7, 2020 17:37
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / ReadText.cs
Last active February 6, 2020 23:47
Read a text file inside a folder in a Visual Studio Project: C#
using System;
using System.IO;
class Program
{
public static void Main(string[] args)
{
//Traverse two folders up
string path = "../../Queries/Stage_Organization.sql"; //sql file is also a text file
string query = File.ReadAllText(path);
@FlameWert
FlameWert / PY0101EN-3-3-Functions.ipynb
Created February 6, 2020 21:27
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-3-2-Loops.ipynb
Created February 6, 2020 17:12
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@FlameWert
FlameWert / PY0101EN-3-1-Conditions.ipynb
Created February 6, 2020 12:09
Created on Cognitive Class Labs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.