Entradas

ChatGPT: answers are not complete

                     ChatGPT might chop the answer when it is too long. I you are writing a code just type "finish                          ____ function" or "finish your answer".                    It might be useful to ask the question in a different way.                    Emma Álvarez                     Software developer in CDMX

get MAX and MIN with pointers from an array in c

This example will help you if you already have the array A function will receive the array by using pointers If not you only have to make a cycle and ask for numbers and scan them on the main #include < stdio.h > void prnt( int *); main() { int array []={ 3 , 4 , 6 , 1 , 2 , 7 , 8 , 10 , 12 , 5 }; prnt( array ); } void prnt( int * array ){ int i, c ; int *minimum, *m; minimum = array ; m= minimum; for ( c = 1 ; c < 10 ; c++ ) { if ( *( array +c) < *minimum ) { minimum = ( array +c); } } for ( c = 1 ; c < 10 ; c++ ){ if ( *( array +c) > *m ) { m = ( array +c); } } printf( "Max %d.\n" , *m); printf( "Min %d.\n" , *minimum); }

DATA PRODUCTS AND BASIC PYTHON FUNCTIONS

Imagen
DATA PRODUCTS AND BASIC PYTHON FUNCTIONS Simply speaking a data product is the output of any data science activity. But why do we need it? While the answer to this question varies, the commonality between all the reasons is to make the data help with taking actions to facilitate an end goal.  A data product is a product that facilitates an end goal through the use of data. Great definition as it speaks to the heart of the reason why we would like to generate a data product in the first place, or the purpose of today the product activity to put insights to use in production so we can take actions. An API is a common data product that others who are building data products from the dataset used Derived data is data after it has been cleaned and prepared for analysis Data science potentially helps the service with the Recommender System to increase its sales by targeting the right consumer. This can be modeled using data related to customer choices, profile, and loca...
Imagen
RANDOM FIGURES MADE EASY  JAVA This tutorial will show you how to do a JFrame with random rectangles INTRODUCTION Java has  the ability to draw text and graphics using GUI. Graphics can only work by importing AWT package allow us to draw primitive geometric types like rectangle line and circle. Other than this it can also display text.  This tutorial will explain various functions of Graphics class used to draw shapes and text. Simple rectangle example: The paint method is the most important one, now for the random figures you just do your random function. Now there are two main options, either the figures are placed in random positions or in random shapes Getting X & Y  (next int is necessary for not repeating numbers) import  java.awt.Graphics; import  java.util.Random; import  javax.swing.JFrame; import  javax.swing.JPanel; public class  DrawRect  extends  JFrame { static JPanel pnl = ...