CF11 issue

May. 17th, 2016 09:26 am
scottobear: (Default)

I’m trying to find an efficient way of pulling in a website’s metadata keywords (from the <meta> tag). Server’s running CF11

Read the rest of this entry » )

Originally published at The Scotto Grotto (org). You can comment here or there.

scottobear: (Default)

campersasSARCH
or… what my settlement in fallout 4 usually ends up looking like.

Originally published at The Scotto Grotto (org). You can comment here or there.

scottobear: (Default)

i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>

i\hbar\frac{\partial}{\partial t}\left|\Psi(t)\right>=H\left|\Psi(t)\right>

\LaTeX

latex \LaTeX&bg=ffcccc&fg=cc00ff&s=4

Originally published at The Scotto Grotto (org). You can comment here or there.

scottobear: (Default)

This guy has an archive of everything:

http://www.gpickin.com/cfrepo/

You can find all versions here:

https://www.copy.com/s/nhIbHZYZnmPN

edit: direct link to files. the link below

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

https://code.visualstudio.com/updates/v0_3_0 (Visual Studio is now open source – https://news.ycombinator.com/item?id=10588264)
smortaz 40 minutes ago

We’ve been asked this by a few people, so I figured this is a good place to respond:
Will PTVS (Python Tools for Visual Studio) come to VSCode?
The answer is YES! This will be a major focus next year. Expect full intellisense, debugging, profiling, pkg mgmt, unit test, virtual env, multiple interpreter, Jupyter, etc. support.
Disc: Python/R/Jupyter team lead

https://www.visualstudio.com/features/python-vs

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)
  • Configure File System Auditing: Navigate to the required file share, right-click it and select “Properties” Select the “Security” tab → “Advanced” button → “Auditing” tab → Click “Add” button: Select Principal: “Everyone”; Select Type: “All”; Select Applies to: “This folder, subfolders and files”; Select the following “Advanced Permissions”: “Delete subfolders and files” and “Delete”.
  • Configure Audit Policy: Run gpedit.msc, edit “Default Domain Policy” → Computer Configuration → Policies → Windows Settings → Security Settings → Go to Local Policies → Audit Policy: Audit object access → Define → Success and Failures.
  • Configure Advanced Audit Policy: Go to “Advanced Audit Policy Configuration” → Audit Policies → Object Access: Audit File System → Define → Success and Failures Audit Handle Manipulation → Define → Success and Failures.
  • Configure Event Log Size: Go to Event Log → Define: Maximum security log size to 4gb. Retention method for security log to Overwrite events as needed.
  • Check Security log: Open Event viewer and search Security log for event id 4656 with “File System” or “Removable Storage” task category and with ”Accesses: DELETE” string. ”Subject: Security ID” will show you who has deleted a file.
  • Use case video: http://www.youtube.com/watch?v=sfLzqGk57vk

Originally published at The Scotto Grotto. You can comment here or there.

YAGNI.

Jul. 1st, 2015 04:41 pm
scottobear: (Default)

https://en.wikipedia.org/wiki/You_aren’t_gonna_need_it

You aren’t gonna need it“ (acronym: YAGNI) is a principle of extreme programming (XP) that states a programmer should not add functionality until deemed necessary. XP co-founder Ron Jeffries has written: “Always implement things when you actually need them, never when you just foresee that you need them.”[ Other forms of the phrase include “You aren’t going to need it” and “You ain’t gonna need it”.

See also:

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

The final working code

<cfloop list="#FORM.fieldnames#" index="c" delimiters=",">
<cfif listfindnocase("ORDER",listfirst(c,"_"),",")>
<cfset item = "##" & "FORM." & c & "##">
    <cfquery name="reorder" datasource="guidance">
    UPDATE fed_lands_doctype
    SET type_order = <cfqueryparam value="#evaluate(item)#" cfsqltype="cf_sql_numeric">
    WHERE type_id = #listlast(c,"_")#
    </cfquery> 
</cfif>   
</cfloop>

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Let’s see here, dear journal…

Friday, Paul sussed out a great solution to the site’s issues – It’s loading now, and fast! After a week of data drag and timeouts he went with 2 things.

1) I changed how caching was done on her pages
2) I indexed 7 columns in her database
once that bottleneck was gone, all the Access-driven pages flew
it works so well I applied that caching model to our pages.
 On Test where there’s no caching, the combined total query execution time was around 230-250ms.  Throwing a 30 second cache on the 2 main queries that the others draw from dropped that to 5-11ms.

Upgrade to CF10 seems to be solidly in place now.

http://www.adobepress.com/articles/article.asp?p=2044525
http://www.carehart.org/blog/client/index.cfm/2012/3/7/charlie_areharts_ultimate_cf10_new_features_list

We should probably also find a list for CF9, because we picked those up during the upgrade from 8 too.

Friday night wasn’t much fun for me – long commute home, sitting next to a guy that was drunk. Apparently he does construction of some sort in DC. I relocated as soon as I could, but the first 45 minutes of the ride home was like being next to a smelly and loud goat.

Got home in a time to get back in the car and head south for another 45 minutes to Laughing Buddha for dinner with the in-laws.  The food there is usually very good, but they must’ve been having a rough night… this was the first time I didn’t want to finish my meal, or keep the leftovers. That said, they are awesome 99% of the time.  I’ll let them know later on – I’m confident that they can take constructive criticism.

Returned home, and promptly zonked right out.

Saturday was Pi / Pie / Pye day, of course.

Spent most of the day taking it easy – I drifted in and out of sleep pretty much until we left for dinner.. . recovering lost sleep after an exhausting week, I suppose.

We celebrated by  going for pizza at 3 brothers (after much deliberation – prior to that, it was going to be a trip to Annapolis for Cheeburger Cheeburger, then Maggiano’s, then the Double T Diner for Pie… ) I was perfectly happy with our Sicilian Pizza solution – I was fairly surprised that it is no longer on the menu, but they can do one if asked.

Post- Pizza, Chris and Allison bounced to TJ Maxx while Larry and  I hit Safeway for some essentials. Made it back home about 10 or so, and we stayed up for maybe an hour watching YouTube before hitting the sack.

Sunday we went to Brunch with the Meyers – met their daughter (Paige) their niece (Kelly), and friends Jeff and Lucie (and their two adorable kids, names out of my noggin) . Jeff and I hit it off pretty well, a common love of comics / RPG tabletop and classic video games. He may have convinced me to give Arrow another try.  Seasons 1-3 are on Netflix right now… if the bus has WiFi, I may make the attempt on the commute home during the week(s) ahead.

So, I finally got to eat at the Rod & Reel (Rotten Eel). The food was OK… standard buffet stuff. decent waffles, decent omelets. They weren’t very interested in high-speed busing the tables. There was a huge crush of people which meant lines and navigation issues. Our reservation was for 11:15, but we really didn’t get a spot to sit in until nearly noon.  Not my thing – plenty of other breakfast spots to visit.

Returned home and we zonked out again. After napping for a while, Allison and I just hit the house hard and caught up with a bunch of chores that just needed doing, and had been put off too long.  We ended up having leftover pizza for dinner, and sacking out after that.

My mood over the course of the weekend has been rather hyper-sensitive. Got a bit of a case of the hives, back was achy at the least and very painful at the worst. I was not a happy camper – irritable, cranky, and a bit negative in thought.

Newton was a good boy.
image

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Description

Removes duplicate values (if they exist) in a list.

Returns

List sans duplicate values

History

ColdFusion 10: Added this function

Syntax

ListRemoveDuplicates(list[, delimiter] [, ignoreCase])

Properties

Parameter Description
list Required. List of objects.
delimiter Optional. Character(s) that separate list elements. The default value is comma. .
ignoreCase Optional. If true, ignores the case of strings in the list. By default the value is set to false.

Example

<cfscript>
                myList = "one,two,three,four,five,one,five,three"
                newList = listremoveduplicates(myList);
                //default delimeter is ","
                //newList contains "one,two,three,four,five"
</cfscript>
<cfscript>
                myList = "one,two,three,four,five,ONE,TWO,THREE"
                newList = listremoveduplicates(myList, ",", true);
    //newList contains "one,two,three,four,five"
</cfscript>

via

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

http://www.gpickin.com/cfrepo/

ColdFusion Downloads / Install Repo

COLDFUSION INSTALL REPO – Updated 1/22/15

View Files

This repo has been created to help those easily find the ColdFusion installs and to help alleviate all the copies sitting around on hard drives everywhere.

Created initially Feb 12, 2014, we are trying to add more files all the time.
If you have installers, hot fixes or updaters not here, please let us know, and we’ll try and add them to the repo.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

string manipulation -

left(event_desc,iif(find(".",event_desc,100) eq 0,500,find(".",event_desc,100)

return the following string from event description -

if the leftmost 100 characters of the text contains a period and is the only period within the first 500 characters, give the text up to the period, otherwise, return the text up to the second period.

Nicely done – saves having to run a loop or step function.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

SQL QUICK REFERENCE
ColdFusion Query Syntax
--------------------------------------

Read the rest of this entry  )

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Section 508 1194.22(d): “Element specifies background color but not specify foreground (text) color”

wpid-medium_ColorBurstAction387.jpg

If I use background-color: [whatever color];
the parameter color: [whatever legible 508 compliant legibility color, or at least inherit]; will be contained with it.

Section 508 1194.22(d): “Element specifies background color but not specify foreground (text) color”

If the author specifies a foreground text color then they should also specify a background color which has sufficient contrast with the foreground and vice versa.

User needs to review all cascading style sheet values for the page. Make sure that all background color values “bgcolor” have a corresponding text color value “color.” This is required to allow visually impaired users to control foreground and background colors through personal stylesheets or other means.

If the site is failing this checkpoint, it is usually due to table, divs, among other tags where either the attribute color or the attribute background-color have not been specified, alongside one another.

For example, you could have something specified

 <div style="color: blue;"></div>

which would fail because there is no background color specified.

 <div style="color: blue; background-color: white;"></div>

Would fly.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)
ColdFusion failIf you ever run into the page below while looking for CF info, ignore it!
Packed with Errors, it’s the anti-snickers. It really doesn’t satisfy.

 “Except for Table IDs, Avoid Numeric Fields Where Possible” 

seriously?

<cfquery name="getItem" datasource="context">
  select * from Item
  where ItemID = <cfoutput>#form.editme#</cfoutput>
  </cfquery>
error 1: You don’t need cfoutputs inside a cfquery
 error 2: no cfqueryparam tag.  Totally injectable
Don’t Autonumber; Create Your Own Table ID
Yes, that way if more than one person use the app at the same time, you overwrite each other.
“Wrap Inserts with a Try-Catch Combination that Tries Again”
Of course! Why trap an error when you can make an endless loop?!
Not to mention all the SELECT *
Why is SELECT * harmful?

There are really three major reasons:

  • Inefficiency in moving data to the consumer. When you SELECT *, you’re often retrieving more columns from the database than your application really needs to function. This causes more data to move from the database server to the client, slowing access and increasing load on your machines, as well as taking more time to travel across the network. This is especially true when someone adds new columns to underlying tables that didn’t exist and weren’t needed when the original consumers coded their data access.
  • Indexing issues. Consider a scenario where you want to tune a query to a high level of performance. If you were to use *, and it returned more columns than you actually needed, the server would often have to perform more expensive methods to retrieve your data than it otherwise might. For example, you wouldn’t be able to create an index which simply covered the columns in your SELECT list, and even if you did (including all columns [shudder]), the next guy who came around and added a column to the underlying table would cause the optimizer to ignore your optimized covering index, and you’d likely find that the performance of your query would drop substantially for no readily apparent reason.
  • Binding Problems. When you SELECT *, it’s possible to retrieve two columns of the same name from two different tables. This can often crash your data consumer. Imagine a query that joins two tables, both of which contain a column called “ID”. How would a consumer know which was which? SELECT * can also confuse views (at least in some versions SQL Server) when underlying table structures change – the view is not rebuilt, and the data which comes back can be nonsense. And the worst part of it is that you can take care to name your columns whatever you want, but the next guy who comes along might have no way of knowing that he has to worry about adding a column which will collide with your already-developed names.

But it’s not all bad for SELECT *. I use it liberally for these use cases:

  • Ad-hoc queries. When trying to debug something, especially off a narrow table I might not be familiar with, SELECT * is often my best friend. It helps me just see what’s going on without having to do a boatload of research as to what the underlying column names are. This gets to be a bigger “plus” the longer the column names get.
  • When * means “a row”. In the following use cases, SELECT * is just fine, and rumors that it’s a performance killer are just urban legends which may have had some validity many years ago, but don’t now:
    SELECT COUNT(*) FROM table;

    in this case, * means “count the rows”. If you were to use a column name instead of * , it would count the rows where that column’s value was not null. COUNT(*), to me, really drives home the concept that you’re counting rows, and you avoid strange edge-cases caused by NULLs being eliminated from your aggregates.

    Same goes with this type of query:

    SELECT a.ID FROM TableA a
    WHERE EXISTS (
        SELECT *
        FROM TableB b
        WHERE b.ID = a.B_ID);

    in any database worth its salt, * just means “a row”. It doesn’t matter what you put in the subquery. Some people use b’s ID in the SELECT list, or they’ll use the number 1, but IMO those conventions are pretty much nonsensical. What you mean is “count the row”, and that’s what * signifies. Most query optimizers out there are smart enough to know this.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Save in your .vim/indent directory. It should kick in when cfutils’ ftdetect plugin determines that your cfc is cfscript only, which is when it sees a line beginning with “component” or a multiline script comment.

Originally published at The Scotto Grotto. You can comment here or there.

scottobear: (Default)

Remove div from table cell

\<th class=\”row\” scope=\”row\”\>\<div align=\”center\”\>(.+?)\<\/div\>\<\/th\>
<th class=”row” scope=”row”>$1</th>
Replace contents of H1

\<h1\>(.+?)\<\/h1\>
<h1>new text</h1>
Find H1 with break

<h1>[^]*</h1>
Replace H1 with H2

\<h1\>(.+?)\<\/h1\>
<h2>$1</h2>

 

\<th colspan=”3″ id=”(.+?)” headers=”(.+?)”>\<div align=\”left\”\>\<strong\>(.+?)\<\/strong\>\<\/div\>\<\/th\>
<th colspan=”3″ id=”$1″ headers=”$2″ align=”left”>$3</th>
\<td (.+?)>\<h4 align=\”center\”\>(.+?)\<\/h4\>\<\/td\>
<td $1 align=”center”>$2</td>
Finds tables

<table [^>]*>[^]*</table>

Copy name to ID

<input name=”(.+?)”
<input name=”$1″ id=”$1″

<tr(.+?)>
<td>(.+?)</td>

<tr$1>
<th scope=”row” class=”row”>$2</th>
<!DOCTYPE [^>]*>
[^]*
<div class=”content”><a name=”content”></a>
([^]*)
<p align=”center” class=”small”>[^]*

#(.+?)\.(.+?)#

Remove td/tr/th width

<t(.+?) width=\”(.+?)\”>
<t$1>

Notepad++

<a href=”(.*)”>(.*)</a>
Empty A tags:
<a name=”([^"]*)” id=”([^"]*)”></a>
Move anchor text outside tag
<a name=”(.+?)” id=”(.+?)”>(.+?)</a>
<a name=”$1″ id=”$2″></a>$3

 

Originally published at The Scotto Grotto. You can comment here or there.

Profile

scottobear: (Default)
scott von berg

April 2017

S M T W T F S
       1
2 345678
9 10 11 12 13 14 15
16 1718 19 20 21 22
23 2425 26 2728 29
30      

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 5th, 2025 11:53 pm
Powered by Dreamwidth Studios