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
| annual_salary = int(input("Enter your annual salary: ")) | |
| percentage_to_save = float(input("Enter the % of your salary to save (eg for 10% enter 10): ") / 100 | |
| total_cost = int(input("Enter the cost of your dream home: ")) | |
| def calculate_savings_timeframe(salary, percentage_to_save, total_cost): | |
| down_payment_target = total_cost * 0.25 | |
| savings_rate = float(0.04) | |
| months = total_saved = 0 | |
| while total_saved <= down_payment_target: |
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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>Tree Example</title> | |
| <style> | |
| .node { |
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 { Directive, Host, Self, HostListener } from '@angular/core'; | |
| import { Calendar } from 'primeng/primeng'; | |
| import { getMomentDate } from '../datetime/date-time.utils'; | |
| @Directive({ selector: '[appUtcOverride]' }) | |
| export class PrimeNgCalendarUtcDirective { | |
| constructor(@Host() @Self() private calendar: Calendar) { | |
| } |
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
| public AccountDo ModifyAccount(AccountDo account) | |
| { | |
| try | |
| { | |
| using (var dbContext = _dbContextFactory.Create()) | |
| { | |
| dbContext.Accounts.Attach(Mapper.Map<Account>(account)); | |
| dbContext.SaveChanges(); // in this method, as the dirty objects should be flushed on dbContext.Dispose() | |
| } // if we want to log the previous state, intercept the dbcontext methods: https://docs.microsoft.com/en-us/ef/ef6/fundamentals/logging-and-interception |
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
| * -cur_console:d:c:\dev\projects\plutus -cur_console:C:C:\apps\cmder\icons\cmder.ico cmd /k "%ConEmuDir%\..\init.bat" | |
| >* -cur_console:s1T50H -cur_console:d:C:\apps\cmder -cur_console:C:C:\apps\cmder\icons\cmder.ico cmd /k "%ConEmuDir%\..\init.bat" | |
| >* -cur_console:s1T50V -cur_console:d:C:\apps\cmder -cur_console:C:C:\apps\cmder\icons\cmder.ico cmd /k "%ConEmuDir%\..\init.bat" | |
| >* -cur_console:s2T50V -cur_console:d:C:\apps\cmder -cur_console:C:C:\apps\cmder\icons\cmder.ico cmd /k "%ConEmuDir%\..\init.bat" |
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
| Console.WriteLine("NOW: " + DateTime.UtcNow); | |
| var timesOfYear = new List<Tuple<string, DateTime>> | |
| { | |
| Tuple.Create("Today (now)", DateTime.UtcNow), | |
| Tuple.Create("Calgary Summer", new DateTime(2018, 6, 27, 14, 30, 0).ToUniversalTime()), | |
| Tuple.Create("Calgary Winter", new DateTime(2018, 11, 21, 14, 00, 0).ToUniversalTime()), | |
| Tuple.Create("In between DST", new DateTime(2018, 3, 19, 14, 30, 0).ToUniversalTime()), | |
| Tuple.Create("Sydney/London crossover", new DateTime(2018, 3, 28, 07, 30, 0).ToUniversalTime()) // London still on GMT, Sydney in DST | |
| }; |
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
| Console.WriteLine("NOW: " + DateTime.UtcNow); | |
| var timesOfYear = new List<Tuple<string, DateTime>> | |
| { | |
| Tuple.Create("Today (now)", DateTime.UtcNow), | |
| Tuple.Create("Calgary Summer", new DateTime(2018, 6, 27, 14, 30, 0).ToUniversalTime()), | |
| Tuple.Create("Calgary Winter", new DateTime(2018, 11, 21, 14, 00, 0).ToUniversalTime()), | |
| Tuple.Create("In between DST", new DateTime(2018, 3, 19, 14, 30, 0).ToUniversalTime()) | |
| }; |
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
| Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
| Enable-RemoteDesktop | |
| cinst RavenDB |
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
| [Binding] | |
| public class ScenarioInvoker_Steps | |
| { | |
| [Given(@"Successfully run scenario (.*)")] | |
| public void GivenSuccessfullyRunScenario(String featureAndScenarioName) | |
| { | |
| var parts = featureAndScenarioName.Split(new string[] {"S_"}, StringSplitOptions.RemoveEmptyEntries); | |
| if(parts.Length != 2) | |
| throw new ArgumentException("Invalid scenario reference string \"{0}\". Expecting string to be in the format F_N Feature Name S_N Scenario Name"); | |