I want to know the complexity of this next code




main vacuum ()
char p (10) (5), temp (5);
int i, j, pt (10), wt (10), totwt = 0, pr (10), temp1, n;
float avgwt;
printf ("Enter no of girls:");
scanf ("% d", & n);
for (i = 0; ipr (j))
temp1 = pr (i);
pr (i) = pr (j);
pr (j) = temp1;
temp1 = pt (i);
pt (i) = pt (j);
pt (j) = temp1;
strcpy (temp, p (i));
strcpy (p (i), p (j));
strcpy (p (j), temp);
wt (0) = 0;
for (i = 1; i

javascript: after sending the code, returns an alert if the input values ​​are zero, pressing the button the page crashes

-I just started learning JavaScript, so I'm a layman on the subject & # 39; – & # 39;
when the input values ​​are zeroed, the correct thing to do was to show an alert and a change in the div, however the page freezes and I can no longer put numbers or click the button.

function tabuada(){
let ini=document.getElementById('txt1')
let fim=document.getElementById('txt2')
let passo=document.getElementById('txt3')
let res=document.getElementById('res')

if (ini.value.lenght== 0 || fim.value.lenght== 0 || passo.value.lenght== 0){
    window.alert('(ERRO), dados faltando...')
    res.innerHTML='Impossível de contar...'
    let i=Number(ini.value)
    let f=Number(fim.value)
    let p=Number(passo.value)
if(i=f; c-=p){


Code Forum ~ A developer house. The | Forum promotion

Modified on February 24, 2020

Forum promotion complies with CodeForum.org

Hello Forum promotion, I would like to promote the community that I built. I created Code Forum with the intention of helping myself and others learn to code. Without the feeling that you are asking a stupid question or even feeling ashamed for not knowing something that everyone else did. Regardless of your skill level, you are always welcome to Code Forum to learn, build, and share. Code Forum was founded in October 2018 and had been striving ever since, at the time of creating this thread that we have about 300 registered members and growing every day. We call our & # 39; member & # 39; encoders. It is exclusive to Code Forum.

About our staff
As we have grown as a community, so has our team. Actually we have four staff members (including myself). We all have different roles that we strategically plan to help grow and maintain the community. My role consists of many different areas, although we are all responsible for moderating the community. A staff member is more or less the leader of this particular area. As mentioned above, we currently have Three staff members (not including me) with roles.

  1. The first role focuses primarily on ensuring that the community follows and adheres to the community's rules and guidelines.
  2. The second role focuses on community participation; These are more areas, such as community events, ensuring that no thread goes unanswered for a long period. And you'll also be the person to submit weekly coding challenges.
  3. The third role is more focused on social networks: this person will manage the interactions of Twitter, Facebook, etc.

How does it work

We want coders to feel comfortable and belong to the Code Forum. Encoders are not just part of the Code Forum. They are Code Forum. When a programmer comes to the Code Forum for help, they are encouraged to use a format that is easy to understand for who is trying to answer their question. We offer a more advanced BBCode function that allows the encoder to select the particular language in which they want to share their code. It also provides the ability to highlight specific lines where encoders may want to draw the attention of other encoders to particular pieces of code. There is also a button that allows encoders and other encoders to quickly copy the code. After the encoder receives some responses to your thread and if a solution is provided. The encoder can mark the thread solution, which will then highlight the post as a green color.

Any rate
Registration is 100% free and publication is 100% free. Encoders can use Code Forum to help encoders. However, some resources may be offered as paid services, but we do not allow it at this time.

Has Code Forum helped anyone?
Yes! Many coders have claimed that they found their answer on Code Forum and that it was very friendly and welcoming!

What is special about Code Forum?
All the encoders that are part of the Code Forum, of course! Code Forum also has many unique things. From rules to services, we strive to be the best coding and programming forum out there. As mentioned above, Code Forum is a welcoming environment, no matter what skill or language the coder knows they will always be treated as if they belonged. We have introduced a rule that helps combat any unpleasant / negative behavior that may lead programmers to ask or even join Code Forum. We have other rules, but I'll let you review the rules and guidelines of our site yourself.

We also offer free services that coders can use to quickly test their code. One of the services we offer is an online encryption field we call Code PlayGround (which was developed by apaCara). That allows you to encode HTML, CSS, and JavaScript into a live preview setup without having to host it on your localhost computer. One of our other services is through Judge0. And it is used to program in more high-level programming languages. It can be found at ide.codeforum.org.

Our future
The most important issue of all, what does the future hold for us? We plan to help coders and it always will be. But we also want to help programmers learn more. Therefore, we believe that the best way to learn is to work together doing open source projects together as a community, weekly code challenges, and weekly budgeting in different programming and coding languages. Something like putting into practice what has been learned and what is known. Keeping it fresh in your mind. We also believe that this will help drive activity and engage developers.

Find us!
You can find us at CodeForum.ORG!

And of course feel free to offer any constructive feedback! :)

virtual machine: How do virtual machines and GCs handle objects that wrap around active resources but cannot be accessed from user code?

I am building a C interpreter for a simple programming language.

The interpreter is equipped with a built-in garbage collector. The GC simply marks all the objects that are linked from some root (the call stack, the evaluation stack, the loaded modules, etc.) and collects the rest.

Now I am writing a DLL extension for the interpreter. The DLL is "wrapping" another C graphics library (SDL). This library creates objects that represent operating system resources, such as viewports. So now I need to think about how the interpreter and the GC integrate with the "outside world" correctly.

In the current situation, one could write the following code in my language and it will work fine:

import graphics
window = graphics.new_window()
# ... all the rest

However, I suppose the following code will cause problems:

import graphics

Since the result of new_window() it is not stored anywhere, at some point the GC will collect the Window object. When picked up, the Window The object will return native resources to the operating system as part of its deallocate implementation that is being called by the GC.

I'm not sure if this is reasonable behavior for a programming language. On the one hand, if we lose the reference to the window, there is little point in filtering it.

On the other hand, if I remember correctly, in Java (and I suppose that we can find equivalent examples in most languages), it is common and legal to write code like the following (Java psuedo):

public void makeWindow() {
    new JFrame();

This would create a GUI window that will appear on the screen and remain visible. And as you can see, the JFrame The object is not saved anywhere. Still, the GC won't collect it (or at least it doesn't collect the OS resource JFrame probably wraps around).

What is the standard way to implement this in a VM language?

The only approach I can think of right now is to have objects that wrap native resources no release these resources when claimed by the GC. The only way to free these resources would be with an explicit call in the user code to a dispose Method on the object. What approach is standard in VM deployments?

hooks: Drupal 8 language code and country code in URL

I have been trying to achieve this:

I have a multilingual site with 8 languages ​​(en, fr, es, de, etc.) and I want all those languages ​​to be available for all countries.

I want Drupal to understand that:

  • / en-CO alias of / en
  • / en-FR alias of / en
  • / en-US alias of / en
  • / en-AR alias of / en
  • / fr-CO alias of / fr
  • / de-US alias de / de

And so on … (They share exactly the same content)

Adding all those custom languages ​​is easy, but I don't want to because over 1600 combinations are possible.

Do you know if there is a way to achieve it programmatically or with a module?

I am currently looking for PathProcessor, but no results for now.

Any help would be highly appreciated.

I want to get the longitude and latitude of the city by its zip code using Datastage

In the source I have two columns (city_name, city_zipcode), so when using Datastage I want to load the data with two additional columns of longitude and latitude, please guide me if you know how I can achieve this.

sql – I need help with PHP, can someone tell me what is wrong with my code?

I am implementing a customer catalog in my program, but I cannot get the information I need to appear. The database I am using is located on a server, therefore, I use php to make my queries, from the php I send a json to my program and this same one, passes the json to a gridControl (dvexpress). All the previous catalogs, I did it using the same method, but in this case, something happens and I can't see all the information I need, since when calling the "State" column of the database, all the json automatically stops to be empty, it doesn't return an exception, nothing, it just empties, but if I remove the "Status" column from the query, everything works as if nothing, I need help

My php code is as follows:

if(!$result=mysqli_query($conexion, $sql)) die();



    $clientes()=array('ID_Cliente'=>$ID_Cliente, 'Nombres'=>$Nombres, 'Correo'=>$Correo, 'Telefono'=>$Telefono, 'Estado'=>$Estado, 'Municipio'=>$Municipio, 'Codigo_Postal'=>$Codigo_Postal, 'Usuario'=>$Usuario, 'Password'=>$Password, 'Sexo'=>$Sexo, 'Fecha_Nacimiento'=>$Fecha_Nacimiento);

or die("Ha ocurrido un error");

echo $json_string; 

The column name "State" is copied and pasted from the database, so the name is not the fault, the sql is not the fault either, because if I copy and paste it in phpmyadmin, it works fine, I can't find what can be the fault and my program is not the fault either, because when I have the error, the only thing I get is an empty argument like this: ""

How important is the data to assess code coverage?

Based on the title, how important is the data to assess code coverage?

As a background, suppose it gives you 20% of the entire dataset to help track the different paths that each row of data traverses the code. I understand this problem is that data limitation may mean that not all possible avenues have been reached.

Now, the big question is whether one needs the other 80% of the data to assess code coverage, or simply needs one or two additional lines to reach the remaining pathways. To put it another way, if I touch all the remaining avenues, is that enough to assess the coverage of the code?

My background is in statistics and data science, so I apologize if my interpretation had been naive.

javascript – Is Atom, PyCharm or Visual Studio Code better?

I am starting to learn JavaScript, html and css, is it better to use Atom, PyCharm or Visual Studio Code? What do you recomend me

Scenebuilder – Using JavaFX and ScenBuilder for a project, how to automatically run code when a new scene is loaded

Hello, I am new to JavaFX and SceneBuilder. I just learned how to change scenes and that is fundamental information to use, but I also want to know how to automatically execute code / execute some code by default when a new fxml file is loaded.

Context: I want to get information from a database and print it directly when the fxml scene is loaded (it is a result scene). Can I do this in the controller class of the fxml file being loaded, or some other way? How?