Jump to content

Wikipedia:Reference desk/Computing: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Line 88: Line 88:


* When someone asks a question about "programming" they usually mean "the only kind of programming that I personally know about". In this case, the person asking the question doesn't seem to know about Assembly, where everything is global (can you imagine me trying to implement something resembling scope when my microcontroller has 128 Bytes of RAM?). They also don't seem to know about FORTH, where data is typically stored on a stack and not in variables. So the "what language" question (and the implied "may I assume that you are using something like a PC with an operating system and not programming a toaster or thermostat?") is key to giving a correct answer. --[[User:Guy Macon|Guy Macon]] ([[User talk:Guy Macon|talk]]) 15:15, 24 April 2019 (UTC)
* When someone asks a question about "programming" they usually mean "the only kind of programming that I personally know about". In this case, the person asking the question doesn't seem to know about Assembly, where everything is global (can you imagine me trying to implement something resembling scope when my microcontroller has 128 Bytes of RAM?). They also don't seem to know about FORTH, where data is typically stored on a stack and not in variables. So the "what language" question (and the implied "may I assume that you are using something like a PC with an operating system and not programming a toaster or thermostat?") is key to giving a correct answer. --[[User:Guy Macon|Guy Macon]] ([[User talk:Guy Macon|talk]]) 15:15, 24 April 2019 (UTC)

* A global maxRecords, to tell everyone that we're just testing and 5 records are enough is OK. Many things are global anyway, the space left on C: is no different for class X or class Y. But if there's not a very good reason to tell everyone about your counter i, it's best to keep it a secret. If some other code wants to know, there's a polite way which is by asking a property, which cleans the house before you enter it. [[User:Joepnl|Joepnl]] ([[User talk:Joepnl|talk]]) 00:47, 28 April 2019 (UTC)


= April 25 =
= April 25 =

Revision as of 00:48, 28 April 2019

Welcome to the computing section
of the Wikipedia reference desk.
Select a section:
Want a faster answer?

Main page: Help searching Wikipedia

   

How can I get my question answered?

  • Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
  • Post your question to only one section, providing a short header that gives the topic of your question.
  • Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
  • Don't post personal contact information – it will be removed. Any answers will be provided here.
  • Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
  • Note:
    • We don't answer (and may remove) questions that require medical diagnosis or legal advice.
    • We don't answer requests for opinions, predictions or debate.
    • We don't do your homework for you, though we'll help you past the stuck point.
    • We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.



How do I answer a question?

Main page: Wikipedia:Reference desk/Guidelines

  • The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
See also:


April 20

Photography

How do you cartoonize a photo? — Preceding unsigned comment added by 105.112.38.212 (talk) 07:15, 20 April 2019 (UTC)[reply]

I would start by typing "how to cartoonize a photo" into a search engine such as Google.--Shantavira|feed me 13:44, 20 April 2019 (UTC)[reply]
Various processes can be applied to a digital photograph to imitate the style of a hand-drawn cartoon such as reducing the number of bits of Color quantization called Posterization and/or using an Edge detection process such as the Sobel filter to emphasize features. This commercial site offers free trials. DroneB (talk) 14:00, 20 April 2019 (UTC)[reply]

Lubuntu 19.04 (Disco Dingo) Icons

https://lubuntu.me/disco-released/ says

"Trash, Home, Computer, and Network icons have been added to the desktop for easy accessibility."

but I just did a fresh install of Lubuntu 19.04 (Disco Dingo) and the icons are nowhere to be found.

Does anyone know how to enable them? --Guy Macon (talk) 19:52, 20 April 2019 (UTC)[reply]


April 21

Microsoft policies

Microsoft allows legally downloading an ISO file and installing Windows 10 without a license. You get a minor watermark about it not being licensed, among some other restrictions, however, you get the OS running without paying a dime.

Has Microsoft got soft on piracy? Is Microsoft using other means (like better contracts with manufacturers for OEM licenses) to get people to chip in for their OS? Are they concentrating more on companies, and letting individual users alone? May it be that they do not fear other OSs anymore (sorry Linux evangelists)? --Doroletho (talk) 01:03, 21 April 2019 (UTC)[reply]

Got a link? There's been rumours for a year or two that the MS business model going forward didn't include tight licensing for Windows. In general they take the "window tax" on nearly every commercially produced PC, the question is: is it worth their while chasing a few hobbyists and developing country pirates. Given that MS are more likely to make money from you through applications, apps and forcing you into their environment perhaps giving away Windows to geeks is akin to handing sweeties to kids. As regards fear: if you fear the opposition you remove barriers to adoption, if you don't fear them you can stick any barrier you want and simply tell people to pay up, there's no choice. Martin of Sheffield (talk) 14:57, 21 April 2019 (UTC)[reply]
There's this howtogeek from 2017 or another minor site. --Doroletho (talk) 00:08, 23 April 2019 (UTC)[reply]
I think they make enough money selling you SaaS like Office 365 and apps that used to be free like Minesweeper, and showing you ads and selling your data to advertisers, that pirates actually become a revenue source. 93.136.1.73 (talk) 04:21, 24 April 2019 (UTC)[reply]
Thanks for the links, I may stick a copy in a VM for support, debug and porting purposes. Martin of Sheffield (talk) 07:38, 25 April 2019 (UTC)[reply]

April 22

WHOIS creation date

Imagine that I registered four domain names on 1 January 2001, and they all originally expired on 1 January 2002:

  • example1.com — I've re-registered it every year
  • example2.com — I never re-registered it, and nobody's registered it since then
  • example3.com — I didn't re-register it, but someone else picked it up on 1 January 2003 and has re-registered it since then
  • example4.com — I let it expire and then re-registered it on 1 January 2003, and have since re-registered it every year

In 2019, what will a WHOIS list as the "creation date" for each of them? Obviously #1 will be 1 January 2001, but I'm not clear whether #3 and #4 will be 2001 or 2003 (or whether it would distinguish between re-registered by original owner and re-registered by someone else), and I don't know whether #2 would even appear. WHOIS doesn't address the subject, and [1] says The creation date is when this domain was originally registered, but I'm not clear whether this is the beginning of the current "streak" of registrations (i.e. one day earlier is the last time this domain wasn't registered) or the very first time it was registered, period. Nyttend (talk) 22:25, 21 April 2019 (UTC)[reply]

For your example #3, that begs the question, are there any websites that actually keep track of who all the prior domain owners are? If they did, the most likely would have to say, from what year to what year, etc. 67.175.224.138 (talk) 11:10, 25 April 2019 (UTC).[reply]

SMB file servers keep asking for credentials

I have both Windows 10 SMB and Linux Samba file servers. The share permissions are:

  • browsable (Linux) / turn on file and printer sharing (Windows)
  • guest ok (Linux) / turn off password protected sharing (Windows)
  • Appropriate file system level permissions on both servers (not really matters here)

Most of the time, using a Windows 10 client to connect to the shared folder is straight forward, just \\my-server and it is fine. But sometimes, it keep asking for credentials for unknown reason. See here.

It won't connect if I leave all fields blank. Sometimes I need to type a random user account with a blank password, and sometimes both a random account plus a random password to pass that stupid prompt. Linux clients do not suffer from that issue, at least by using smb://my-server on Ubuntu's Nautilus and select Connect anonymously. To make the problem worse, let's say I have a shared printer on the server. After a client provides a random user + password, he can connect to the server and use the shared printer. After a few days, he suddenly cannot print using the previously added printer, until he tries to connect and provides a random user + password again (the printer does not need to be re-added). Looks like the junk user + password time out after a few days (even if you do check Remember my credentials).

The issue occurs randomly. What could be the cause of the problem? -- Livy (talk)

Regarding scope in programming

I understand that basically there are global and local scopes and if I put a variable in a local scope (say, inside a function) I cannot access it from outside this this local scope unless I declare this variable as exceptional so that it would indeed be accessible from that local scope unlike its siblings in that local scope that aren't accessible,

If this general description is correct, please share an example on why to do such exception. Thanks, — Preceding unsigned comment added by 49.230.14.59 (talk) 11:15, 22 April 2019 (UTC)[reply]

A simple example: I write a function that connects to a database and creates a handler variable for the connection. I want that handler variable to be in scope for any other function that requires access to the database. I *could* have my initial function return the handle and then pass that handle as a parameter to any function that needs it. My alternative is to push the variable into global scope from inside the function so all functions can see it.
Also, there is a slight nuance to global vs local scope. In some programming languages, global scope means that it was created outside of any class or function, but that doesn't mean that it exists inside the class/function without being explicitly included in some form of "give me access to global variable X inside here" statement. If I don't import the global variable, I can create a local variable of the same name. In those languages, you will often find some sort of super or mega global, which is a global that is automatically included in all classes and functions and you can't create a local variable of the same name. 68.115.219.139 (talk) 13:41, 22 April 2019 (UTC)[reply]

Your question seems too general. What language are you using? Do you want something like a C++ friend specification[2]? It is also sometimes possible to control such things with a package system. Otherwise you'd just use arg passing. Encapsulation (computer programming) discusses the general issues somewhat. 67.164.113.165 (talk) 17:33, 22 April 2019 (UTC)[reply]

  • Fashions come and go in programming, but for a long time there has been an ongoing single-direction to avoiding global scope. So if you possibly can, avoid globals. And that means for everything. Even if the code "looks complicated" or "becomes long-winded". Overall, the advantages favour avoiding that global scope.
The general technique would be to return a "Connection" object and to pass that around. This, like any object, allows techniques like abstraction and data-hiding. You can write your code from the outset around this Connection object and even if (as is likely) the management of that connection becomes more complicated, then you can hide that new complexity inside that object and the client code using it either doesn't need to know about that new complexity (it's all handled internally by the Connection object) or at least only those parts of the client which need to need to be updated. If you use one global though, before long that grows into two. Even making the connection object global (which gives a few advantages) is a bad idea, because it's then a fundamental limitation that there is only one Connection possible.
A recent development (and a good one) is functional programming (which is not merely the use of functions). In this, there is a vehement avoidance of globals, or any form of persistent state outside the narrowest possible scope. Everything passed in is parameterised, everything returned is immutable. The advantage of this is in both reliability (and provable reliability) but also (and mostly) flexibility for future change without the code collapsing. The departed globals will not be missed. Andy Dingley (talk) 20:18, 22 April 2019 (UTC)[reply]
  • When someone asks a question about "programming" they usually mean "the only kind of programming that I personally know about". In this case, the person asking the question doesn't seem to know about Assembly, where everything is global (can you imagine me trying to implement something resembling scope when my microcontroller has 128 Bytes of RAM?). They also don't seem to know about FORTH, where data is typically stored on a stack and not in variables. So the "what language" question (and the implied "may I assume that you are using something like a PC with an operating system and not programming a toaster or thermostat?") is key to giving a correct answer. --Guy Macon (talk) 15:15, 24 April 2019 (UTC)[reply]
  • A global maxRecords, to tell everyone that we're just testing and 5 records are enough is OK. Many things are global anyway, the space left on C: is no different for class X or class Y. But if there's not a very good reason to tell everyone about your counter i, it's best to keep it a secret. If some other code wants to know, there's a polite way which is by asking a property, which cleans the house before you enter it. Joepnl (talk) 00:47, 28 April 2019 (UTC)[reply]

April 25

What do you call this type of environment

Terminology question.

The 1st is like my school e-mail or Facebook, I login at home. Then stayed logged in, and go to school computer, login at school. Then logout at school. But doing so, doesn't log me out at home. So come back home, refresh the page, and still logged in. So, you could be logged in multiple places, and no way to know how many other places you're logged in, unless you're a server admin.

And the 2nd, is where you can only be logged in at 1 place at a time. And here, we may have 2 more types: 1 where it automatically logs you off the 1st place you logged in, or, it may complain, and force-log off the 1st after a period of idle time. Thanks. 67.175.224.138 (talk) 11:07, 25 April 2019 (UTC).[reply]

Access to a service in a client-server system is commonly referred to as a "session." In the first example, you have a "multi-session" service. A single user can open multiple sessions. In the second example, you have a "single session" service. A single user can only one and only one session. That terminology is common in servers where services are set up to be single or multi sessions. In desktop computers, it isn't as common. However, I have seen the single/multi session option for remote desktop service. 68.115.219.139 (talk) 12:07, 25 April 2019 (UTC)[reply]
I don't get your last statement on "in desktop computers, it isn't as common." Of what relevance is it if the users accesses the session from a desktop computer, laptop, or smartphone? 67.175.224.138 (talk) 12:53, 25 April 2019 (UTC).[reply]
You misinterpreted it. *ON* desktop computers it is less common. *ON* cell phones and tablets, it rarely exists. *ON* those devices, you usually have one user logged in and only one user logged in. I did not claim that when using a desktop computer, servers behave differently. I claimed that desktop computers are usually single-user-at-a-time systems. I also noted that when using remote desktop services, you can have two users actively using Windows. But, that is more an exception than a rule. 68.115.219.139 (talk) 16:30, 25 April 2019 (UTC)[reply]


Having Android Take Over Auto Screen

I have a Samsung Galaxy 7 smartphone, which has the Android operating system. Is there a way that is independent of the automobile manufacturer that I can have the phone take over the audio display in my car via Bluetooth? Or is this a feature of the software in the car, in which case I have to get the instructions on how to do this from the dealer? I have seen this done from an iPhone in other cars, but I have not seen it done from an Android, so I don’t know whether this was a feature of the iPhone or a feature of the car audio display. Robert McClenon (talk) 18:43, 25 April 2019 (UTC)[reply]

I have been car shopping. What I have seen is some cars let my wife's iPhone take over the car's media interface. Others let my LG (android) take it over. So, some are Apple. Some are Android. I haven't seen any that are both. The higher end cars let you pick. Example: The Infiniti dealer specifically asked if we would be wanting Apple or Android. The Dodge dealer said it can only do Android. So, my vote for a Challenger got shot down. 64.53.18.247 (talk) 21:40, 25 April 2019 (UTC)[reply]
One clarification is in order. I can use Bluetooth and Spotify to play music through the car radio, and to give me audio directions from Google maps, which interrupt the music. So I can do some Bluetooth from the Android. The question is whether I can take over the console display. Also, can I display the Google Map navigation on the console display? Robert McClenon (talk) 00:36, 26 April 2019 (UTC)[reply]
The answer was referring to Android Auto, which allows your phone to use the car's multimedia display. Some manufacturers include Android Auto. Some include Apple CarPlay, which does the same thing, but with iPhone. Luxury vehicles often let you choose. All of them have bluetooth capability, which has different levels of functionality depending on exactly what is implemented. So, you can use an android phone with a CarPlay system. It just won't be as effective. You can use an iPhone with an Android Auto system. Again, it won't be as effective. What many people want is seamless navigation. You need to match the system for that. If you have Android Auto, you need an android phone. If you have Apple CarPlay, you need an iPhone. 68.115.219.139 (talk) 11:45, 26 April 2019 (UTC)[reply]

Minimizing Spotify without turning it off

I have a Samsung Galaxy 7 smartphone, which has the Android operating system. I am running Spotify to play a selected PlayList of music on the car audio. I want to send a text message, which means that I need to open the messaging app. If Spotify is displayed, is there a way that I can minimize it without closing it? If I close it, it turns off the audio, which I don’t want. (If I can use the screen of the audio device in the car, then I can use its console, but that is not this question.) Robert McClenon (talk) 18:43, 25 April 2019 (UTC)[reply]

Word Stops Printing

I am using a Dell desktop computer and Word with Office 365. I have a very large number of Word documents open, because I don’t close documents after I open them. I print some of them to a locally connected printer. At some point, printing stops. The print jobs are shown as Spooling. I can’t cancel them. What I can do is that I can kill Word from the Task Manager or the Resource Monitor. The stuck print jobs go away. I can then resume printing. Is there a specific limit that I am exceeding, or is this just something that occasionally happens? Robert McClenon (talk) 18:43, 25 April 2019 (UTC)[reply]

What printer is it? It's possible that the large number of word documents and/or a long print queue is causing the printer and/or printer drive to glitch out, Windows does weird shit when too many processes or programs are running at once. I'd say...try not to open or print a lot of things before they're actually completed. Rob3512 chat? what I did 19:20, 26 April 2019 (UTC)[reply]
User:Rob3512 - Well, the printer is a Brother 2360. I am not trying to print multiple pages at once. I am waiting for a page to print before printing another page from another document. I am opening a lot of Word documents, because I am not bothering to close them, just counting on Windows to manage memory. It isn't the print queue that is glitching out. If the problem is indeed due to my opening too many Word documents at once, then I am satisfied just to kill Word and relaunch it when the printer stops. Robert McClenon (talk) 20:11, 27 April 2019 (UTC)[reply]

Launching Access from E: file

Is there any reason that I can’t put an Access database (*.mdb or *.accdb) on an insertable drive, and then click on it to launch Access to view and maintain the database?

Robert McClenon (talk) 18:43, 25 April 2019 (UTC)[reply]

I can't think of any reason, unless the database is larger than the space on the drive. If the E: drive is a memory stick then it might have less free memory than it reports. What goes wrong when you try it? Dbfirs 19:18, 25 April 2019 (UTC)[reply]
  • Performance will be abyssmal.
It would be better if you follow the basic Access design technique and split the database file in two. A shard of the data goes onto the "data" volume and the rest of it (stored queries, forms, reports, code, scratch tables, and invisible temporary tables which Access generates) are all held on the local "code" volume instead. The two are linked by using Access' linked tables (which can also be created dynamically by VBA code, if the path to the data volume can change).
But on the whole, performance is likely to be awful. USB3 to a magnetic drive or SSD might be OK, but USB sticks and SD cards won't be. Andy Dingley (talk) 20:32, 25 April 2019 (UTC)[reply]
There is a case where it will won't be bad... If the USB drive is pulled into a memory cache, then the memory cache is used. Accessing a memory cache is fast - faster than accessing an internal drive. The kicker is that it will take longer than normal to load because it has to copy to cache. You also MUST perform a proper eject to write changes to the USB drive. Unfortunately, we have no way to know how his USB driver is set up. So, we can't make a claim about speed. 64.53.18.247 (talk) 21:35, 25 April 2019 (UTC)[reply]
User:Andy Dingley - I don't understand what the point is to splitting the database into shards, but then I didn't explain what the size of the database is. The database has approximately 100 addresses at present and approximately 400 mail records at present. Maybe you thought I had a medium-sized database. Someone is going to ask me why I am using an Access database for something that is small enough that I could use an Excel spreadsheet. There are three reasons. First, Access supports a real one-to-many relationship. Second, I am using the Report capability of Access to print mailing labels. Third, I am a retired database engineer and I like Access. Performance isn't an issue. It isn't a shared database or anything like that. It is a personal database. I just want to keep track of my correspondence and print mailing labels. Robert McClenon (talk) 20:21, 27 April 2019 (UTC)[reply]
A single shard of the whole database (i.e. all rows) is still a shard. But the point here is to keep the Access scratch tables on a local, high-performance filesystem. Even if you move the data onto some lower-performance device, because you need to have it removable. Andy Dingley (talk) 20:29, 27 April 2019 (UTC)[reply]

April 26

What is wrong with this Python function?

Here's the relevant Python function:

def is_power(a,b):
   if a%b > 0:
       return False
   else:
       if a/b == b:
           return True
       else:
           if a/b/b == b:
               return True
           else:
               while a > 1 or a == 1:
                   a = a/b
                   is_power(a,b)

When I type "print(is_power(2,16))" or "print(is_power(3,81))" or print(is_power(4,256))", the program prints out "None" (instead of "True"). In other words, there's an issue with powers of four. I previously had this problem with powers of three in this Python function, but then I changed the function a bit, fixed the issue with the powers of three, but ended up having a problem with powers of four instead. Anyway, how do I fix my Python function here?

Basically, I want to return True if a is a power of b but return False otherwise. Futurist110 (talk) 06:16, 26 April 2019 (UTC)[reply]

Do you mean "a and b are positive integers. I want a function that returns True if a is a positive integer power of b."? Your tests all yield fractional powers of b i.e. 2=160.25, 3=810.25, 4=2560.25. DroneB (talk) 09:32, 26 April 2019 (UTC)[reply]
@Futurist110: What's the definition of a power you try to implement here? Is 1 a power (with a zero exponent) of 3? Is zero a power of zero? --CiaPan (talk) 10:49, 26 April 2019 (UTC)[reply]
@Futurist110: I guess you get None because there is no return under the last else, so when the loop terminates there is no value specified to be returned. --CiaPan (talk) 10:59, 26 April 2019 (UTC)[reply]
As noted, the recursive call to is_power must be returned. You want "return is_power(a,b)" - assuming you actually want to use the logic that you implemented. 68.115.219.139 (talk) 11:48, 26 April 2019 (UTC)[reply]
The logic is pretty confusing and doesn't look right. The test "a>1 or a==1" at the end can be written "a >= 1". If you use "return is_power(...)" as people mention, then the "while" loop can't actually loop. Your tests like "is_power(2,16)" make it look like the code has the args backwards (it tests whether 2 is a power of 16 rather than the other way around). For example, is_power(9,3) if you run the code will return True immediately. You don't really need all those nested tests or the separate a/b and a/b/b tests. The nested tests aren't needed because if you execute a return statement inside an if block, the code after the if doesn't get run, so you can omit the "else" and return to the earlier nesting level.
Some stylistic points: in Python you should use // instead of / for integer division, since the behaviour of / in Python 3 changed to return a floating point result (so 1/2 is 0.5). And in Python you should generally prefer to use loops instead of recursion, since Python doesn't understand how to convert tail recursion to a loop. It's helpful to include a comment at the top of the function saying what the function is supposed to do. I'd write that function like this:
def is_power(a,b):   # return true if a is a power of b, else false
    if b == 0: 
        return False
    while b%a == 0:
        b //= a
    return (b == 1)
173.228.123.207 (talk) 04:41, 27 April 2019 (UTC)[reply]
That's better than the OP but not quite correct. This version incorrectly returns True for is_power(5,1) and loops forever on is_power(1,5). (Also you reverse a and b compared to the OP.) I'd write it as
def is_power(a,b):   # return true if a is a power of b, else false
    if b == 0:
        return (a == 0)
    if b == 1:
        return (a == 1)
    if a == 0:
        return False
    while a % b == 0:
        if a == b:
            return True
        a //= b
    return False
CodeTalker (talk) 07:17, 27 April 2019 (UTC)[reply]

MediaWiki: This might be an SEO problem yet to be fixed over the years

Please visit this question in Webmasters Stackexchange. — Preceding unsigned comment added by 103.199.26.76 (talk) 17:35, 26 April 2019 (UTC)[reply]

Wrong link posted; please visit again.

iPhone app

Is there iPhone app that when installed list me the app installed on iPhone that are compatible with iPad? --151.49.89.141 (talk) 18:17, 26 April 2019 (UTC)[reply]

How do Wikipedia blocks work?

This is more of the technical side of it, does the normal blocking function block a specific username and password from logging in, or does it block the user's IP? What if the user logs out and edits via IP spoofing? (Or create new account(s) from different IPs)? And what if the user is vandalising (or whatever they're doing) cross-wiki? It feels like determined users will always find some way to evade a block or ban. Rob3512 chat? what I did 19:17, 26 April 2019 (UTC)[reply]

You might find Wikipedia:Autoblock one of the more fundamental pages to understand some of this. If someone needs blocking on all wikis they get a global lock (for an account) or a global block (for IP addresses) (see m:Global blocks). The short answer is that some people can always find new ways to edit, but we can usually limit their activity through one means or another. Blocks are often overrated, but they are just one of a number of tools available to admins. -- zzuuzz (talk) 20:01, 26 April 2019 (UTC)[reply]

April 27

How do I contact the proper people to start translating the interface into Chickasaw language?

I want to translate the interface into Chickasaw.Ndołkah (talk) 06:57, 27 April 2019 (UTC)[reply]

You need to register at translatewiki.net and do translations there. Ruslik_Zero 20:33, 27 April 2019 (UTC)[reply]