Making a new electrical component in raceway/electrical package – Start to Finish

This tutorial / step-by-step can be used as a training manual. If you want the log book style article on how to figure all this out see the other article. No lesson in Bentley Docs describes this. There is a help file on linking in the Equipment Modules as a .ebs drawn entity and how to edit those classes. This is for the Piping module side of things for Electrical items – the concepts can be used for any piping module application.

Step 1. Start Class Editor and gather info

  1. Open your Class Editor
  2. Open your project under the menu File->Open Continue reading

Report Server Report add a mailto: link in the report rows

I am just getting familiar with report services and making a report with Business Intelligence. I think you can do the same with Report Builder 2.0 – if someone would comment I will update the post. I wanted to add a mailto: link with a subject. You are allowed in expressions, to use any .net function you want, but there is a way to do this.

Not every dll is included by default, and what I wanted to use was the System.Web.HttpUtility.UrlEncode() function. Here is the magic that makes it work:link.

In short, if you are a programmer you would normall put an Imports System.HttpUtilty at the top and then use the function with HttpUtility.UrlEncode()

If you do this, the Intellisense (when the code completes the strings for you) will kick in. This is how you know if it is working.

Basic Steps:

  1. Click menu Report->Report Properties
    1. what? no report menu? Ok – right mouse click in the area just outside the tablix and choose Report Properties
  2. Click References on the Left, then Add at the top and the … button to get a list
  3. Scroll down and include System.Web, click OK, then OK again
  4. Put a place holder in any cell by R-Click->Create Placeholder
  5. Click, THEN Right Mouse click on the placeholder and choose Placeholder Properties
    1. General Tab fill in the name, the text to show (might be an expression of =”my text here” and tooltip
    2. Action Tab: Choose “Goto URL” and fill the function listed below
    3. Format your text
  6. Click OK twice
  7. Click Build-Build Project_Name to see if it worked

[vb]

="mailto:me@mycompany.com?subject=" & System.Web.HttpUtility.UrlEncode("Topic:" & Fields!Topics_ID.Value & " " & Fields!TopicText.Value).ToString.Replace("+"," ") & "&body=" & System.Web.HttpUtility.UrlEncode("Q: " & Fields!Topics_ID.Value & "." & Fields!Questions_ID.Value & " " & Fields!QuestionText.Value & vbCrLf & vbCrLf).ToString.Replace("+"," ")

[/vb]

Report Services & SQL Server install and set up for use with Bentley AutoPLANT

I am using report services to publish my reports instead of using Crystal Reports for many Bentley AutoPLANT items. Here is my journey over the past couple of weeks:

Install the Tools

If you set up SQL Express with Advanced Services – this is 2008 (download link) – not 2008 R2 (download link). If you are going to back up a Bentley AutoPLANT database – you can NOT restore a 2008 R2 database to a 2008 server, you have to use another method.

  • To make reports, you can use Business Intelligence which comes with SQL 2008 Express with Advanced Services (thanks Geordie Guenther!)
  • A co-worker recommended a really easy tool to make reports that got me 90% of the way (but not advanced) called Microsoft Report Builder 2.0 (there is a 3.0 but we are still in a 2008 SQL Server world). I really like Bus. Intell because it is like Visual Studio and you can do much more.

Get Familiar with things:

Changing the server name or location of a linked Table in MS Access

Why is this so confusing? It isn’t but it is quite convoluded on how to get this done. I had to do this because the connections to my SQL Express database had to have the port name in the connection.

So on my local machine, I could open up the MS Access file with tables linked to the computer named CDC-EBLEY2-7\SQLEXPRESS, but if you were to open the file from someone else’s computer, an Connection failed: SQL State: ‘01000’ SQL Server Error 67 SQL Server Error: 17 (blah blah blah) resulted. Why? Because I enabled my server to be connected to via TCP/IP over port 1433 – which are the defaults, but it has to be explicitly set in the connection string of every table. What I needed was to connect to CDC-EBLEY2-7,1433\SQLEXPRESS so others could open the MS Access file and NOT get errors. This is strange, because 1433 is the default port any way – but it works.

Each one of my tables is not through an ODBC setup but each table has it’s own string which needs to be updated

Lets get some info first. Open notepad and get ready to copy the DESCRIPTION of the linked table’s construction. Here’s how

  1. Open MS Access
  2. Right mouse click on a table that used to work or you are sure does work and choose “Design View”. This does not make sense for a linked table, but bear with me.
  3. Select Yes on the warning screen to continue
  4. If, on the right, there is no properties window for the table, on the Ribbon (Access 2010) click Property Sheet
  5. This reveals a Description property – copy all that it is in that property it and paste it into Notepad or somewhere for later.
  6. Click the External Data in the ribbon and choose ‘Linked Table Manager’
    1. CLick the Always prompt for a new location check box – this is a complicated way to ask the user if (s)he wasts to change the connection info
    2. Click Select All button or choose the tables you wish to update with check marks
    3. Click OK
  7. A dialog comes up. Click New
    1. Choose SQL Server as your driver
    2. CLick the Advanced Button
    3. Paste all that stuff in Notepad
      1. EXCEPT REMOVE the TABLE=… stuff up to the next semicolon.
      2. change the server name to be CDC-EBLEY2-7,1433 where 1433 in my example is the port n
      3. Click OK
    4. It then prompts you to save all this into a file for later. Chooose a spot in My Documents in a connections folder – or better yet on a network location for other’s to use later
    5. Click OK a couple of times
    6. Now Access will replace all your tables with the new DSN (connection details) string.

 

Using Smart Youtube Plugin

Adding to the sidebar? See the first set of instructions. Adding to a post (article) or a page? See the 2nd set of instructions.

Common info

For you – simply insert a normal weblink for a youtube video. For example, an seminar promo video for a seminar called “IMPRESSION” has a youtube link of :

http://www.youtube.com/watch?v=w5jIMphTm9w

Where it says below to change http to httpv – there are MORE options and they are listed at the following link – scroll down about 1/2 way cause the stuff at the top is promo fluff.

http://www.prelovac.com/vladimir/wordpress-plugins/smart-youtube

First – what NOT to click on or change – I warned you

One of my customers clicked on the obvious link – Smart Youtube Settings  on the left of the wordpress admin section. Don’t do it – you will be sorry (you have been warned 😉 )! This is for geeks only … but then why do they make it so tempting to click on? I don’t know – one of life’s ironies. Simply do follow the instructions below and you will be better off – get a geek to fiddle with the Smart Youtube Settings area. 🙂

Sidebar additions:

To add a Smart Youtube link to your sidebar or long vertical area on the right of all your pages (“Primary Sidebar”) you would do the steps below. Remember – you might have a few sidebars (like a blog sidebar) you want to add the video to – do these steps for all sidebars.

  1. log into your site’s admin or back end http://www.yoursite.com/wp-admin
  2. on the far left, click the menu Appearance->Widgets
  3. using find, or your eyes, look for “Smart Youtube”. You have scroll down a bit
  4. click “Add”
  5. it now brings you to a place that you have to paste the link like in the email bel
    1. add a title that appears ABOVE the video in the sidebar
    2. THE TRICKY BIT & MAGIC BIT – CHANGE THE http to httpv – so your link will be httpv://www.youtube.com/watch?v=w5jIMphTm9w (you have to edit/force it to be this)
    3. Choose the radio button (round check mark like thing) beside “Leadershift Blog, Category”
    4. on the right of this text, use the pulldown marked –Select– and choose the order in which you want it to appear – I think you want #1 (top) so your visitors will see it.
  6. click “Save Widget” at the bottom
  7. If you want finer control over things – go to the webpage below, scroll down to “Installation and Usage” and look at the options that this plugin has. You can control the size, the quality etc. of what is shown. Click this link (same link as given above) to see more options (scroll 1/2 way down first)

ALWAYS preview your work – check it out on all pages that have that sidebar (remeber not all links/menus etc. have the same sidebar).

NOTE – TEACHING MOMENT: – you can have different sidebars for different parts of your site. So when you get into teaching mode, and have blogs/categories for them, you could provide special links for your students – which you would NOT include for your main visitors whom you are trying to get hooked.

Adding to an article (post or page)

  1. log into your back end of your website http://www.yoursite.com/wp-admin
  2. go to the article where you want to insert it
  3. add a link to the video
    1. so first, type some text like “IMPRESSION Video” (You won’t see this text anyways)
    2. next highlight the above phrase
    3. click the chain links button to make a link
  4. paste your youtube link above into the box labelled “URL”
  5. THE TRICKY BIT & MAGIC BIT – CHANGE THE http to httpv – so your link will be httpv://www.youtube.com/watch?v=w5jIMphTm9w
  6. click Link button at the bottom
  7. If you want finer control over things – go to the webpage below, scroll down to “Installation and Usage” and look at the options that this plugin has. You can control the size, the quality etc. of what is shown. Click this link (same link as given above) to see more options (scroll 1/2 way down first)

One Report, Multiple Queries

I am a die hard Filemaker user/designer. For MS Access – building ONE report that can be “fed” with many different SQL or queries seems like a straight forward idea – but it isn’t. Here is how to get around it … kind of…

This is the site that gave me the goods – there is another, but that was too long ago.

Basically – you have buttons NOT on the current form (this is unfortunate)

  • close the form of interest
  • reopen the form with the DoCmd but with arguments
  • The value of the argument is then used in the Report_Open event – THIS is where you set your query or record source SQL.

Example: A navigation form contains 2 buttons – one for query A and another for query B. We are trying to open a Report called “Questions Test”

[vb]

Private Sub NavigationButton24_Click()
DoCmd.Close acReport, "Questions Test", acSaveYes
DoCmd.OpenReport "Questions Test", acViewReport, , , , ""
End Sub

Private Sub NavigationButton30_Click()
DoCmd.Close acReport, "Questions Test", acSaveYes
DoCmd.OpenReport "Questions Test", acViewReport, , , , "Not Answered"
End Sub

[/vb]
[vb]

Private Sub Report_Open(Cancel As Integer)

If IsNull(Me.OpenArgs) Then
‘Me.RecordSource = Me.OpenArgs
    Else
        If Me.OpenArgs = "Not Answered" Then
            Me.RecordSource = "qryQuestionsNotAnswered"
        Else
            Me.RecordSource = "qryQuestionsAll"
        End If
    End If

End Sub

[/vb]

Never include your email in an article – or anyone else’s email either if you can

We often write email addresses into our email articles online whether it is our blog, comments or website pages we build. Web-bots (Robots) scour web pages and those that link to them 24/7 looking for email addresses and use them to spam us and others. That is the main reason.

Other reasons are if you put a link to your email and people click on it – what if they are hotmail or yahoo or gmail users? On a PC, it will by default start up Outlook Express (older computers) or Outlook which usually isn’t set up for these types of users. Mac will start up “Mail” which again might not be set up for our all-online friends. Will these customers figure it is not worth contacting you because it is too much hassle or they don’t have time right ow to log in to their online service? Having a link to a page/link called “Contact Us” instead of your email address allows seamless integration and natural navigation to people contacting you.

For the same reasons – do not include other people’s email addresses either (the ‘golden rule’ applies for you and your friends). Their spam count will go up as well.

So what do we do instead?

a) make a Contact Me or Contact Us page with an online form (continued below)

b) if you HAVE TO (like you should on your linked in summary) use me.at.mycompany.com or me – at – mycompany.com form of your email address. Yes, it can be simply scraped but using ~ or # or * as the symbols, it is less likely to get picked up

Make a contact me page on your website (all webpage makers, Joomla or WordPress have this pre-installed), and link to that. Always put a link with “Contact Us” which is the standard for almost all websites. For example, all my customers who fill their own content in online, all have been set up with a contact-us page. That is a form in which you can enter your information / email / request with all the reasons for your customers to contact you. If you have your local web-geek doing this for you or you are doing it yourself, please ensure (s)he puts a CAPTCHA on the page as well so the computer knows it is a human and not a computer. I have one on my site with random simple math the person has to do, others have a word phrase that has to be entered etc.

How do get the link to this Contact Us page to copy/paste in? The easy way is to open a new internet tab or window, click on the contact us link on that page and copy the link all the way from http to the end. Then paste it into your article using the link button. It is that simple. If you have WordPress or Joomla there is a search box – just type in “contact” (assuming your link/article has the word ‘contact’ in it) and wait … up it comes in the list. Click on it and you are linked.

Always test any pages that have links so you stay looking professional.

I am always looking out for your best interest – keep these things in mind and avoid a little less spam and a few more contacts from customers or friends.

iOS app image size matrix for projects. Track your sizes using this tool.

This is for a personal project a friend and I are doing – there are soooo many iterations of graphics that we need because we want things to look crisp. The intent for the table below to be copy& pasted and a column exists next to each resolution for a check mark to put beside each completed task. Keeping track of all this was almost a nightmare – I know this is specific to our project, but I trust this is useful for you too – copy and paste away.

Please see naming conventions for this project at the end of this article.

Rotation iPhone 3″ iPhone Retina 3″ iPhone 5 (4″) iPad/ Mini * iPadRetina*
Cover Portrait Lscp 90 deg R 480×320 960×640 640×1156 768 x 1004 1536 x 2008
Cover LandScape landscape 1024 x 748 2048 x 1496
Guts/Main Page landscape 480×320 980×640 1136×640 1024×768 2048×1536
buttons/segmented Controls landscape 52 x 44 104 x 88 104 x 88 52 x 44 104 x 88
default camera image landscape same as guts same as guts same as guts same as guts same as guts
ring and check image 300 x 300 300 x 300 300 x 300 300 x 300 300 x 300
appIcon 72 x 72px 144 x 144px 144 x 144px 72 x 72px 144 x 144px
iTunesArtwork n/a 512 x 512 1024 x 1024 1024 x 1024 512 x 512 1024 x 1024
iPhone: settings/spotlight n/a 29 x 29 58 x 58
iPad: settings** n/a 29 x 29 58 x 58
iPad:spotlight n/a 50 x 50 100 x100

NOTE: iPads and iPhones do NOT have the same aspect ratios – so you graphics will be stretched and interpolated by the device’s software/hardware.

Links

Naming Conventions used in this project

All retina images MUST be names @2x at the end for this project. So myImage.png would be myImage@2x.png for this project. For the 4″ retina screen please put -568h@2x at the end.

iPad main page images “page05_ipad.png” and “page05_ipad@2x.png” seems to be close to what you have now.
iPad masks: “page05_ipad_Pic_Insert.png” and “page05_ipad_Pic_Insert@2x.png”

iPhone main pages: “page03_480x320.png”,”page03_480x320@2x.png” and “page03_480x320-568h@2x.png”

iPhone masks: “page03_pic_insert_480x320.png”, “page03_pic_insert_480x320@2x.png” and “page03_pic_insert_480x320-568h@2x.png”

Cover pages for this project should be named like you have done the others, but lets call it Cover WWWxHHH.png, Cover WWWxHHH@2x.png and Cover WWWxHHH-568@2x.png . Cover pages MUST be rotated 90 degrees Right (clockwise)

There are 2 folders that these are dumped in “SmallImages” (iPhone) and “LargeImages” (iPad)

Rotation iPhone 3″ iPhone Retina 3″ iPhone 5 (4″) iPad/ Mini * iPadRetina*
Cover Portrait Lscp 90 deg R Cover iPhone Cover iPhone@2x Cover iPhone-568h@2x Cover iPad90 Cover iPad90@2x
Cover LandScape landscape Cover iPad Cover iPad@2x
Guts/Main Page landscape page03_iPhone page03_iPhone@2x page03_iPhone-568h@2x page03_ipad page03_ipad@2x
Guts Masks page03_pic_insert_iPhone page03_pic_insert_iPhone@2x page03_pic_insert_iPhone-568h@2x page03_ipad_Pic_Insert page03_ipad_Pic_Insert@2x
last main Page
buttons/segmented Controls landscape
   – book book_icon book_icon@2x n/a n/a n/a
   – camera camera_icon 100 x 88 n/a n/a n/a
   – take pic 50 x 44 100 x 88 n/a n/a n/a
   – lock LockIconClosed LockIconClosed@2x n/a n/a n/a
   – correct incorrect_ipad incorrect_ipad@2x n/a n/a n/a
   – incorect incorrect_ipad incorrect_ipad@2x n/a n/a n/a
default camera image landscape Insert_Instructions_iphone Insert_Instructions_iphone@2x Insert_Instructions_iphone-568h@2x Insert_Instructions_ipad Insert_Instructions_ipad@2x
ring and check image correct_green_iphone correct_green_iphone@2x n/a n/a n/a
appIcon Icon.png Icon@2x.png n/a Icon-72.png Icon-72@2x.png
iTunesArtwork n/a iTunesArtwork iTunesArtwork@2x n/a n/a n/a
iPhone: settings/spotlight n/a Icon-Small.png Icon-Small@2x.png
iPad: settings** n/a Icon-Small.png Icon-Small@2x.png
iPad:spotlight n/a Icon-Small-50.png Icon-Small-50@2x.png
orange text means I don’t have a nice name yet
Put iPhone images in a directory called SmallImages and iPad images in a directory called LargeImages

Notes

Copy/Paste from apple: For iPad launch images, do not include the status bar region. Create launch images of these sizes (most iPad apps should supply a launch image for each orientation)

** Apple trims off 1px (low res) or 2px (retina) on each side for drop shadow

NOTE: Mathematically – always reduce your graphics 50% or more – never resize up and never resize between 50% and 99%. There are mathematical reasons for this … it is called aliasing. Apple does a good job at re-rendering graphics, by why not do our designs with a little understanding while we are about it 🙂

Installing a Radius Server with MySQL on Mac OS X 10.7 – Mountain Lion


This is a bit of a pain but I got it running. Some

basics before you start. Links are at the

bottom for installation tips.