Programming › Re: Challenge Me by 4kings: 4:02pm On Oct 25, 2017 |
DanielTheGeek: I did a Mandelbrot program in Rust, nothing close to a pixel manipulator but something cool what's parse_pair ? |
Programming › Re: Challenge Me by 4kings: 1:35pm On Oct 25, 2017 |
olulove: Thank you very much sir. i appreciate, how do i go about putting it in a new folder
USE [master] GO
/****** Object: Database [KNMIS] Script Date: 09/03/2016 06:00:23 ******/ CREATE DATABASE [KNMIS] ON PRIMARY ( NAME = N'KNMIS', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\KNMIS.mdf' , SIZE = 2048KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB ) LOG ON ( NAME = N'KNMIS_log', FILENAME = N'c:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\KNMIS_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%) GO
thank you sir Wait first, didn't you write this code yourself? May i ask what you think the parameter FILENAME does?
Don't call me Sir |
Programming › Re: Which Highly Appreciated IT Course Can I Do? by 4kings: 12:51pm On Oct 25, 2017 |
Try Data Science. |
Christianity Etc › Re: The Doctrine Of The Ufos by 4kings: 12:42pm On Oct 25, 2017 |
hopefulLandlord: never knew you were a reader, I only read his doctufos when he posts excerpts of it during discussions on other threads Ya i am. It's actually interesting, you know Otem and creative stories... |
Christianity Etc › Re: The Doctrine Of The Ufos by 4kings: 10:23am On Oct 25, 2017 |
Damn, i'm many chapters behind. I totally forgot about this thread. |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 10:15am On Oct 25, 2017 |
KingEbukasBlog: Who said that you can get something from nothing due to the 'indeterministic' nature of quantum mechanics ? And please when I mean nothing I dont mean the redefinition of nothing in science , I mean absolute nothingness . Hmm "redefinition", that's what i observed also in Lawrence Krauss' explanations. Anyway this is where i say I DONT KNOW, absolute nothingness does not conform with any scientific explanation that i've seen so far. There was a debate about "Existence of Nothing" hosted by Neil deGrasse Tyson; Lawrence Krauss, Jim Holt, Prof Eva of standford and 1 or 2 others were in the panel, but no explanation of "absolute nothingness" was pointed out, except "redefinition" like you put it. |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 9:59am On Oct 25, 2017*. Modified: 12:46am On Oct 26, 2017 |
KingEbukasBlog: Abeg we all what nothingness is . All these equivocations are unnecessary, intended to deceive . Anyway , here is what cosmologist Sean Carrol said :
This kind of scenario is exactly what quantum cosmologists like James Hartle, Stephen Hawking, Alex Vilenkin, Andrei Linde and others have in mind when they are talking about the ‘creation of the universe from nothing.’ In this kind of picture, there is literally a moment in the history of the universe prior to which there weren’t any other moments. There is a boundary of time (presumably at the Big Bang), prior to which there was . . . nothing. No stuff, not even a quantum wave function; there was no prior thing, because there is no sensible notion of ‘prior. I read speculations(or hypotheses). Don't get me wrong i'm also open to the possibility of indeterministic nature of quantum mechanics which can give rise to something from nothing based on what i've read so far concerning quantum fluctuations but this is still an area with no universally accepted answer just speculations(but important however). Some try to isolate virtual particles as properties not event to buttress on causality, some see the possibility of Heisenberg Uncertainty principle absolutely applying here, Michio Kaku is talking about the application of String Theory, but still this is an area of scientific ignorance(i'm not sure there is a generally acceptable theory at the moment). Afterall even Isaac Newton made a wrong speculations based on what he could observe back then. Maybe Teempakguy Cloudgoddess Johnydon22 and JackBizzle can share more insight. |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 9:32am On Oct 25, 2017 |
KingEbukasBlog: Isn't the Law of Causality a scientific truth ? Is it possible for nothingness that has no causal potency to produce something ? Is nothingness(quantum mechanics) fully understood? |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 1:36am On Oct 25, 2017 |
KingEbukasBlog: Not all scientific truths are universally acceptable . Anyway , what qualifies as a religious truth ? Define the term 'religious truth' It is wrong to use the word "truths". Those that are not acceptable are hypotheses which are yet to be experimented or debunked from peer review. Those that conform to existing theories and have better empirical observations should be what to consider as "truth"(or acceptable). Science is about observation and testing not decree. |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 9:19pm On Oct 24, 2017 |
JackBizzle: Of course. But it does prove that it was not an omniscient or all mighty being from the bible that orchestrated it. Yep. |
Christianity Etc › Re: Atheism VS Christianity, Which One Is A Result Of Indoctrination? by 4kings: 9:15pm On Oct 24, 2017 |
JackBizzle: Unless you want to admit that your God is quite a reetard, you wouldnt want to credit God for evolution. As a mechanism for change in life, evolution is brutal and at times ineffective. Just strolling in... This point does not disprove the fact that it could have been orchestrated. |
Programming › Re: Challenge Me by 4kings: 8:56pm On Oct 24, 2017 |
olulove: Pls guru in the day house, kindly assist me look into this below code, i'm having issue executing in SSMS... Rename KNMIS.mdf file, cos you've used it with a previous project or put it in a different folder. |
Christianity Etc › Re: Testimony Of An Atheist by 4kings: 8:07pm On Oct 24, 2017 |
Horlufemi: Religion is messed up. Yes true.
But all I can tell you is there is a creator.
God is not the problem. Religion is.
GOD hates Religion How do you know God hates religion? |
Programming › Re: Challenge Me by 4kings: 8:01pm On Oct 24, 2017 |
dhtml118: What happened again? I am seeing the work of a moderator here chopping a post. Hope no one has been banned on this thread sha? If so kindly report. It might be anti spam bot nonsense and not a real ban. |
Programming › Re: Challenge Me by 4kings: 6:55pm On Oct 24, 2017 |
DanielTheGeek: This Is me proving that you can't USE just ANY language
You asked me to throw a challenge in any language I like... If you can't do that simple data partition task the challenge would be null.
I see you like the piece of cake to have opted for Python... 
There's no point in throwing tasks in popular non-esoteric languages that can easily be googled out.. Stress your brain a bit dude, #onelove lol... But i'm just seeing Glass for the first time. I checked the syntax this morning, you must be a crazy coder. |
Programming › Re: Challenge Me by 4kings: 6:52pm On Oct 24, 2017 |
DanielTheGeek: Who can try this in Rust?... Rust is actually one of the finest language for image manipulation in my opinion.
I'd try implementing something close and quite awesome done in Rust. Okay. So rust is this awesome. |
Programming › Re: Challenge Me by 4kings: 5:21pm On Oct 24, 2017 |
seunthomas: I do but would have to dust the cob webs for tough tasks. Hmmm, then use python. Write a code that rearranges pixels in an image based on hue value(or any other image parameter you want) in python? This is not really a challenge since it should be easy with python, it's just a test. |
Programming › Re: Challenge Me by 4kings: 5:13pm On Oct 24, 2017 |
seunthomas: I dont know glass language and dont want to invest (time) resources in it. But i can do in some of the languages i know how to use well. Usually this kind of problem is best solved with python. But before i go ahead, is this you challenging me?? Do you know assembly? |
|
Programming › Re: Challenge Me by 4kings: 8:07am On Oct 24, 2017 |
DanielTheGeek: I'm doing some app monitoring and routine checks... To even run test isn't feasible, the only reason i'm on NL is because i'm watching xvid... YouTube  lol  OK. |
Programming › Re: Challenge Me by 4kings: 3:38am On Oct 24, 2017 |
DanielTheGeek: Nicely done soldier, nicely done.
I'm assuming your unit test was against multiple inputs... Thanks. Yep, you can test them. lenY = 1 gives 3; 2 gives 6 and 3 gives 9. If you have different set of coordinates from another graph you can also test them(if u use python also).
I just noticed something replace cont with x_points, though i've modified my original post. I'm not too god with naming variables. |
Programming › Re: Challenge Me by 4kings: 2:57am On Oct 24, 2017*. Modified: 3:25am On Oct 24, 2017 |
seunthomas: Mr man, stop making nonsense noise and lets go head to head. Infact i will allow you pick the language you want me to write the solution in. Lets see if your silly theory on polygot holds water. For someone like me every language is one and the same. Programming is first like an art, you have to know how to paint and then you can use the brush and paint to create a work of art. I am waiting for you to challenge me else dont be making generalized statements like someone who said Naija coders are copy pasters. You don interview every polygot programmer before Hmm, can you write a code that rearranges pixels in an image based on hue value(or any other image parameter you want) in assembly? |
Programming › Re: Challenge Me by 4kings: 12:14am On Oct 24, 2017 |
Just incase anyone is still confused on how to get m and b (gradient and intersection). here's an example: From the diagram: x = [0, 2.5, 5, 7.5, 10] y = [0, 1, 2, 3, 4]
0 is b the intersection. ==> filter(lambda x:x in x,y)
gradient(m) is 2-1/5-2.5 or 4-3/10-7.5 or any two values of y and x.
then put the variables in the function parameters. func(lenY, m, b) lenY is obviously lenght of Y which is 4. len(Y) |
Programming › Re: Challenge Me by 4kings: 11:44pm On Oct 23, 2017*. Modified: 3:36am On Oct 24, 2017 |
hMM, haskel that's cool. @danielthegeek et al... here's the code: apologies for my variable naming. def func(lenY, m, b): lenY, m, b = lenY, m, b x_points, fac = [], 0 for y in range(1,lenY+1): x = (y - b)/m if x.is_integer() is not True: x_points.extend(list(range(fac, int(x)+1))) x_points.append(x_points[-1]) fac = int(x) + 1 else: x_points.extend(list(range(fac, int(x)+1))) fac = int(x) + 1 dif = int(len(x_points[:-1])/lenY) y_points = [i for i in range(1,lenY+1) for j in range(dif)] cells = len(x_points[:-1]) cells_coordinates = list(zip(y_points, x_points[:-1])) return(cells, cells_coordinates) the function takes in height or lenght of Y, m and b. m is gradient of line; using any two point in y will give 0.4 b is point of intersection which is 0. so if two list of values for x and y is given, the common number is the intersection and m is determined by picking any two values from y with respect to x. change in y/change in x then the function calculates the number of cells and also give the coordinates or location of each cell from the top. number, locations = func(4, 0.4, 0) Benchmark: import timeit timer = timeit.Timer('func(3,0.4,0)', 'from __main__ import func') benchmark = timer.timeit(number=1000) print(benchmark) It took average of 0.026 seconds with 1000 number of executions. When i increased Y to 1000. That is func(1000, 0.4,0); Python messed me up, it took average of 5.3 seconds. So there's the code, returning number of cells and their locations.
I didn't loop through every value of x like i said before that is 0.1,0.2 to 10. I just calculated x at different values of y(intervals), and any number that exceeded an integer indicates a repeated cell. For example if x values are 2.5, 5, 7.5, 10. 2.5 is counted twice because it extends to cell 3. |
Programming › Re: Challenge Me by 4kings: 1:17pm On Oct 23, 2017 |
DanielTheGeek: Yes...you did well, I was guessing you're into algorithm design thus the inspiration for the solution you tendered.. Please test, I may also be wrong (don't expect me to be right always) as I just scan through with my eyes and think of every logical reason why it wouldn't work. If it's not going to be the most efficient solution I will also consider it wrong as it'd be a wrong practice although yielding a possibly right answer..
Trust me I love being disproven... I really do, and I'm really enjoying this as I'm seeing things candidates never tried out.. OKey-dokey. I don't feel like opening python now, but will do later today. |
Programming › Re: Challenge Me by 4kings: 1:01pm On Oct 23, 2017 |
orimion: my deduction
if n is the number of cells
1. if x = y, then n = x = y 2. if x is odd or y is odd n = (x + y) - 1 3. if they are both even n = (x + y) - (level of reduction * 2) where level of reduction = the number of times we can divide by 2 until one of them is odd
is this right? x and y in the diagram are not equal. But assuming x is 5 and y is 5. n = (x+y)-1 = 9 is wrong. If you trace the diagram to y and x at 5 max. The number of cells are 6 not 9. |
Programming › Re: Challenge Me by 4kings: 12:57pm On Oct 23, 2017 |
DanielTheGeek: v is a hint of the approach using gcd given that the line segment repeats v times.
And again you were asked to find the total number of cells the line passes through from one point to another.. Or rather come up with your own formula to derive an answer and you have to test this formula to give the most accurate (or near accurate) results possible.
I forgot to add: the diagram in the original question has a little caption: From the figure below, the line segment from the origin to the point A(10,4) passes through 12 cells. Assuming my approach is correct, the total number of cells is determined by the total number of result coordinates. Guess i would have to test my approach to determine if it's fit or not, but i don't see anything wrong with it. Concerning formula, i can't think of one for now, but what i gave was an algorithm to follow. |
Programming › Re: Challenge Me by 4kings: 12:23pm On Oct 23, 2017 |
DanielTheGeek: Nice try man, I'm really impressed and glad you gave this a shot... However you have not given a correct answer or approach... Let v be = gcd of X and Y What's v and why do i need greatest common divisor here? Hint?  Moreso, why is the approach not correct? |
Science/Technology › Re: EXECUTIVE NOTES – An Auspicious Time To Invest In Nigeria’s Thriving ICT Sector by 4kings: 11:58am On Oct 23, 2017 |
Hi technative, i like your website. |
Programming › Re: Challenge Me by 4kings: 11:55am On Oct 23, 2017 |
DanielTheGeek: But before then, I have a simple question.. I don't need to see code; just logical reasoning.. (Taken from an interview of a company I worked for)
In a co-ordinate plane, a line segment is drawn from the origin to a point A(x,y). With great efficiency, find the number of cells the line passes through Assuming X and Y are ints...
Google may not be of too much help, this is largely theoretical.
Mod: let's have more of this kind of questions as the ones involving code can easily be Googled or outsourced.. This limits the participation of programmers with less fundamental knowledge of computer science.. Programming is more of thinking than coding Assuming the length of cells are 1, same with Y and X. Then determining the line in which the cells passes through would be; 1) Incorporating the straight line formula y = mx + b. 2) go or loop through each value Y(with interval of size 1) and compare also with all X values. 3) And then just scale the X and Y values to it's nearest whole number and there you have the answer. Illustrating step 2 and 3: For example at point 1 to 2 for Y; X values will be 0.1, 0.2,...,0.9, 1, 1.1, ...., 2,2.1,- 2.5. using the equation at every point in the Y value range. Scaling x: Just use a function to round up decimal values to it nearest whole number, filter repeating numbers and store result in a variable. The result will be (1,0),(1,1),(1,2) ==>(y,x) format. And those are the cells when y is 1. Then continue for the rest and you have your solution. |
Christianity Etc › Re: Testimony Of An Atheist by 4kings: 11:24am On Oct 23, 2017 |
|
Christianity Etc › Re: Testimony Of An Atheist by 4kings: 11:19am On Oct 23, 2017 |
 I thought you were being sincere. |