This file contains 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
#!/usr/bin/env bash | |
# fail if any commands fails | |
set -e | |
# debug log | |
set -x | |
# write your script here | |
# Navigate to DerivedData | |
cd /Users/vagrant/Library/Developer/Xcode/DerivedData/ |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
from numpy.fft import fft, ifft | |
from pydub import AudioSegment | |
from playsound import playsound | |
from tkinter import * | |
from pydub.playback import play | |
import tkinter as tk |
This file contains 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 numpy as np | |
import matplotlib.pyplot as plt | |
from numpy.fft import fft, ifft | |
from pydub import AudioSegment | |
from playsound import playsound | |
from tkinter import * | |
from pydub.playback import play | |
import tkinter as tk |
This file contains 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
/// 1- Generate a random solution | |
func randomSolution(tspProblem: [[Int]]) -> [Int] { | |
var cities = Array(1...tspProblem.count) | |
var randomSoultion:[Int] = [] | |
randomSoultion.append(1) | |
cities.removeAll(where: { $0 == 1}) | |
for _ in 1 ..< tsp.count { | |
let randomCity = cities.shuffled().last! |
This file contains 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
{ | |
"watermark": { | |
"image": "MovielalaLogo", | |
"position": "topRight" | |
}, | |
"topBar": { | |
"backgroundColor": ["#a60500b0", "#a60500a0"], | |
"elements": [ | |
{ | |
"type": "button", |
This file contains 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 Combine | |
var moviessPublisher = ["James bond","abo elaraby","F.R.I.E.N.D.S","House Of Cards"] | |
.publisher | |
.eraseToAnyPublisher() | |
func rating(for movie: String) -> AnyPublisher<Int,Never> { //could be a restful api that takes movie name and return the rating |
This file contains 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
//In your app delegate, add the following | |
static var deviceID = String() | |
func messaging(_ messaging: Messaging, didRefreshRegistrationToken fcmToken: String) { | |
guard let newToken = InstanceID.instanceID().token() else {return} | |
AppDelegate.deviceID = newToken | |
connectToFCM() | |
} | |