Skip to content

Instantly share code, notes, and snippets.

Avatar

Mohamed Yousif adonese

View GitHub Profile
@adonese
adonese / certum.pem
Created March 10, 2020 07:41
Certum ca cert
View certum.pem
-----BEGIN CERTIFICATE-----
MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK
ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv
biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy
MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU
ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5
MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC
l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J
J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4
View gist:595842960cf15b95d3926d2a10adebe1
#include <stdio.h>
#include <string.h>
#include </home/adonese/sources/curl-7.59.0/include/curl/curl.h>
int main(void)
{
CURL *curl;
CURLcode res;
static const char *postthis = "moo mooo moo moo";
@adonese
adonese / time_format.md
Last active March 30, 2018 11:55
Morsal timezone issue.
View time_format.md

How DateTime is parsed in Morsal

I must stress that working with time is always a major-bug source.

I have checked both GWD {Consumer,Terminal} API documentation, as well as the source code. Here is how our CMS handles the timezone. Again, I have already mentioned that in a previous email, but it is nevertheless important to make sure that we all understand how our CMS handles timezone.

  • You can either send the time, in any tranDateTime parameter, as YYYY-MM-ddThh:mm[:ss]Z, in this case, the time should be sent in UTC. This is what causes the +2:00 issue. In our CMS, we have set our timezone as Khartoum, which is UTC+2:00, so when we receive any request, we instantaneously convert it to the appropiriate timezone, the timezone that is recognized by EBS, which is UTC+2:00. All that depends on the fact that any tranDateTime is received by CMS as UTC time. What we are doing now is sending our time in UTC+2:00! This is bug. It is neither from CMS, nor Alaa Aldin, nor EBS.
  • Or, we can send the `tranD
@adonese
adonese / grading-list
Created January 8, 2018 11:23
My Grading list, High School Certificate.
View grading-list
+---------------------------------------------------+
| Subject | Grade | Grade Written |
----------------------------------------------------+
| Arabic Language | 92 | Ninety Two |
+---------------------------------------------------+
| English Language | 91 | Ninety One |
+---------------------------------------------------+
| Islamic Studies | 92 | Ninety Two |
+---------------------------------------------------+
| Specialized Mathematics | 77 | Seventy Seven |
@adonese
adonese / Makefile.config
Created December 31, 2017 15:48
Caffe Makefile
View Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@adonese
adonese / geoid.m
Created September 12, 2017 14:23
This function computes the geoid and store the results as a grid. We have another function to do the pointwise computations.
View geoid.m
function [latbp, lonbp, grid, windowSize] = geoidUndulationMod(model,nmax,varargin)
% [lonbp,LATD,GEOPOT_GRID] = geoidUndulation(MODEL,NMAX,VARARGIN)
% What this function does is calculating the geoid height of specific lon/ lat (location)
% Parameters it takes:
% 1. 'model': Name of *.mat file that contains cnm & snm. It also should come with maximum degree.
% All these steps are handled in ggmReader script, you should run it before. You can take the cnm & snm and pass them
% as inputs.
%
%
% 2. nmax is maximum degree of model to be used in geoid height calculation. Highest degrees will get you fine results but requires
@adonese
adonese / matshow.m
Created September 10, 2017 13:03
matshow: a function to plot matrices
View matshow.m
function _ = matshow(matrix)
# This function plots matrix as an image.
max_element = max(max(matrix));
norm_mat = matrix / max_element;
imshow(norm_mat);
end
View keybase.md

Keybase proof

I hereby claim:

  • I am adonese on github.
  • I am adonese (https://keybase.io/adonese) on keybase.
  • I have a public key ASBSWUE5paGZ0yL6I7ZBQ_kr8UQNN9NR6QZtIfN7K6Q51wo

To claim this, I am signing this object:

View xyz2ell.m
function [lat, lon, h] = xyz2ell(X, Y, Z, a, e2)
% XYZ2ELL Converts cartesian coordinates to ellipsoidal coodinates.
% We can add some default values here, i.e. a and e2.
% Latitude and height convergence criteria
eps_lat = 1.e-12;
eps_height = 1.e-5;
% Initial values...
@adonese
adonese / quicksort.py
Created March 22, 2016 09:25
Quicksort 3-way partition algorithm
View quicksort.py
def partition3(A, l, r):
"""
partition3: A partition for quicksort algorithm. We'll use the 3-way to handle few equal elements in array (happens
a lot in practical use.)
This function is called from the main function quick_sort.
"""
lt = l # We initiate lt to be the part that is less than the pivot
i = l # We scan the array from left to right
gt = r # The part that is greater than the pivot
pivot = A[l] # The pivot, chosen to be the first element of the array, that why we'll randomize the first elements position