[Solved] The drawStarsStairs challenge

[ad_1] function draw(inputNum) { var pound=””; for(var i = 1; i <=inputNum; i++ ) { for(j = 0; j<i;j++) { pound+=”#”; } pound+=”\n”; } console.log(pound) } draw(5); 1 [ad_2] solved The drawStarsStairs challenge

[Solved] Prolog Define Predicates [closed]

[ad_1] Try this one 🙂 The main idea is to accumulate number of hours in the predicate min by subtracting 60 from total time and when the total time is lower than 60 we can unify counted hours from accumulator with H variable and rest of time with M variable. minutes(X,H,M):- %main predicate min(X,0,H,M). min(X,H,ResultH,ResultM):- … Read more

[Solved] Return a String instead of an Integer

[ad_1] A better way to achieve what you’re trying to do overall would be to use an exception. Consider if we wrote AddNumbers as such: public static int AddNumbers(int number1, int number2) { int result = number1 + number2; if(result <= 10) { throw new Exception(“Should be more than 10”); } return result; } and … Read more

[Solved] Why my Thread run after Form creation?

[ad_1] unit AniThread; interface uses Classes, Windows, Controls, Graphics; type TAnimationThread = class(TThread) private { private declarations } FWnd: HWND; FPaintRect: TRect; FbkColor, FfgColor: TColor; FInterval: integer; protected procedure Execute; override; public constructor Create(paintsurface : TWinControl; {Control to paint on } paintrect : TRect; { area for animation bar } bkColor, barcolor : TColor; { … Read more

[Solved] Why does this work? (JQuery) [closed]

[ad_1] No. It is a CSS property, passed as literal string, in order to be interpreted as CSS property by jQuery. No. CSS properties are transformed to CamelCase when used in JS. Although jQuery can also take them in the hyphenated form, the author of your example has chosen to camel-case them, so they don’t … Read more

[Solved] Display results of a query before query itself

[ad_1] Using Javascript will likely work. <div id=”grandtotal”>0.00</div> <?php $getinfo = mysql_query(“SELECT * FROM sales”); while($rows = mysql_fetch_assoc($getinfo)){ $price = $rows[‘price’]; // I want this to be display on top of my page before this query $quantity = $rows[‘quantity’]; // I want this to be display on top of my page before this query $total … Read more

[Solved] Splitting comma set files

[ad_1] This might work for you (GNU sed): sed -r ‘s/^(.*\|.*\|)([^,]*),([^|]*)(\|.*\|.*\|)([^,]*),([^|]*)(.*)/\1\2\4\5\7\n\1\3\4\6\7/;P;D’ file Iteratively split the current line into pieces, building two lines separated by a newline. The first line contains the head of the 3rd and 6th fields, the second line contain the tails of the 3rd and 6th lines. Print then delete the first … Read more

[Solved] Delete object single property from list

[ad_1] This cannot be done because once the class definition is set, that’s it. The best you can do to retrieve an array of only the Name and Address properties contained in an object is to use LINQ to perform an operation on each element, in which case you can then retrieve an array of … Read more

[Solved] How could I select music files in iOS app [closed]

[ad_1] See if below code works for you, Add ‘NSAppleMusicUsageDescription’ to your Info.plist for the privacy authority. Make sure your music is available in your iPhone. It will not work in the simulator. import UIKit import AVFoundation import MediaPlayer class ViewController: UIViewController, MPMediaPickerControllerDelegate { var musicPlayer: AVAudioPlayer? var pickerVC: MPMediaPickerController? var mediaItems = [MPMediaItem]() let … Read more