« first day (1956 days earlier)      last day (3009 days later) » 

10:01 PM
though, I usually start by creating the repository in ${GIT_VCS_PLATFORM_ENVIRONMENT_OF_MY_CHOOSING} first, cloning the repository, and then adding data in
and with the recent addition of a private GitLab server to my stuff... :P
@Serg No.
"Origin" is the default upload destination for pushing
so if I had the repo in three places ('github', 'privgitlab', and 'bitbucket'), in addition to wherever the origin is, then git push github git push privgitlab git push bitbucket
all work
you can have multiple 'remotes', but 'origin' is the one that is referred to when you do just git push
 
(or git pull)
@Seth Interesting!
 
@ThomasW. well I did git branch --unset-upstream
but now i cannot commit
skolodya@ubuntu:$ sudo git commit
[sudo] password for xieerqi:
On branch master
Your branch is based on 'origin/master', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)

nothing to commit, working directory clean
 
because you failed to read what I told you
so
lets start again
@Serg FIRST, remove origin from the remotes: git remote remove origin
 
ok
 
10:08 PM
NEXT, add it back in with the correct location, using the URL that GitHub provided
but make sure it's complete
those > chars suggest it's spilling offscreen
which means you're either copying it wrong
or something else
git remote add origin URL
then
git commit
 
I am just copying it from terminal window which is somewhat narrow, that's why there's the chars
 
it should then 'work'. But, I will make an observation: you're using sudo. Why? You don't need sudo to work in your own git dir...
 
Because I've set nano to be root owned . . . so that i can learn vi . . . and i never changed it back . . .
 
change your editor?
tests something
 
There is variable to set git editor, i know
 
10:11 PM
actually
EDITOR='vi' git commit
EDITOR is a shell variable, defines your default editor for things
applies to crontab -e, etc.
you can set it in your ~/.bashrc too, with export EDITOR='PICKONE'
@Serg so, lets learn a few things:
(1) setting the editor to need root to execute is a failure
(2) you can change the editor you use by changing the EDITOR shell variable
 
Is this a valid answer or too vague and should have been a comment? askubuntu.com/a/730588/367990
 
(3) Don't use sudo with 'git' - it can mess with your git perms
 
skolodya@ubuntu:$ EDITOR='vi' git commit
fatal: could not open '.git/COMMIT_EDITMSG': Permission denied
 
as i said
 
I'll be right back
 
10:14 PM
45 secs ago, by Thomas W.
(3) Don't use sudo with 'git' - it can mess with your git perms
NOW you have broken it.
 
sudo chown -R $USER: ~
 
sudo chown -R YOURUSERNAME:YOURUSERNAME .git
@ByteCommander except he's only in his git repo heh
but yes, he broke it
 
Well, replace ~ with the git directory then...
But still no need to type YOURUSERNAME:YOURUSERNAME ;-)
 
@ThomasW. Actuall no need to recursivelly change ownership on whole dir
skolodya@ubuntu:$ ls -l .git
total 44
drwxrwxr-x 2 xieerqi xieerqi 4096 Feb  6 14:43 branches/
-rw-r--r-- 1 root    root      12 Feb  6 15:04 COMMIT_EDITMSG
-rw-rw-r-- 1 xieerqi xieerqi  394 Feb  6 15:13 config
-rw-rw-r-- 1 xieerqi xieerqi   73 Feb  6 14:43 description
-rw-rw-r-- 1 xieerqi xieerqi   23 Feb  6 14:43 HEAD
drwxrwxr-x 2 xieerqi xieerqi 4096 Feb  6 14:43 hooks/
-rw-rw-r-- 1 xieerqi xieerqi  112 Feb  6 14:43 index
drwxrwxr-x 2 xieerqi xieerqi 4096 Feb  6 14:43 info/
drwxr-xr-x 3 root    root    4096 Feb  6 14:44 logs/
just one file
 
One file plus one folder. :P
 
10:18 PM
Yeah , I may have taken a wrong approach to learning vim . . . probably should have just uninstalled nano:p
 
@Serg No! You should have just used vim instead of nano!
Do you sell your car when planning to bike some more?
Or if you're just used to type nano, make an alias: echo "alias nano='vim'" >> ~/.bash_aliases
@Serg ----^
 
@ByteCommander not a very good analogy, at least I've learned a few things
 
@Serg Yes, and no, it's easier to enforce it across the entire dir other than typing out a ton ;)
@Serg Better suggestion is to do what bytecommander said with the alias
@NathanOsman so, good news for you:
nitroshare (- to 0.3.1-1)
    Maintainer: Nathan Osman
    Section: universe/misc
    0 days old
    Valid candidate
but note that that does not give you direct upload rights
(not to Ubuntu anyways)
 
What is it a valid candidate for?
 
migration
and in fact
it's in progress of migrating
@Serg is that python 2.x or 3.x?
(it's failing in my run tests)
 
10:34 PM
Ah, okay.
 
@NathanOsman Are you familiar with handling UTF-8 and non-UTF-8 files in Python 3?
 
UTF-8 source files or reading / writing UTF-8 files in Python 3?
 
I wrote those lines to check whether a file contains non-utf-8 characters:
>>> with open("utf8check.txt", mode="rb") as file:
...  lines = file.readlines()
...
>>> for n, line in enumerate(lines, 1):
...  try:
...   l = line.decode("utf-8", "strict")
...  except UnicodeDecodeError:
...   print(n, line)
...
>>>
Reading data files.
 
Do you open the files in binary mode?
 
It's to answer this question: askubuntu.com/q/730591/367990
Yes, I opened it as mode="rb".
(Sorry, I copied too many lines from the terminal)
As the OP advised, I downloaded this file to test my code.
But as you see, there's no output, so no decoding errors using utf-8, so no non-utf-8 characters detected.
 
10:43 PM
@ThomasW. Python 2.7
 
Or do you see a mistake in my code?
 
@Serg is there a reason you use static variables for your linked list?
 
@Chan-HoSuh no reason . . . yet . . . just following the professors lead so far
 
@ByteCommander yeah, I can confirm it's a valid UTF-8 file.
Are you printing the lines anywhere?
 
@dn-ʞɔɐqɹW Re the AskUbuntu question about UEFI secure boot keys. OP asked about " ...install Lubuntu 16.04 in May." I didn't suggest it
 
10:45 PM
Also, I've figured that git thingy out . . . . Everything is awesuuuuum, everything is coool wen you part of a teeeeem
 
If there isn't any code other than what you've shown me, the lines are never printed.
@Serg I wish I didn't know where that song was from...
 
@Serg ok ... seems a bit weird that you really can't have more than one linked list
 
That one is almost as annoying as "Friday".
 
@Chan-HoSuh what do you mean more than one ?
One could declare another instance
stack2 = linked_list()
 
@NathanOsman What do you mean?
 
10:46 PM
@Serg when you do that, stack2 will have the same references for front and rear as stack1
 
@ByteCommander There's no line that says "display the lines onscreen".
 
The line gets printed if it catches an UnicodeDecodeError.
Otherwise I decided to remain silent, as that file has about 8k lines...
 
But you said nothing got printed.
Isn't that what you want?
(I guess I can't figure out the question now :D)
 
Yeah. But I assumed the file contained non-UTF8 characters.
The OP of the question I linked claimed that at least.
 
He's wrong. It's a valid UTF-8 file.
 
10:48 PM
And they test it using grep:
grep --color='auto' -P -n "[\x80-\xFF]" utf8check.txt
 
@Serg do stack1 = linked_list() ; stack2 = linked_list()
stack1.push_front(1)
stack2.empty()
 
But that spots many non-UTF8 lines.
 
@ByteCommander That's a flawed test.
 
I dunno. Can you explain?
 
They seem to be confused. There are valid bytes in a UTF-8 stream in the range \x80-\xff
Anything below that is considered ASCII.
Perhaps that's what he meant.
 
10:50 PM
Okay. I am not familiar with those encodings TBH... ^__^
Thanks, I'll tell him that.
 
@Chan-HoSuh OK, here's the changes
126 class factorial:
127   def fact(self,a):
128     if a < 0: raise ValueError("Less than zero")
129     if a == 0 or a == 1 : return 1
130     stack = linked_list()
131     stack2 = linked_list()
132     print stack
133     print stack2
134     stack.push_front(a)
135     print stack2.empty()
160 if __name__ == '__main__':
161 #   unittest.main()
162
163 #if main:
164
165 #   print factorial().fact(1)
166    print factorial().fact(5)
167 #   print factorial().fact(100)
And that's what you get when running
DIR:/xieerqi
skolodya@ubuntu:$ ./linkedlist.py
<__main__.linked_list instance at 0x7f2d18a146c8>
<__main__.linked_list instance at 0x7f2d18a14710>
True
Two different addresses
 
they are different instances, but they have the same class variables
 
Being different isntances, how can they share variables ? Unless they're global ?
 
print stack1.front
print stack2.front
 
@waltinator Ah! Sorry! I misread then...
 
10:54 PM
@dn-ʞɔɐqɹW
 
because your "front" and "rear" variables are class variables
in Java, you call those "static" variables
 
<__main__.linked_list instance at 0x7fc6f306a6c8>
<__main__.linked_list instance at 0x7fc6f306a710>
True
None
<__main__.node instance at 0x7fc6f306a638>
stack2.front is none
stack.front has instance
 
ok I think I see what's happening
 
@Chan-HoSuh I might not be OO expert, but individual object has its own variables. Class is just template.
Object is the actual real memory location
 
before you set the front variable, they are class variables, but when you use push_front you are creating instance variable "front"
 
10:56 PM
@NathanOsman @ByteCommander ^ Your thoughts ?
instance variable of each object
stack.front
stack2.front
two different vars
 
@Serg try this in the interpreter:
class A(object):
front = 1
with the right indent :)
 
OK
 
@waltinator Sorry!
 
then ?
 
I must have misread that! @waltinator
 
10:58 PM
then:

a1 = A()
a2 = A()
A.front = 2
a1.front
a2.front
 
I'll remove my dumb comment in the next few minutes...
 
@Serg luckily for your professor's code, when you assign to self.front later in the code, that creates new instance variables that mask the class variables
 
@waltinator: re-read your comment:
"Burn the future 16.04", so that is what turned me off...
the OP might interpret that as "burn whatever is out now... ;-(
@waltinator Suggestion?
 
@Chan-HoSuh Well sure, a1.front == a2.front , 1. But you are basically spawing two objects , who have default value of front equal to 1 . TAke a look :
>>> a1 = A()
>>> a2 = A()
>>> a1.front
1
>>> a2.front
1
>>> print a1
<__main__.A object at 0x7f0dab875810>
>>> print a2
<__main__.A object at 0x7f0dab8757d0>
They are two different objects
 
@Serg to continue with the example above:

a1.front = 1
a2.front # 2 since A.front == 2
a1.front # 1 since we assigned to a1.front to create new variable
type(a1).front # 2 since A.front ==2
 
11:03 PM
>>> a = b = 1
>>> print a
1
>>> print id(a)
25559384
>>> print id(b)
25559384
 
no, you're not getting it, yes they are different objects, but they have the same variable when created
 
same id , reference same object
OK . . . so if in my code the variables were supposed to be the same, how come in first case stack2.front is none , and stack.front is set ?
 
@Chan-HoSuh o/
 
id(a1) == id(2) # False
id(a1.front) == id(a2.front) # True
 
130 stack = linked_list()
131 stack2 = linked_list()
132 print stack
133 print stack2
134 stack.push_front(a)
135 print stack2.empty()
136 print id(stack2.front)
137 print id(stack.front)
DIR:/xieerqi
skolodya@ubuntu:$ ./linkedlist.py
<__main__.linked_list instance at 0x7fdfdc4ed6c8>
<__main__.linked_list instance at 0x7fdfdc4ed710>
True
9545840
140599450588728
 
11:06 PM
you have to do that after a1 and a2 are created, before you assign to either a1.front or a2.front
ok, so let me explain it in two parts
 
@NathanOsman Correct answer? (The Python UTF8 thing) askubuntu.com/a/730611/367990
 
1) when you do:

class linked_list:
front = rear = None
that creates class ("static") variables for your class linked_list
 
@Serg Sorry, can't review now. I'm about to shut down and go to bed.
 
every instance of linked_list will now have front and rear variables which you can either access directly or through its class
the front and rear variables are the same in every instance, as you can check by using id
the instances themselves are not the same
the second thing that's hapepning is this
2) when you do :

l1 = linked_list()
l1.front = 1
you now create an attribute for l1
it masks the class attribute "front"
 
Ah, I think i see what you're saying
 
11:09 PM
although you can still access it by doing:
type(l1).front
 
@Zacharee1 :D I was already answering that one! Telepathy!
@ByteCommander **:-)**Upgoated!
 
lol
 
I guess the code is safe since your methods are assigning to self.front etc
 
I just..
0
A: Safely unmounting a Netgear Wireless USB adapter

Zacharee1Mounting and unmounting only apply to USB devices that have some sort of storage feature that the computer can access and edit. A thumb drive is an example of this. Unmounting just ensures that nothing is using the drive when you unplug it, avoiding file corruption. AFAIK, USB wireless adapters ...

 
but it's a bit dangerous, since you have to always be aware of the possibility that you are accessing a class variable not an instance variable
 
11:12 PM
@Zacharee1 disconnect first , then remove. That's how i do with my USB dongle
 
it's better IMO to just set front and rear in __init__ for linked_list, like you do for Node
 
@Serg huh?
Oh
 
@Chan-HoSuh Well . . .i somewhat dont get what you're trying to say here . . .
aren't we supposed to use self. . . . ?
To mean the variable in the instance ?
 
@Serg oh the point I was making there is, luckly when you do that you are overriding the class variable
like in my example above
a1 = A()
a1.front = 1
that overrides A.front
really you should not be introducing class variables and then overriding them
so the first time your code does self.front = whatever, it is creating that attribute for your object and setting it to whatever
 
11:28 PM
^^ agreed
@Zacharee1 a better answer might be a tiny script to rmmod/insmod the kernel module for the wireless stick instead of telling the OP that they don't know the right term for "software disconnect a device". That's what they're trying to do (they just only know it as mount/unmount)
 
hm
 
skolodya@ubuntu:$ ./linkedlist.py
Traceback (most recent call last):
  File "./linkedlist.py", line 169, in <module>
    print factorial().fact(5)
  File "./linkedlist.py", line 133, in fact
    print type(stack).front
AttributeError: type object 'instance' has no attribute 'front'
class linked_list:
  def __init__(self):
      self.front=self.rear=None
Sooooo . . . . what's happening now ?
 
that's good ... you got rid of the class variable, so type(stack) doesn't have a front attribute
 
yeah, but the code broke now :)
 
haha, but why are you trying to print an attribute that doesn't exist? :) ( remove "print type(stack).front" from fact method )
 
11:35 PM
the type retval doesn't have a front attribute
>>> class Test:
...   def __init__(self):
...     self.front=self.rear=None
...
>>> test = Test()
>>> test.front
>>> test.rear
>>> dir(type(test))
['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
>>> type(test).rear
Traceback (most recent call last):
 
@hbdgaf \o
 
o/ @Chan-HoSuh
 
OK, now I get 600 for factorial resul
clearly something isn't right
 
just from changing linked_list to use __init__ ?
 
No, something isn't right
factorial of 5 is 120, not 600
 
11:38 PM
pastebin it
 
Hah! If this answer doesn't give me a few upvotes, I'm bailing! ;-)
 
and factorials are a great time for lambdas
 
ah i see, there was extra push method being called, i didn't remove that from the time I was trying to do things
Nevermind , i cannot talk anymore . . . my brain is fried i think
 
@Serg oh yeah you didn't sleep yet? You should sleep
@Serg I have another comment about the code, "==" vs "is" but save that for later
 
@Chan-HoSuh Nah! The linked list in his brain is corrupted! :D (cc @Serg)
 
11:41 PM
@dn-ʞɔɐqɹW I think corruption in the brain is turning out to be a good thing (re: regularization in deep learning)
 
@Chan-HoSuh Absolute power corrupts absolutely! ;-)
 
@hbdgaf that's a crazy way to do a factorial, lol
 
if I see a recursive one or two line function, i think "why isn't it a lambda"
 
@hbdgaf I think if I wrote code like that at work, I'd be stuck maintaining it forever
 
11:47 PM
Who knows what this is without reverse image searching it?
 
I like that one ----- ^
@Zacharee1 opium
 
@Zacharee1 looks like opium poppies to me, but I've never seen one up close
 
DING DING DING
wow
 
@hbdgaf I have! In our neghbour's garden when I was a kid...
 
(doing a presentation on opiates BTW)
@dn-ʞɔɐqɹW ō_ô
 
11:48 PM
@Zacharee1 poppies?
 
@Seth Ja
 
@hbdgaf He had an entire patch and they were there for years and he used to harvest the poppy seeds to make his own buns...
 
@dn-ʞɔɐqɹW ahh
Oh yeah. Don't eat a poppy bagel right before a drug test :p
 
Until one day the police showed up, cut everything down and took him away for a talk...
 
@dn-ʞɔɐqɹW It's illegal to grow poppies?
 
11:49 PM
@dn-ʞɔɐqɹW I knew someone with a similar story that used it to make tea, but they didn't score it over and over - the labor intensive part if you're on the drug manufacturing thing - so not potent at all.
 
@Zacharee1 Those ones: yes...
 
they put the seeds on hotdog buns...
 
@hbdgaf yup...
 
@Zacharee1 is that actually a way to be positive on a test, or an urban legend?
 
@Mateo And bagels
 
11:50 PM
@Chan-HoSuh Skeptics
 
@Chan-HoSuh I think it can actually trip some, depending on how much you eat
 
@Chan-HoSuh mythbusters tested :)
 
@Zacharee1 opium poppies yes. I've grown non opium poppies though. That's not illegal.
 
@Seth I'm lazy and Zacharee1 should be doing the research for his prsentation :D
 
@Seth ahh
 
11:50 PM
@Chan-HoSuh true :D
 
@Chan-HoSuh Well, we don't need that part :p
 
@Zacharee1 having given presentations in the past, I suspect that might be the only thing people want to ask about during your presentation :p
 
lol
Then it'll come up in the Q&A afterward
 
@Zacharee1 Definitely!
 
My understanding is that it depends on the sensitivity of the test and the quantity you eat. Heck, cloves could make you pop for opiates if you ate or smoked enough of them I suppose (it's enough of an opiate to make things go numb).
 
11:52 PM
@hbdgaf That's a painkiller, not an opiate!
 
adds to list of random things he knows
 
(lemme look up the chemical composition)
@hbdgaf Chemically totally different from an opiate...
 
@Mateo TV, the only place you can get paid thousands of dollars for eating bagels.
 
(pubmed confirmed)
 
11:57 PM
@Mateo thanks.. strangely entertaining to watch two guys eat a bunch of bread and bagels :)
 
@dn-ʞɔɐqɹW good to know.
@Chan-HoSuh i skipped straight to the end
 
@hbdgaf you just wanted the "science" eh
 
Yeah. I was all "enough suspense. Just answer the question"
Funny bit. I tried to close a powershell prompt with ctl+d and looked at my monitor funny when it didn't work.
 
so, yeah - it will trip the cheap tests - probally with the cheap bagels too - you will find "you did it wrong" articles - saying that washing the seeds should get rid of the drug, better tests will detect the proper levels ect. - but overall yes it can happen
 
basically what I got from it is, I'm not eating poppy seed bagels before my next drug test
 

« first day (1956 days earlier)      last day (3009 days later) »