This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let initial_investment = -1000.0; | |
| let cash_receipts = vec![250.0, 350.0, 450.0, 550.0]; | |
| let cash_flows = vec![initial_investment, | |
| cash_receipts[0], cash_receipts[1], cash_receipts[2], cash_receipts[3]]; | |
| let rate = irr(&cash_flows); | |
| println!("IRR: {:.2}%", rate * 100.0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Transfer folder with files to vm | |
| scp -r -i certificate.pem home/userlocal/diretory uservm:ip_vm_host home/uservm/directory | |
| # Connect to vm | |
| ssh -i certificate.pem uservm:ip_vm_host | |
| # INSTALL .NET 7 | |
| # 1) Add package | |
| wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | |
| sudo dpkg -i packages-microsoft-prod.deb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pymongo | |
| print("start program --") | |
| client = pymongo.MongoClient("mongodb://localhost/DataBaseName?ssl=true&authSource=admin&maxIdleTimeMS=120000&retrywrites=false" | |
| , socketTimeoutMS=3600000) | |
| db = client["DataBaseName"] | |
| collection = db["ZipeCodeNumber"] | |
| ceps = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Reflection; | |
| using System.Text.Encodings.Web; | |
| using System.Text.Json; | |
| using System.Text.Json.Serialization; | |
| using Microsoft.Extensions.Logging; | |
| namespace Vasconcellos.Log |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.ComponentModel; | |
| using System.Linq; | |
| using System.Reflection; | |
| public static class EnumExtension | |
| { | |
| public static string GetDescription<TEnum>(this TEnum value) where TEnum : Enum | |
| { | |
| FieldInfo fieldInfo = value.GetType().GetField(value.ToString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function b64EncodeUnicode(str) { | |
| // first we use encodeURIComponent to get percent-encoded UTF-8, | |
| // then we convert the percent encodings into raw bytes which | |
| // can be fed into btoa. | |
| return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, | |
| function toSolidBytes(match, p1) { | |
| return String.fromCharCode('0x' + p1); | |
| })); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| private static T DeepCopy<T>(T other) | |
| { | |
| using (MemoryStream ms = new MemoryStream()) | |
| { | |
| BinaryFormatter formatter = new BinaryFormatter(); | |
| formatter.Context = new StreamingContext(StreamingContextStates.Clone); | |
| formatter.Serialize(ms, other); | |
| ms.Position = 0; | |
| return (T)formatter.Deserialize(ms); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function timer(ms) { return new Promise(res => setTimeout(res, ms)); } | |
| async function FollowInstagramUsers(amount) { | |
| for (var i = 0; i <= amount; i++) { | |
| document.getElementsByClassName("sqdOP L3NKy y3zKF ")[i].click(); | |
| console.log(i); | |
| await timer(5000); | |
| } | |
| } | |
| function wait(ms) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function download(content, fileName, contentType) { | |
| var a = document.createElement("a"); | |
| var file = new Blob([content], {type: contentType}); | |
| a.href = URL.createObjectURL(file); | |
| a.download = fileName; | |
| a.click(); | |
| } | |
| function getInstagramsIFollow(amount) { | |
| let instagrams = ''; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.IO; | |
| using System.Collections.Generic; | |
| using System.Runtime.Serialization.Formatters.Binary; | |
| using System.Linq; | |
| namespace Vasconcellos.Extensions | |
| { | |
| public static class ObjectExtension | |
| { | |
| /// <summary> |