Programming and Computer Science

Welcome to the portal about Programming and Computer Science.
 

New Topics

PHP: Add previous sub-array value to next sub-array value

In each sub-array's end element, I want to add the previous sub-array's end-element. $arr = [ [1,2,4], [4,2,6], [2,1,8] ]; How can I do that with...

Open Question | 1 Answer

undefined array key php

<?php $var = array(2,5); $cnt = count($var); for ($i = 0; $i < $cnt; $i++) { echo $var[$i]."\n"; echo...

Open Question | 1 Answer

Print current and next Value of Array - Undefined Array Key Error

I have the following PHP code: $var = array(2, 5); $cnt = count($var); for ($i = 0; $i < $cnt; $i++) { echo $var[$i]."\n"; echo...

Open Question | 1 Answer

Cordova: Close App

I would like to close my Cordova App via code (for example when a user clicks a button or the like). Is there a command for this that I can...

Question | 1 Answer

Delphi: Format Numeric Output with 2 Decimal Places

Hello community Please lend a hand :) I have this line : Memo10.Text := FloatToStr(round(Memo29.Value)) + '$'; This results is rounded : 25...

Open Question | 1 Answer

Delphi Error with Form.Hide and Form.Show: This Form of Method Call only allowed for Class Methods

I am using 2 forms and I want one to show up while the current one hides. I used the code: Form1.Hide; Form2.Show; I then get this error: This...

Open Question | 1 Answer

New Answers and Comments

NetLabel: You mean something like that? $arr = [ [1,2,4], [4,2,6], [2,1,8] ]; for ($i = 1; $i < count($arr); $i++) { $arr[$i-1][2] +=...

Question | PHP: Add previous sub-array value to next sub-array value

AskingBox Moderation: Why are you posting this another time when your original question is already answered?! ...

Question | undefined array key php

SmartUser: The problem with your code is as follows: You have an array with two elements (indexes 0 and 1). Then you loop through this array with $i < number...

Question | Print current and next Value of Array - Undefined Array Key Error

Delphian: Thank you very much for reporting that issue. It must be bmp not c, I have corrected that error in the example...

Question | Delphi/Lazarus: Specify TextWidth and TextHeight without Canvas

Guest: What is c, and why are you freeing it instead of...

Question | Delphi/Lazarus: Specify TextWidth and TextHeight without Canvas

Guest: Thank you! You helped me a lot with this answer!! It was...

Question | Lazarus: Program without GUI - Many WSRegister Errors