SQL HTML Code Converter/Formatter - html

I own a website where I like to store my favourite SQL scripts.
I have previously seen an online converter tool which formats SQL code to have the applicable html tags so that when viewing the site the colours of key words such as SELECT FROM WHERE are all blue as per SQL management studio.
It looks exactly like one of those translation websites where you copy in your text, hit convert then get an output.
Problem is I can't for the life of me find which tool I used!! Does anyone know of one?
Thanks

A quick Google returns a number of results.
https://highlightjs.org/
http://prismjs.com/
https://code.google.com/p/google-code-prettify/
http://craig.is/making/rainbows
The point to note though is that you don't mark-up your code, the highlighter does it for you on the fly. You just need to flag in someway what language/syntax the highlighter needs to target.

Related

Newbie - How to display info from a .dat file?

I'm pretty new to this so I'm not sure if this is a simple request or not but here goes:
I am working on a school website and under each program page is a list of course codes. What I'm looking for is when I click on said course code (ex. HEL2106), to have a lightbox-type of popup that displays program info about said course code. What I have is a .dat file that has all the course codes and descriptions in it, so I would like to use some sort of HTML/CSS/JS that will pop this up and display the correct info about the clicked course from the .dat file.
I'm not 100% sure on how to go about this so if anyone has any suggestions at all, that would be really helpful.
If you need any other details from me, let me know.
Thanks,
(File Info* The .dat file is pretty much just a notepad document with each course code & description in sequence)
Just to let you know, you need to search and learn about a lot of things first.
For data access on a website, you need access to a database. If you don't know about SQL (or any other query language), Query, Database, Tables, Server ... then you should start there.
To read those databases, you need to write code (ASP.NET, PHP, etc) that runs on a web server (Apache, IIS, etc).
If you want to create a website, I recommend you start working with WordPress, Joomla or other CMS (Content Management System) for you to familiarize with a lot of things before jumping to the advance stuff.
YouTube is a very good friend and teacher! :) Start by looking some tutorials there. Hope this will guide you to what you need.
I have no idea what your level of experience is based off your question so I will assume you have a basic understanding of HTML,CSS and JS. If not, then I would recommend Exel Gamboa's answer.
It sounds like you're looking for something like http://fancybox.net/
Of course, it is typically used for displaying images but it could be easily modified for your purpose.
Now about your .dat file. When storing data for large websites, it's typically best to use SQL for databases. This allows you to access data and store it in an organized manner.
As a final recommendation I'd take a look at using a CMS for your website. (Wordpress, WolfCMS, perch, etc...)
Hope this helps.

SSRS Word Clouds

We are currently integrating with SQL Server Reporting Services and have got most of the functionality we require in place now but I am stumped on how do get the last bit working. On the current manual system at the bottom of the Excel spreadsheet is a Word Cloud which we would like to emulate in SSRS. I have constructed a DataSet that returns a list of words and their scores but I cannot work out how to create a word cloud from it.
I have followed the example below and got it working successfully and it looks great in Visual Studio but when I look at it in Excel and as a PDF its just not very nice at all.
http://www.sqljason.com/2012/03/making-tag-cloud-with-ssrs-rich-text.html
The main problem is that the results are loaded into a table (that has to be shrunk so it is unobtrusive) the some VB generates the HTML that is then rendered in a Text Area.
When I look at it in Excel the table is clearly visible (its huge) and in PDF form it is missing.
Does anyone know of an extension or plugin that I could use to display the word cloud or a better way of doing it?
The alternative would be to embed it as an image and call a web-service that creates the word cloud on the fly but it does seem like a lot of work for something that is probably a fairly common requirement.
Thanks everyone in advance :)
You say it does not look nice and then that it is missing. Which one? Why are you having to use a Dataset for words generated? If they are just arbitrary words you could set them up in free floating text boxes. I am not getting why to generate text you need to apply a dataset to it unless there is an object like a 'list' you have rules that you HAVE TO use a dataset.
Without a picture (which you do not have enough points to show) it is hard to tell what the cross applicatin problem could be. You are using a blog as a basis which the person could be using 2008R2 or 2012 SSRS for as well which makes it hard to troubleshoot.
My guess is you are applying a boxing layer, positioning or overlay that the PDF renderer does not like. My suggestion would be to start a small report with just his example only and see if it works as is in 2008. He seems to have someone mention on an issue of positioning which is the biggest culprit of problems with SSRS and multi format saving. If you can get the CORE part of your report working as he described I would think you may be able to use that as a 'subreport' inside of another report if you want more than one object to a report.

GEDCOM to HTML and RDF

I was wondering if anyone knew of an application that would take a GEDCOM genealogy file and convert it to HTML format for viewing and publishing on the web. I'd like to have separate html files for each individual and perhaps additional files for other content as well. I know there are some tools out there but I was wondering if anyone used any tools and could advise on this. I'm not sure what format to look for such applications. They could be Python or php files that one can edit, or even JavaScript (maybe) or just executable files.
The next issue might be appropriate for a topic in itself. Export of GEDCOM to RDF. My interest here would be to align the information with specific vocabularies, such as BIO or REL which both are extended from FOAF.
Thanks,
Bruce
Like Rob Kam said, Ged2Html was the most popular such program for a long time.
GRAMPS can also create static HTML sites and has the advantage of being free software and having a native XML format which you could easily modify to fit your needs.
Several years ago, I created a simple Java program to turn gedcom into xml. I then used xslt to generate html and rdf. The html I generate is pretty rudimentary, so it would probably be better to look elsewhere for that, but the rdf might be useful to you:
http://jay.askren.net/Projects/SemWeb/
There are a number of these. All listed at http://www.cyndislist.com/gedcom/gedcom-to-web-page-conversion/
Ged2html used to be the most popular and most versatile, but is now no longer being developed. It's an executable, with output customisable through its own scripting syntax.
Family Historian http://www.family-historian.co.uk will create exactly what you are looking for, eg one file per person using the built in Web Site creator. As will a couple of the other Major genealogy packages. I have not seen anything for the RDF part of your question.
I have since tried to produce a Genealogy application using Semantic MediaWiki - MediaWiki, the software behind Wikipedia, and Semantic MediaWiki includes various extensions related to the Semantic Web. I thought it is very easy to use with the forms and the ability to upload a GEDCOM but some feedback from people into genealogy said that it appeared too technical and didn't seem to offer anything new.
So, now the issue is whether to stay with MediaWiki and make it more user friendly or create an entirely new application that allows for adding and updating data in a triple store as well as displaying. I'm not sure how to generate a family tree graphical view of the data, like on sites like ancestry.com, where one can click on a box to see details about the person and update that info or one could click on a right or left arrow around a box to navigate the tree. The data comes from SPARQL queries sent to the data set/triple store both when displaying the initial view and when navigating the tree, where an Ajax call is needed to get more data.
Bruce

Markdown or HTML

I have a requirement for users to create, modify and delete their own articles. I plan on using the WMD editor that SO uses to create the articles.
From what I can gather SO stores the markdown and the HTML. Why does it do this - what is the benefit?
I can't decide whether to store the markdown, HTML or both. If I store both which one do I retrieve and convert to display to the user.
UPDATE:
Ok, I think from the answers so far, i should be storing both the markdown and HTML. That seems cool. I have also been reading a blog post from Jeff regarding XSS exploits. Because the WMD editor allows you to input any HTML this could cause me some headaches.
The blog post in question is here. I am guessing that I will have to follow the same approach as SO - and sanitize the input on the server side.
Is the sanitize code that SO uses available as Open Source or will I have to start this from scratch?
Any help would be much appreciated.
Thanks
Storing both is extremely useful/helpful in terms of performance and compatiblity (and eventually also social control).
If you store only Markdown (or whatever non-HTML markup), then there's a performance cost by parsing it into HTML flavor everytime. This is not always noticeably cheap.
If you store only HTML, then you'll risk that bugs are silently creeping in the generated HTML. This would lead to lot of maintenance and bugfixing headache. You'll also lose social control because you don't know anymore what the user has actually filled in. You'd for example as being an admin also like to know which users are trying to do XSS using <script> and so on. Also, the enduser won't be able to edit the data in Markdown format. You'd need to convert it back from HTML.
To update the HTML on every change of Markdown version, you just add one extra field representing the Markdown version being used for generating the HTML output. Whenever this has been changed in the server side at the moment you retrieve the row, re-parse the data using the new version and update the row in the DB. This is only an one-time extra cost.
By storing both you only have to process the markdown once (when it is posted). You would then retrieve the HTML so that you can load your pages faster.
If you only stored one, you'd forever have to recreate the other for either the display view or the edit view.

PDF Report generation [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
EDIT : I completed this project using ABCpdf. For anyone interested, I love this product and their support is A+. Everything I listed as a 'Con' for the HTML -> PDF solution was easily doable in ABCpdf.
I've been charged with creating a data driven pdf report. After reviewing the plethora of options, I have narrowed it down to 2. I need you all to to help me decide, or offer alternatives I haven't considered. Here are the requirements:
100% Data driven
Eventually PDF (a stop in HTML is fine, so long as it is converted)
Can be run with multiple sets of data (the layout is always the same, the data is variable)
Contains normal analysis-style copy (saved in DB with html markup)
Contains tables (data for tables is generated at run-time)
Header/Page # on each page
Table of Contents
.NET (VB or C#)
Done quickly
Now, because of the fact that the report is going to be generated with multiple sets of data, I don't think a stamped pdf template will work since I won't know how long or how many pages a certain piece of the report could require.
So, I think my best options are:
Programmatic creation using an iText-like solution.
Generate in HTML and convert to PDF using a third-party application (ABCPdf is the tool I have played with so far)
Both solutions have their pro's and con's.
Programmatic solution:
Pros:
Flexible
Easy page numbering/page header/table of contents
Free
Cons:
Time consuming (to write a layer on top of iText to do what I need and keep maintainable)
Since the copy is already stored in the db with html markup, I would have to parse through the data before I place it into the pdf, ensuring I don't have to break the paragraph into chunks so I can apply bold, italic, underline, etc. to specific phrases. This seems like a huge PITA, and I hope I am wrong about that assumption.
HTML -> PDF
Pros:
Easy to generate from db (no parsing necessary)
Many tools for conversion
Uses technology I am already familiar with
Built-in "Print Preview" - not a req, but nice
Cons:
(Edited after project completion. All of my assumptions were incorrect and ABCpdf is awesome)
1. Almost impossible to generate page headers - Not True
2. Very difficult to generate page numbers Not True
3. Nearly impossible to generate table of contents Not True
4. (Cross-browser support isn't a con; Since its internal, I can dictate what browser to use)
5. Conversion tool quirks - may not convert exactly as rendered in browser Not True
6. Overall, I think it would be very hard to format the HTML exactly as I would want it to appear/convert to PDF. Not True
That's it - I need the communitys help in deciding which way I should go. I might be wrong about some of my Pro/Con assumptions. If I am, please tell me. All thoughts and suggestions are welcome and appreciated.
Thanks
Decided on using an approach similar to the one used at
http://alistapart.com/articles/boom
Using ABCPdf instead of Prince for the eventual HTML -> PDF generation.
Anyone who is interested in the same thing, feel free to message me about this approach.
I think that if you have a full version of Adobe Acrobat Pro, it comes with Adobe Live Cycle. You should be able to produce reports generated from a database from it. It will give you everything you need in formatting since you will create the report from scratch.
You can create a database connection to an OLE database that will feed data to your form fields. You select the tables to be used, any stored procedures that will run, any queries, and then the data will appear on one of the pallettes in the designer.
You can also use Web Services (WDSL) to receive and process commands and return the results to the form.
Either way, you would bind fields to your data source and then the data would be displayed in your form.
If you're willing to do a little .NET work there's this:
http://www.dotnetvj.com/2009/05/populating-pdf-from-aspnet-using.html
Depending on which platform you are using and targeting, you might want to consider a reporting solution. These are not perfect but the one thing they do give you is the ability to write a report once and then render it in HTML, PDF, or even Excel.
Usually they also provide an editor that helps you design the report and make it look just right. They provide things like paging, headers, footers, graphs, etc. They also provide an API that you can use to programatically create and run the reports.
I've used Reporting Services in a MS environment and Jasper Reports in a Java environment with good results in both. I'm sure there are other options but these are the ones I've been able to use successfully.
For the HTML→PDF step, I really love Prince. It looks like you can call it from VB.
My recommendation is to use SQL Reporting Services.
Can design every page & table of your report
Include Header and Footer
Include Page Numbers
Table of Contents
Can span through multiple pages
Supports Images & Charts
Can be rendered to PDF without a need for any thrid party PDF Converters