[Solved] The drawStarsStairs challenge

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 solved The drawStarsStairs challenge

[Solved] Prolog Define Predicates [closed]

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):- %ending … Read more

[Solved] Return a String instead of an Integer

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 our … Read more

[Solved] Why my Thread run after Form creation?

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; { colors … Read more

[Solved] Parse error: syntax error, unexpected ‘public’ (T_PUBLIC) in [closed]

Remove public static. Those Keywords are for function definitions inside a class. Alternative: define a class around your function, this will take care of other class related references as well: class MyClass { // your function here } then you can call your function like this: MyClass::redirect(); 2 solved Parse error: syntax error, unexpected ‘public’ … Read more

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

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 need … Read more

[Solved] Display results of a query before query itself

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

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 of … Read more

[Solved] Delete object single property from list

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 anonymous … Read more

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

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 currentIndex … Read more