Posts

Featured post

php - Upload Photo To Album with Facebook's Graph API -

i'm trying familiarize myself facebook's new graph api , far can fetch , write data pretty easily. something i'm struggling find decent documentation on uploading images album. according http://developers.facebook.com/docs/api#publishing need supply message argument. i'm not quite sure how construct it. older resources i've read are: http://wiki.auzigog.com/facebook_photo_uploads https://developers.facebook.com/docs/reference/rest/photos.upload/ if has more information or me tackle uploading photos album using facebook graph api please reply! here various ways upload photos using php facebook graph api. examples assume you've instantiated $facebook object , have valid session. 1 - upload default application album of current user this example upload photo default application album of current user. if album not yet exist created. $facebook->setfileuploadsupport(true); $args = array('message' => 'photo caption...

java - I'm really having trouble figuring out how to make my GUI window display the values in the array -

f nudge me in right direction great. or tell me if have redo chunk or something. this program rolling dice. i'm trying make each individual 'roll' display in ediefield. here class: import java.util.random; public class dice { private int times; private int roll; private int side; public int[] each; random roller = new random(); public void settimes(int rolls) { times = rolls; } public void setsides(int die) { side = die; } public int getroll() { int[] each = new int[times]; int total = 0; int c = 0; int = 0; while (c < times) { c = c + 1; roll = roller.nextint(side); roll = roll + 1; each[i] = roll; total = total + roll; system.out.print(each[i] + " "); = + 1; } return total; } public int geteach() { return each[/*each number in array*/]; } } here guiwindow: import javax.swing.*; import java.awt.*; import java.awt.event.*...

linux - Setting up a 'find' command cron/bash script, which emails if there are any results? -

i'd setup cron job checks e.g. every 24 hours see if 'find' command 1 below (which checks malicious shell hacking scripts) has results: find /home/username/public_html -type f -print0 | xargs -0 egrep '(\/tmp\/cmd(temp)?|sniper_sa|(c99|r57|php)shell|milw0rm)' and if there results, receive email @ specified email address exam@ple.com. perhaps cron job calls bash script run once per day, find command run via bash script, , bash script checks number of characters find command returns , sends email if greater 0. not sure if that's best approach it's 1 think of. i don't know enough bash programming implement though (or similar alternative) - implementation of like? the default action of cron email if there output script edit crontab (crontab -e) , add mailto variable @ top. mailto=exam@ple.com 30 1 * * * find /home/username/public_html -type f -print0 | xargs -0 egrep '(\/tmp\/cmd(temp)?|sniper_sa|(c99|r57|php)shell|milw0rm)' ...

objective c - Please help with iPhone Memory & Images, memory usage crashing app -

i have issue memory usage relating images , i've searched docs , watched videos cs193p , iphone dev site on memory mgmt , performance. i've searched online , posted on forums, still can't figure out. the app uses core data , lets user associate text picture , stores list of items in table view lets add , delete items. clicking on row shows image , related text. that's it. everything runs fine on simulator , on device well. ran analyzer , looked good, starting looking @ performance. ran leaks , looked good. issue when running object allocations every time select row , view image shown, live bytes jumps few mb , never goes down , app crashes due memory usage. sorting live bytes column, see 2 2.72mb mallocs (5.45mb total), 14 cfdatas (3.58mb total), 1 2.74mb malloc , else real small. problem related info in instruments technical , problem solving examples i've seen missing release , nothing complicated. instruments shows core data responsible library 1 ...

php - How to build a web site which gives a sub-domain dynamically to every registered user? -

possible duplicate: create subdomain upon user registration suppose have site, , wish give sub-domain each registered users. site, http://site.com/ . and test-user user registered on site, , site wants make sub-domain user. like http://test-user.site.com . like http://test-user1.site.com test-user1. i hope understood requirement. how can create sub-domain using sites back-end or dynamically while registering? make dns record bring * requests site ip. set web server handle * requests (thanks @animuson mentioning) check $_server['http_host'] against database. profit!!!

c# - How can I sort ObservableCollection<T> such that my UI also sees the process of sorting? -

i have listbox item panel set wrappanel. want whenever new item added listbox collection should sorted , process should visible on ui. mean user should able see fancy effect them identify item being sorted. looked @ few posts on stackoverflow , suggest use collectionviewsource. itemsource bound observablecollection in viewmodel. first wrote code. works new collection bound can't see fancy effect items in container move new position original position :- var photolist = photostoupload.tolist<photo>(); photolist.sort(new photosorter()); photostoupload = new observablecollection<photo>(photolist); this class :- public class photosorter : icomparer<photo> { public int compare(photo x, photo y) { return x.photobytearr.length - x.photobytearr.length; } } then wrote simple bubble sorting algorithm. achives desired effect don't know why takes long time. know it's ineffecient algori...