
The Big Programming Thread - Page 342
Forum Index > General Forum |
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. | ||
Shield
Bulgaria4824 Posts
![]() | ||
HardlyNever
United States1258 Posts
On August 13 2013 16:46 Encdalf wrote: I'm sorry, but without any further context, I doubt anyone will be able to help you. This is a problem caused by the combination of scripts on your page, and without a live example these things are pretty hard to track down. Or to put it into a metaphor.. You get a combustion engine to a mechanic, and tell him "I think this eingine is broken.". "Why?" the mechanic asks. "Well, I checked everything and I believe it's the engine which is broken.". The mechanic checks the engine, but unfortunately the engine is brand new and working perfectly. The real problem was somewhere else: The car was electric. Not really... I know 100% that the problem is within the script. If I take that out, the recaptcha works, and if I leave it in, it doesn't. I've added/removed other things, and they don't change the outcome. And more specifically, I believe it is one of the global variables in the script that is causing the problem. I know that is a pretty big chunk of script, but since it seems to be a premade piece of open-source and recaptcha is a pretty common thing. I thought there was an outside chance someone had run into the same problem. I know it's a long shot, but it was worth a try. | ||
UdderChaos
United Kingdom707 Posts
| ||
phar
United States1080 Posts
Can you ask your recruiter what to expect? | ||
Shikada
Serbia976 Posts
On August 08 2013 18:04 n0ise wrote: Starting with Ruby on Rails, coming from java/J2EE/Spring MVC Any quick tips/pointers or a particular piece worth reading? Much appreciated Guess your question was missed due to the heavy discussion going on. At a minimum, I would recommend: http://www.amazon.com/Ruby-Programming-Language-David-Flanagan/dp/0596516177 This is your Ruby language reference book. For Rails, get the newest version of Agile Web Development with Rails. It gets you writing a demo app in no time, and the other half of the book explains Rails nicely (though keep in mind that Rails changes and improves often). http://www.amazon.com/Ruby-Rails-Tutorial-Addison-Wesley-Professional/dp/0321832051/ref=pd_sim_b_8 Another fine Rails book, which also has DVD video tutorials, if you're into that. Good luck and have fun ![]() | ||
heroyi
United States1064 Posts
I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list?? | ||
spinesheath
Germany8679 Posts
Linked lists are good at adding/removing/inserting/splitting elements or sequences of elements because you only need to change a couple of next/previous references. They are bad at indexed access because you need to traverse the list. Mergesort is good on linked lists because the algorithm just goes very naturally with linked lists. Quicksort isn't really worse either as long as you do it properly (see http://stackoverflow.com/questions/14805936/optimal-quicksort-for-single-linked-list). | ||
Freaky[x]
Canada995 Posts
I've been working on a project relating to the 3gpp lte, simulating coding schemes in matlab. I wanted to try and implement what I built in hardware and would like to know if people had knowledge in this field (vhdl programming). | ||
gedatsu
1286 Posts
On August 14 2013 02:36 heroyi wrote: Piggy-backing on the recent posts: I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list?? An array-list will have its elements lined up in order in the physical memory. With a linked list, every element has a pointer to where the next element is in memory, and it may be in a completely different place. This means that you can immediately find the 100th element in an array - just look 100 steps from the start of the array. With a linked list, you have no idea where the 100th element is, you need to ask the 99th element where it is (and to find the 99th, you need to ask the 98th...). So for lookups and overwrites, array is typically better. But if you want to insert an element into the middle of an array, you need to move every following element one step, and that can take a lot of time. Linked lists can do that operation very quickly. Mergesort involves a lot of comparing two neighboring elements and switching their positions, which is easy to do with a linked list. You can do that with quicksort too, but it's easy to write a quicksort that assumes random access to elements which linked lists don't provide. | ||
CecilSunkure
United States2829 Posts
On August 13 2013 17:19 darkness wrote: Where do you guys read/learn which algorithm is best for your problem? For example, I've read today that MergeSort is best for linked lists, while QuickSort is best for general use and that it is more memory efficient than MergeSort. Well, I guess that's logical when you know MergeSort uses additional array. Is it also a good idea to just use already implemented algorithms in the language you use? I've read that std::sort, Java's Collections.sort(), Linked List, etc are much more optimised than you would possibly implement them. It just has to do with the way things are laid out in memory. You might not want to, or be able to, move the nodes of a linked list around in memory. Merge sort allows you to sort the linked lists in-place by just swapping head/tail pointers around. Other sorting algorithms are better suited for moving around stuff that is packed together in memory within an array. That's about it. You take note of how things are stored in memory, how they will be used in that memory, and find the fastest algorithm you can apply given the restrictions. | ||
Deleted User 101379
4849 Posts
On August 14 2013 02:36 heroyi wrote: Piggy-backing on the recent posts: I was wondering if someone could explain linked list quickly to me. I have read some of it on Google but I am quite confused with some of their explanation. Also, why is it mergesort is better than quicksort on a linked list?? A linked list basically consists of a series of this: class LinkedListNode Adding an element somewhere in the middle of the linked list is as easy as creating a node with the Next pointer on the following node and changing the previously preceding node so it points to the new one.
The advantages of linked lists are: They can be (in theory) infinitely large without having to reallocate the whole array every time you exceed the storage space of the previous arry. This makes them good at dealing with situations where you have to store an unknown amount of data. If an array exceeds it's storage space, a new, bigger storage space has to be allocated and the old data has to be copied over to the new space, which is time consuming. For the linked list, each node is in it's own memory space and seperately managed. Insertion/Deletion at the start or in the middle is extremely fast. If you remove an array element in a classical array, you have to move all following elements a step forward which in large arrays can take a lot of time, i.e. array[2] has to be moved to array[1], array[3] to array[2], array[4] to array[3], etc. If you insert an element in the middle, all following elements have to be moved a step back. In linked lists adding a node in the middle of the list doesn't affect any other nodes than the directly preceding one, so you don't have to move elements around no matter what you do in the list itself, you just have to set the pointers. In the previously discussed big-O notation that means adding/removing is O(1) since you always just have to change two pointers (or 3 in a doubly linked list), in an array it is O(N) with N being the number of elements in the array since it can happen that you have to move every single element in the array if you insert/delete right at the start. The disadvantages of linked lists are: Getting a specific element in the list requires going through all elements in the list, so in terms of the big-O notation, a linked list has an access time of O(N) where N is the number of elements in the linked list. An array has an access time of O(1), i.e. you get the element in a constant time no matter how big the array grows. Finding a specific element in an array of a million entries is as fast as finding it in one with 10 entries. Finding a node in a linked list of a million entries can potentially require a million comparisions until you finally find it. Since you also store a pointer in conjunction with the actual content of the node, a linked list requires more memory than an array. This is not a big deal if each node stores a relatively high amount of data but if the content of each element is very small, e.g. only a single integer, then using a linked list can use twice as much memory as an array. | ||
heroyi
United States1064 Posts
how/what comprises of the windows gui system language wise (I understand that the kernel, while holds true for other OS like OS x and linux, is written in C) but what is written for the shell? | ||
![]()
tofucake
Hyrule19077 Posts
| ||
Blisse
Canada3710 Posts
On most Unix (X Window) systems, the GUI is written in Xlib. Windows Shell I believe is currently DirectX, which is built on top of WinAPI. Everything is C. | ||
obesechicken13
United States10467 Posts
| ||
Blisse
Canada3710 Posts
On August 14 2013 12:32 obesechicken13 wrote: Nvm, dumb question. No one does this. http://www.ggobi.org/rgtk2/ http://www.omegahat.org/RwxWidgets/ apparently this is the best if you want to avoid wx or gtk http://cran.r-project.org/web/packages/gWidgets/gWidgets.pdf | ||
obesechicken13
United States10467 Posts
On August 14 2013 12:58 Blisse wrote: http://www.ggobi.org/rgtk2/ http://www.omegahat.org/RwxWidgets/ apparently this is the best if you want to avoid wx or gtk http://cran.r-project.org/web/packages/gWidgets/gWidgets.pdf Oh thanks. I missed this on my first search for R gui dev packages. | ||
adwodon
United Kingdom592 Posts
I've made an audio peak meter 'control', it's actually just a progress bar at the minute, I may create a custom control in future but the tricky part was actually make the damn thing work which I've now done. Anyway I just noticed that once I've stuck it into the main app from my little test app that Visual Styles are enabled and the shiney green bar does not look as appealing as the solid blue one before, it distracts and now it does definitely look like a progress bar. I'm a little unfamiliar with Visual Styles but is it possible to override them for individual controls? Either disabling them or removing the aero theme plus changing the colour? Would be nice if I could change the colour with no aero, then I could have a table of colours going from green->red and have it change colour dynamically, would be pretty ![]() This is all C/C++ by the way, no .NET or anything fancy. EDIT - Solved Ok so straight forward enough SetWindowTheme( hCtl, L"", L"") disables visual styles for an individual control. Passing in NULL instead of an empty string does not work by the way and was why I was a bit stumped before. | ||
spinesheath
Germany8679 Posts
| ||
adwodon
United Kingdom592 Posts
On August 14 2013 17:43 spinesheath wrote: That kind of depends on the technology (for example WPF, MFC, Win32 or whatever that ancient stuff is called) you are using for your user interface, but generally I'd assume you can change styles for individual controls, yes. Yea its all Win32, I've not dared touch anything else, MFC looks a bit horrible. WPF looks mental but I hear if you can do it you can get some pretty swanky jobs, looks like a bitch to debug though and in my current job I've got very little excuse to learn .NET outside of writing some sample apps for our SDK. Figured it out in the end though ![]() | ||
| ||