language-comparisons Questions

5

Solved

I am really fond of python's capability to do things like this: if __name__ == '__main__': #setup testing code here #or setup a call a function with parameters and human format the output #etc....
Frugal asked 14/1, 2011 at 17:24

4

Solved

Is there an equivalent of Python str.format in PHP? In Python: "my {} {} cat".format("red", "fat") All I see I can do in PHP natively is by naming the entries and using str_replace: str_replac...
Perrins asked 19/5, 2013 at 6:35

10

Solved

Powershell's array notation has rather bizarre, albeit documented, behavior for slicing the end of arrays. This section from the official documentation sums up the bizarreness rather well: Negat...
Vespertine asked 11/2, 2015 at 17:7

7

Solved

Do you know any PHP statement that works like Python's pass statement?
Mellisa asked 17/5, 2010 at 21:1

25

Solved

Is there an XSLT equivalent for JSON? Something to allow me to do transformations on JSON like XSLT does to XML.
Jadda asked 24/10, 2009 at 13:40

4

Solved

I'm trying to find an exact equivalent to javascript's function 'btoa', as I want to encode a password as base64. It appears that there are many options however, as listed here: https://docs.pyth...
Chiller asked 4/9, 2016 at 3:58

9

Solved

I've searched the wiki modules page, but I can't find anything similar to virtualenv (python) or rvm. Anyone here separates node.js in their own env? I really don't like to install npm system-wid...
Banting asked 6/9, 2010 at 18:15

5

Solved

Python has syntactically sweet list comprehensions: S = [x**2 for x in range(10)] print S; [0, 1, 4, 9, 16, 25, 36, 49, 64, 81] In PHP I would need to do some looping: $output = array(); $Nums ...

5

Solved

In Python, you can access an object's docstring by using obj.__doc__. What is the equivalent action in Ruby?

10

Solved

In Python, it is tedious to write: print "foo is" + bar + '.' Can I do something like this in Python? print "foo is #{bar}."

2

Solved

Is there an AWS equivalent to Azure Logic Apps? Furthermore I would like to know if someone has experiences regarding a migration of Azure Integration Services into AWS and if a comparison between ...

8

Solved

I read on another Stack Overflow question that Python was just like Ruby, as it relates to "everything's an object," and everything in Python was an object, just like Ruby. Is this true? ...
Absorbent asked 14/5, 2009 at 21:33

2

Solved

Given this powershell code: $drivers = New-Object 'System.Collections.Generic.Dictionary[String,String]' $drivers.Add("nitrous","vx") $drivers.Add("directx","vd") $drivers.Add("openGL","vo") Is ...
Conveyance asked 20/7, 2011 at 16:37

10

Solved

I have a to do this: AccountList.Split(vbCrLf) In c# AccountList is a string. How can i do? thanks
Celestial asked 8/3, 2010 at 14:3

2

I would like to write a visual studio code extension that parse and analyse large log files. I thought to start with language server extension. I would like the server to be written in python. Belo...

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

11

Solved

What is the cleanest way to make Javascript do something like Python's list comprehension? In Python if I have a list of objects whose name's I want to 'pull out' I would do this... list_of_names...

2

How can I convert a string in Golang to UTF-8 in the same way as one would use str.encode('utf8') in Python? (I am trying to translate some code from Python to Golang; the str comes from user input...
Quarterback asked 1/3, 2017 at 20:21

5

What would be a node.js templating library that is similar to Jinja2 in Python?
Bosomy asked 11/8, 2013 at 18:49

2

Solved

I´ve found a comment of user R..: C and C++ are not the same language. In particular, C const has nothing to do with C++ const. I know, that one difference between the const qualifier in C and...

4

Solved

In Bash I can easily do something like command1 && command2 || command3 which means to run command1 and if command1 succeeds to run command2 and if command1 fails to run command3. What'...
Corespondent asked 10/3, 2010 at 12:4

13

Solved

I've been programming in Java for a while and just got thrown onto a project that's written entirely in C#. I'm trying to come up to speed in C#, and noticed enums used in several places in my new ...
Unequivocal asked 22/1, 2009 at 14:19

9

Solved

Ruby example: name = "Spongebob Squarepants" puts "Who lives in a Pineapple under the sea? \n#{name}." The successful Python string concatenation is seemingly verbose to me.
Geologize asked 15/12, 2010 at 13:50

5

Solved

Does C++ offer something similar to Ada's subtype to narrow a type? E.g.: type Weekday is (Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday); subtype Working_Day is Weekday range M...
Fatma asked 9/5, 2019 at 21:12

3

Solved

I'm trying to convert some Python code into Ruby. Is there an equivalent in Ruby to the try statement in Python?
Rowland asked 9/9, 2013 at 19:19

© 2022 - 2025 — McMap. All rights reserved.