I think normally pentomino problems come under "exact cover", so you'd want to use Knuth's "dancing links" algorithm to solve them. With no collisions though, I think the way you solve it is almost entirely dependent on how the score system works.
The Big Programming Thread - Page 469
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. | ||
netherh
United Kingdom333 Posts
I think normally pentomino problems come under "exact cover", so you'd want to use Knuth's "dancing links" algorithm to solve them. With no collisions though, I think the way you solve it is almost entirely dependent on how the score system works. | ||
Arevall
Sweden1133 Posts
On April 17 2014 22:23 netherh wrote: @Arevall - What exactly is the aim here? Maximising score per piece? How are you calculating the scores? I think normally pentomino problems come under "exact cover", so you'd want to use Knuth's "dancing links" algorithm to solve them. With no collisions though, I think the way you solve it is almost entirely dependent on how the score system works. Thanks for the reply! It will make the move that maximises the score for a piece (Score = weight a * score A + weight b * score B ...). When gameboard is filled the scoring would be number of pieces. So less is better. Since I want a random order of pieces and not even the next piece is know beforehand it's not the "exact cover" cover problem, since there is a high possibility of a puzzle becoming unsolvable! Thats why I don't want collision btw. | ||
RoyGBiv_13
United States1275 Posts
10,000 digits of e encoded in binary + Show Spoiler [boring code] +
https://gmplib.org | ||
Shield
Bulgaria4824 Posts
Sample code: + Show Spoiler +
As you see, the ArrayList could be of any type. And now the problem is that I want to use two different ArrayLists, but one doesn't have all the methods of the other. So I want to do something like this: + Show Spoiler +
Unfortunately, it doesn't seem to work due to ArrayList's generic type requirements. I've heard of reflection but I don't know how viable it is or how I can make this work. | ||
berated-
United States1134 Posts
On April 18 2014 08:24 darkness wrote: I have a problem with Java generics. Sample code: + Show Spoiler +
As you see, the ArrayList could be of any type. And now the problem is that I want to use two different ArrayLists, but one doesn't have all the methods of the other. So I want to do something like this: + Show Spoiler +
Unfortunately, it doesn't seem to work due to ArrayList's generic type requirements. I've heard of reflection but I don't know how viable it is or how I can make this work. Yeah, thats not going to work due to type erasure, but tbh, I'm not really understanding the reason for that any way. It seems, weird, to try to come up with a generic design but then have specific type requirements. If DisplayClass<T> had a method add(T obj) then you could just add it there, or if you had some sort of abstract method that was public T getObjectToAdd(some var) and then you had a concrete implementation for DisplayClass<String> and DispalyClass<CustomClass>, then you could generate your own object to get that way to add to the list or something. I think the way you've described it feels very contradictory. | ||
Manit0u
Poland17046 Posts
On April 16 2014 15:19 darkness wrote: I think this is a better to say it. http://stackoverflow.com/a/5199425/1091781 I wish that all languages used primitive types. It's way easier to make errors if you don't have them. Also, I wish that something like LPC's/Pike's #pragma strict_types would be a requirement for all languages: "strict_types" Enable warnings for all cases where the compiler isn't certain that the types are correct. It instructs the interpreter to require all functions to be strictly typed. I.e. the type of the function has to match the type of what is returned by the function, and the type of the variable recieving the function result has to match the function type as well. Consistent and frequent use of this pragma enhances both short-time code quality and improves maintainability immensly. | ||
zksa
11 Posts
| ||
Kambing
United States1176 Posts
On April 18 2014 09:25 Manit0u wrote: I wish that all languages used primitive types. It's way easier to make errors if you don't have them. Primitives are a performance optimization in Java because Java doesn't give the programmer control over where values are allocated. In contrast, C++ allows you to allocate on the stack or heap at will:
Furthermore, the abstraction facilities of C++ are rich enough that you can create datatypes that effectively function like primitives:
In the limit, you can write code that looks a lot like something you would write in a functional programming language, but have greater assurance about its performance characteristics. | ||
Blisse
Canada3710 Posts
| ||
BlueRoyaL
United States2493 Posts
I'm looking for some good ideas for a web programming project. I'm semi-new to programming (I've taken a few introductory courses at my university but majored in something entirely different). My IT job as a fair amount of free time, so I've been studying and practicing programming. I've been learning C# (easy transition due to a bit of java experience in the past) and using visual studio, but I've decided that for now, I'll be programming without an IDE to really learn the nitty gritty details on how things are used. I've googled a bunch but I haven't found something that I liked yet. I'm looking for something that will help me learn and test my skills in a variety of things such as using various classes, interfaces/delegation, possibly networking, databases or other forms of data I/O, and something I can try to implement good design patterns into. My programming background: learning C#, I know enough to be able to dig through APIs and documentation online (thank god for stackoverflow, MSDN, etc) to be able to figure out stuff and apply them. Web wise, I've done a fair share of html, css, JS (jquery and a bit of angular), and a tiny amount of SQL stuff. Does anyone have any suggestions here? Even if you think it may be too complicated for me, I'd love to hear your ideas or even better, the kinds of projects you've tackled in the past. Even if I can't take on the projects as of yet, it'd be nice to get an idea of what kind of projects are marketable and maybe I can break them down into smaller chunks, focusing on getting those right (while learning things along the way) and eventually do the whole thing. Thanks for any ideas, insight, and tips! | ||
RoyGBiv_13
United States1275 Posts
On April 22 2014 03:45 BlueRoyaL wrote: Dear programming gurus, I'm looking for some good ideas for a web programming project. I'm semi-new to programming (I've taken a few introductory courses at my university but majored in something entirely different). My IT job as a fair amount of free time, so I've been studying and practicing programming. I've been learning C# (easy transition due to a bit of java experience in the past) and using visual studio, but I've decided that for now, I'll be programming without an IDE to really learn the nitty gritty details on how things are used. I've googled a bunch but I haven't found something that I liked yet. I'm looking for something that will help me learn and test my skills in a variety of things such as using various classes, interfaces/delegation, possibly networking, databases or other forms of data I/O, and something I can try to implement good design patterns into. My programming background: learning C#, I know enough to be able to dig through APIs and documentation online (thank god for stackoverflow, MSDN, etc) to be able to figure out stuff and apply them. Web wise, I've done a fair share of html, css, JS (jquery and a bit of angular), and a tiny amount of SQL stuff. Does anyone have any suggestions here? Even if you think it may be too complicated for me, I'd love to hear your ideas or even better, the kinds of projects you've tackled in the past. Even if I can't take on the projects as of yet, it'd be nice to get an idea of what kind of projects are marketable and maybe I can break them down into smaller chunks, focusing on getting those right (while learning things along the way) and eventually do the whole thing. Thanks for any ideas, insight, and tips! Pick something that facebook or another big site does but you dislike how it works. Rebuild just that feature on a new site. http://blog.codinghorror.com/dont-reinvent-the-wheel-unless-you-plan-on-learning-more-about-wheels/ You'll find that something as simple as a twitter clone has a lot of moving parts, and you'll almost immediately hit a road block that you don't know how to get around. This is why it's good advice to reinvent something that you use a lot. I've been toying with building a new website based totally on a forum (TeamLiquid style), and it's been a lot of fun. | ||
Release
United States4397 Posts
On April 22 2014 02:07 zksa wrote: Does anyone here know of a good introduction tutorial for Java? I've been looking around but I can't seem to find anything. I have about 50 hours of experience programming in python. I just want to learn the syntax quickly and have some problems to work through. http://math.hws.edu/eck/cs124/javanotes6/ Chapter 5 and 7.1 if you just want syntax. | ||
Blisse
Canada3710 Posts
On April 22 2014 03:45 BlueRoyaL wrote: Dear programming gurus, I'm looking for some good ideas for a web programming project. I'm semi-new to programming (I've taken a few introductory courses at my university but majored in something entirely different). My IT job as a fair amount of free time, so I've been studying and practicing programming. I've been learning C# (easy transition due to a bit of java experience in the past) and using visual studio, but I've decided that for now, I'll be programming without an IDE to really learn the nitty gritty details on how things are used. I've googled a bunch but I haven't found something that I liked yet. I'm looking for something that will help me learn and test my skills in a variety of things such as using various classes, interfaces/delegation, possibly networking, databases or other forms of data I/O, and something I can try to implement good design patterns into. My programming background: learning C#, I know enough to be able to dig through APIs and documentation online (thank god for stackoverflow, MSDN, etc) to be able to figure out stuff and apply them. Web wise, I've done a fair share of html, css, JS (jquery and a bit of angular), and a tiny amount of SQL stuff. Does anyone have any suggestions here? Even if you think it may be too complicated for me, I'd love to hear your ideas or even better, the kinds of projects you've tackled in the past. Even if I can't take on the projects as of yet, it'd be nice to get an idea of what kind of projects are marketable and maybe I can break them down into smaller chunks, focusing on getting those right (while learning things along the way) and eventually do the whole thing. Thanks for any ideas, insight, and tips! I enjoy stuff like UI/UX so it would be cool if you would build an C# application on top of TeamLiquid that did GET requests to acquire content and POST requests to log in, comment and etc. that also managed cookies. :3 There's a lot of original content that can be done. I'm going to grab an Arduino and an RPi sometime soon so I can do some hardware stuff. I also want to find a service that can manage my 200gb media library safely, and also that I could access and upload content remotely (area of research). I build apps for Windows, I want to make some simple games, I want to build a physics engine, I want to help people build websites, etc. The most important part of hobby programming is actually solving problems that you have. It is definitely not as interesting being told to do something than it is to think about interesting applications that you would want to have, and then making it! I have friends that randomly learned simple integration with Google App Engine and Facebook OAUTH for the sole purpose of sharing Steam screenshots directly to Facebook because he loves taking them. I have friends that built operating systems for their dedicated home servers because they loved the idea, and it's actually impressive. Other friends have built link shorteners (easy weekend project) for their websites. I have a friend that built an application to show the weather status in the taskbar on his mac because he found it useful. There are ideas that other people have, but you'll have a lot more fun finding and solving your own. And even if you don't solve it, it's no biggie. You've done research and thought about it and thinking about the idea abstractly and doing independent research is a very good skill to improve on. It's a good idea to find like-minded people who also want to learn and make cool stuff because it gives you lots of new ideas. Hackathons are a great place for stuff like this. I'm definitely not a guru or even remotely close but this is the kind of perception I've gained from being around people like this. They like building things because they like building things; coding is one way of expressing that desire. | ||
Fawkes
Canada1935 Posts
Of course, I'm not looking to dive in and code. I would need to get familiar with the code, probably work on documentation or bugtracking for a little while and then try to contribute in the long run. Looking at some of these projects, I'm just like..."What do I do with this? How can I use this?", but for the projects that usually have documentations on how to setup and a well written introduction, are quite complex and I have no idea what is going on. Stuff that seems simple usually don't have the documentation to back it up so I have no idea what is going on as well. Anybody follow interesting projects or have advice on where I can get started? + Show Spoiler [why I have weird questions] + I graduated from Software Engineering 2 years ago. Why do I sound so noob? Lack of confidence in anything I do. Unemployed for so long, probably only person in my graduating class not working. Lack of self confidence pushed into a downward spiral. Finally managed to start my climb back up, need a place to improve my skillset. Didn't have much experience in development via co-op in school as other people in my class. I just judge myself so hard. My class full of people working at Microsoft, Google, Amazon, Mozilla, Facebook, Twitter...and then there's me. Just trying to improve my skillset and experience, so I can finally get a job =\ It's been too long.... Sigh...probably just a problem with me. | ||
Cyx.
Canada806 Posts
On April 22 2014 12:26 Fawkes wrote: Looking to get into open source projects, but it seems so intimidating. I feel like the first major hurdle I can't get over is finding something I want to be part of. It might not be that everything doesn't interest me, but I am not looking at the right places. Many projects are oriented around libraries, I personally feel like I need an idea on what to use the library for to get into those. Then finding projects concerning the right platform. Of course, I'm not looking to dive in and code. I would need to get familiar with the code, probably work on documentation or bugtracking for a little while and then try to contribute in the long run. Looking at some of these projects, I'm just like..."What do I do with this? How can I use this?", but for the projects that usually have documentations on how to setup and a well written introduction, are quite complex and I have no idea what is going on. Stuff that seems simple usually don't have the documentation to back it up so I have no idea what is going on as well. Anybody follow interesting projects or have advice on where I can get started? + Show Spoiler [why I have weird questions] + I graduated from Software Engineering 2 years ago. Why do I sound so noob? Lack of confidence in anything I do. Unemployed for so long, probably only person in my graduating class not working. Lack of self confidence pushed into a downward spiral. Finally managed to start my climb back up, need a place to improve my skillset. Didn't have much experience in development via co-op in school as other people in my class. I just judge myself so hard. My class full of people working at Microsoft, Google, Amazon, Mozilla, Facebook, Twitter...and then there's me. Just trying to improve my skillset and experience, so I can finally get a job =\ It's been too long.... Sigh...probably just a problem with me. Well, I don't have a whole lot of experience, but I'm working on my first bigger-than-two-line patch for Blender right now which is totally awesome =D if you've never heard of it, it's a 3D modeling program that's free and open source with a really good community of devs around it. It's been going for a long time now so it's pretty complicated (and 3D modeling and rendering is pretty complex in and of itself, not to mention the game engine and other things that are involved) - but you're not going to get any open source experience that's worthwhile if it's not pretty complicated. The reason those companies like open source is because it teaches you to work in a big team of developers - if you look for 'simpler' open source projects I think you're kind of defeating the point. | ||
Blisse
Canada3710 Posts
On April 22 2014 12:26 Fawkes wrote: Looking to get into open source projects, but it seems so intimidating. I feel like the first major hurdle I can't get over is finding something I want to be part of. It might not be that everything doesn't interest me, but I am not looking at the right places. Many projects are oriented around libraries, I personally feel like I need an idea on what to use the library for to get into those. Then finding projects concerning the right platform. Of course, I'm not looking to dive in and code. I would need to get familiar with the code, probably work on documentation or bugtracking for a little while and then try to contribute in the long run. Looking at some of these projects, I'm just like..."What do I do with this? How can I use this?", but for the projects that usually have documentations on how to setup and a well written introduction, are quite complex and I have no idea what is going on. Stuff that seems simple usually don't have the documentation to back it up so I have no idea what is going on as well. Anybody follow interesting projects or have advice on where I can get started? + Show Spoiler [why I have weird questions] + I graduated from Software Engineering 2 years ago. Why do I sound so noob? Lack of confidence in anything I do. Unemployed for so long, probably only person in my graduating class not working. Lack of self confidence pushed into a downward spiral. Finally managed to start my climb back up, need a place to improve my skillset. Didn't have much experience in development via co-op in school as other people in my class. I just judge myself so hard. My class full of people working at Microsoft, Google, Amazon, Mozilla, Facebook, Twitter...and then there's me. Just trying to improve my skillset and experience, so I can finally get a job =\ It's been too long.... Sigh...probably just a problem with me. Yay Software Engineering :3 I see co-op so was it Waterloo? I like to refer to this book + 1star reviews on Amazon because the 3rd 1star review is quite good. + Show Spoiler + http://www.amazon.com/Before-Happiness-Achieving-Spreading-Sustaining/product-reviews/0770436730/ref=cm_cr_pr_hist_1?ie=UTF8&filterBy=addOneStar&showViewpoints=0&sortBy=bySubmissionDateDescending There are a lot of similar books that present similar ideas but this one resonated with me better. Plus I really like his other book. + Show Spoiler [long reply] + The idea I want to point out is that you seem to be spending more time thinking about what could go wrong and placing mental blocks on doing things rather than thinking about what could go right and what you can do. Yes, you're going to be underqualified for a lot of things, but so will a huge number of people. So why get so hung up over it? You've graduated an arguably extremely difficult degree and acquired at least some set of skills that allowed you to overcome challenges in school. Deep diving into huge projects should not be a problem for you, and should not be scary. How hard could it be compared to a 15 hour algorithms assignment? You also seem to like finding ways that prevent you from actually doing work - it's too hard to setup, it's too complex, I need to start small. This is a self-defeating attitude that doesn't help if you keep dwelling on it. If you're interested in it, who cares whether it's hard or not? If it takes 3 hours to setup then so it takes 3 hours to setup. I've spent days troubleshooting stupid things gone wrong with my laptop, and days troubleshooting silly errors that completely kill a feature I'm working on, banging my head until something works. If there's a tutorial or guide about setting up something you're interested in, there's absolutely no reason why you can't spend some time figuring out how to get it to work, because that's a huge leg up already on googling everything you need to do yourself. Think about it this way, if you give up so easily on something as little as even setting up a project or deep diving into it, why would a large software engineering company want someone like that? And if someone 20 years ago could do something as complex as Linux without the benefit of Google, why make excuses about things being too hard? Have a goal and go for it. Set your role model as someone who does do those things. People don't get good at them overnight. They work at it and it becomes second nature. And they still learn new things all the time. Yes, you definitely lack experience compared to your friends with software jobs, but you have your own inherent advantages as well. You have a degree, and you've suffered through however many years of school, something that I'm not even done with yet. You have the opportunity to jump and learn and become a master at what you enjoy whereas people in school or still at work are not going to have the amount of time or energy to pursue any extraneous hobbies as much as you will have. I tried to advocate to a lot of younger years that there is absolutely nothing separating them from being a good programmer other than themselves, and nothing separating them from being as good as some really good programmers other than time, commitment and attitude. And the entire time I'm in awe of a lot of them who do have a lot more experience and years of programming under their belt than me. But even so I know that by the end of the day, not only are we all equals, we all have inherent advantages and disadvantages and skills based on our own upbringing that makes it so it doesn't really matter whether anyone has more experience. It's about what you use your experience for. You have to learn to not only not compare yourselves to others, but to accept the reality of your situation, and look for what positive changes you can do now. There's no point in dwelling on what you could have done. I really wish I started programming 7 years ago like some of my classmates. I only started 2 years ago instead, but I'm doing fine I guess. As for the having a goal part, there's two options. You might have something you really love or ideas about what you want to do. So I assume you love gaming. Go make a game! There are a lot of things such as 1 HTML5 game a day for 100 days or game engines like Unity or you can do something in Lua's LOVE or hundreds of other things. Go read people's blogs, go Google or Bing or DuckDuckGo for a couple hours just absorbing the huge amount of content that is available to consume (Googling skills required). Or you have no clue. Then ask friends. It's almost impossible to graduate without making at least a couple friends, maybe some good. Swallow your pride and ask them for help, for inspiration, if they have anything that they wanted to make but don't have time but could offload to you to make for them, if your family wants a website made. And then do it and use their expectation of you doing it to fire yourself up to completely the task and overcoming hurdles like, the build system is too complex. Stop putting up barriers between yourself and the task you want to get done. Break it down into chunks, compartmentalize, and work hard at it. Nothing good comes easy. I've found a large part of doing all of this is developing, or being aware of, not the right attitude, but a better attitude for approaching problems. Reading self-help books help immensely, as does the normal work out, feel better about yourself, get more confident, energetic, etc., and then just go and do it. Some days you'll be off. Some days you'll be on fire. I find good+ programmers view programming like some writer's view writing: do it daily whether you want to or not, don't make excuses, set reachable goals and reach them and you can't help but progress and get better. When you stagnate, when you don't try to improve, then you're going to fall behind people who do try. The good thing is, you have a lot more free time to improve than your peers and any upcoming peers. This is my list of programming/life stuff that I keep track of and enjoy reading from time to time, and something that I've had multiple people mention they enjoy reading some of too. http://pastebin.com/CVhbrqRv. This link at the bottom was one of my first inspirations: http://www.rdegges.com/how-i-learned-to-program/. | ||
Fawkes
Canada1935 Posts
Graphics and modelling just ain't up my aisle. I took a course on graphics in Uni, barely passed it. I just can't visualize the transforms and fancy math that goes on behind it. I found many people writing little libraries here and there for Android related things, but I haven't really looked into Android development...maybe I could a little bit. The only real thing I know about it is that people usually choose Java for it. | ||
Shield
Bulgaria4824 Posts
| ||
Nesserev
Belgium2760 Posts
| ||
Cyx.
Canada806 Posts
On April 23 2014 07:59 Nesserev wrote: Haha, I'm the same... I genuinely don't get why some people like graphics so much. hehe... I love it but I can totally see why it's not exactly some people's cup of tea, I'm a weird kid when it comes to math like that =/ but that shit gets hairy sometimes lol | ||
| ||