Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I am creating a chess variant. The rules and pieces are the same with classic chess. The only different is the size of the board (12x12 instead of 8x8).
My goal is to validate and apply moves only. What options I have aside from writing everything from scratch?
Most popular formats seem to be limited to 8x8 boards only.
I am fine with any popular programming language.
There are three general approaches chess engines take in move generation. In chess programming jargon these are commonly known as:
1)Bitboards
2)Mailbox (chess jargon for arrays with padding)
3)Piece lists
The most common method used today is Bitboards, which unfortunately is not easily modifiable to larger boards. This shouldn't be too bad for you, however. The reason bitboards are the de-facto standard is not because the are the easiest to implement (they are in fact the most complex), but because they are much faster for move generation (and by extension validation). However, this is only pertinent for use in a search function that needs to validate moves tens of millions of times per second. If you just want good old simple move validation, the method two should be more than adequate, and easily adaptable to larger boards. If you want to see chess engines that utilize this method, look up engiines that use a mailbox or oX88 board representation. I think the didactic CPW engine uses mailbox.
https://chessprogramming.wikispaces.com/CPW-Engine
and here is an article about move generation:
https://chessprogramming.wikispaces.com/Move+Generation
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I designed a nice resumé template in Sketch and now I want to make it available to use it for the users of a site.
The data will be stored in MySql database and the design should be modular depending on the information.
What is the best way of doing it? I though of replicating the design in CSS3 and then converting it with some of this scripts fpdf or mpdf but I don't thing that it's the easiest way of doing it.
What do you think?
Thanks!
An example of the resumé is the following:
If it's a set template/pattern I'd approach it like each segment as an object with a varying number of attributes based on data it returns from the mysql call.
IE when you pull the data from your table and start looping through a person's skills you can add that to the SKILLS object. Same for the Experience, etc etc.
Since this would essentially be like Parent Child nodes you could also do it with XML but the approach is really up to you.
You could then easily output the constructed resume as HTML (so your users on the site can see it live and may make changes, and then use a converter to convert to PDF (alots of languages have libraries to do just that). Most modern browsers can also already convert HTML pages to PDF too nowadays so you could also give them instructions on how to do that.
Just my two cents,
Hope it helps!
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm working on a new website, and I'm trying to decide how I want to balance the need for semantic correctness, with other important stuff, like development time. I know that semantics are supposed to be important for SEO, and accessibility for blind people. And those are important to me, and shouldn't take too much extra time. So I'll design them in, from the beginning. Anyway, my question is, what else is semantic correctness currently useful for? If there's something else I may consider worthwhile, I'd rather spend a little extra time now to build it in, than wait until later, when it may be more difficult.
Also, I know there are a lot of future possibilities. Some good, and some not (I've seen all the Terminator movies:). But I'll wait and see what happens with those.
edit: I should have mentioned that supporting some old browsers is important for this project, so being semantically correct won't be easy. Especially since I haven't done a lot of browser programming.
I did some more research, so now I can answer my own question.
Other than making sure my site is accessible to disabled people and search engines, there isn't currently anything all that important about semantic correctness, for my project. And I think search engines and screen readers are sophisticated enough these days, to handle some incorrect semantics, as long as the content structure isn't too confusing.
I can see semantic HTML elements being useful for documentation though, as long as it doesn't complicate my code.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I know you do commonly refactor code for the back-end to improve it's speed, security or make it more readable for the next person who takes over your project, but do you refactor html and css? Since they are markup languages it doesn't seem so trivial, besides wiping off a few bytes of your code vs the time input looking for alternatives doesn't seem to be worth the effort, especially if you are working on a tight deadline.
There are innumerable things that can increase or decrease page performance. Like with any optimisation though, you should start with where people are seeing problems or slowdown.
On a broader level, reducing payloads to the smallest possible size makes a big difference. This involves gzip, caching, and minification. You can rewrite your code a thousand times but it probably won't end up much smaller if at all than it would if you were to use gzip and minify your CSS — but don't minify HTML as it's too prone to rendering issues.
On a finer level, specific CSS features such as resizing large images and implementing lots of browser-generated gradients and shadows can bring performance down significantly. If you're noticing sluggishness when scrolling then things like this are probably what you need to focus on. Just one image that's 640x480 or more being resized by CSS can bring performance crashing down in some browsers.
Then of course there's latency. Using content distribution networks or at the very least highly optimised servers will ensure your HTML, CSS, JavaScript, and image files are delivered to users and shown as quickly as possible.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I have a Web Site thats designed using traditional tags but I need to convert to CSS based tags. Is there a better way (Free Software / Tool) to do this rather than taking one tag at a time and converting it ?
I'd say not. If there was, avoid it. Part of the point of moving away from tables-based mark-up is to improve accessibility, which requires a human eye. eg. content priority and SEO.
Generally no, because the switch from visually based table layout to semantic based CSS layout is more than just a rearrangement of code.
Typically you need to rethink the structure of the page in terms of the data rather than in terms of the grid, and that can only be a manual process
There is no automatic way to replace a table with DIVs+CSS since DIVs and tables have a different features. You can't replace one for the other (otherwise, the W3C would have dropped support for one of them).
A lot of people tell you "tables are bad" which is wrong. The correct saying is "dozens of nested tables are bad". There are some things DIV with CSS can do but tables definitely have their place. So the goal is to reduce the number of tables necessary for your layout not to get rid of them altogether.
No that is not possible, or even a good idea. By CSS based tags I assume you mean using divs for layout rather than tables (as CSS can be applied to tables).
I recommend you start over, it's the only way to do it properly, but you can make use of existing CSS frameworks such as the http://960.gs to get you going and also look at using things like YUIs reset and fonts stylesheet for a good base foundation that starts you on a level playing field with most modern browsers
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Hello I have an html page that through php pulls reports about sales and puts them in charts and graphs. It works great however I am looking for a way to convert a div box into a pdf so whoever is using the sight can print specific graphs and charts that are in selected div boxes. Is there a simple way to do this or is this unfeasible?
Thanks!
There are lots of answers here merely talking about making a PDF. That's the easy part - the hard part is finding an engine that renders the CSS well.
This question has been raised before, and the issue doesn't lie with feasibility (it's very possible and there are lots of solutions), but they vastly differ on their capabilities to translate CSS into PDF. Many just completely fail altogether.
From my research it looks like WKHTMLtoPDF is your best bet, as it uses a full WebKit engine to render the HTML first, then translate that into a PDF (I found a tutorial in addition to the docs).
The downside? It's command-line, so you'll need to engineer a solution involving either python or php to execute the program. Here's the PHP manual on executing a program.
Edit:
I have personally used FPDF before, which is a surprisingly light-weight solution with a caveat that you have to provide it with all of the HTML (edit:) line-by-line, rather than being able to use the browser-rendered result of a HTML page (a result that would include a rendered chart). I'm providing it merely as a suggestion and to help you work out where you can go from here, but it's not directly applicable to your complex CSS/chart problem.