Updates from June, 2015 Toggle Comment Threads | Keyboard Shortcuts

  • Jay Versluis 9:33 am on June 15, 2015 Permalink | Reply
    Tags: , ,   

    Categories: Commodore ( 41 )   

    How to split a long string into separate words in Commodore BASIC 

    Here’s a quick word splitter routine for CBM BASIC. It takes phrase and “explodes” all words into an array, removing spaces. Feel free to adopt it for your own needs.

    10 rem word splitter
    20 rem splits a long phrase into words at a space
    30 input "tell me something";a$
    40 rem clear current array of words
    50 for i=0 to 10: wd$(i)="": next: wd=1
    60 rem detect spaces
    70 for i=1 to len(a$)
    80 wd$(0)=mid$(a$,i,1)
    90 if wd$(0)=" " then wd=wd+1: next
    100 wd$(wd)=wd$(wd)+wd$(0): next
    110 print
    120 rem print all words
    130 for i=1 to 10
    140 if wd$(i)="" then 160
    150 print wd$(i)
    160 next
    

    Line 50 clears an array of 10 words called WD$(n). We also setup a word counter called WD. So in this example we can only detect a maximum of ten words. If you need more, you must DIM the array first.

    Lines 70 loops through all characters in our phrase. We make use of the first element in our array WD$(0) to store each single character. If it’s a space, we’ll increase the word counter and move on to the next character. If it’s not (line 80), then we’ll add this character to the current word which is stored in WD$(WD).

    The rest of the code simply prints each word on a new line to see our handy work.





     
  • Jay Versluis 8:57 am on June 2, 2015 Permalink | Reply
    Tags: ,   

    Categories: macOS ( 37 )   

    How to kill the “accept incoming connections” dialogue on your Mac forever 

    Screen Shot 2015-06-02 at 08.28.12Have you ever come across the above dialogue, asking if you’d like to “accept incoming network connections” on your Mac? It’s caused by the Firewall and it’s meant to be helpful. Because if you have an app that needs incoming network connections all the time, you can just add them to the Firewall rules (under System Preferences – Security – Firewall).

    But of course, it doesn’t always work. Some apps get updated and this message starts appearing out of the blue, no matter if it hasn’t happened before or if you’ve manually added said app to the Firewall rules a thousand times already. God only knows whatever is upsetting our precious operating system, but it’s driving us all nuts.

    Help is at hand: turns out these messages are caused by some certificate issue I genuinely do not care to know about – nor should I have to. Here’s a “relatively easy” way to fix it once and for all. There are other ways which involve more typing, or switching off the Firewall altogether, but the following is by far the quickest option in my opinion:

    • open a Finder window and navigate to the app in question (usually in Applications, potentially in a subfolder)
    • open a Terminal Session (under Applications – Utilities – Terminal)
    • type cd followed by a space
    • from the Finder window, drag the folder in which your app resides into the Terminal window
    • hit return (this will put you into the same directory as your app)
    • type the following scary line of code:
    sudo codesign --force --deep --sign - ./YourApp.app
    

    Replace “YourApp.app” with the actual name of the app, including the .app extension. You will be prompted for your password and in a few moments you should see a message such as “replacing existing signature”. With this code your Mac will have created a self-signed ad-hoc certificate, re-signing the app.

    Don’t worry if this doesn’t sound English, all it means is that we’re telling the operating system (or rather, Keychain Access) that “the Administrator says it’s OK to trust this app”.

    Now launch your app again. Don’t be dismayed when you see that annoying “accept incoming connections” dialogue again – it’ll be the last time. Select “allow” and you’re done with this – hopefully for good. Try it out by closing your app and restart it again. Celebrate about not seeing that message again.

    Should this trick not work, leave out the –deep switch, and make sure your file does not have a trailing slash. Oh, and preface any spaces in the file name with a backslash.

    Kudos to ahall over on Stack Exchange for this tip! It’s made me a much happier person again 🙂





     
    • wpguru.co.uk@vickishome.com 9:09 am on February 24, 2017 Permalink | Reply

      Thank you!! Thank you!! This has been plaguing me for months. I could not find the answer anywhere else. I just tried it on two of my apps, and now they load without that annoying popup!

c
Compose new post
j
Next post/Next comment
k
Previous post/Previous comment
r
Reply
e
Edit
o
Show/Hide comments
t
Go to top
l
Go to login
h
Show/Hide help
shift + esc
Cancel