Troubleshooting django installation

Sometimes it won’t compile on a Mac. This seemed to do the trick

The error: File "/private/var/folders/hq/npxxjwlx30qbxzz87fpns79w0000gn/T/pip-build-8IPZ7O/PyICU/setup.py", line 33, in
''')
RuntimeError:
Please set the ICU_VERSION environment variable to the version of
ICU you have installed.

brew install icu4c
brew link icu4c --force

error:

ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command ‘cc’ failed with exit status 1

Fix:

xcode-select –install
pip install mysql-python

Only to find out mac won’t work with mysql5.7 use Mysql5.6

reverse array in specific places in javascript

I had an interview question that stumped me earlier today. Aside from trying to use coderpen.io which wasn’t doing what I wanted, it didn’t work the same way that my own interpreter was working.

Anyways, I totally bombed on the question, but I didn’t give up on the challenge. The challenge required 3 inputs, an array of letters, a min, and max parameters. The goal was to reverse the strings inbetween the min and max indexes.

When these types of interview questions pop up its important to walk through the steps. I’m not going to modify my existing array, so.

1.) create new array.
2.) loop through and push the items lower than the min index into the new array
3.) push the indexes higher than the max into the array

This is where it became a little tricky for me. Just getting use to the syntax was one thing. At first i was comparing the wrong min max values.
x === a[x], nope.

I’m sure there’s another way to do it that’s better but what i ended up doing was created a separate array called c. Then using the reverse function. So I had two separate arrays. I then used the splice,apply,concat methods to insert the new reversed array into the min position and pushing it inbetween the max.

If you know of another way, please mention in the comments section below.


var a = ['A','B','C','D','E','F'];

function reverse_array(a, i, j){
var b = [];
var c = [];
for (var x=0; x < a.length ; x++){
if (x < i){ b.push(a[x]); } else if (x > j){
b.push(a[x]);
}
else if (i > x < j){
// console.log(a);
c.push(a[x]);
// console.log(c);
}
}
d = c.reverse();
b.splice.apply(b,[i,0].concat(d));
console.log(b);
return b;
}

[ 'A', 'E', 'D', 'C', 'B', 'F' ]
[Finished in 0.1s]

Windows 10 Crosshair IV Formula VIA Audio

After upgrading from windows 7 to windows 10, i had some problems with my audio. To resolve the audio issues, I had to look at the device manager and check out the audio controller and look for via audio (win10) driver and uninstall it.

After this was uninstalled and rebooted the automatic driver installed the correct version. The audio is a little tricky but can work with a little patience. Also dont’ forget to set up the audio and choose the appropriate output device. Mine defaulted to HDMI.