Skip to content

Instantly share code, notes, and snippets.

View iMostfa's full-sized avatar
๐Ÿคช
โ“˜ ๐—ข๐—ณ๐—ณ๐—ถ๐—ฐ๐—ถ๐—ฎ๐—น ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—ฑ ๐˜๐—ต๐—ฎ๐˜ ๐˜๐—ต๐—ถ๐˜€ ๐—ถ๐˜€ ๐—ณ๐—ฎ๐—น๐˜€๐—ฒ ๐—ฎ๐—ป๐—ฑ ๐—บ๐—ถ๐˜€๐—น๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด

iMostfa

๐Ÿคช
โ“˜ ๐—ข๐—ณ๐—ณ๐—ถ๐—ฐ๐—ถ๐—ฎ๐—น ๐˜€๐—ผ๐˜‚๐—ฟ๐—ฐ๐—ฒ๐˜€ ๐˜€๐˜๐—ฎ๐˜๐—ฒ๐—ฑ ๐˜๐—ต๐—ฎ๐˜ ๐˜๐—ต๐—ถ๐˜€ ๐—ถ๐˜€ ๐—ณ๐—ฎ๐—น๐˜€๐—ฒ ๐—ฎ๐—ป๐—ฑ ๐—บ๐—ถ๐˜€๐—น๐—ฒ๐—ฎ๐—ฑ๐—ถ๐—ป๐—ด
View GitHub Profile
@iMostfa
iMostfa / table2.md
Last active March 7, 2025 11:00
table2.md
thread number operation type function
61 write #0 closure #1 in ConversationChattoDataSource.shouldForceUpdate(messages:changes:)
81 read #0 TextMessageViewModel.__allocating_init(domain:timeFormatter:)
Field Description
Exception Type EXC_BAD_ACCESS which is a type of an exception raised by the processor when an app tries to access an illegal memory address
Exception Subtype KERN_INVALID_ADDRESS at 0x00000005329061e0 which means that the kernel tried to access an invalid address
Triggering Thread The thread which has crashed, Thread 26
Crash stack 0 libobjc.A.dylib 0x0000000199d21688 objc_retain_x8 + 16 (:-1) the function we crashed in, a function inside Objective-C runtime
Field Description
Path The path of our application at the time of the crash on the userโ€™s device: /private/var/containers/Bundle/Application/70CC1A20-0BBC-4BEC-85CB-497F7CAE0552/Wallapop.app/Wallapop
Exception Type EXC_BAD_ACCESS a type of an exception raised by the processor when an app attempts to access an illegal memory address.
Exception Subtype KERN_INVALID_ADDRESS at 0x0000000000000010 means that the kernel tried to access 0x10 which is an unexpected address that our app should not attempt to access.
Thread 0 Crashed The thread that crashed. In this case, it is the main thread.
#!/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/
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
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
@iMostfa
iMostfa / SimulatedAnnealing.swift
Last active April 30, 2021 20:44
Simulated Annealing for TSP
/// 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!
{
"watermark": {
"image": "MovielalaLogo",
"position": "topRight"
},
"topBar": {
"backgroundColor": ["#a60500b0", "#a60500a0"],
"elements": [
{
"type": "button",
@iMostfa
iMostfa / Combine.swift
Created August 20, 2020 19:48
flatMap without losing the value from upstream
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
@iMostfa
iMostfa / AppDelegate.swift
Created February 7, 2020 15:18
Notifications Firebase
//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()
}