Wikipedia:Reference desk/Archives/Computing/2019 November 27

= November 27 =

HATEOAS as Object Oriented Design Pattern
I'm learning about REST and HATEOAS, and it reminds me of some object-oriented design pattern, but I'm not sure which one. What would you call a pattern where object A must make use of several functions in object B, but B is not allowed to maintain any state related to A, so you have a container object C that you pass back and forth in each function call to maintain state? 2600:1700:46B0:BE60:5173:CF5D:F352:C4FC (talk) 01:00, 27 November 2019 (UTC)

hi, Dear Misters Editors, i put some lines on my wiki page English ... Idd like to know how do they look to You
hi, i put some lil sections on my wiki page english language n idd lke to know how well does it fit to the wiki cz i dont wish any trouble with that here, n i might consider to remove it (maybe You will do it before me, eventualy). i m just boosting around my own ideas (it could be some others too that found them before me) hoping that there will be somebody that reading them, like them n probabily show some interest in support me in any way with my kinda "original research". alrite, thank You for Your time. Kind respect, Florin747 (talk) 07:55, 27 November 2019 (UTC)
 * Your user page is supposed to tell something about yourself, and what you are doing on Wikipedia. What you have put there looks like a bunch of original ideas. Original ideas from our authors are unsuitable for Wikipedia articles, as everything should be verifiable WP:V. Some could go to your sandbox. So it is best that you take it down. Graeme Bartlett (talk) 11:56, 27 November 2019 (UTC)
 * Please, see WP:NOTWEBHOST. Ruslik_ Zero 11:59, 27 November 2019 (UTC)

hi, there, thank You for the reply. May i ask to You that You remove my sections on my user page, cz I am not evn so sure that I'll be able to do the rite job about it. Thank You for reading my posts anyway, at least for the moment I cant do better I am affraid. Thank You once more, please dont take me as a bad name for asking You to remove the sections that suits for that. Florin747 (talk) 12:09, 27 November 2019 (UTC) :-)


 * Wikipedia does not want original research, see WP:OR. Wikipedia is supposed to document notable topics using reliable sources writing them up with a neutral point of view. It follows, it does not lead. Please see WP:5P. Dmcq (talk) 14:15, 27 November 2019 (UTC)


 * To delete things on your user page just select them and press delete, type an edit summary in the gray box below and press publish changes like you did here. Other people should normally leave your user page alone. Dmcq (talk) 14:19, 27 November 2019 (UTC)


 * -) One big OK, thank You for the tips, I think I will try that, Thank You very much for Your help! Kind

respect, Florin747 (talk) 14:37, 27 November 2019 (UTC)

alrite, done it, i wish to know one more thing: about that sandbox. what can You tell me about it in the context of original ideas, if i wish to put some more over there, just in case, for some other time, maybe. Thank You, anyway! Kind respect, Florin747 (talk) 14:47, 27 November 2019 (UTC)

...alrite, i forgot to say please about my last question here. please forgive me about that. if You wish, then You may not answer to that anyway. Thank You for reading my posts, anyway! I am truly honoured ! Sayonara! :-) Florin747 (talk) 05:55, 28 November 2019 (UTC)
 * Per the page outlined by Ruslik_Zero i.e. WP:NOTWEBHOST, no part of wikipedia is intended for you to publish your original ideas or anything of that sort. You can use your sandbox to help you learn how to edit wikipedia, but if you continuously use it to publish your own original ideas, it may be deleted or you could be blocked. People may turn a blind eye if start to post 24k worth of stuff, you may get attention. If you want to publish your own idea, I suggest you look for one of the many places out there that are web hosts of some sort such as blog hosting services who normally allow you to post your own ideas to your heart's content subject to some terms of service (e.g. copyright, and often with restrictions on bigoted content). You can surely even find one which lets you do it in a wiki if you wish that for some reason. Nil Einne (talk) 04:17, 30 November 2019 (UTC)

Alrite, thank You for Your clarifcations, I hope that I will be able to remember Your advices for the future, even my memory is kinda moody sometimes. Kind respect, Florin747 (talk) 11:02, 2 December 2019 (UTC) :-)


 * Could you, please, pay more attention to proper punctuation and ortography? Not all users, readers and editors of English-language Wikipedia are fluent in English. Writing incorrectly, although may be fun, does not help in communication with native speakers, and may be annoying or disturbing for those others. --CiaPan (talk) 13:02, 2 December 2019 (UTC)

alrite, Dear Misters Editors, i think that "We" just got more trouble wth Romanian language, please see it on my sandbox page. i know, i know, its just abt some just more original ideas which wiki doesnt want. Please try to translate the issue (28), tell me what do You think about it... Maybe >< Kind respect, anyway, Florin747 (talk) 06:23, 3 December 2019 (UTC) :-)


 * Hopefully this was obvious to everyone but I just noticed a significant typo in my original reply. I said "People may turn a blind eye if start to post 24k worth of stuff, you may get attention." but meant "People may turn a blind eye, however if you start to post 24k worth of stuff, you may get attention. " Nil Einne (talk) 08:34, 4 December 2019 (UTC)

well, as for me, i have some skitzofrenia since more than 20 years ago, i am following brain treat since then and since i am focusing on (applied) maths mainly, i got no such big time to learn english, nor editing on wiki style, for example. what i am trying to say is that i am trying to pay my contribution to some appealing programming paradigm at some basic math level, hoping that youth will have something to guide them about studying the computers programming, getting in touch with the programming optimizations for basic routines that are taught in school. i dont need much credits for that since it is my pleasure to think about computers thow i might wish that somebody would notice me maybe support me about my attempts with a little money perhaps , good advices, tips for good books, good internet topics, etc, etc. Thank You, its nice to keep in touch with some of Wikipedia Editors because they are surely smart guys. Kind respect, Florin747 (talk) 09:42, 4 December 2019 (UTC)

Excel question
I have a Microsoft Excel question that I haven't been able to get an easy answer to on other question forums. Since Wikipedians seem to be the smartest people around, I thought I would try here. I have two lists of data (barcodes). One large list (A) and one shorter list (B). I would like to divide list B into two parts: 1) list C, which includes only data that appears in both list A and list B, and 2) list D, which includes only data that appears in list B but not in list A. A potential complication is that some data in list A may be duplicated. Is there any easy way to do this in Excel? Thanks in advance, Questiontoask (talk) 15:30, 27 November 2019 (UTC)
 * As a start, if you want List A to only contain unique values, Excel has got a great Remove Duplicates function on the Data tab. - X201 (talk) 16:00, 27 November 2019 (UTC)
 * Thanks for the suggestion. I need to keep List A intact, but if generating Lists C and D requires a duplicate-free List A, I will make a copy of List A and remove the duplicates from it.  Questiontoask (talk) 16:10, 27 November 2019 (UTC)
 * I forgot to mention, it doesn't have to be Excel. If there is some other free, publicly available resource that can be used then I can presumably manually export the lists from Excel, generate Lists C and D elsewhere, and then import them back into Excel. Questiontoask (talk) 16:18, 27 November 2019 (UTC)
 * Also, if it makes any difference, List A is hundreds of thousands of items long and list B is several hundred. Questiontoask (talk) 16:18, 27 November 2019 (UTC)


 * You can use the comm Unix command. If you get the two columns into two sorted files A and B, then  will give you the commons entries, and   will give the entries unique to file B. You can install such a command under Windows. Graeme Bartlett (talk) 21:06, 27 November 2019 (UTC)
 * That sounds promising, though perhaps beyond my knowledge of computers. Can you suggest somewhere that I might learn how to "install such a command under Windows"?  Thank you.  Questiontoask (talk) 21:27, 27 November 2019 (UTC)
 * Cygwin is the easiest route to getting access to a Unix command shell under Windows. You can then use any of the innumerable guides to bash for how to work it.
 * Some Microsoft diehards prefer PowerShell, which I'm sure could do it too. But bash experience is always useful. Andy Dingley (talk) 22:47, 27 November 2019 (UTC)


 * Maybe I'm missing something, but this seems easy enough to do in Excel. Let's assume that list A is in column A of Sheet1 and list B is in column A of Sheet2. Let's further assume that you want to leave both lists intact and untouched. Create a copy of Sheet2 and rename it to Sheet3 so we have a space to work. In column B of Sheet3 do a VLOOKUP of those values against the list in Sheet1. It would look something like this . (As a practical thing, after all the lookups are done I would then copy-paste values to column B so that the formula doesn't have to keep re-running every time you filter it). The value in column B will then tell you which list that barcode belongs to: C or D. You can then filter to show one or the other and then do with them whatever you want (e.g. copy to two new tabs). Matt Deres (talk) 15:06, 28 November 2019 (UTC)


 * I am sure Matt Deres's approach works perfectly but I'm always uncomfortable using IFERROR because it feels like I'm planning on failure. My approach would be to make a copy of ListB and put the following formulae in columns B and C respectively:
 * =IF(AND(COUNTIF(ListA!$A:$A,ListC!$A1)>0,COUNTIF(ListB!$A:$A,ListC!$A1)>0),"C","")
 * =IF(AND(COUNTIF(ListA!$A:$A,ListC!$A1)=0,COUNTIF(ListB!$A:$A,ListC!$A1)>0),"D","")
 * The first formula reports "C" if there are members in ListA and in ListB, and the second reports "D" if there are no members in ListA but members in ListB.
 * (You don't need the '$' symbols. I included them because I was porting the first formula to the second before modifying it.)
 * I find COUNTIF is more robust than VLOOKUP when I try to code quickly.
 * Hayttom (talk) 09:02, 1 December 2019 (UTC)
 * This is a classical database functionality, you can solve complicated by using the DLOOKUP function. -- Hans Haase (有问题吗) 10:32, 2 December 2019 (UTC)
 * In this case, planning to fail does not mean failing to plan. :) Neither COUNTIF nor VLOOKUP are great with huge lists, but in my experience, VLOOKUP is slightly quicker since it only has to find the first iteration and then return it. When checking hundreds of values against hundreds of thousands, the computing time may have a convenience factor. Matt Deres (talk) 15:18, 2 December 2019 (UTC)

Limit CPU core use of all processes for user on Linux
I have a piece of proprietary software that crashes on launch if run on a machine with more than 8 cores. Unfortunately, I have 64. Double unfortunately, it spawns itself off into a second process for some reason on launch, so even if started by taskset it still crashes. Is there a way I can (temporarily) restrict all processes for a given user to use only certain cores? 108.46.239.236 (talk) 22:43, 27 November 2019 (UTC)
 * Normally you'd run the software in a VM where you can limit the cores, memory, file visibility etc. Proxmox is a common simple way to set that up. 67.164.113.165 (talk) 08:46, 28 November 2019 (UTC)
 * The manpage for "sched_setaffinity(2)" says that A child created  via fork(2) inherits its parent's CPU affinity mask. The affinity mask is preserved across an execve(2). So I do not understand why you believe that your program is all of a sudden attempting to use more CPUS. Are you sure that is why it is crashing? Did you use taskset -a? Is the subprocess privileged enough to call sched_setaffinity and take back more CPUs than you gave it? Possibly a virtual machine is the best way. Elizium23 (talk) 20:28, 28 November 2019 (UTC)
 * Well I figured out how it's doing it (it was telling its launcher to spawn a copy not doing it itself, and I hadn't thought to taskset that) but it still crashes when restricted so I'm back to square one! Thanks anyway. 108.46.239.236 (talk) 21:01, 28 November 2019 (UTC)
 * Missunderstanding! A task only can crash. You can mate-system-mon to set priorities. As free software is out of charge, and you are not coding, have a stable version or alternative of affetected software. -- Hans Haase (有问题吗) 10:26, 2 December 2019 (UTC)