Jump to content

Satlen

Member
  • Posts

    1,098
  • Joined

  • Last visited

Reputation Activity

  1. Agree
    Satlen got a reaction from straight_stewie in Best Python IDE   
    Ahh the typical IDE vs Editor debate. I say use whatever you work with the best. As for a good python ide, PyCharm is good, since you are a student, you get access to all of the Jetbrains products for free.
  2. Informative
    Satlen got a reaction from vorticalbox in How did you learn Linux?   
    Installed ubuntu on a crappy laptop when I was 12. After many years of googling how to do things you learn how everything works. Also this is a pretty new website to check out https://linuxjourney.com/
  3. Agree
    Satlen got a reaction from VicBar in Where the linux users at   
    Arch Linux here. 
  4. Funny
    Satlen got a reaction from Gachr in Apt alternative?   
    you could use apt-get 
  5. Like
    Satlen got a reaction from PlayStation 2 in Can you use this instead of the windows 10 creation tool?   
    Indeed it will, this is what I do all the time.
  6. Like
    Satlen got a reaction from iM8Pizza in Logitech G710+ review Stay Away!   
    I currently have the G710+ and have had it for almost 2 years now and everything still works fine.  I have removed all keycaps 2 times (one for cleaning and another to remove the o-rings, on top of that, I use a screwdriver b/c I don't have a key puller) and have had no problems with them.  every led light still works great, media keys still work great, and the wheel is fine.  The only thing I don't like about this keyboard is how big it is. Everything works as advertised.  Every product will have some batches with defects and apparently you have gotten one and I am sorry.
  7. Like
    Satlen reacted to Tycho in Purchasing Windows Os from G2A.com   
    I'd try buying one from a verified reddit marketplace seller instead https://www.reddit.com/r/microsoftsoftwareswap/
  8. Like
    Satlen reacted to Mr_KoKa in Java sorting LinkedList with Map.Entry objects   
    LinkedList<Map.Entry> entryList = new LinkedList(); //YourlistCollections.sort(list, new Comparator<Map.Entry>() { @[member='OverRide'] public int compare(Map.Entry e1, Map.Entry e2) { return //Helper function goes here, or just split it into if and many returns. }});Your return value needs to be either a negative integer, zero, or a positive integer as the first argument (e1) is less than, equal to, or greater than the second (e2). 
    You can make yourself a helper function that will compare two entries and return integer so you can use it inline with return like, return yourCompareFunction(e1, e2);
  9. Like
    Satlen got a reaction from Marvzl1357 in Java Recursively Sort an ArrayList   
    Alright guys, I actually figured it out. I ended up not going with the merge sort because that was making things more complicated than they needed to be. I ended up using a much simpler sorting method which basically sets the the first value in a given range to the min and compares it to the rest, swaps the two elements if it finds a smaller one, then is recursively called until everything is sorted.
     
    Here is a snippet of my method in case anyone is curious in the future:
    private static void sortObjects(ArrayList<GeometricObject> list, int low, int high){ if (low < high){ int minIndex = low; GeometricObject min = list.get(low); //set min to first object in range for (int i = low + 1; i <= high; i++){ //loop through all values other than first if (list.get(i).getArea() < min.getArea()){ //check if the value is smaller than current min min = list.get(i); //if it is update the min minIndex = i; //store min index so we can swap locations later } } Collections.swap(list, low, minIndex); //move the original min to new min's old index (tricky wording) list.set(low, min); //set the old lowest to the new lowest using store min value sortObjects(list, low + 1, high); //call it again } }
  10. Like
    Satlen reacted to prolemur in Java Recursively Sort an ArrayList   
    Yes doing it this way would only call the getArea function, the amount of items in the array, times.
  11. Like
    Satlen reacted to Marvzl1357 in Java Recursively Sort an ArrayList   
    I'm not sure how to sort it recursively, but the way I managed something similar was to have two arrays, say one for area and one for object, then do sorting on the area array but do the exact same rearranging on the object array. That way area[0] corresponds to object[0] and area[2] should correspond to object[2] etc etc. 
  12. Like
    Satlen got a reaction from imthewalrus in Java Recursively Sort an ArrayList   
    Alright guys, I actually figured it out. I ended up not going with the merge sort because that was making things more complicated than they needed to be. I ended up using a much simpler sorting method which basically sets the the first value in a given range to the min and compares it to the rest, swaps the two elements if it finds a smaller one, then is recursively called until everything is sorted.
     
    Here is a snippet of my method in case anyone is curious in the future:
    private static void sortObjects(ArrayList<GeometricObject> list, int low, int high){ if (low < high){ int minIndex = low; GeometricObject min = list.get(low); //set min to first object in range for (int i = low + 1; i <= high; i++){ //loop through all values other than first if (list.get(i).getArea() < min.getArea()){ //check if the value is smaller than current min min = list.get(i); //if it is update the min minIndex = i; //store min index so we can swap locations later } } Collections.swap(list, low, minIndex); //move the original min to new min's old index (tricky wording) list.set(low, min); //set the old lowest to the new lowest using store min value sortObjects(list, low + 1, high); //call it again } }
  13. Like
    Satlen got a reaction from cyberjunkie in Gom or VLC...   
    MPC-BE http://sourceforge.net/projects/mpcbe/
  14. Like
    Satlen reacted to Nineshadow in Data Structures [WIP]   
    WORK IN PROGRESS
     
    A data structure is a particular technique used to organize and store information in a computer with efficiency in mind. They can store both primitive and abstract data types and they are quite varied.I will be using C++ to demonstrate most examples , as that is my language of choice, and I will also be implementing some data structures myself. While most programming languages have them built-in, it's always good to know how everything works.
     
    Arrays

    <data_type> <array_name>[<size>]; int arr[10]; <data_type> <name>[<size1>][<size2>] int m[10][10] template<typename T>class Stack {public :Stack(); // constructor~Stack(); // destructorint size() const; // returns number of elements in stackbool isEmpty() const; // pretty obvious...const T& top() const; // returns a constant reference to the top objectvoid push(const T& obj); // adds an object to the topvoid pop(); // removes the object from top} private :struct Element {T data;Element *below;};Element *top;int count; template<typename T>class Stack{public :    Stack();    ~Stack();    int size() const;    bool isEmpty() const;    const T& top() const;    void push(const T& obj);    void pop();private :    struct Element    {        T data;        Element *below;    };    Element *top;    int count;}; template<typename T> Stack::Stack(){top = NULL; // initializng the stack implies the top being nullcount = 0; // also count must be 0} template<typename T> bool Stack<T>::isEmpty() const{    return top == NULL;}Returning the number of elements is pretty easy :template<typename T> int Stack<T>::size() const{return count;} template<typename T> void Stack<T>::push(const T& ob){if(isEmpty()){top = new Element;top->data = ob;top->below = nullptr;count = 1;}else{Element * newElement = new Element;newElement->data = ob;newElement->below = top;top = p;++count;}} template<typename T> void Stack<T>::pop(){if(isEmpty()) throw "Error. Empty stack.";Element * oldTop = top;top = top->below;delete oldTop;--count;} template<typename T> const T& Stack<T>::top() const{if(isEmpty()) throw "Error. Empty stack.";return top->data;}Deconstructor :template<typename T> Stack<T>::~Stack(){while(top != nullptr){Element *oldTop = top;top = top->below;delete q;}} template<typename T>class Stack{public :Stack();~Stack();int size() const;bool isEmpty() const;const T& top() const;void push(const T& obj);void pop();private :struct Element{T data;Element *below;};Element *top;int count;};template<typename T> Stack::Stack(){top = NULL;count = 0;}template<typename T> bool Stack<T>::isEmpty() const{return top == NULL;}template<typename T> int Stack<T>::size() const{return count;}template<typename T> void Stack<T>::push(const T& ob){if(isEmpty()){top = new Element;top->data = ob;top->below = nullptr;count = 1;}else{Element * newElement = new Element;newElement->data = ob;newElement->below = top;top = p;++count;}}template<typename T> void Stack<T>::pop(){if(isEmpty()) throw "Error. Empty stack.";Element * oldTop = top;top = top->below;delete oldTop;--count;}template<typename T> const T& Stack<T>::top() const{if(isEmpty()) throw "Error. Empty stack.";return top->data;}template<typename T> Stack<T>::~Stack(){while(top != nullptr){Element *oldTop = top;top = top->below;delete oldTop;}} Stack< <data_type> > <variable_name>; Stack<int> stack; template<typename T>class Queue{public: Queue(); // Constructor ~Queue(); // Destructor void enqueue(const T& obj); // add an element in back void dequeue(); // remove element from front const T& front() const; // return reference to front const T& back() const; // return reference to back int size() const; // return number of elements bool isEmpty() const;private: struct Element { T data; Element *next; }; Element * front; Element * back; int count;}; template<typename T> Queue<T>::Queue(){ front = back = NULL; count = 0;} template<typename T> bool Queue<T>::isEmpty() const{ return front == NULL;} template<typename T> int Queue<T>::size() const{ return count;} template<typename T> void Queue<T>::enqueue(const T& ob){ if(isEmpty()) { front = new Element; front->data = ob; front->next = nullptr; back = front; count = 1; } else { Element * p = new Element; p->data = ob; p->next = back; back = p; ++count; }} template<typename T> void Queue<T>::dequeue(){ if(isEmpty()) throw "Error. Empty Queue."; Element * q = front; front = front->next; delete q; --count;} template<typename T> const T& Queue<T>::front() const{ if(isEmpty()) throw "Error. Empty Queue."; return front->data;} template<typename T> const T& Queue<T>::back() const{ if(isEmpty()) throw "Error. Empty Queue."; return back->data;} template<typename T> Queue<T>::~Queue(){ while(front != NULL) { Element * q = front; front = front->next; delete q; }} template<typename T>class Queue{public: Queue(); ~Queue(); void enqueue(const T& obj); void dequeue(); const T& front() const; const T& back() const; int size() const; bool isEmpty() const;private: struct Element { T data; Element * next; }; Element *front; Element *back; int count;};template<typename T> Queue<T>::Queue(){ front = back = NULL; count = 0;}template<typename T> bool Queue<T>::isEmpty() const{ return front == NULL;}template<typename T> int Queue<T>::size() const{ return count;}template<typename T> void Queue<T>::enqueue(const T& ob){ if(isEmpty()) { front = new Element; front->data = ob; front->next = nullptr; back = front; count = 1; } else { Element * p = new Element; p->data = ob; p->next = NULL; back->next = p; back = p; ++count; }}template<typename T> void Queue<T>::dequeue(){ if(isEmpty()) throw "Error. Empty Queue."; Element * q = front; front = front->next; delete q; --count;}template<typename T> const T& Queue<T>::front() const{ if(isEmpty()) throw "Error. Empty Queue."; return front->data;}template<typename T> const T& Queue<T>::back() const{ if(isEmpty()) throw "Error. Empty Queue."; return back->data;}template<typename T> Queue<T>::~Queue(){ while(front != NULL) { Element * q = front; front = front->next; delete q; }} class Lista{public : struct Iterator; Lista() { head = tail = NULL; } ~Lista() { if(!isEmpty()) clear(); } void push_back(int elem); void push_front(int elem); void insert_before(int elem, Iterator nod); void insert_after(int elem, Iterator nod); void pop_front(); void pop_back(); void remove(Iterator nod); bool isEmpty() const { return head == NULL; } void clear(); Iterator front() const { return Iterator(head); } Iterator end() const { return Iterator(NULL); } Iterator search(int value) const;private : struct Nod { int data; Nod *next; }; Nod *head; Nod *tail;public : struct Iterator { friend class Lista; Iterator() { list = NULL; } Iterator(Nod *ls) { list = ls; } int& operator*() { if(list != NULL) return list->data; else throw "Null iterator!"; } //postfix Iterator operator++(int) { Iterator temp = *this; ++(*this); return temp; } //prefix Iterator& operator++() { list = list->next; return *this; } bool operator==(const Iterator& it) const { if(it.list == this->list) return true; else return false; } bool operator!=(const Iterator& it) const { if(!(it==*this)) return true; else return false; } private : Nod *list; };};void Lista::push_front(int elem){ if(isEmpty()) { head = new Nod; head -> data = elem; head -> next = NULL; tail = head; } else { Nod *nod = new Nod; nod->data=elem; nod->next=head; head=nod; }}void Lista::push_back(int elem){ if(isEmpty()) { head = new Nod; head -> data = elem; head -> next = NULL; tail = head; } else { Nod *nod = new Nod; nod->data=elem; nod->next=NULL; tail->next = nod; tail = nod; }}void Lista::insert_after(int elem, Iterator nod){ Nod *newNod = new Nod; newNod -> data = elem; newNod -> next = nod.list->next; nod.list->next = newNod; if(nod.list == tail) tail = newNod;}void Lista::insert_before(int elem, Iterator nod){ Nod *newNod = new Nod; newNod -> data = nod.list->data; nod.list->data=elem; newNod -> next = nod.list->next; nod.list->next = newNod; if(nod.list == tail) tail = newNod;}Lista::Iterator Lista::search(int value) const{ for(Nod* it = head; it != NULL; it = it->next) { if(it->data == value) return Iterator(it); } return end();}void Lista::pop_front(){ if(isEmpty()) throw "Empty List"; if(head==tail) delete head; head = tail = NULL; Nod *temp = head; head = head->next; delete temp;}void Lista::pop_back(){ if(isEmpty()) throw "Empty List"; if(head==tail) delete head; head = tail = NULL; Nod *pred; for(pred = head; pred->next->next != NULL; pred = pred->next); pred->next = NULL; delete tail; tail = pred;}void Lista::clear(){ Nod *it = head, *temp; while(it!=NULL) { temp = it; it = it->next; delete temp; } head = tail = NULL;} class ListD{private : struct Node { int data; Node *next; Node *prev; }; Node *tail; Node *head;public : struct Iterator { private: Node * list; public: friend class List; Iterator() { list == NULL; } Iterator(Node *ls) { list = ls; } int& operator*() const { if(list!=NULL) return list->data; else throw "Null Iterator"; } Iterator& operator++() { list = list->next; return *this; } Iterator operator++(int) { Iterator temp = *this; ++(*this); return temp; } bool operator==(const Iterator& it) const { if(it.list == this->list) return true; else return false; } bool operator!=(const Iterator& it) const { if(!(it==*this)) return true; else return false; } }; bool isEmpty() { return head == NULL; } List() { head=tail=NULL; } ~List() { if(!isEmpty())clear(); } Iterator end() const { return Iterator(NULL); } Iterator front() const { return Iterator(head); } Iterator search(int value) const { for(Node *i = head; i !=NULL; i=i->next) if(value==i->data) return Iterator(i); } void pop_back() { if(isEmpty()) throw "Empty List"; else if(head==tail) delete head; else { Node *temp = tail->prev; delete tail; temp->next = NULL; tail = temp; } } void pop_front() { if(isEmpty()) throw "Empty List"; else if(head==tail) delete head; else { Node *temp = head->next; delete head; temp->prev = NULL; head = temp; } } void remove(Iterator node) { if(isEmpty()) throw "Empty List"; else if(head==tail) { delete head; head=tail=NULL; return; } else if(node==this->end()) { pop_back(); } else if(node==this->front()) { pop_front(); } else { node.list->prev->next= node.list->next; node.list->next->prev = node.list->prev; } } void insert_after(int value, Iterator node) { Node *newNode = new Node; newNode->data=value; newNode->prev=node.list; newNode->next=node.list->next; node.list->next->prev=newNode; node.list->prev->next=newNode; } void insert_before(int value, Iterator node) { Node *newNode = new Node; newNode->data=value; newNode->next=node.list; newNode->prev=node.list->prev; node.list->prev->next=newNode; node.list->next->prev=newNode; } void push_back(int value) { if(isEmpty()) { head = new Node; head->data=value; head->next=NULL; head->prev=NULL; tail=head; } else { Node *newNode = new Node; newNode->data=value; newNode->next=NULL; newNode->prev=tail; tail->next=newNode; tail=newNode; } } void push_front(int value) { if(isEmpty()) { Node newNode; head = tail = &newNode; newNode.data = value; newNode.prev = NULL; newNode.next = NULL; } else { Node newNode; newNode.data = value; newNode.prev=NULL; newNode.next = head; head->prev = &newNode; head = &newNode; } } void clear() { Node *i = head, *temp; while(i!=NULL) { temp=i; i=i->next; delete temp; } head=tail=NULL; } void print() { for(List::Iterator it = this->front(); it!=this->end(); it++)std::cout << *it << ' '; std::cout<<"\n"; } void swap(Iterator node1, Iterator node2){ int temp = node1.list->data; node1.list->data = node2.list->data; node2.list->data=temp; } void sort(){ bool is_sorted; do { is_sorted = true; for(Iterator it = this->front(); Iterator(it.list->next)!=this->end(); it++) if(it.list->data > it.list->next->data) { is_sorted = false; swap(it.list,it.list->next); } } while(!is_sorted); }}; template <class T>class List{ struct Node { T data; Node *prev; Node *next; }; Node *head; Node *tail;public: struct Iterator { private: Node *node; public: friend class List; Iterator() { node = NULL; } Iterator(Node *n) { node = n; } T& operator*() const { if(node!=NULL) return node->data; else throw "Null operator"; } Iterator& operator++() { if(node->next==NULL)node=NULL; //throw "Iterator out of bounds"; else { node=node->next; return *this; } } Iterator operator++(int) { if(node->next==NULL)node=NULL ;//throw "Iterator out of bounds"; else { Iterator temp = *this; ++(*this); return temp; } } Iterator& operator--() { if(node->prev==NULL)node=NULL ;//throw "Iterator out of bounds"; else { node = node->prev; return *this; } } Iterator operator--(int) { if(node->prev==NULL)node=NULL ;//throw "Iterator out of bounds"; else { Iterator temp = *this; --(*this); return temp; } } bool operator==(const Iterator& it) const { if(it.node == this->node)return true; else return false; } bool operator!=(const Iterator& it) const { if(!(it==*this)) return true; else return false; } }; bool isEmpty() { return head ==NULL; } List() { head=tail=NULL; } ~List() { if(!isEmpty()) clear(); } void clear() { Node *i = head, *temp; while(i!=NULL) { temp = i; i=i->next; delete temp; } head=tail=NULL; } Iterator end() const { return Iterator(tail); } Iterator front() const { return Iterator(head); } void pop_back() { if(isEmpty()) throw "Empty List"; else if(head==tail) delete head; else { Node *temp = tail->prev; delete tail; temp->next = NULL; tail=temp; } } void pop_front() { if(isEmpty()) throw "Empty List"; else if(head==tail) delete head; else { Node *temp = head->next; delete head; temp->prev = NULL; head=temp; } } void remove(Iterator it) { if(isEmpty()) throw "Empty List"; else if(head==tail) { delete head; head = tail = NULL; return; } else if(it==this->end()) pop_back(); else if(it==this->front()) pop_front(); else { it.node->prev->next = it.node->next; it.node->next->prev = it.node->prev; delete it.node; } } void push_back(T value) { if(isEmpty()) { head = new Node; head->data = value; head->next=NULL; head->prev=NULL; tail=head; } else { Node *newNode = new Node; newNode->data = value; newNode->next=NULL; newNode->prev=tail; tail->next=newNode; tail=newNode; } } void push_front(T value) { if(isEmpty()) { head = new Node; head->data = value; head->next=NULL; head->prev=NULL; tail=head; } else { Node *newNode = new Node; newNode->data = value; newNode->prev=NULL; newNode->next=head; head->prev=newNode; head=newNode; } } void swap(Iterator node1, Iterator node2) { T temp = node1.node->data; node1.node->data = node2.node->data; node2.node->data=temp; } void insert_before(T value, Iterator it) { Node *newNode = new Node; newNode->data = value; it.node->prev->next = newNode; newNode->prev=it.node->prev; it.node->prev=newNode; newNode->next=it.node; } void insert_after(T value, Iterator it) { Node *newNode = new Node; newNode->Data = value; newNode->prev=it.node; newNode->next=it.node->next; it.node->next->prev=newNode; it.node->next=newNode; }};
  15. Like
    Satlen got a reaction from ,,,,,,,,,,,,,,,,,,,,,,,,,, in [DOWNLOAD] mPurge - Fix Windows 7/8/10 Privacy and Spying issues.   
    Why dont you have this up on github? 
  16. Like
    Satlen got a reaction from Cprogrammer in Help finding an organised list of C program operators, functions, keywords etc.   
    Here you go https://www-s.acm.illinois.edu/webmonkeys/book/c_guide/
  17. Like
    Satlen got a reaction from Vypa in Keep game open while atl tabbing?   
    Borderless Fullscreen is what you are looking for. Not all games have it built in so you might have to use https://github.com/Codeusa/Borderless-Gaming
  18. Like
    Satlen got a reaction from alpenwasser in most lightweight linux distro with a GUI out there   
    just install arch then install what you need.
  19. Like
    Satlen got a reaction from GoodBytes in Visual Studio 2013 on Windows 10   
    Do what is says and uncheck run in compatibility mode on the exe.
  20. Like
    Satlen got a reaction from ohJey in Dual booting linux with a 3rd partition.   
    You would need to mount your /home folder to a different drive than what your system is mounted to. http://www.howtogeek.com/116742/how-to-create-a-separate-home-partition-after-installing-ubuntu/
  21. Like
    Satlen reacted to madknight3 in C# from scratch?   
    Code Academy doesn't teach C# (you all should be ashamed for recommending it!)
     
    Try C# Fundamentals for Absolute Beginners (alternative location for same videos) for a set of introductory video tutorials. Paid subscription sites like Pluralsight and Lynda (offer code wanshow to support Linus) also have a lot of video tutorials on C# and other topics. Here is another list that contains even more resources for learning C#.
     
    The official documentation is located at MSDN so it's good to get familiar with it. It includes information on C#, .NET, and many other topics. Sites like Tutorials Point and Dot Net Perls can be useful for extra explanation/examples on the specific topics they cover.
     
    As always, Google is your friend. Looking up questions you have will likely give you links to one of the above resources or other great sites like StackOverflow.
  22. Like
  23. Like
    Satlen got a reaction from Vitalius in Is it possible to clean install Windows 10 Technical Preview?   
    That is because all insiders should have gotten the release build.
  24. Like
    Satlen reacted to madknight3 in Repeating a method in C#   
    @Ziggs ignore this comment. Stack Overflow is indeed a great place to ask and find answers to questions, however we're certainly here to help with your programming questions too.
  25. Like
    Satlen got a reaction from Kherm in Windows Power Plans   
    Power plans are still present in windows 10, not sure where he heard that information. I am running the RTM build right now, and there are still the 3 options. Just leave it on balanced as performance keeps your cpu clocked up all the time, and does not really affect performance in real world usage.
×