program-entry-point Questions

6

Solved

If I run this file as "ruby x.rb": class X end x = X.new What is the thing that is calling "X.new"? Is it an object/process/etc?
Rori asked 27/5, 2009 at 20:16

2

Is semantically correct to use a header, footer o main elements inside a dialog component in Html5?. I want to build a complex modal view with options about articles in my main page content. I am...
Consequence asked 3/4, 2017 at 13:55

11

Solved

Quick question, is there a way to call your main method whatever you like ? Or does it have to be called "Main()" ?
Georgiageorgian asked 9/4, 2010 at 19:36

22

I'm trying to load a jar using @echo off java -jar Test.jar pause With the manifest of Manifest-Version: 1.0 Main-Class: classes.TestClass In the Jar directory, I can clearly see a classes\T...
Detinue asked 23/10, 2012 at 12:43

1

Solved

foo.raku: #! /usr/bin/env raku use v6.d; sub MAIN (Str $some-text = $*IN.slurp, Bool :$verbose) { say "Your text:" if $verbose; say $some-text; } When I run it ~% echo "Hello W...
Explant asked 11/12, 2022 at 2:44

6

I've been using R for 4 months now, and I really hope there is a way to use main function as in other languages (C++, Python...) The main reason I want to do this is that all the variables I use i...
Luhe asked 28/10, 2015 at 19:48

1

Solved

What is the best answer for configuring package.json within an npm monorepo, (e.g. the "main", "module" or "exports" field), so that packages referenced locally can re...
Nakitanalani asked 5/12, 2022 at 13:20

6

Solved

In Rust the main function is defined like this: fn main() { } This function does not allow for a return value though. Why would a language not allow for a return value and is there a way to ret...
Redfield asked 16/6, 2014 at 13:47

8

Solved

I know a cool shortcut for System.out.println(): sysout Ctrl + Space. Is there something similar for public static void main(String args[])?
Electrode asked 18/10, 2011 at 20:18

8

Solved

I have a sample directory of some software, which contains multiple files with multiple main functions. May I assemble all of these files into single project, compile them and then run specific one...
Bronchus asked 10/6, 2013 at 11:10

5

I have this code: import sys def random(size=16): return open(r"C:\Users\ravishankarv\Documents\Python\key.txt").read(size) def main(): key = random(13) print(key) When I try runnin...
Plumbiferous asked 23/6, 2013 at 4:6

2

Solved

I want to access the main package from another package, but this is impossible because the main file isn't in a directory. I already tried putting the main file in a directory, but when I try to im...
Knew asked 7/6, 2017 at 19:2

19

Solved

What is the correct (most efficient) way to define the main() function in C and C++ — int main() or void main() — and why? And how about the arguments? If int main() then return 1 or return 0?
Buffum asked 15/10, 2008 at 12:13

9

Solved

It's a simple question, but I keep seeing conflicting answers: should the main routine of a C++ program return 0 or EXIT_SUCCESS? #include <cstdlib> int main(){return EXIT_SUCCESS;} or in...
Jerold asked 15/1, 2012 at 6:9

2

Solved

According to The Rust Reference, If a main function is present, (snip), and its return type must be one of the following: () Result<(), E> where E: Error but it doesn't say what happens...
Wilburwilburn asked 29/4, 2022 at 7:6

2

Solved

I have a very simple Go project setup. At root directory I have go.mod file and main.go and a folder called main2. Inside main2 folder there is main2.go file. / |_ go.mod |_ main.go |_ main2 |_ ma...
Stiffen asked 28/4, 2022 at 14:58

2

Solved

I'm following the official Thymeleaf tutorial on its website and I'm currently on the section Executing the template engine. From what I understood, I should already be able to run the app coded so...
Penutian asked 13/2, 2020 at 13:8

3

Solved

I have a python script that have __main__ statement and took all values parametric. I want to import and use it in my own script. Actually I can import but don't know how to use it. As you see be...
Conducive asked 21/7, 2014 at 11:4

10

Solved

What does the following mean : int main(void) {...} VS int main() {...} ? I think that int main() {...} means that main doesn't receive any parameters (from command line) , however: int main(int...
Mcandrew asked 1/9, 2012 at 5:30

14

Solved

Using Python, reverse an integer and determine if it is a palindrome. Here is my definition of reverse and palindrome. Do I have a correct logic? def reverse(num): s=len(num) newnum=[None]*lengt...
Bookcase asked 24/10, 2012 at 23:42

2

Solved

Python's click module have choice-options, when the input is invalid: import click @click.command() @click.option('--hash-type', type=click.Choice(['MD5', 'SHA1'], case_sensitive=False)) def dig...
Anagnorisis asked 3/3, 2022 at 10:54

4

My question is can't we write an output statement outside the main in java? If I enclose it in { } braces then I don't get error, but if I directly write it, I get an error. why so? public class a...
Polloch asked 13/9, 2013 at 21:22

4

Solved

I am developing a SwiftUI app, there I added a custom splash screen, But now my app is showing 2 splash screens one is blank(the default one) and other is the one that I created. How can I set the ...
Landpoor asked 14/6, 2021 at 19:43

4

Solved

As per the title, is there PHP equivalent of __name__ == "__main__"? Is there something that would work for both scripts executed through the command line and through a web request, or would a cus...
Midget asked 10/3, 2010 at 1:46

1

Solved

I have been using the #[tokio::main] macro in one of my programs. After importing main and using it unqualified, I encountered an unexpected error. use tokio::main; #[main] async fn main() {} err...
Nunnery asked 7/2, 2022 at 19:41

© 2022 - 2025 — McMap. All rights reserved.