Stream

Join this community to post or comment

Lionel D

Everything Else!  - 
 
Lionel D originally shared:
 
Haven't laughed this hard in a while.

Via https://xkcd.com/327/
15
1
Louis Maresca's profile photoBill Brandt's profile photo
 
Haha thanks for sharing Lionel!
Add a comment...

James Coleman

Episode Discussion  - 
 
iOS's text editor can do rich text if you change it from plain to attributed text. You may have to write controls to change bold, font, underline, and all of that... But it exists.
2
Add a comment...

James Coleman

Episode Discussion  - 
 
The guest who is teaching Objective-C is teaching methods I don't exactly agree with.

Using macros to store keys.
Using global variables to store notes.
Using NSUserDefaults to store data for the app.

The issue with macros is all they do is tell the compiler, wherever you see this variable, replace with what's here. So basically, every time you use the key, you make another copy of the key in binary. What I would use instead of macros is a constant variable:
NSString * const kMyKey =@"Key";

The issue with using global variables is that they are not contained within a class and the only reason you would ever want to use a global variable is if you need the data to stay across all new instances of a class. Or if you want to make a class so that it can have one instance that can be retrieved via a class method. This is called a singleton http://www.idev101.com/code/Objective-C/singletons.html

The issue with using NSUserDefaults to store persistent data is that it's made for preferences and not data and you have to do what the guest did making it an NSData object. What I suggest doing for a notes app is just using the NSArray's built in method writeToFile https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSArray_Class/index.html#//apple_ref/occ/instm/NSArray/writeToFile%3Aatomically%3A using this will allow you to store to an file within the file system provided to your app. On an iOS device, that would be the Documents folder provided which can be found via [@"~/Documents/" stringByExpandingTildeInPath]. You can place the name of the file after the last / to get the path for the file under the documents folder ready to be written to.

I am a long time Objective-C guy, been using it for years now since Objective-C 1.0 and still write in 1.0 syntax.
1
Add a comment...

Patrick Delahanty

Episode Discussion  - 
 
Padre and I talk about robotic algorithms, a Windows 10 password leak via Wi-Fi Sense, and then I gives you a sneak peek of the TWiT API!
Coding 101 74 | TWiT.TV
4
Patrick Delahanty's profile photoJeff Brand's profile photo
2 comments
 
+Patrick Delahanty , I reported this earlier but I imagine you've been swamped with the new website/API.. The link to the docs provided on the 3scale page (https://twit-tv.3scale.net/) has an invalid link back to the docs. I believe that link is to your own profile on 3scale.

Next, I'm trying to retrieve information by the <endpoint>/<id> format but receive a 404 error. Perhaps it's an error with the proxy url rules. Case in point:

https://twit.tv/api/v1.0/episodes/63696

... and yes, the rest of the request is right since it works without the ID at the end.

What am I doing wrong?
Add a comment...

Neil Balch

General Coding Questions  - 
 
Does anyone know what the benefits of installed apps on windows?  Putty for windows is an app, but it doesn't install.  It runs in realtime.  Are there more permissions allowed when you install a program?
1
Louis Maresca's profile photoNeil Balch's profile photo
4 comments
 
+Louis Maresca I am not really building an app just yet, (Sorry to let you all down) I am mostly just interested in knowing why because I was getting really curious while using a Mac on a trip.

But.  I will ask you, for an app that would query information from the web, some Google and Social Media APIs and store a database of some kind (My SQL maybe?) locally on the machine and interact with a Ruby on Rails Back end, would the "Windows Installer" or the "ClickOnce" approach be more suitable?  Also, would .Net ClickOnce still use C# the same way you demonstrated in the Santa's Little Helper project?
Add a comment...

Neil Balch

Episode Discussion  - 
 
+Fr. Robert Ballecer, SJ I saw you had a VM on your Windows computer for OSX.  How did you get that and what did you use to obtain the OS?

Macs are quite expensive for me and I would like to tinker with Xcode.
1
Jeff Brand's profile photoLee Crocker's profile photo
4 comments
 
Apple claims that Hackintoshes are illegal, but they really have no legal leg to stand on. Tying agreements are illegal per se under antitrust law, even for non-monopoly companies. That's why Epson can't stop you from using off-brand ink, Gillette can't stop you from using other razor blades. Apple's claim that they can stop you from using OSX on non-Apple hardware is hot air. I really hope someone sues over it who isn't doing other dubious things like Psystar was so we can have a good court ruling.
Add a comment...

Steven Erickson

Episode Discussion  - 
 
Does anybody have the link to the Medium article that Lou referenced in the last episode?
2
Louis Maresca's profile photoSteven Erickson's profile photo
2 comments
 
Thanks Lou!
Add a comment...

Jeff Brand

Share Your Code!  - 
 
OK, PHP coders - here's some sample code for the TWiT.tv API. The wrapper library isn't done yet but the examples will help you code warriors get started.

I want to stress that the example code is bare-bones and meant for teaching purposes. Any production implementation would see the code broken up into a class with 5-7 methods at least.

That said, the examples are (CC) Attribution Share-Alike so use it with your Coding 101 skills to make it better.

Feel free to use GitHub to submit Issues for additional how-to's as Issues and submit your own samples as Pull Requests.

/cc +Fr. Robert Ballecer, SJ , +Louis Maresca , +Patrick Delahanty 
twit-tv-api - TWiT.TV API wrapper library in PHP
1
Add a comment...

Donald Burr

Episode Discussion  - 
 
Great to see you guys starting on an iOS segment.

FYI, currently you must be a member of the Apple Developer program ($99/year) in order to build and run your code on an actual iOS device. (you can run code on the iOS Simulator without needing to pay)

HOWEVER, when Xcode 7 comes out later this fall, that will change. With Xcode 7, anybody will be able to build and run code on actual iOS devices, so long as the device(s) are registered (i.e. logged into iCloud, etc.) with your Apple ID. (Note that if you do want to sell your apps in the App Store, you will need to join the developer program.)

More here: http://9to5mac.com/2015/06/10/xcode-7-allows-anyone-to-download-build-and-sideload-ios-apps-for-free/
Apple has changed its policy regarding permissions required to build and run apps on devices. Until now, Apple required users to pay $99/year to become a member of Apple's Developer Program in orde...
3
Add a comment...

Ubaid azm

Everything Else!  - 
 
<!-- bla bla bla -->     <<== will be gone if i execute perl pi -e ’s/\<\!-[^\>]+--\>//g’ *.txt

if i tried to remove strings from line...:

this will be gone  <<==perl -pi -e ’s/this[^gone]+gone//g’ *.txt 
does not work... help me please... how do i do this..
1
Joe Maruschek's profile photoUbaid azm's profile photo
2 comments
 
thank you soo much +Joe Maruschek 
Add a comment...

Lionel D

Everything Else!  - 
 
Share Tweet WhatsApp Mail Cascading Style Sheets (CSS) is a stylesheet language that defines how the content on a web page is to be displayed with colors, borders, fonts, backgrounds etc. Inspired by this Reddit thread, today’s post showcases 34 CSS puns that’ll put a smile on every web designer’s face. The interesting bit is that even […]
7
2
Louis Maresca's profile photoThomas Wolf (The0xD8)'s profile photoВасилий Бахарев's profile photo
 
LoL! my margin with my wife is in the negatives. :)
Add a comment...

About this community

Join Father Robert Ballecer and Louis Maresca on Coding 101, a weekly instructional, project-oriented programming show with appeal for beginning to intermediate programmers. Using a combination of classroom-style teaching, guest programmers, and special interest segments, Coding 101 will offer beginner, intermediate and "applied" programming topics within several interchangeable modules. Learn programming languages such as Java, C++, Visual Basic, and more! Records live every Monday at 2:30pm PT / 4:30pm ET.

Louis Maresca
moderator

Episode Discussion  - 
 
Come Join is Live today at 2:30 PM PST as +Fr. Robert Ballecer, SJ​and I talk tech, code, teaching and influences on +TWiT Coding 101​ with +Scott Hanselman​ . 
6
mike klaene's profile photoOmega Nine's profile photo
2 comments
 
Yay no more iOS.  
Add a comment...

James Coleman

Episode Discussion  - 
 
Another note on Objective-C. If you want to reference a class in a header file, you can use @class Class, Class2; to just say it exists, then import the header file in the actual code. The reason you do not want to import the header file in the header file is you can cause issues for other classes which import that header file.
1
Add a comment...

James Hughes

General Coding Questions  - 
 
I posted this on KH, but I think it really belongs here. I'm trying to build my own filament resetter for my Da Vinci 3d printer. Here's my problem:

 I'm trying to upload the sketch that resets the cartridge to my arduino uno and keep getting an error message that it's not in sync.. I've tried changing out the pin connections and everything else I can think of.

Here is the code that is returned (I'm on a Mac if that makes any difference, and I've already replaced the FTDI drivers.):

Sketch uses 1,030 bytes (3%) of program storage space. Maximum is 28,672 bytes.
Global variables use 9 bytes (0%) of dynamic memory, leaving 2,039 bytes for local variables. Maximum is 2,048 bytes.
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega328p -carduino -P/dev/cu.usbserial-AI02OD5P -b115200 -D -Uflash:w:/var/folders/zt/07g4_7yd3wz5kxt73gtlkzbw0000gp/T/build8381775075535385418.tmp/Blink.cpp.hex:i 

avrdude: Version 6.0.1, compiled on Apr 14 2015 at 16:30:25
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
         User configuration file is "/Users/teacher/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/cu.usbserial-AI02OD5P
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x20
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xe0
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xa0
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x30
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20

avrdude done.  Thank you. 
2
Lee Crocker's profile photoJames Hughes's profile photo
11 comments
 
Thanks +Lee Crocker​, it turns out that I was selecting the wrong board from the list. I have the arduino pro mini and in the list I was picking the mini. 
Add a comment...

Donald Burr

Episode Discussion  - 
 
Just started watching the most recent iOS segment. I realize it's probably pre-recorded so you guys may not have had the most up-to-date information, so I just wanted to mention a few quick corrections.

* As of June 2015, the Apple developer programs are now united. A single $99/year fee will allow you to develop and sell apps for both iOS AND OS X.
* I mentioned this before in another post, but maybe you didn't catch it. When Xcode 7 comes out later this fall (along with iOS 9) you will no longer need to pay for the Developer Program to test on YOUR OWN DEVICES. So long as a device is signed in to iCloud with YOUR Apple ID, you will be able to load and run code on it without having to join the paid developer program. You WILL still need to join the paid program, however, if you want to distribute apps to beta testers (other than yourself), or to sell it in the  App Store.
3
Louis Maresca's profile photoDennis A. Deschamps (Drmacintosh)'s profile photo
2 comments
 
I would like to find out more about Swift replacing Objective-C and Open Source talked about @ WWDC 2015 
Add a comment...

Jeff Brand

Episode Discussion  - 
 
Following my mini adventure in Python with +Rudy Trujillo , I reviewed some of the transcript for the Python intro episode of Coding 101, #11.

I have a few questions that perhaps +Fr. Robert Ballecer, SJ or others could help answer.

1. In that track, you favored Python 2.x. For someone learning today, is that still the correct choice? I've ready that Python 2.x development has stopped which leads me to think 3.x is the way to go.

2. Google uses Python heavily. Much of their support sites still use .py extensions in their URLs. I've also heard that aspiring Googlers would do well to learn Python over any other scripting language. What's the reason for this? It seems like it has much less legacy baggage that PHP, Perl, or Bash has. The import system also seems to keep things lean and mean so it may be a matter of performance, flexibility as a command-line or web backend scripting language, or a personal preference by early Googlers.

3. How well does Python bridge the gap from scripting to bytecode-compiled executable? I've seen .py and .pyc files used by software like Sublime Text 2 and believe that that entire IDE is written in it. I know tools like py2exe exist. Does this make Python a viable alternative for development of actual desktop apps instead of C++, C#, VB.NET, or even Java? It might actually be easier to deploy than apps that depend on either the .NET Framework or JRE.
2
Chris Bickhaus's profile photoRudy Trujillo's profile photo
2 comments
 
My decision was to load and use Python 3 only from past experience in other areas where earlier versions were always phased out for the new.

 I have used the py2exe successfully and need to setup up some sort of code drop box so the old code can be dropped into it and pop out as Python3, only because I tend to forget how to run it and where I put the code:)
Add a comment...

Donald Burr

Episode Discussion  - 
 
BTW Someone has managed to add a sort of "Playground" like functionality to Objective-C. It's kind of a hack, but it works. :)  https://github.com/krzysztofzablocki/KZPlayground
KZPlayground - Playgrounds for Objective-C
1
Add a comment...

Rudy Trujillo

General Coding Questions  - 
 
Can python redirect a listing of a directory into a file either txt or csv?
Looking for something similar to unix or DOS where you can just type something like:
dir > listing.txt
1
Rudy Trujillo's profile photoJeff Brand's profile photo
18 comments
 
It's my pleasure. I write code for a living, largely fueled by an interest in problem solving and understanding how things work. This was a great first exercise by which to learn Python and I'm glad I could share the results.
Add a comment...

Stewart Gondo

Episode Discussion  - 
 
This is from my son Aaron.  It might be fun to sometimes spend a few minutes on Minecraft coding mods.  He's sure that a lot of kids would like to see some of the really neat ones & it might get more kids interested in coding.
24 votes  -  votes visible to Public
Good idea! :-)
88%
Not so good :-(
13%
2
Add a comment...