Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Snake X

Pages: [1] 2 3 ... 7
1
Other / Favorite distro or windows version?
« on: October 14, 2014, 08:37:20 pm »
This is a rather tough one for me. It varies throughout the year but I tend to switch distro's time to time as well as the desktop environments on them. Recently I've been using the cinnamon DE on manjaro linux (a fork of arch linux with a GUI). I used linux mint on my laptop for a while, But I'm also interested in what you all use too.


What's your preferred flavoring of linux?
Or, if you use windows, favorite windows version?
I've tried windows 10 and it seems to be fairly decent but wont boot off an external and takes 10 minutes normally  ???


I also dual boot manjaro and windows 7 through grub, and have each on a raid 1 and windows 10 on a single drive.

2
Computer Programming / Dedicated thread sleeping?
« on: April 11, 2013, 09:30:41 pm »
Lol, sorry if I seem to be "overly-asking" with my mini-wall of threads ive been making, but ive beein doing quite a bit of programming recently :p

Anywho, I'm writing a library that will connect to sockets and manage them, process its data, and do stuff based on that.

My problem lays on sending b"\r\n\x00" to the socket every 20 seconds. I thought that if I started a new thread for the ping function, that would work.

..however, time.sleep() seems to pause the whole entire program instead of what I thought would be just that thread D:

here's my code thus far:

Code: [Select]
  def main(self):

    recvbuf = b""
    self.connect(self.group, self.user, self.password)
    while self.connected:
      rSocket, wSocket, error = select.select([x[self.group] for x in self.conArray], [x[self.group] for x in self.conArray], [x[self.group] for x in self.conArray], 0.2) #getting already made socket connections
      for rChSocket in rSocket:
        while not recvbuf.endswith(b"\x00"): #[-1] doesnt work on empty things... and recvbuf is empty.
          recvbuf += rChSocket.recv(1024) #need the WHOLE message ;D
        if len(recvbuf) > 0:
          dataManager.manage(self, self.group, recvbuf)
          recvbuf = b""
      for wChSocket in wSocket:
        t = threading.Thread(self.pingTimer(wChSocket)) #here's what I need to be ran every 20 seconds.
        t.start()
    chSocket.close()

and here's the pingTimer function:

Code: [Select]
  def pingTimer(self, wChSocket):
    time.sleep(20)
    print(time.strftime("%I:%M:%S %p]")+"Ping test!") #I don't want to mini-DDoS
    #wChSocket.send(b"\r\n\x00")

Thanks :D

3
Computer Programming / Good openGL tutorials?
« on: March 11, 2013, 09:39:56 pm »
Tutorials are just one of those things that never set you up for the *REAL* work environment... Unless the writer knows this, of course.

Your not going to be using "OpenGL-tutorial-library-1.4.3.zip" in a professional work field. (I made the file name up but you get the idea.)

With that in mind... Looking for a good OpenGL tutorial that does NOT use any proprietary tools/library's for coding and goes into decent detail about the code's.

Note: I will be working in g++ with gedit on arch linux. Seems like everyone is using visual studio c++ these days..

Thanks.

4
Computer Projects and Ideas / Original and unique idea's needed
« on: January 30, 2013, 02:33:20 pm »
Alright, im building an irc-like bot however its not using irc, and the chat system works the same way as irc does.

With this in mind, I am looking for original, unique idea's for commands a user can use and interact with for entertainment or whatnot.

it's text-based, so keeping that in mind, im a bit restricted (i.e. no GUI).

The reason im asking this is because theres a 85% chance that what you thought of is already taken by other user-made bots, and im looking for something fresh.

So something that can be used for entertainment, games, getting something, or whatnot just as long as its text-based. I can't do anything like a full-on text rpg tho.

If you have an idea go ahead and post it, i'll get back and tell you if thats already taken.

A few idea's that are already used:
- definitions
- nicknames
- youtube/google/google image search
- roleplaying
- guess my number
- hang man
- messaging other rooms (rooms are the irc equivalent of channels)
- PMing people
- uno

It's rather hard thinking of things since i'm not the creative type of person, lol.

EDIT: make sure its something achievable with the python programming language :P

5
Computer Programming / getting load status for individual commands?
« on: January 16, 2013, 06:49:19 pm »
Alright, so I run a python bot connected to some server.

I'll just start with that first.

So, when I go into SSH and I'm seeing that my bot which shouldn't be taking up much CPU happens to be the first on the list sorted by most intensive cpu processes.

I would love to know if there's some way to be able to track or trace exactly which part of my code in my python bot is causing it to create such a high amount of load on the CPU.

Right now, my only way of knowing what's taking up most of the cpu loads is this:

http://i50.tinypic.com/23sepdu.png

Not even sure what that text means under the command part... :L

6
Computer Programming / removing b from bytes object
« on: December 07, 2012, 10:52:49 am »
Another day another runtime error... At least for me anyways :P

Anyways, when I have a string encoded (for example: "test".encode()), it comes out to be: b'test'

The thing is, is that this bytes object is being sent in a packet, which somehow gets that prefix b parsed into the text itself.

So, this means that in the packet data, it is being sent as "btest" (I examined it in wireshark tcp stream) when I REALLY need it to just be sent as "test" without this b before it.

I cannot simply use .lstrip("b"), for its not a string object, nor can I simply .decode() and then use .encode() again as that would just put it back to "btest" in the packet data.

I somehow need to perform some function to manipulate the bytes object to remove this "b" so that it can be read correctly by the server im sending it to.


I'm at an extreme loss here....  ???



EDIT: Is it possible there's something else that placed this "b" into the byte object instead of .encode() itself?


EDIT 2: I fixed it :D after THOROUGHLY tracing it lol

7
Computer Programming / os.execl error
« on: November 01, 2012, 11:33:42 pm »
Alright so my main goal in what I'm currently working on is to get a script file to reload itself (assume there is a trigger because there is one in place for it) whenever the code is updated. Right now I have scriptfilename.py and reload.py.

What I'm trying to do is to execute the reload.py file and after that is executed the program closes itself. After the reload.py file is called, it executes scriptfilename.py and close the reload.py file.

as I just typed the above, I realized that reload.py wouldn't get to be able to close itself because it cant get past the scriptfilename.py program which will be continuously running..

what is the best way to impliment a self update code for a python script file  (NOT a module) after code has been changed? It would be put under a trigger which I'm able to trigger myself as the code is running.

so like for example

if trigger.activated==True:
  #update the Scriptfilename.py file to run new code that's been put into it.

note: I'm using python 3.0 and I've been spending many hours googling on this vastly Lol

EDIT: actually nevermind on this, this can be deleted. I got what I needed.

8
Computer Programming / Searching thru a file code
« on: October 15, 2012, 07:48:32 pm »
Alright, i have my reasons for this particular piece of code so dont worry its not for nothin :P (it just may seem useless because i modified it into a simpler version so that it can be helped with)

However, it doesn't work and the error I get is not referring to any lines in the script:

Code: [Select]
#test2.py
import re
import sys

x=1
while x==x:
  with open("room.txt", mode="a", encoding="utf-8") as log:
    log.seek(0)
    for line in log:
      if not re.search(("apple"), line):
        log.write("grape")
        log.write("\n")

assume this is the contents of room.txt just for clerification

Code: [Select]
cherry
orange
strawberry
lemmon

(there is an empty line after "lemmon" so that it writes starting with that new blank line)

an explination of the code's usage is probably necessary so ill just explain that part.

It's basically in a loop (the whole 6 lines, assume its an infinite loop) and if it cant find the word "apple" in any of the lines in the file then write "grape" onto the last new line (in this case the line after "lemmon").

I know that this code as it is will be quite useless but that's *only* because I had to modify it so that there wouldnt be any confusion over external definitions. The coding structure is the exact same.
The important part in this is fixing the error.

So when I run this code, I get this error:

Code: [Select]
Traceback (most recent call last):
  File "C:\Users\Jacob\Desktop\bot\test2.py", line 8, in <module>
    for line in log:
  File "C:\Python30\lib\io.py", line 1739, in __next__
    line = self.readline()
  File "C:\Python30\lib\io.py", line 1813, in readline
    while self._read_chunk():
  File "C:\Python30\lib\io.py", line 1560, in _read_chunk
    input_chunk = self.buffer.read1(self._CHUNK_SIZE)
AttributeError: 'BufferedWriter' object has no attribute 'read1'

9
Art / Sunny Bliss [2nd edition]
« on: October 06, 2012, 11:23:14 pm »
I have revived my psd started from quite a while ago and decided to finish the work it had in it.

And with this, I present my 2nd edition of my "Sunny Bliss" photomanipulation project: http://cellsheet.deviantart.com/#/d5h4f22


Spoiler For image:

10
Art / photoshop Lagging?!
« on: October 06, 2012, 11:20:14 pm »
This shouldnt be happening on a computer of this caliber.. lol

Seriosly. I bought creative suite 6 design standard (at educational discount yesterday) and installed photoshop 64 bit and its LAGGING!

LAGGING!

It mostly laggs when I'm zooming in/out and moving my cursor around the image its pretty choppy. http://i45.tinypic.com/2ic2k5x.png

I have the following:

nvidia gtx 460 (msi hawk edition 1 GB vram)
g.skill ripjaw 4 gb memory (http://www.newegg.com/Product/Product.aspx?Item=N82E16820231427)
intel i5-2500k

Seriously with that kinda stuff how can it be lagging? The only thing i can figure out is if i need more ram

11
Miscellaneous / A note about Googling.
« on: September 18, 2012, 04:00:33 pm »
Google it. Google it some more. And google it some more. Just in case, google it just a bit more. And if you still havn't found it, you may ask.


Far too often I see this and no doubt this is a standard for any person that uses forums.. However, I felt that I should say something about this subject.

Have you ever noticed when you are googling a question or something and you see it in forums where people in the end just say "google it. Thread closed" or something of the sort?

I don't feel like I'm the only one who's ever noticed this trend and I wanted to finally comment on this.

When I see this, I just want to say to the person if they've outright denied any responce "If it wern't for google I wouldnt be seeing "google it", smart one..."

I think with this in mind people should know when to enforce the search rule especially google but because I see this a lot, google doesn't always know..

That DOESNT however mean by any stretch of the imagination this can be used an excuse to not google, I'm just saying that keep in mind when your telling someone to google it, just make sure the person didn't see that exact same message before they made the post..

Well, what do you think anyways?

12
Computer Programming / actionscript 3 code analysis help
« on: September 10, 2012, 09:43:14 pm »
edit: figured it out, for now....

13
Other Calculators / ti 83+.. reviewed on engadget?
« on: April 02, 2012, 12:27:26 pm »
This was quite recent too  :o (only yesterday infact!)

http://www.engadget.com/2012/04/01/texas-instruments-ti-83-plus-review/

lol I don't know why they just decided to randomly review the 83 plus but here it is folks  ;D

edit:
Quote
Half of this review is an obvious tongue-in-cheek approach to dealing with April Fool's Day, but I'm dead serious when I say that the continued "necessity" for the TI-83 in America's education system is as glaring an example as any of just how behind we are.

oh.. :P

14
Computer Usage and Setup Help / Linux mint shortcut problems
« on: February 11, 2012, 05:07:44 pm »
FFFFFFFFFFFFFFFF I just installed linux mint and chrome but its makeing me PO'd. I can't create a shortcut to chrome without having to add some script and even then when I search for chrome in the create launcher window I CANT FIND IT

I have never had so much trouble adding a simple shortcut on a desktop..  >:(


15
Other / $820 in 3d softwares for free!
« on: February 04, 2012, 12:16:51 pm »
Yep! You herd me correct! No catches whatsoever (I just got mine :D )

For "A limited time" Feb. 29th you can get DAZ's Studio 4, Bryce pro, and hexagon software for absolutely $0.00 which together is $820 at normal price!!

http://www.daz3d.com/i/3d/free-3d-software-overview

 ;D

Pages: [1] 2 3 ... 7