637 Topics

Member Avatar for
Member Avatar for Johannes C.

**Turning ideas into executable code has never been easier. This is the story of how I created a small program that turns your photos into pixel art in less than half an hour – with a little help from my AI assistant.** ![ai-coding-assistant.jpg](https://static.daniweb.com/attachments/4/167a40014fbe0091604c395e88cacd5e.jpg) The program is called **PixelPotion**, and you …

Member Avatar for Johannes C.
1
99
Member Avatar for pwolf

i was on the site pyschools working through the exercises, but i dont understand why it wont accept the code i input. [url]http://www.pyschools.com/quiz/view_question/s4-q2[/url] Create a function generateNumbers(start, end, step) that takes in three numbers as arguments and returns a list of numbers ranging from start to the end number (inclusive)and …

Member Avatar for Reverend Jim
1
1K
Member Avatar for JModak

hello sir getting error when run the loop and going to last value of row count please help and i can not use the 2nd loop in the place of cells(?????) number how can i use this **Index was out of range. Must be non-negative and less than the size …

Member Avatar for Reverend Jim
0
3K
Member Avatar for rayrenz

$string="City" $consonants=array("B","b","C","c","D","d","F","f","G","g","H","h","J","j","K","k","L","l","M","m","N","n", "P","p","Q","q","R","r","S","s","T","t","V","v","W","w","X","x","Y","y","Z","z"); foreach($consonants as $chk2) { if(strpos($string,$chk2)!= false) { $ans2[]=$chk2; } } if(isset($ans2)) { $comment2="Consonants in this string: ".join(" ",$ans2); } else { $comment2="Consonants in this string: None"; } echo "".$comment2."<br/>"; so the error is that the displayed consonants does not include the first letter. what could be wrong?

Member Avatar for Aravinth_2
0
369
Member Avatar for Reverend Jim

##vbScript - Sorting With and Without Code Please see my post [vbScript - The Basics](https://www.daniweb.com/programming/threads/516400/vbscript-the-basics) for more details on vbScript. Sorting is something that must be done from time to time. I'm going to examine three ways. The first is the well known (at least by name) QuickSort method. Rather …

1
1K
Member Avatar for jj.dcruz

Hi there been having this problem for a while now and i need guidance the only thing that is showing me only **111** when looping through i have 3 data in my database and its not showing me the result i want any ideas?? thanks in advance **edit** the result …

0
393
Member Avatar for Reverend Jim

Over the years I've seen a lot of discussion (and several implementations) of the Quicksort algorithm. Most of what I have seen, unfortunately, lacks sufficient commenting as well as meaningful variable names. Hopefully the following vbScript code will more clearly show how Quicksort actually works. A couple of incidental notes: …

Member Avatar for Reverend Jim
1
2K
Member Avatar for squeak24

Hi Everyone I am trying to achieve a cell that is dependent on two different cells. Basically what I want to do is: *Item 1* If the contents of Cell U20 equals the contents of W12 or W13 the cell will equal a certain value. *Item 2*Depending on the date …

Member Avatar for Shankar.Shiv
0
293
Member Avatar for Magic8Computing

I have an If Statement that isnt loading the right image any help would be great <?php if($formattedNum6 > $PeriodSalesTarget):{ echo '<img src="images/TargetMetGreen.png" alt="" />';} elseif($formattedNum6 > $CummulativePeriodSalesTarget):{ echo '<img src="images/TargetMet.png" alt="" />';} else:{ echo '<img src="images/TargetNotMet.png" alt="" />';} endif; ?> $formattedNum6 = 515,839 $PeriodSalesTarget = 1,366,000 $CummulativePeriodSalesTarget = 503,600 …

Member Avatar for Anil_17
0
474
Member Avatar for Siberian

I was informed the if-statement is incorrect. I can't find the syntax error ? var curDoc = app.activeDocument; var selall = app.executeMenuCommand("selectall"); var fillrmv = curDoc.pathItems[0].filled = false; if (app.activeDocument.pathItems[0].filled = true) { for (i=0;i>fillrmv;i++) { curDoc.pathItems[0].filled = false; }; };

Member Avatar for Siberian
0
354
Member Avatar for Mohammed_9

Using swift programming import UIKit var str = "Hello, playground" func ls(array: [Int]) -> (large: Int, small: Int)//function { var lar = array[0] // array of large number var sma = array[0] // array of small number let num = 0 // check odd or even for i in array[1..<array.count] …

Member Avatar for JamesCherrill
0
2K
Member Avatar for Dani

I'm having a little brain fart and I just want to double check something ... // Array of [a,b,c,d] $array = array('a', 'b', 'c', 'd'); // Loop through array foreach ($array AS $letter) { // Break out of the loop on a specific condition if ($letter == 'c') { break; …

Member Avatar for ryantroop
0
374
Member Avatar for phaedrusGhost

Hi All, I am stumped here. Perhaps I've been at it too long and am missing something elementary or it really is a missing link. I hope someone can point me in the right direction here. I have this piece of code for my new widget functions: function underslider_widgets_one_init() { …

Member Avatar for diafol
0
388
Member Avatar for daniel955

Hi I am a beginner in game programming and would like to make a rocketmania clone using opengl, the display and interaction part is done. I also have a classes named gameboard and tiles with their properties. but I am having problems on game logic, where the fuel flows into …

Member Avatar for Nisa_1
0
520
Member Avatar for Roger_2

I am having trouble implementing a solution using a binary search tree that returns the key of the node based on it's rank in O(N) worst case running time. Every idea i have (listed below) results in O(N^2) or sends me to a dead end. This almost seems impossible. i …

Member Avatar for AssertNull
0
1K
Member Avatar for letters1417

Hello! I have to print patterns using '*' and I am at a loss how to get these patterns printed! I figured out the first one, * ** *** **** ***** ****** ******* ******** ********* ********** and now i have to do it upside down: ********** ********* ******** ******* ****** …

Member Avatar for JamesCherrill
0
2K
Member Avatar for naz1234

Hi, from the result in my "for" loop, have stored four value. How to extract that value to show the value(sprintf) ? Kindly refer to the attached the image file. Thanks Regrads, nazif

Member Avatar for naz1234
0
227
Member Avatar for Doogledude123

Is this try catch block enough to ensure the process ran successfully? protected boolean attemptLaunch() { try { System.out.println("Attempting to open '" + name + "'."); //Try to open the Process new ProcessBuilder(path).start(); return true; } catch (IOException e) { System.out.println("Opening failed. Will retry during next Iteration."); return false; } …

Member Avatar for jwenting
0
282
Member Avatar for fheppell

I have this function: function (Blobs) { console.log(JSON.stringify(Blobs)); // Make the progress bar here Blobs.forEach(function(Blob) { console.log(Blob); $.post(window.location.href + '/add', Blob); // Increment the progress bar by the correct amount, once above request has completed }); } (This function is passed as an argument, hence no name) I want a …

Member Avatar for fheppell
0
1K
Member Avatar for vegaseat

Use Google's modern Go language (aka. golang) to convert a denary number (base 10) to a roman numeral. Just a good exercise to explore Go's map, slice, sort and for loop features. Note that in Go the **:=** is shorthand for assigning a type (by inference) and a value to …

2
586
Member Avatar for Niloofar24

Hello! I have a little problem with a For Loop, this is a For Loop in my script: $last_id = $conn->lastInsertId(); for($a = $last_id ; $a > 0 ; $a--){ code.... } But it doesn't work because of `($a = $last_id ;`, the variable $a can't be set to the …

Member Avatar for Niloofar24
0
877
Member Avatar for Jaklins

TLDR: When large amounts of files (array values) are in the array, the loop will iterate through all the values but only execute part of the foreach statement for some of them. When that happens, it will always affect the same files (in file order, not file name). Detailed version: …

Member Avatar for diafol
0
442
Member Avatar for inspire_all

Hello everyone,i think i know quick sort algorithm.But i need help in figuring out its worst case. Lets look at the below quicksort code----> void quicksort(int arr[],int low,int high) //low and high are pased from main() { int m; if(low<high) { m=partition(arr,low,high); quicksort(arr,low,m-1); quicksort(arr,m+1,high); } } int partition(int arr[],int low,int …

0
133
Member Avatar for ali11

*getting following error. duplicate found Exception in thread "main" java.lang.NullPointerException at binarysearchtree.main(binarysearchtree.java:185) Java Result: 1 here is my code* public class node<T> { public node<T> root ; public T data; public node left; public node right; public node (T newData) { data = newData; left = null; right = null; …

Member Avatar for Taywin
0
413
Member Avatar for macky.p.deleon

hi guys im a newbie on html java script,, im using switch statement but my final output always fall at my default statement need help.... here's my code... function finalgrade() { var texttgp, texttgm, texttgsf, texttgf, textfg; texttgp = parseFloat(document.frmMacky.textTgp.value); texttgm = parseFloat(document.frmMacky.textTgm.value); texttgsf = parseFloat(document.frmMacky.textTgsf.value); texttgf = parseFloat(document.frmMacky.textTgf.value); textfg …

Member Avatar for Daniel_28
0
126
Member Avatar for nathan.pavlovsky

Hello programmers! I have been working on STL algorithms for some time now as a beginner, and I started doing an exercise, among which is the task of `use the fill algorithm to fill the entire array of strings named items with "hello"`. My code for this is below: // …

Member Avatar for nathan.pavlovsky
0
2K
Member Avatar for Auroch

Hello everybody. I'm trying to write program with vectors and iterators. Coordinates X and Y are entered from keyboard (as structure) and placed in vector of points. It's necessary to display coordinates with maximal X and Y. This code was compiled but not display maximal X. What should I change? …

Member Avatar for Lucaci Andrew
0
274
Member Avatar for adishardis

Hi, I would like to loop the data-attribute to contain all column names and values from a mysql table. This is what it looks like today: while ($row = $result->fetch()) { echo "<div id='{$row['namn']}' data-column1='{$row['column1']}' data-column2='{$row['column2']}'... So some kind of magic :) loop inside there so I don't have to …

Member Avatar for adishardis
0
256
Member Avatar for Brandy_1

Program runs without errors, unfortunately it will not calculate the days overdue. Any Suggestions? I have attached the code as a pdf, i have also done this as an IF, THEN, ELSE statement with the exact same results, but it will not let me upload it. Help! Private Sub calculateFees …

Member Avatar for Reverend Jim
0
393
Member Avatar for صمتي
Member Avatar for Hiroshe
0
213

The End.