Skip to content

Instantly share code, notes, and snippets.

View adonese's full-sized avatar

Mohamed Yousif adonese

View GitHub Profile
adonese / certum.pem
Created March 10, 2020 07:41
Certum ca cert
#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 /
Last active March 30, 2018 11:55
Morsal timezone issue.

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 / grading-list
Created January 8, 2018 11:23
My Grading list, High School Certificate.
| 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 / Makefile.config
Created December 31, 2017 15:48
Caffe Makefile
## Refer to
# 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).
# uncomment to disable IO dependencies and corresponding data layers
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.
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 / matshow.m
Created September 10, 2017 13:03
matshow: a function to plot matrices
function _ = matshow(matrix)
# This function plots matrix as an image.
max_element = max(max(matrix));
norm_mat = matrix / max_element;

Keybase proof

I hereby claim:

  • I am adonese on github.
  • I am adonese ( on keybase.
  • I have a public key ASBSWUE5paGZ0yL6I7ZBQ_kr8UQNN9NR6QZtIfN7K6Q51wo

To claim this, I am signing this object:

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 /
Created March 22, 2016 09:25
Quicksort 3-way partition algorithm
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