Sublime Text 2 Create template - editor

I want to build a project specific template to include in newly created PHP files same as Eclipse does as the following,
/**
* #file test.theme.inc
* DESCRIPTION LINE 1
* DESCRIPTION LINE 2
* DESCRIPTION LINE 3
* #name test.theme.inc
* #created Dec 21, 2012
* #author Aneek
* #version $Id:$
* #copyright
* Proprietary and Confidential
* Copyright (C) 2012 Company name. All Rights Reserved.
*/
How can I make such a template to use?

Related

F# FSI, Change working directory

I have the following file located in a "New Folder" of Desktop:
// File location: "C:\Users\my_user_name\Desktop\New folder\AddOne.fs"
//
module internal AddOneModule
let AddOneFunction x = x + 1
I can access this file by using #load on the full path name using FSI F# Interactive.
Microsoft (R) F# Interactive version 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> #load "C:\Users\my_user_name\Desktop\New folder\AddOne.fs";;
//[Loading C:\Users\my_user_name\Desktop\New folder\AddOne.fs]
//namespace FSI_0002
// val AddOneFunction : x:int -> int
> open AddOneModule;;
> AddOneFunction 100;;
// val it : int = 101
How do I change the working directory so that I can access the file using relative path?
F# interactive:how to display/change current working directory
I tried something similar to the post above, but FSI still tries to find the file in the Temp folder:
(RESET FSI)
Microsoft (R) F# Interactive version 4.1
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
> open System;;
> Environment.CurrentDirectory <- #"C:\Users\my_user_name\Desktop\New folder";;
//val it : unit = ()
> #load "AddOne.fs";;
// #load "AddOne.fs";;
// ^^^^^^^^^^^^^^^^^
//C:\Users\my_user_name\Desktop\New folder\stdin(3,1): error FS0078: Unable to find
//the file 'AddOne.fs' in any of
// C:\Users\my_user_name\AppData\Local\Temp
Thank you for your help.
Instead of changing the working directory you may achieve the desired using a trick with __SOURCE_DIRECTORY__ built-in identifier.
To begin with, you need a certain anchor point in directory structure. For illustration purposes let's assume you are on Windows and let this anchor point be your user directory, which is defined by %USERPROFILE% environment variable. Place there a script anchorfsi.fsx containing the following single line of code:
#I __SOURCE_DIRECTORY__
That's basically all you need to do. Now, regardless from what location you shoot your fsi using command line fsi --load:%USERPROFILE%\anchorfsi.fsx, you can use relative paths in your scripts and in interactive commands.
Turning to the setup in your question with loading .\desktop\new folder\addone.fs, the following screenshot demonstrates achieving the desired:
Notice how the entered relative path ".\desktop\new folder\addone.fs" was correctly mapped to the absolute one C:\Users\gene\desktop\new folder\addone.fs without any dependency upon the fsi working directory whatsoever.

iOS: Webfont displaying on home page, but not subpages

I'm building a new website for a client here - the embedded webfont displays just fine in Safari & Chrome (MacOS)... but only on the home page under iOS. On subpages in iOS, it defaults to Times Roman. The webfont files are located in the root.
Stumped. Any help? Here's my CSS:
/**
* #license
* MyFonts Webfont Build ID 3124015, 2015-11-11T18:29:33-0500
*
* The fonts listed in this notice are subject to the End User License
* Agreement(s) entered into by the website owner. All other parties are
* explicitly restricted from using the Licensed Webfonts(s).
*
* You may obtain a valid license at the URLs below.
*
* Webfont: Tiki-Solid by Pelavin Fonts
* URL: http://www.myfonts.com/fonts/pelavin/tiki/solid/
*
* Webfont: Tiki by Pelavin Fonts
* URL: http://www.myfonts.com/fonts/pelavin/tiki/regular/
*
*
* License: http://www.myfonts.com/viewlicense?type=web&buildid=*******
* Licensed pageviews: 10,000
* Webfonts copyright: Copyright (c) 2011 by Daniel Pelavin. All rights reserved.
*
* © 2015 MyFonts Inc
*/
/* #import must be at top of file, otherwise CSS will not work */
#import url("//hello.myfonts.net/count/2fab2f");
#font-face {font-family: 'Tiki-Solid';src: url('webfonts/2FAB2F_0_0.eot');src: url('webfonts/2FAB2F_0_0.eot?#iefix') format('embedded-opentype'),url('webfonts/2FAB2F_0_0.woff2') format('woff2'),url('webfonts/2FAB2F_0_0.woff') format('woff'),url('webfonts/2FAB2F_0_0.ttf') format('truetype');}
#font-face {font-family: 'Tiki';src: url('webfonts/2FAB2F_1_0.eot');src: url('webfonts/2FAB2F_1_0.eot?#iefix') format('embedded-opentype'),url('webfonts/2FAB2F_1_0.woff2') format('woff2'),url('webfonts/2FAB2F_1_0.woff') format('woff'),url('webfonts/2FAB2F_1_0.ttf') format('truetype');}
h1, h2, h3, h4, h5, h6 {
font-family: Tiki-Solid;
font-weight: normal;
font-style: normal;
}
h1, h2, h3, h4, h5, h6 {
letter-spacing: 4px;
line-height: 80%;
}
Look at your inspector. The font files are located at the root, but they're being looked for (and not found) in a subdirectory.
Failed to load resource: the server responded with a status of 404 (Not Found)
http://www.damonsglendale.com/new/lunch/webfonts/2FAB2F_0_0.ttf
Rather than referring to them relatively, you could resolve this issue by specifying the entire path.

CopyBooks,.cpy files,WTX Design Studio

I am working on WTX design Studio with copybooks,i have a copybook but i dont have any corresponding sample input regarding that .cpy file .
Are there any means to generate a sample text file from copy book rather than writing the text document manually?
As bill said there are lots of ways depending on the tools available:
Ask for sample file
There are packages that can generate data. As I do not work at your site I do not know if any have been installed. They tend to be expensive though
Write a Cobol program (I presume the source is a mainframe) so it would have to be done on the mainframe.
I presume the source is a Mainframe, get on the Mainframe and use FileAid (or FileMaster or whatever they have) to setup the file. FileAid and its ilk let you edit files with a Cobol copybook.
Use the RecordEditor to create the file. You can import Cobol Copybooks into the RecordEditor and then use them to edit Cobol-Data files.
Use a RecordEditor macro to generate a file;
Write a Java / jython / JRuby program with Cobol interface package (have a look on sourceforge)
There are a lot of other possibilities, as I do not know what software or skills you have I can not really advise.
RecordEditor Macro to generate some numeric data:
/******************************************************************
* Purpose: RecordEditor Example Macroto generate numeric data for a file
*
* It is best to run this script from a Single Record Screen rather than
* a Table screen
*
*******************************************************************/
var rec = layout.getRecord(0)
var lines = RecordEditorData.view.createLines(20)
for (lineNo = 0; lineNo < 20; lineNo++) {
print(lineNo);
for (i=0; i < rec.getFieldCount(); i++) {
try {
lines[lineNo].getFieldValue(0, i).set(lineNo * 100 + i)
} catch(err) {
lines[lineNo].getFieldValue(0, i).set(i % 10)
}
}
}
RecordEditorData.view.addLines(-1,1, lines)
Output from the Macro:

HeaderDoc not generating HTML Documentation

I'm working on a re-usable API component for iOS apps. I have completed the API and documented it using headerdoc for future users.
Now I want to create HTML pages for those header files. So I executed the following command in terminal from my project directory
headerdoc2html -o ~/Desktop/My_Project_Documentation APIFolder/
But No documents are being created, instead I'm getting an error like:
Skipping. No HeaderDoc comments found.
No default encoding. Guessing. If date formats are wrong, try
specifying an appropriate value in the LANG environment variable.
...done
I tried various methods and ways, finally I narrow down the issue:
In the beginning of my project I have something like:
/**
* DarkPantherConstants.h
* Panther
* Created by Midhun on 05/11/14.
* Copyright (c) 2014 Midhun. All rights reserved.
* Panther Constants are defined in this header file
*/
So the issue was with this particular comment, actually this comment is auto-generated by XCode and I actually modified the name and comment format to headerdoc. Nothing with date or date-format. Even If I remove those comments, nothing works; getting same error. Can anybody please help me to solve this ?
I fixed it by changing my commenting format from:
/**
*
*/
to
/*!
*
*/
I made my header comment like:
/*!
* DarkPantherConstants.h
* Panther
* Created by Midhun on 05/11/14.
* Copyright (c) 2014 Midhun. All rights reserved.
* Panther Constants are defined in this header file
*/
And it solved the issue, but I don't know why the previous commenting format not working. (Both are valid for headerdoc)
Add the -j options when executing headerdoc2html to also process java style comments ( /** )

Using CKFinder in an Orchard CMS module

In trying to integrate the CKsource CKFinder control into Orchards CMS. I've already done this with a plain non orchard project, but am having difficulty with the orchard CMS project.
When popuing up the The finder control I get the following javascript error:
It was not possible to properly load the XML response from the web server.
Raw response from the server:
<%# Page Language="c#" Inherits="CKFinder.Connector.Connector" Trace="false"
AutoEventWireup="false" %><%# Assembly Name="AAA.CMS"%> <%# Register
Src="../../../config.ascx" TagName="Config" TagPrefix="CKFinder" %> <%-- * CKFinder *
======== * http://cksource.com/ckfinder * Copyright (C) 2007-2013, CKSource - Frederico
Knabben. All rights reserved. * * The software, this file and its contents are subject
to the CKFinder * License. Please read the license.txt file before using, installing,
copying, * modifying or distribute this file or part of its contents. The contents of
* this file is part of the Source Code of CKFinder. * * --- * This is the ASP.NET
connector for CKFinder. * * You must copy the CKFinder.Connector.dll file to your "bin"
directory or * make a reference to it in your Visual Studio project. --%>
I've verified my Config.ascx is correct. I'm able to access the js file. Is it even possible to integrate ckfinder into a Orchard Module?

Resources