ColdFusion 2016 code separation - coldfusion

I am getting back into ColdFusion after a few years off (from version 8).
I am changing my approach to web dev in that instead of posting pages to server I am submitting Ajax calls to CFCs to talk to my database.
So far so good but I wondered..
Instead of having lots of inline server ColdFusion code (handy as it is) that set HTML elements like form fields and labels etc.
Can I set these AFTER page load with JS?
I know I probably can but is this sensible and a good approach?
Keeps my client side code clean?
Also strictly a 2nd question but would a dedicated ColdFusion Windows server handle 300 users, max 100 at same time?

If you are going to use ColdFusion to merely provide data, you're leaving it up to the front end to create your HTML (fields, labels, etc).
Since you said that you don't want to inline CF code, this is pretty much your best option (there are other ways to accomplish this, but since you're asking this question, this method will probably be the quickest to get started).
In practice, you'll be creating data, let's say JSON or XML data, that the front end will need to parse and create HTML from.
There are a number of tools out there designed to to what you're describing. I'm not going to weigh in on what the right tools are, but if you research you'll find plenty of pro/cons/implementation details, etc. The word tools is important here. Some are frameworks, others aren't. You're looking for JavaScript frameworks, libraries, or plugins that can create or otherwise be populated by the data your CFCs will provide.
You can build your own "UI Framework" by using something like jQuery / jQuery UI (even raw JS) or you can use other tools. AngularJS, React, extJS, etc.
Here's a link which lists and describes some popular JS front end frameworks.
Secondly, there's not enough information your second question to really answer. A single server with the correct configuration could support 100 concurrent users. But the performance is going to depend on your hardware and software. If you have adequate CPU power, memory, disk I/O, etc, and your software doesn't require extensive resources from the hardware ( think high CPU usage, high memory usage, etc), then you will be fine.

My approach has been to use ColdFusion to simply generate JSON, which I feed into my front-end templates. To generate my JSON, I can still make use of all the CF functions to tweak things when I need.
As for your second question, it will depend on the work your server is doing, but I think in general you shouldn't have any issue. I do some image processing on my servers which adds a lot of load, but I can still handle 300 simultaneous connections without issue. Your milage may vary.

While this question is very broad, have my take on it.
As soon as I know I have lots of content, I don't want to generate it at once, but also don't want to show it at once.
I found that jQuery UI's AJAX on tabs was just the ticket to solve both problems
See: https://jqueryui.com/tabs/#ajax
Below is a ColdFusion-ized version of jQuery UI's approach
<div id="tabs">
<ul>
<li>Preloaded</li>
<li>Tab 1</li>
<li>Tab 2</li>
<li>Tab 3 (slow)</li>
<li>Tab 4 (broken)</li>
</ul>
<div id="tabs-1">
<p>Proin elit arcu, rutrum commodo, vehicula tempus, commodo a, risus. Curabitur nec arcu. Donec sollicitudin mi sit amet mauris. Nam elementum quam ullamcorper ante. Etiam aliquet massa et lorem. Mauris dapibus lacus auctor risus. Aenean tempor ullamcorper leo. Vivamus sed magna quis ligula eleifend adipiscing. Duis orci. Aliquam sodales tortor vitae ipsum. Aliquam nulla. Duis aliquam molestie erat. Ut et mauris vel pede varius sollicitudin. Sed ut dolor nec orci tincidunt interdum. Phasellus ipsum. Nunc tristique tempus lectus.</p>
</div>
</div>
Later
I don't really use jQuery UI any more. I now do the same approach with Bootstrap tabs. It requires a little more wiring up, but is still useful.

Related

Regex extract header and text separately from a paragraph form a list of content

(Javascript RegEx) I am writing to express my appreciation for this community and to seek assistance with a problem that I have been struggling to solve. I have been an avid user of this website since my earliest days, but this is my first time posting a question on the forum.
I am currently working on a project where I need to split a given paragraph into two distinct parts - a title and a description. I am looking for a solution that utilizes regular expressions (regex) to achieve this. Despite my best efforts, I have been unable to find a suitable solution on my own.
I would be extremely grateful if someone in this community could provide me with guidance or assistance in finding a regex solution to this problem. Your help would be greatly appreciated, and I look forward to any suggestions or solutions that may be offered.
Thank you in advance for your time and consideration.
`1. Raiders of the Lost Ark (1981)
The first entry on our list is Raiders of the Lost Ark, a 1981 classic directed by Steven Spielberg. This movie is considered to be one of the best adventure movies of all time, and for good reason. Featuring Harrison Ford as the iconic Indiana Jones, this action-packed flick follows the daring archaeologist as he travels the world in search of the fabled Ark of the Covenant. Along the way, he encounters a number of dangerous obstacles, including a man-eating boulder, a hostile tribe of natives, and a team of Nazi soldiers. With its incredible stunts and iconic soundtrack, Raiders of the Lost Ark is an adventure movie that never gets old.`
I have this piece of content for example, the content comes in this way, is there any way to grab the title 1. Raiders of the Lost ark (1981), and split The first entry on our list is Raiders of the Lost Ark, a 1981 classic directed by Steven Spielberg. This movie is considered to be one of the best adventure movies of all time, and for good reason. Featuring Harrison Ford as the iconic Indiana Jones, this action-packed flick follows the daring archaeologist as he travels the world in search of the fabled Ark of the Covenant. Along the way, he encounters a number of dangerous obstacles, including a man-eating boulder, a hostile tribe of natives, and a team of Nazi soldiers. With its incredible stunts and iconic soundtrack, Raiders of the Lost Ark is an adventure movie that never gets old.
Despite attempting to use Regex101 and other resources, I am having difficulty understanding the subject as I am relatively new to it, I'm trying to do this with javascript at the moment.

Demographics search in italian language with Facebook Marketing API

Good day.
Using Facebook Ad I can include public with demographics caracteristics same as education, sentimental relation, work position, etc. in italian language.
With search on Graph API Explorer I can only search some of them in english language excluding locale parameter.
With old version of marketing apis using adeducationmajor, adworkposition, etc, I obtainied the local values of them.
Now not.
It's possibile obtain it in a same way as adinterest?
Best regards.
Stefano Errani

List of EU countries from webservice

I need to know if a country belongs to the European Union.
I could create a list of nations that belong to the union now, but if they change I should update all the programs because the list is static.
I would like to find a webservice that gives me this data starting (for example) by the ISO code.
But I am not able to find any similar service.
Does anyone know if there is already this service?
Thanks to everyone.
Note: i'm looking for a list of EU countries, not a list of all the countries in the European continent.
You might be able to find it on the EU website; maybe start from this page. F.ex. I know for sure they offer a free webservice to check if a VAT number exists. You might get lucky also by asking on their forum (find it in that same page).

Django textile not returning results for some content

I've noticed that for an event with a description below using {{ event.content|textile }} returns text. textile version 2.2.2
This is a night of pure inspiration with some truly great people who have refused to follow the masses.They are determined to be at the top, all for a good cause.
It doesn't get better than this! November 6th at St. Andrew's Church. Admission is Absolutely free! Invite your friends, family and your colleagues. Make a date and don't be late.
But for an event with the content below returns nothing back.
Mutinda from Kenya - winner of the International Songwriting Competition 2010 World Music Category - is a strong singer/songwriter, vocalist and acoustic guitarist playing World Music and afro-folk, which contains rare sounds of Kenyan Music meeting the global contemporary influences of today.
Mutinda is a self-taught musician who began pursuing his career in his childhood by playing a home-made guitar.
Growing up in a typical rural setting and later living in one of the toughest neighborhoods in Nairobi, has made Mutinda interact with all kinds of people, whose lives and choices give him inspiration to share his messages, and be an encouragement, a hope and motivation for change.
For Mutinda music is an opportunity to share his inner realizations and truths and to connect with people through a personal life experience.
Since 2005 when Mutinda was one of the top artists in the Alliance Francaise “Spotlight on Kenyan Music” competition his professional music career has grown steadily taking him to places like Sauti Za Busara Festival in Zanzibar and on tour in Scandinavia.
Under the indie-label metta metta ART, Mutinda released his first solo album – entitled “Matopeni” – in 2009.
Performing either alone, with a 5 piece band, a Kenyan or a Danish band, Mutinda passionately prefers playing the guitar during his concerts. “Music is that which takes you to a place where only uncertainty prevails; yet anchoring you here.”, he says.
Besides making music, Mutinda is the founder of Iwayo Arts Centre - an NGO working with youth from the ghettos and slums of Nairobi. Through music Iwayo encourages the youth to know life to be more than their environment and that it is possible to find grace and humbleness in the midst of the toughest life-conditions.
The issue is with the tags “ and – textile doesn't deal with non unicode characters

QML-like approaches or programming languages?

According to wikipedia, QML is a declarative, reactive, scripting programming language. It also seems to be a unique language. Nothing similar to it apparently exists, while many other programming languages in wide use today shamelessly copy ideas from one another.
Do there exist programming languages or approaches within a language (such as within C++), that mimick QML?
The reason that I'm asking is because that I'm trying to implement my own QML-like language and compiling it into Lua, but it is hard work. Something even remotely similar to QML might do the job instead.
In the same year QML was released (2009), Microsoft released XAML.
XAML works together with C#, like QML and C++ do. JavaScript is also integrated.
<canvas debug="true">
<button name="button1" text="Click me !">
<handler name="onclick">
parent.button1.setAttribute("text","Hello, World !"); // JavaScript-Code
</handler>
</button>
</canvas>