Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "j = k"
-
A is for Assembly, a wizard's spell
B is for Bootstrap, so bland and the same. And also for Brainf*ck, will blow you away
C is for COBOL, your grandad knows that
D is for daemon, your server knows what
E is for Express.js, you node what is coming
F is for FORTRAN, which is perferct for sciencing
G is for GNU which is GNU not UNIX
H is for Haskell using functional units
I is for Intance, An action of Object
J is for Java plays with them Always
K is for Kotlin, Android's new toy
L is for Lisp, scheming a ploy
M is for Matlab, who knows how it works
N is for Node a bloatware of code
O is for Objective Pascal, you did not expect that
P is for programming, we all love to do that
Q is for Queries, A database is made
R is for R, statistics are great
S is for Selenium, you have to test that
S is for Smalltalk, let's make it all brief
T is for Turing Test, how human is this?
U is for Unix, build with all talents
V is for Visual Studio, built with all laments
W is for Web, lets build something cool
X is for XHTML, remember all that?
Y is for Y2K, I'm tired as f*ck
Z is for Zip, let's zip is all now.
Get yourself coffee and back to the grind.8 -
Try this line of javascript in a browser:
<pre id=p><script>n=setInterval("for(n+=7,i=k,P='p.\\n';i-=1/k;P+=P[i%2?(i%2*j-j+n/k^j)&1:2])j=k/i;p.innerHTML=P",k=64)</script>8 -
The GashlyCode Tinies
A is for Amy whose malloc was one byte short
B is for Basil who used a quadratic sort
C is for Chuck who checked floats for equality
D is for Desmond who double-freed memory
E is for Ed whose exceptions weren’t handled
F is for Franny whose stack pointers dangled
G is for Glenda whose reads and writes raced
H is for Hans who forgot the base case
I is for Ivan who did not initialize
J is for Jenny who did not know Least Surprise
K is for Kate whose inheritance depth might shock
L is for Larry who never released a lock
M is for Meg who used negatives as unsigned
N is for Ned with behavior left undefined
O is for Olive whose index was off by one
P is for Pat who ignored buffer overrun
Q is for Quentin whose numbers had overflows
R is for Rhoda whose code made the rep exposed
S is for Sam who skipped retesting after wait()
T is for Tom who lacked TCP_NODELAY
U is for Una whose functions were most verbose
V is for Vic who subtracted when floats were close
W is for Winnie who aliased arguments
X is for Xerxes who thought type casts made good sense
Y is for Yorick whose interface was too wide
Z is for Zack in whose code nulls were often spied
- Andrew Myers4 -
And this, ladies and gentlemen, is why you need properly tested backups!
TL;DR: user blocked on old gitlab instance cascade deleted all projects the user was set as owner.
So, at my customer, collegue "j" reviews gitlab users and groups, notices an user who left the organisation
"j" : ill block this user
> "j" blocks user
> minutes pass away, working, minding our own business
> a wild team devops leader "k" appears
k: where are all the git projects?
> waitwut?.jpg
> k: yeah all git projects where user was owner of, are deleted
> j.feeling.despair() ; me.feeling.despair();
> checks logs on server, notices it cascade deletes all projects to that user
> lmgt log line
> is a bugreport reported 3(!) years ago
> gitlab hasnt been updated since 3 years
> gitlab system owner is not present, backup contact doesnt know shit about it
> i investigate further, no daily backup cron tasks, no backup has been made whatsoever.
> only 'backups' are on file system level, trying to restore those
> gitlab requires restore of postgres db
> backup does not contain postgres since the backup product does not support that (wtf???)
> fubar.scene
> filesystem restore finished...
> backup product did not back up all files from git tree, like none of refs were stored since the product cannot handle such filenames .. Git repo's completely broken
Fuck my life6 -
Remember the post about bruce's constant?(4.5099806905005)
Well apparently theres a convergent series for it found all the way back in 2015.
Apparently its an actual thing. Which connects e to the square root of this series.
And it converges on (bruce-1)**0.5.
I confirmed it myself.
The two people who found the series that converges are N. J. A. Sloane and Hiroaki Yamanouchi
Thank you Sloane and Hiroaki!
The actual formula is a series of embedded square roots with the repeating numbers 1,4,2,8,5,7
like so...
sqrt(1+sqrt(4+sqrt(2+sqrt(8+sqrt...
What this means is you can find e using this series.
All you do is run the series, raise by a power of 2, add 1, calculate J and K like so
J = log(2, 1.333333333333333) / log(2, 2)
K = log(2, 1.333333333333333) / log(2, 3)
then calculate (J+K)-(bruce-1)
and out pops our buddy e:
2.7182818284591317
I guess I bullshitted myself for so long, that I didn't believe people like scor when they said they legit witnessed by math skills grow.
Or maybe a blind squirrel occasionally DOES find a nut.
Pretty cool find either way.13 -
A new mathematical constant was discovered recently: Bruce's constant
I took some code from the paper and adapted it in python.
def bruce(n):
J = log(n, 1.333333333333333) / log(n, 2)
K = log(n, 1.333333333333333) / log(n, 3)
return ((J+K)-e)+1
gives e everytime for ((J+K)-bruce)+1, regardless of the value of n.
bruce can always be aproximated with the decimal 4.5, telling you how close n can be used to aproximate e (usually to two digits).
Bruce's constant is equal to 4.5099806905005
It is named after that famous mathematician, bruce lee.
You'll start with four limbs and end up with two in a wheelchair!6 -
I have a guy sitting next to me in class. We were working on the same project. It's about rewriting a functioning mergesort algorithm in C and doing a presentation about that topic.
Now... the thing is that I was ill on that specific day when we got that project assigned. And he didn't tell me it either. I asked the whole class.
They just said that there was nothing special about that day. These fuckers.
Anyway...
Thé following week we had the same lesson again. Actually there were more than both of us. We were a group of 5 dudes.
3 of them barely have anything to do with programming at all. They just learn for the exams and have bad grades in programming.
Luckily, they already wrote the functioning sorting algorithm.
Since that is the case, I chose to review it to get deeper into that topic.
There were comments in English (we live in Germany) and these comments were written in a different style. My classmates would never comment in such a way.
It was a modified version copied from the internet. The whole source code.
The variables had names like j,k,b,u and so on. It was perfectly obfuscated.
Yesterday, I wasn't at college either.
I had to show up to a given time at a government bureau. They have been working on that project that day. So, I decided to ask them via a messenger, if they can give me the newest presentation files after 1 pm.
They said that they barely have anything to present. They would like to improvise they said.
"Fuck you all" I thought.
I'm done with these fucking illiterate humans.
I hope they all die in hell with satan having a ride on them. Stabbing them from behind right into their assholes and eating their ball sacks (if they have any).
Today is the presentation.
That's when I decided not to drive there during these specific lessons.1 -
Opened an old document using Office, tried hours to move around the document but couldn't.
Then realised, I was pressing 'h', 'j', 'k' and 'l'.
😒😒2 -
Found a clever little algorithm for computing the product of all primes between n-m without recomputing them.
We'll start with the product of all primes up to some n.
so [2, 2*3, 2*3*5, 2*3*5*,7..] etc
prods = []
i = 0
total = 1
while i < 100:
....total = total*primes[i]
....prods.append(total)
....i = i + 1
Terrible variable names, can't be arsed at the moment.
The result is a list with the values
2, 6, 30, 210, 2310, 30030, etc.
Now assume you have two factors,with indexes i, and j, where j>i
You can calculate the gap between the two corresponding primes easily.
A gap is defined at the product of all primes that fall between the prime indexes i and j.
To calculate the gap between any two primes, merely look up their index, and then do..
prods[j-1]/prods[i]
That is the product of all primes between the J'th prime and the I'th prime
To get the product of all primes *under* i, you can simply look it up like so:
prods[i-1]
Incidentally, finding a number n that is equivalent to (prods[j+i]/prods[j-i]) for any *possible* value of j and i (regardless of whether you precomputed n from the list generator for prods, or simply iterated n=n+1 fashion), is equivalent to finding an algorithm for generating all prime numbers under n.
Hypothetically you could pick a number N out of a hat, thats a thousand digits long, and it happens to be the product of all primes underneath it.
You could then start generating primes by doing
i = 3
while i < N:
....if (N/k)%1 == 0:
........factors.append(N/k)
....i=i+1
The only caveat is that there should be more false solutions as real ones. In otherwords theres no telling if you found a solution N corresponding to some value of (prods[j+i]/prods[j-i]) without testing the primality of *all* values of k under N.13 -
Working with surds recently, and found some cool new identities that I don't think were known before now.
if n = x*y, and z = n.sqrt(), assuming n is known but x and y are not..
q = (surd(n, (1/(1/((n+z)-1))))*(n**2))
r = (surd(n, (surd(n, x)-surd(n, y)))*surd(n, n))
s = abs(surd(abs((surd(n, q)-q)), n)/(surd(n, q)-q))
t = (abs(surd(abs((surd(n, q)-q)), n)/(surd(n, q)-q)) - abs(surd(n, abs(surd(n, q)+r)))+1)
(surd(n, (1/(1/((n+z)-1))))*(n**2)) ~=
(surd(n, (surd(n, x)-surd(n, y)))*surd(n, n))
for every n I checked.
likewise.
s/t == r.sqrt() / q.sqrt()
and
(surd(n, q) - surd(s, q)) ==
(surd(n, t) - surd(s, t))
Even without knowing x, y, r, or t.
Not sure if its useful, but its cool.
surd() is just..
surd(j, k ) = return (j+k.sqrt())*(j-k.sqrt())
and d() is just the python decimal module for ease of use.13 -
I must be a madman.
Trying to log in to appDynamics. enter account name, hit ENTER -- <...>/appdynamics.com/controller/undefined, 404: Page not found.
Go back, do that again -- same result
Go back, ctrl+F5, try again -- same result.
So in the end I did 17 or 19 back-retry attempts in a row and the last one DID log me in.
Peachy.
<F><U><C><K.<J><S>1 -
I accidentally deleted a folder containing contracts and files worth millions.
There's no backup. 😭😭😭. EaseUS didn't help with the entire recovery.
.
.
.
.
.
.
.
.
.
.
.
.
J K. I put a recurring backup every week 😌. Hadn't made any changes in the past week. 😂.6 -
My favorate bookmarklet (ES6 only):
javascript:(()=>{var b,c,a=document,f="onreadystatechange",h="https://rawgithub.com/smore-inc/...=(p,q)=>{p.readyState?p[f]=()=>{"loaded"!=p.readyState&&"complete"!=p.readyState||(p[f]=null,q&&q())}:p.onload=function(){q&&q()}},k=()=>{clippy.load("Clippy",p=>{$(".clippy").css("position","fixed"),$(".clippy").css("z-index",1e3),p.show(),p.moveTo(100,100)})},m=()=>{(c=a.createElement("script")).src=h+"clippy.js",a.body.appendChild(c);var p=a.createElement("link");p.rel="stylesheet",p.type="text/css",p.media="all",p.href=h+"clippy.css",a.getElementsByTagName("head")[0].appendChild(p)};"undefined"==typeof jQuery?(b=a.createElement("script"),b.src="https://ajax.googleapis.com/ajax/...,j(b,()=>{m(),j(c,k)})):"undefined"==typeof clippy?(m(),j(c,k)):k()})();14 -
// Posting this as a standalone rant because I've written the best piece of code ever.
// Inspired by https://devrant.com/rants/1493042/... , here's one way to get to number 50. Written in C# (no, not Do diesis).
int x = 1;
int y = x + 1;
int z = y + 1;
int a = z + 1;
int b = a + 1;
int c = b + 1;
int d = c + 1;
int e = d + 1;
int f = e + 1;
int g = f + 1;
int h = g + 1;
int i = h + 1;
int j = i + 1;
int k = j + 1;
int l = k + 1;
int m = l + 1;
int n = m + 1;
int o = n + 1;
int p = o + 1;
int q = p + 1;
int r = q + 1;
int s = r + 1;
int t = s + 1;
int u = t + 1;
int v = u + 1;
int w = v * 2 * -1; // -50
w = w + (w * -1 / 2); // -25
w = w * -1 * 2; // 50
int addition = x+y+z+a+b+c+d+e+f+g+h+i+j+k+l+m+n+o+p+q+r+s+t+u+v;
addition = addition * 2;
if (addition == w)
{
int result = addition + w - addition;
Console.Writeline(result * 1 / 1 + 1 - 1);
}
else
{
char[] error = new char[22];
error[0] = 'O';
error[1] = 'h';
error[2] = ' ';
error[3] = 's';
error[4] = 'h';
error[5] = 'i';
error[6] = 't';
error[7] = ' ';
error[8] = 'u';
error[9] = ' ';
error[10] = 'f';
error[11] = 'u';
error[12] = 'c';
error[13] = 'k';
error[14] = 'e';
error[15] = 'd';
error[16] = ' ';
error[17] = 'u';
error[18] = 'p';
error[19] = ' ';
error[20] = 'm';
error[21] = '8';
string error2 = "";
for (int error3 = 0; error3 < error.Length; error3++;)
{
error2 += error[error3];
}
Console.Writeline(error2);
}5 -
While I'm doing my hacker rank problem I have seen new word instead of using letter like I,j,k .but it is weired .Can I just know what is t_itr is that has any operation? In for loop "for "t_itr" in range t"16
-
So while exploring some new ideas, I decided to figure out if I could use variables in the known set to determine the bounds of variables in the unknown set.
The variables in question are algebraic identities derived from the semiprimes, so you already know where this is going.
The existing known set is 1194 identities.
And there are, if I recall, roughly two dozen unknowns.
Many knowns have the unknowns as their factors. The d4 product set for example is composed of variables d4a, d4u, d4z, d4z9, d4z4, d4alpha, d4theta, d4omega, etc.
The component variables themselves are unknown, just their products are known. Anyway.
What I've found interesting is if you know the minimum of some of these subsets, for example d4z is smallest out of the d4's for some semiprimes, then you know the upperbound of both the component variables d4 and z.
Unless of course either of them is < 1.
So the order of these variables, based on value, changes depending on the properties of the semiprime, which I won't get into. Most of the time the order change is minor, but for some variables they can vary a lot between semiprimes, rapidly shifting their rank in the known set. This makes it hard to do anything with them.
And what I found myself asking, over and over again, was if there was a way to lock them down? Think of it like a giant switch board, where flipping one switch lights up N number of others, apparently at random. But flipping some other switch completely alters how that first switch works and what lights it seemingly interacts with. And you have a board of them thats 1194^2 in total. So what do you do?
I'd had a similar notion a while back, where I would measure relative value in the known set, among a bunch of variables, assign a letter if the conditions were present, and generate a string, called a "haplotype."
It was hap hazard and I wrote a lot of code to do filtering, sorting, and set manipulation to find sets of elements in common, unique elements, etc. But the 'type' strings, a jumble of random letters, were only useful say, forty percent of the time. For example if a semiprime had a particular type starting with a certain series of letters, 40% of the time a certain known variable was guaranteed to be above a certain variable from the unknown set...40%~ of the time.
It was a lost cause it seemed.
But I returned to the idea recently and revamped the entire notion.
Instead what I would approach it from a more complete angle.
I'd take two known variables J and K, one would be called the indicator, and the other would be the 'target'.
Two other variables would be the 'component' variables (an element taken from the unknown set), and the constraint variable (could be from either the known or unknown set).
The idea was that relationships between the KNOWN variables (an indicator and a target variable) could be used to indicate the rank relationship between the unknown component variable and the constraint variable.
You'd think this wouldn't work either, but my intuition was there were so many seemingly 'random' rank changes of variables in the known set for any two semiprimes, that 1. no two semiprimes ever shared the same order for every variable, and 2. the order of the known variables had to be leaking information about the relationships of the unknown variables.
It turns out my intuition was correct.
Imagine you are picking a lock, and by knowing the order and position of the first two pins, you are able to deduce the relative position of two pins further back that you can't reach because of the locks security features. It doesn't let you unlock the lock directly, but by knowing this, if you can get past the lock's security features, you have a chance of using information about the third pin to get a better, if incomplete, understanding about the boundary position of the last pin.
I would initiate a big scoring list, one for each known element or identity. And then I would check it in tandem like so:
if component > constraint and indicator > target:
indicator[j]+= 1
This is a simplication, but the idea was to score ALL such combination of relationship, whether the indicator was greater than the target at the same time a component was greater than a constraint, or the opposite.
This worked out to four if checks and four separate score lists.
And by subtracting one scorelist from another, I could check for variables that were a bad fit: they'd have equal probability of scoring for example, where they were greater than the target one time, and then lesser than it for another semiprime.
So for any given relationship, greater or lesser between any unknown variable and constraint variable, I could find any indicator variable and target variable whose relationship strongly correlated to the unknown's.18 -
Please, stop using `i`, `j` and `k` in loops... specially if they are nested, help the fellow programmer after you29
-
Me:put proper variable names so that i can remember later what this loop does
After writing some good names
Me: i will remember it i am just gonna put initials
After a week or two.....
Me:wtf these a,b,c,d,i,j,k,l variables do2 -
I got so used to vim like bindings on spacemacs, i3wm, firefox(with vimium) in such a way that I was pressing j and k on Microsoft Word like a moron and wondering why that shit isn't scrolling up or down.
-
If I have four unknown variables, x, y, j, and k, but know the values of x*j, y/k, and k/j, and x*j == y/k
How do I go about getting the values of the individual unknown variables?10 -
Should I be ashamed?
I hardly ever use "i" as a counter in for loops
I most likely use "k" and "j"; "i" stands for "index"23 -
Why some single letter variable names looks ugly to me, for example: c, i and j (and even k) are the most used (mostly in for loops) but does not look ugly.. why?
Ugly
for (int a = 0; a < 10; ++a)
Not ugly
for (int i = 0; i < 10; ++i)24 -
Have some downtime today, so since I lucked out and found some old backups (from before I used Git) of a project I was planning on revisiting, I decided to fire it up and see what I can do to get that going again.
And discovering just how much my coding style has changed since then...
[Code is in PHP, for reference]
* Virtually no documentation (whereas my current style is near-obsessive with PHPdoc blocks)
* Where comments exist, they only use // and are a full tab after the end of the line
* All assignment operators are dutifully aligned on tabs
* Have to update the entire codebase because it relies on deprecated `mysql_*` calls
* Have to flip all of the quotes throughout the codebase because I used double-quotes as my primary at the time instead of single quotes.
* Also relied on magic quotes for injecting variable content into strings
* Associative array practices varied; sometimes the names are encased in double quotes, but I just hit a block where it's all leaving it to the compiler to interpret unquoted string literals
And perhaps the most egregious so far...
* Any time we get database results back the process for cycling through them is to do `$count = mysql_num_rows($result);` (or $count2, etc.), then do a `for ($i = 0; $i < $count; $i++)` (again, or $j, $k, etc.), instead of just a simple `while ($data = $result->fetch_assoc())`2 -
So I'm learning Vim at the moment... and one thing that bugs me is that the navigation arrows are h,j,k,l.
On the german keyboard layout, when I use the 10-finger-system, my right hand is in this constellation: forefinger on j, middle finger on k, ring finger on l, and little finger on ö.
So wouldn't it be better if the navigation would be j,k,l,ö instead of h,j,k,l?
Or is this different in english keyboard layout?
I'm confused 🤔6 -
Finally back at the HQ and away from Offsite Hell after 18 months!!!!!!!!!!!! Real internet! Coffee on tap! Community of practice meetings! COOODDDEEEE!!!! Also back to devrant. Goodbye Indian devs from hell, j/k they still suck life out of my day with their deprecated ways.
Side note:
Switched to Unreal Engine from Unity recently and my god it is amazing! I definitely prefer being able to use C# with unity vs c++ with unreal but the blueprint system is a great visual programming system.
Unit testing is my new side chick. She wants me to leave my wife; I'm considering it.
Unrelated: Read Dead Redemption 2 is amazing.1 -
Challenge: rank the following in your favourite order:
A: Stargate shows
B: Battlestar Galactica (and Caprica)
C: StarTrek
D: Westworld
E: Star wars
F: Doctor Who
G: Black mirror
H: X files
I: Matrix films
J: Babylon 5
K: Altered Carbon
L: The Arrival
And any other sci-fi shows/films I've missed19 -
heres something interesting:
The golden ratio is 1.618...
If you're not familiar with it, doing 1/goldenratio
the result is 0.618...
It gives you back the float component exactly.
Discovered that it is actually part of a series.
First of all:
2-(((5-sqrt(5))/2)-1) =
1.618033988749895 -> thats our golden ratio
In other words:
(2%gold) =
0.381966011250106
While:
((5-sqrt(5))/2) =
1.381966011250105
Ok, now we're getting somewhere. We can turn these into variables
First of all, lets see if we can get the golden ratio back out:
2-(((5-sqrt(5))/2)-1) = 1.618033988749895
Okay good.
The formula looks something like
j-(((i-sqrt(i))/2)-1)
Where j = (i*2)+1
That means we can easily figure out what j we need from our i value. (i-1)/2 = j
We run it back far enough we get
1-(((3-sqrt(3))/2)-1) =
1.3660254037844386
Thats the golden ratios little brother. Doesn't look anything like it, but it is part of the series.
And I found a boat load of research documents scattered *all* over the net, where this number and others in the series inexplicably crop up in power series, in chemistry, and elsewhere. Just looks like random floats if you don't know better.
We can actually go lower in the series:
0.5-(((2-sqrt(2))/2)-1)
1.2071067811865475
At the lowest positive value for j, we get
0-(((1-sqrt(1))/2)-1) = 1
It's kinda elegant.
I even wrote a little script to do the conversions:
def gr(k):
....i = k
....j = (i-1)/2
....return j-(((i-sqrt(abs(i)))/2)-1)
The dots are so devrant doesn't break pythons formatting.3 -
Whenever I take a break from my editor, I end up pressing j and k to scroll up and down in be browser, only to be disappointed. Looks like someone at FB was having the same problem and added it to their newsfeed. Thanks bud!1
-
Is it sad that I look forward to the weekend so that I can actually write some code rather than:
- Helping clients that can’t / won’t read docs
- Explaining to test colleagues that we need repro steps and can’t fix a bug based on “I was doing something and it crashed”
- Writing any regular expressions for another dev where it’s more complicated than ^[A-Z0-9]*$
- Wading through legacy VBA that’s littered with GoTo, global variables (even i, j and k for loops are fucking global!) and all the other fucking lazy shortcuts that save you 10 seconds at dev time and cost you (which ends up meaning me) hours in subsequent debugging.
I love writing code, and I think I’m pretty good at it, so can I please just get on with it?
Fellow ranters, please tell me I’m not alone in this. -
Pretty tired, plus working on something that at some point needs 4 or 5 for loops inside each other
End result: for (i=0; k<=Nspecies; ++j)
Mhkay time for coffe -
I'm curious about what you guys think of giving percentage updates. Like we have an x project, there are i, j, k things to do and you're asked to give percentage completed on the sub tasks. I feel like we're generally bad at estimating, now you have to consider the weight of each sub-sub tasks and I feel like when you give a percentage update, project managers and clients will eventually ask you "why is the 20% of work not done yet". I feel like it makes the work look a lot easier than it is.8
-
!basicNonHarmfulExploitTest
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
Lets see If I can mess up the character cutoff limit 😜3 -
BEHOLD! The voting power of Bill Gates!
j/k just a "bug" in my app, the rants were loaded this morning but going thru them now and upvoting.
But that gives me an idea for another app or maybe @dfox can just generate it from the database (not sure if he'd like me spamming the server to monitor the scores on certain rants).: A time graph of how a rant's score increases. -
Let's say I take a matrix of high entropy random numbers (call it matrix J), and encode a problem into those numbers (represented as some integers which in turn represent some operations and data).
And then I generate *another* high entropy random number matrix (call it matrix K). As I do this I measure the Pearson's correlation coefficient between J (before encoding the problem into it, call Jb), and K, and the correlation between J (after encoding, let's call it Ja) and K.
I stop at some predetermined satisfactory correlation level, let's say > 0.5 or < -0.5
I do this till Ja is highly correlated with some sample of K, and Jb's correlation with K is close to 0.
Would the random numbers in K then represent, in some way, the data/problem encoded in Ja? Or is it merely a correlation?
Keep in mind K has no direct connection to J, Ja, or Jb, we're only looking for a matrix of high entropy random numbers that indicated a correlation to J and its data.
I say "high entropy", it would be trivial to generate random numbers with a PRNG that are highly correlated simply by virtue of the algorithm that generated them.12 -
Hi everyone, I have such a task: “Given an integer square matrix. Determine the minimum among the sums of diagonal elements parallel to the main diagonal of the matrix.” I have a code but I have problems compiling a flowchart for it, can you help me with compiling a flowchart or give tips? thanks in advance!
Thats my code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define N_MIN -3
#define N_MAX 5
int main(int argc, char *argv[]){
int s,i,j,k,l,s1,t2,t1;
int a[5][5];
srand(time(NULL));
for(i=0;i<5;i++){
for(j=0;j<5;j++){
a[i][j]=rand()%(N_MAX-N_MIN+1)+N_MIN;
}
}
for(i=0;i<5;i++){
for(j=0;j<5;j++){
printf("%3d ",a[i][j]);
}
printf("\n");
}
k=0;
s=0;
l=0;
for (i=0; i<5; i++){
for (j=0; j<5; j++){
if (a[i][j]>=0){
if(a[i][j]%2==0)
l+=a[i][j];
k++;
}
}
if (k==5){
l=l;
}
else {
l=0;
}
s=s+l;
k=0;
}
s1=a[0][5-1];
for(i=1; i<5; i++){
t1=t2=0;
for(j=0; j<5-i; j++){
t1+=a[i+j][j];
t2+=a[j][i+j];
}
if(t1<s1) s1=t1;
if(t2<s1) s1=t2;
}
printf("vivod %d %d\n", s,s1);
return 0;
}2 -
n=input( )
k=list(n)
for j in range(len(k)):
if k[j]=="a":
k.pop(j)
print(k)
''' i want to print the list by removing a letter "a" but it is showing index error why ? help me out'''7