Jump to content

Contribution and Development


Guest BuildSmart
 Share

3 posts in this topic

Recommended Posts

Guest BuildSmart

Financial contribution while a nice idea have proven that they do not work well in the x86 community.

 

The main reason for failure is expectation, the contributor (you) has expectations of specific results, as well as the contributee (the programmer) may have financial expectations and thus the downfall begins.

 

For example, donation are received for a project that requires the purchase of a laptop to develop and resolve a hardware issue related to it but after more than a year the problem is still unresolved and the donators are feeling jilted because along with the acceptance of the donation to purchase the required hardware to resolve the problem, expectations/promises were implied/made regarding results that have not been met.

 

Donations themselves are a nice gesture if it is given without expectations or strings attached but rather as a method of showing support to the donatee who is attempting to resolve whatever the issue is.

 

 

 

 

I am proposing a different approach, rather than tie someone up for days writing an entire app as part of a collective work I thought it might be better to simplify the coding requirements to something more manageable and less time consuming on the potential coders so that the project doesn't overwhelm their time.

 

I'm looking for code contributors, people who are interested in advancement for the betterment of the community in general, this is not some fancy group like TOH where you have to be friends and be in the click and don't trust anyone else or fail to provide the source openly to those not part of the group.

 

You wont get any glory and you probably wont get much credit from the community (they don't thank you much but are quick to {censored} about a bug or flaw) but you will be listed as a contributor of the project and it provides an opportunity for you to give back to the community without devoting large amounts of your time.

 

I'ts nice if you want to jump on board but you require some programming knowledge/experience and in most cases what is asked of you will require little of your time unless you have a project you wish to spearhead.

 

Development in this manner means the contributor doesn't need to be a seasoned programmer, just someone who can code the requirement in a reasonable amount of time and work on the code on their own.

 

If you are proposing a project, you are the project coordinator, this does not give you power over anyone else, only that you are responsible for the project so seeking assistance in the way of function contributions frees you to spend more time on the more important or difficult portions of your project.

 

If you are not the project coordinator your participation does not require you to write an entire app, driver or daemon from scratch, in most cases it would require nothing more than a simple routine or two so by spreading out some of the work load, development is shared reducing overall development time which brings the end-product to the community that much faster.

 

For example, given the following Info.plist file

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Example</key>
<dict>
	<key>Config</key>
	<dict>
		<key>setting1</key>
		<false/>
		<key>setting2</key>
		<true/>
		<key>setting3</key>
		<string>0x109a8086</string>
	</dict>
</dict>
</dict>
</plist>

you might be asked to write a small app that reads in this Info.plist file and displays the results for setting1, setting2 and setting3 based on the following base code

/*
This is a base template for CLI project work.
configplist.c (you can compile this with 'gcc -o configplist configplist.c')
The date.
Your Name.
Project Name.
Function SubName.
*/

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <strings.h>

#define INFO_PLIST "/TESTPLIST/Info.plist"

int main(int argc, char **argv)
{
bool setting1 = NULL, setting2 = NULL;
char *setting3 = '';

/* your code goes here */

printf("setting1: %s\n", (setting1 == 1) ? "true":"false");
printf("setting2: %s\n", (setting2 == 1) ? "true":"false");
printf("setting3: %s\n", setting3);
return 0;
}

with as little fluff and showmanship as possible.

 

While this is not complicated, seems almost pointless given that it's an easy task, it does show that you understand what is being asked of you and it is a good example of symbiotic contributing where your required participation time to the project would be less than 1 hour (max) allowing the main programmer to focus on the more complicated portions of the project, so, given the Info.plist file and the base source file, can you write an app that displays all 3 setting and that each time the app is run, it switches the state of setting2 after displaying it's current state?

 

If someone has submitted a solution, you can still submit one if your method/approach is different, this would allow discussion on a better solution and perhaps allow the submitters to colaborate and come up with a joint solution that is better than the individual submissions while still not requiring a large amount of their time.

 

(header for project)

/*
This is a base template for CLI project work.
configplist.c (you can compile this with 'gcc -o configplist configplist.c')
10/03/08.
Lucifer Savant
PLIST-CONFIG
CONFIG-STATUS
*/

  • Guidelines
  • You can change the hard-code path to the Info.plist file. (I like to use /TESTPLIST/Info.plist)
  • You can use XCode for the project but not required. (for small things I like BBEdit and TextWrangler)
  • Keep code simple. (why waste time on the unnecessary fluff)
  • Comment your work. (others will read it)
  • Test your work. (goes without saying)

Link to comment
Share on other sites

  • 4 weeks later...

Why bother with a compiled language?

#!/usr/bin/env python

# Import the Python modules needed
import os, sys, plistlib

# Parse the plist file or give a warning if no plist file was specified
try:
plist = plistlib.readPlist(sys.argv[1])
except:
print "Usage:", sys.argv[0], "/path/to/file.plist"
exit(1)

# Print the settings
print ("setting1: %s" % (plist.Example.Config.setting1))
print ("setting2: %s" % (plist.Example.Config.setting2))
print ("setting3: %s" % (plist.Example.Config.setting3))

# Toggle setting2
if plist.Example.Config.setting2 == True:
plist.Example.Config.setting2 = False
elif plist.Example.Config.setting2 == False:
plist.Example.Config.setting2 = True

# Write changed plist back to the file
plistlib.writePlist(plist, sys.argv[1])

Note that this has not been optimized for minimal number of lines, but for easiest readability of the code.

Link to comment
Share on other sites

  • 2 weeks later...
Guest BuildSmart
Why bother with a compiled language?

#!/usr/bin/env python

# Import the Python modules needed
import os, sys, plistlib

# Parse the plist file or give a warning if no plist file was specified
try:
plist = plistlib.readPlist(sys.argv[1])
except:
print "Usage:", sys.argv[0], "/path/to/file.plist"
exit(1)

# Print the settings
print ("setting1: %s" % (plist.Example.Config.setting1))
print ("setting2: %s" % (plist.Example.Config.setting2))
print ("setting3: %s" % (plist.Example.Config.setting3))

# Toggle setting2
if plist.Example.Config.setting2 == True:
plist.Example.Config.setting2 = False
elif plist.Example.Config.setting2 == False:
plist.Example.Config.setting2 = True

# Write changed plist back to the file
plistlib.writePlist(plist, sys.argv[1])

Note that this has not been optimized for minimal number of lines, but for easiest readability of the code.

well probably nice for a code snippet, you wouldn't code tools or System Preference panes that way.

Link to comment
Share on other sites

 Share

×
×
  • Create New...