Posts

Showing posts from September, 2015

excel vba - Reading all folders in VBA -

i put following code in excel. script found on net.. sub testlistfolders() application.screenupdating = false workbooks.add ' create new workbook folder list ' add headers range("a1") .formula = "folder contents:" .font.bold = true .font.size = 12 end range("a3").formula = "folder path:" range("b3").formula = "folder name:" range("c3").formula = "size:" range("d3").formula = "subfolders:" range("e3").formula = "files:" range("f3").formula = "short name:" range("g3").formula = "short path:" range("a3:g3").font.bold = true listfolders "c:\foldername\", true application.screenupdating = true end sub sub listfolders(sourcefoldername st

javascript - Open a class div on click -

so making website, , want when click on navigation link (hyperlink) show div. this have: http://pastebin.com/lp2awfpy i'd have classes. thanks guys! if you're happy use jquery , make life easier, can achieve result expected that: html <ul> <li><a class="mylink" href="#">services</a></li> </ul> <div class="alert-message notice"> here! <a class="mylink" href="#">hide</a> </div> css .alert-message { display:none; position: relative; border: 1px solid #ddd; background-color: #f9f9f9; -webkit-box-shadow: 0px 1px 1px 0px rgba(180, 180, 180, 0.1); -moz-box-shadow: 0px 1px 1px 0px rgba(180, 180, 180, 0.1); box-shadow: 0px 1px 1px 0px rgba(180, 180, 180, 0.1); font-weight: bold; padding: 10px 40px; margin-bottom: 20px; } .alert-message.error { background-color: #ffe9e9; border-color: #e99f9f;

android - Why do I get a error date value? -

i use following code display details of photo, find value of myinfo.date 22:15 15-01-1970. error made? thanks! public static void getphotodetailsbyid(context mycontext,string id,detailsinfo myinfo ) { cursor cur = mycontext.getcontentresolver().query( mediastore.images.media.external_content_uri, null, mediastore.images.media._id+"=?", new string[]{id}, "" ); if (cur.movetofirst()){ myinfo.title= cur.getstring(cur.getcolumnindex(mediastore.images.media.title)); myinfo.path = cur.getstring(cur.getcolumnindex(mediastore.images.media.data)); myinfo.size=cur.getstring(cur.getcolumnindex(mediastore.images.media.size)); myinfo.date=cur.getstring(cur.getcolumnindex(mediastore.images.media.date_modified)); myinfo.date=getdate(mycontext,myinfo.date); /* myinfo.resolutio

How to print all the values for a key in HashMap in java -

map<string, string> map = new hashmap<string, string>(); map.put("1", "xyz"); map.put("1", "abc"); map.put("1", "cde"); map.put("2", "err");` ` for above map want values associated key 1. expected output. key:: 1 values are:: xyz, abc, cde order of values doesn't important. in map key should unique . if associate new value existing key, overwrite value of existing entry. you might need check interface map#put(k, v) method. if map contained mapping key, old value replaced specified value. so in case map have "cde" value key "1" .

android - Wrong reference to Activity in listener after screen rotation -

i have problem google maps api. after rotate screen have wrong/old reference activity. i"am using "mmapfragment.setretaininstance(true);". "pact" activity. logging gives me hascode of activity not same(look example). private void setupmapifneeded() { if (map != null) { log.d(h.tag, "setupmapifneeded" ); log.d(h.tag, pact.tostring() + " set new onclicklistener"); map.setoninfowindowclicklistener(new oninfowindowclicklistener(){ @override public void oninfowindowclick(marker marker) { log.d(h.tag, pact.tostring() + " click"); } }); } } loggin example before rotation: mainapp@422fa1c0 mainapp created mainapp@422fa1c0 set new onclicklistener mainapp@422fa1c0 click after rotation: mainapp@42b291f0 mainapp created mainapp@42b291f0 set new onclicklistener mainapp@ 422fa1c0

java - Load properties files in session + Struts -

can in struts 1 load , set properties file in session, need not load properties file in action @ every request @ method level. please me this. properties props = ... // load properties file request.getsession().setattribute("mypropertiesfile", props); but not practice use session store such things, why don't use cache?

How to store file in Android which I want edit later? -

i have .vcf file , want put in android can read code. problem cannot put assets folder, because want overwrite/edit file later. how should this? first since might want load via code, may need include .vcf file in /assets folder loading. then can copy .vcf file device's internal or external storage doing overwrite/edit operation on fly. for more information internal , external storage, please refer android developers: storage options

How to show popupalert using javascript in my jsp page? -

i have used confirm("") popup alert function of javascript in jsp page , shows 'ok' , 'cancel' button want 'yes' , 'no' instead. please tell me there way or there alternative it. if using confirm statement in javascript cant change it. have create custom confirmation box using java script or jquery. here optional method without using jquery or javascript <style type="text/css"> div#popup { position:absolute; display:none; top:200px; left:50%; width:500px; margin-left:-250px; border:1px solid blue; padding:20px; background-color:white; } </style> <a href="http://example.com/" onclick="document.getelementbyid('popup').style.display = 'block'; return false;" >go example.com</a> <div id="popup"> <p>are sure want go example.com?</p> <p> <a onclick="

Listview 5 "items" horizontal with a vertical scroll Android -

i know how make listview 5 items per row horizontal vertical scroll you need create custom row, have 60 rows. lets asume have arraylist<string> cars with cars data. @override public view getview(int position, view convertview, viewgroup parent) { //determine first car int firstcarposition = position*5; carlistitem item = new carlistitem(context); item.fillitem(firstcarposition); return item; } then create class one public class carlistitem extends linearlayout { public singlerowlistitem(context context) { super(context); layoutinflater inflater = (layoutinflater)getcontext().getsystemservice(context.layout_inflater_service); inflater.inflate(r.layout.list_item_cars_row, this, true); } public void fillitem(int firstposition) { textview car1 = (textview)findviewbyid(r.id.car1); textview car2 = (textview)findviewbyid(r.id.car2); textview car3 = (textview)findviewbyi

flash - ActionScript 3 FTP via NativeProcess -

i'm writing air application connects subversion repo, gets diff, , downloads them deploy website. i'm doing via nativeprocess runs '/usr/bin/svn' , execute necessary svn commands. that's working uploading them website. can't quite figure out how upload files website via ftp terminal command using '/usr/bin/ftp' does know how can accomplish uploading file ftp air? edit: solved! instead of using ftp switched curl using following command: curl --ftp-create-dirs -u uname:pass -t /users/me/documents/subsync/tmp_109065090/sub/index.html ftp://ftp.mysite.net:21//web/content/sub/index.html couple things note be sure add --ftp-create-dirs after port use double slash bypasses ftp's redirect (used when ftp account sub-account or in shared hosting environment). for ssl add --ftp-ssl curl command

CAS Single sign on implementation on Spring Security guarded application -

i trying implement cas single sign on in application. application guarded spring security. have put required jars lib folder of application, i'm getting these errors. >severe: exception starting filter cas gateway filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)... >severe: exception starting filter cas validation filter java.lang.illegalargumentexception: casserverurlprefix cannot null. @ org.jasig.cas.client.util.commonutils.assertnotnull(commonutils.java:89)... >severe: exception starting filter cas renew filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)... >severe: exception starting filter cas authentication filter java.lang.illegalargumentexception: servername or service must set. @ org.jasig.cas.client.util.commonutils.asserttrue(commonutils.java:116)... a

security - Correct use of Google+ one-time login token -

in sample java code google+ server-side authentication there comment within code handling requests url /connect : // state one-time use token, in our // simple case, want user able connect , disconnect // without reloading page. thus, demonstration, don't // implement best practice. //request.session().removeattribute("state"); the state attribute random sequence generated on page load of default route ( / ) , must presented ajax call /connect connect request succeed. the comment implies improper state remain in session, has been commented out allow user log in , out repeatedly in example. however, want user able log in , out @ will, without reloading page. if keep value state in session allowing exploit? should generating new state , updating somewhere in dom on /disconnect ? or should different altogether? in short, state value set in session used prevent cross-site-request-forgery ( csrf/xsrf ). in samples, have trusted pat

c - Launch a program using sudo -

i want launch program using sudo, have used command sudo './connectionmanager' on a: distributor id: scientificsl description: scientific linux sl release 5.5 (boron) release: 5.5 codename: boron (like centos5.5) and works, doesn't work on distributor id: scientific description: scientific linux release 6.4 (carbon) release: 6.4 codename: carbon in last case have following message: [1]+ stopped sudo './connectionmanager' i have check code , problem instruction int setpgrp(void) in connectionmanager. connectionmanager program written in c, wich fork process in order wait tcp/ip connnection. someone can me ? follow sample code #include <stdio.h> #include <ncurses.h> ... int main() { if (chdir("/opt/informix/server") == -1) { printf("errore nella directory /opt/informix/server\n"); getch(); exit(1); }; signal(sigint, onexit); signal(sig

c# - solved; Cannot convert method group... NOT missing parentheses -

bool connected = false; if (isconnected()) //if(isconnected() == true) doesn't work { //code } else { connect(); } public bool isconnected() { if (nextevent != "null" && !nextevent.contains(getevent("disconnected"))) { connected = true; } return connected; } getting error: cannot convert method group 'isconnected' tot non-delegate type 'bool'. why? i've looked , in cases, people forget put parentheses after function name, this: if(isconnected) { // .... } which not case me. what's wrong? in advance. you trying define function inside other function, if put function in out side function, suppose code calling inside yourfun() take isconnected() definition out side yourfun() void yourfun() { bool connected = false; if (isconnected()) //if(isconnected() == true) doesn't work { //code } else

ios - UITableView image changing while scrolling -

i have uitableview custom cell . custom cell contains uiview . image loaded here asynchronously. when scrolls table view, images in cell changes. here code: - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"mycell"; msappointmentsmodel *data = [self.appointments objectatindex:indexpath.row]; msappointmentscell *cell = (msappointmentscell*)[tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { nsarray *ar = [[nsbundle mainbundle] loadnibnamed:[common checkdeviceforcontroller:@"msappointmentscell"] owner:nil options:nil]; (id eachobject in ar) { if ([eachobject iskindofclass:[uitableviewcell class]]) { cell = eachobject; } } cell.accessorytype = uitableviewcellaccessorydisclosureindicator; dispatch_async(dispatch_get_global_queue(0, 0), ^{

Django-taggit inserting -

my model defines 1 field like keywords = taggablemanager(_('keywords'), blank=true) from view need use get_or_create in for *** transaction.commit_on_success(): # inserting obj_parsed defaults = { 'owner': user, 'title': obj.title, 'abstract': obj.abstract, #'keywords': [kw kw in obj.keywords], 'url': obj.url, } obj_instance, created = obj.objects.get_or_create( title=obj.title, defaults=defaults) if not created: result['error'] = _('url in repository') return result obj.keywords list (it can empty) get_or_create gives me error "typeerror: 'keywords' invalid keyword argument function" how can solve this? i don't want do mymodel = obj(**defaults) mymodel.save() mymodel.keywords.add([kw kw in obj.keywords]) thanks! i had similar problem , looked taggit tests

android - Multiple fragments/layout in one Tab of actionbarsherlock -

this related last post, need solution i'm trying simplify problem. all want having several fragments (one list @ left , detail view @ right) in 1 tab. do have idea ? if know 2 fragment s in advance declar them both within xml layout file tab. can see how in fragment tutorial android docs. display 2 fragments in 1 activity using outer layout element container.

scala - Idiomatic way to write multi-project builds with .sbt files in sbt 0.13 -

i hear .sbt files have been improved in various ways in 0.13, , can specify multi-project builds in them. http://www.scala-sbt.org/0.13.0/docs/community/changesummary_0.13.0.html#sbt-format-enhancements mentions can define subprojects in .sbt file. know multiple .sbt files in root aggregated single conceptual file. what i'd like, though, not pollute root dozen subproject .sbt files. there way can throw subproject build.sbt files respective subdirectories, keep common code between them somewhere shared, , have root build.sbt entire project aggregates subprojects? have similar setup in .scala files right prefer use .sbt files if possible. if isn't possible, "correct" way construct large multi-project builds .sbt files? it should case in 0.12 can put .sbt files in base directory of subproject , settings there included in project's scope. code reused between .sbt files creating normal .scala file in project/ . code in project/ available use

c# - When form load, open form 2 and close form 1 -

when program loads want check file, if file exists want continue, if doesn't want not open main form , open form 2. this have far: private void home_load(object sender, eventargs e) { string path = @"c:\path\path2\file.txt"; if (!file.exists(path)) { messagebox.show("file not found!"); form2 f = new form2(); f.show(); this.hide(); } else { messagebox.show("file found!"); } } but opens 2 forms. can please me? thanks. seems me should in application start. right you're doing in load of first form, don't want open. so, this: [stathread] static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); string path = @"c:\path\path2\file.txt"; if (!file.exists(path)) { application.run(new form2()); } else { application.run(new form1()); } }

wso2esb - Can we use Multiple Users at a time for one service in wso2 Esb -

my client sending me single request time proxy processing response whenever number of clients increasing proxy went error means same service hit number of client request http request error this passthroughhttplistener system may unstable: http listeningioreactor encountered runtime exception : null java.lang.nullpointerexception @ org.apache.synapse.transport.passthru.sourceresponse.start(sourceresponse.java:83) @ org.apache.synapse.transport.passthru.sourcehandler.responseready(sourcehandler.java:184) @ org.apache.http.impl.nio.defaultnhttpserverconnection.produceoutput(defaultnhttpserverconnection.java:223) @ org.apache.http.impl.nio.defaultserverioeventdispatch.outputready(defaultserverioeventdispatch.java:161) @ org.apache.http.impl.nio.reactor.baseioreactor.writable(baseioreactor.java:179) @ org.apache.http.impl.nio.reactor.abstractioreactor.processevent(abstractioreactor.java:344) @ org.apache.http.impl.nio.reactor.abstractioreactor.processevents(abs

Java Inspect File Contents -

i have jee6 app accepts files via post. can perform server side basic test ensure file extension correct there way inspect file contents make sure don't process unless i'm happy valid file i.e. avoid renaming file extension if know mime type of file, can try comparing value returned files.probecontenttype(tempfile) (documentation here ). mime types can have number of optional parameters (for example "text/plain; charset=utf-8"), may want compare using mimetype.match method rather comparing strings.

html - Responsive text size using ems -

Image
i trying learn responsive webdesign techniques , trying code website in responsive way. don't want use frameworks yet. problem div width in ems different on mobile on desktops. when viewing on desktop, h1 fits div , on mobile not. shouldn't same in both case? sizes in em. here html code: <!doctype html> <!--[if ie 8]> <html class="no-js lt-ie9" lang="en" > <![endif]--> <!--[if gt ie 8]><!--> <html class="no-js" lang="en" > <!--<![endif]--> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>sieć z pasją</title> <link rel="stylesheet" href="css/style.css"> <!-- google webfonts --> <!-- font-family: 'expletus sans', cursive; --> <link href='http://fonts.googleapis.com/css?family=expletu

java - Hardcoding values vs. reading from file -

this general question efficiency of hardcoding data - i'm writing program in java chemical analysis, , need use isotopic abundances of different elements. way have set right values (which never need modified) stored final fields in class, i.e. static final double c12abundance = .989; static final double c12mass = 12; a lot of similar programs store type of data in xml file, read values there, this: <compounds> <elements> <element symbol='c' mono_isotopic_mass ='12.00000000000' abundance='.989'/> is there reason (performance, memory, etc) read way? seems easier leave field. hard coding way faster in terms of performance , memory allocation. the thing gain reading file code re-usability (running program different parameters without need recompile it). note reading file has following steps: declare variable use storing value. create input (stream) object initialize path open file fs find correct line read fr

scala - multiple verify method on form tuple -

i'm quite new play , scala. i'm working on form , validations. couldn't figure out errors multiple verification on form. my form tuple looks like; val companymapping = forms.tuple( "name" -> nonemptytext, "email" -> email, "password" -> nonemptytext(8), "re-password" ->nonemptytext(8)).verifying( // add additional constraint: both passwords must match "passwords don't match", data => { data._3 == data._4 } ).verifying( // second constraint "test error", data => { false } ) in view print global errors , errors, looks like; @println(companyform.globalerror) @println(companyform.errors) and output; some(formerror(,passwords don't match,wrappedarray())) list(formerror(,passwords don't match,wrappedarray()), formerror(,test error,wrappedarray())) at stage have absolutely no idea how print both of

Chrome extension: How to remember previous previous Tab? -

i made extension remembers previous tab , on button click toggles between current tab , previous tab. want extend remember previous previous tab. allow toggle between 2 tabs once current tab closed. however, struggling code logics. code toggle between current , previous tab: var previoustab; var currenttab; // switch tab on button click chrome.browseraction.onclicked.addlistener(function(tab) { chrome.tabs.update(previoustab, {selected: true}); }); // update variables on tab change chrome.tabs.onselectionchanged.addlistener(function(tab) { if (previoustab == null) { previoustab = tab; } if (currenttab == null) { currenttab = tab; } else { previoustab = currenttab; currenttab = tab; } }); now code toggle between 2 tabs once current tab closed: var previoustab; var previousprevioustab; var currenttab; // switch tab on button click chrome.browseraction.onclicked.addlistener(function(tab) { chrome.tabs.update(pre

authentication - How to Customize CAS login and validation -

i'm implementing cas in web application. can explain how avoid cas login , replace application login? the second question - cas login details validated? there full explanation of qustion using cas without cas login screen . , official souce. take @ using cas without login screen . names of links same, content different information.

java - SQLite date query returns no record -

i developing android application search records created after given date. code thing this public list<nprmember> incrementaldata(string lastdttime) { list<nprmember> results = new arraylist<nprmember>(); sqlitedatabase db=getmyreadabledatabase(); string lastdt="datetime("+lastdttime+")"; cursor cursor = null; try{ cursor = db.query(table_name_npr, new string[] { key_fullname, key_fathername, key_rcrd_source,key_rcrd_crn_date},key_rcrd_crn_date + ">? , "+key_rcrd_source+">?", new string[]{lastdt, "0"}, null, null, null); cursor.movetofirst(); while (!cursor.isafterlast()) { nprmember nprmem = cursortomemberdetails(cursor); results.add(nprmem); cursor.movetonext(); } }catch(exception e){ log.e(app_name, "an error occurred while searching "+lastdttime+": "+e.tostring(), e); }finally{ if(cur

javascript - Require.js timeout with Charles proxy -

code works absolutely fine when charles proxy running in background, following error in chrome , firefox. charles proxy running @ default settings. uncaught error: load timeout modules: jquery,handlebars http://requirejs.org/docs/errors.html#timeout require.js:8 f require.js:8 c require.js:13 (anonymous function) os: os x 10.8.4 charles: v 3.7 chrome : 28.0.1500.71 firefox : 22.0 turns out issue related hosts file. requirejs throwing timeout because localhost taking long resolve. works fine after updating hosts file this: ## # host database # # localhost used configure loopback interface # when system booting. not change entry. ## 127.0.0.1 localhost.localdomain 127.0.0.1 localhost 127.0.0.1 username.lmuk.local 255.255.255.255 broadcasthost ::1 localhost fe80::1%lo0 localhost more information available here .

php - ajax POST success result not logging -

i'm making ajax post php page. on php page echo result success call log it, doesn't work. js: $(function(){ $.ajax({ url : "http://xxxxxxx/bn/sample.php", type : 'post', number: "1234567", success : function (result) { console.log("success"); console.log(result); }, error : function () { alert("error"); } }); php: <?php $data = $_post['number']; echo json_encode($data); ?> that's because you're setting number attribute in ajax json object. correct attribute data : $.ajax({ url : "http://xxxxxxx/bn/sample.php", type : 'post', data: {number: "1234567"}, success : function (result) { console.log("success"); console.log(result); }, error : function () { alert("error"); } });

eclipse - m2eclipse not showing latest artifacts in search -

Image
i using eclipse m2eclipse plugin , have setup nexus repository mirror. when search artifacts not show recent versions; shows outdated versions of artifacts. end searching online latest version. have configured incorrectly, or bug? on eclipse kepler, happened in juno version. for example, tried adding groovy dependency, on version 2.1.6. latest (non-beta) shown 1.8.1: i don't think has nexus. can view nexus repository in maven repositories view in eclipse. also, if manually type in latest version there not errors, jar file(s) pulled in correctly. here local settings.xml referencing nexus mirror: <?xml version="1.0" encoding="utf-8"?> <settings xmlns="http://maven.apache.org/settings/1.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/settings/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <plugingroups> </plugingroups> <proxies>

wpf - ScrollViewer styled with images doesn't scroll on full track -

Image
in wpf application, have styled scrollbar using images background , thumb. scrollbar scrolling along whole height of scrollbar. inside scrollviewer, thumb doesn't scroll along whole track. scrolls in middle of track doesn't close ends of scrollbars. please see attached image. below scrollbar style: <imagebrush x:key="scrollbar.static.background" imagesource="/wpfapplication1;component/resources/zeepad v1.65b dev vertical slide.png" stretch="fill" /> <imagebrush x:key="scrollbar.static.horizontal.background" imagesource="/wpfapplication1;component/resources/zeepad v1.65b dev vertical slide - horizontal.png" stretch="fill" /> <imagebrush x:key="scrollbar.mouseover.thumb" imagesource="/wpfapplication1;component/resources/zeepad v1.65b dev slider knob.png" stretch="uniform" /> <imagebrush x:key="scrollbar.pressed.thumb" imagesource="/wpfapplicati

java - Slide in another XML layout when button is clicked -

i have main.xml layout file , in java code, doing calculation taken main layout , wanting display in result.xml layout file. know can use anim folder hold animation slidei n result layout following: left right: <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false"> <translate android:fromxdelta="-100%" android:toxdelta="0%" android:fromydelta="0%" android:toydelta="0%" android:duration="700"/> </set> right left: <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareinterpolator="false"> <translate android:fromxdelta="0%" android:toxdelta="100%" android:fromydelta="0%" android:toydelta="0%" android:duration="700" /> </set> i wondering how implement above when button clicked o

How to create multi dimensional array in php without specifying index -

i newbie programmer of php. how should create array without specifying size of array.i have tried using $items = array(); how can add array element? without having specify index. in advance feedback. // define array $item = array(); // adding multi dimensional array array_push($item, array('name'=>'pen','qty'=>1)); you may nest array more levels same method mentioned above.

matlab - finding gradient/curvature of surface defined by arbitrary, non-grid-spaced points -

so have 3 dimensional matrix of points (presumably) define surface. purposes, x , y can random values when plotted along z coordinates, define undulating surface. i'd measure local curvatures of said surface, , in order that, need able find gradient of said surface, @ point calculating curvature trivial. i have not yet found implementation of how measure curvature doesn't make use of matlab's gradient function. problem matlab's gradient function assumes points in sort of order, similar diff(x). suffice if points spaced along grid, not case. one possible solution measuring gradient give in , assign each point discrete coordinate in grid in xy plane, overcoming issue. however, solution seems inelegant , curious see if had suggestions. thanks! you can use griddata interpolate scattered data points grid spaced points , calculate gradient.

c# - LINQ Expression Conversion / Concat from Int to string -

i want concat 2 expressions final expression expression<func<t, string>> so have created expression belwo code works fine string types , if memberexpression int32 or datetime throwing exception expression of type 'system.int32' cannot used parameter of type 'system.string' of method 'system.string concat(system.string, system.string)' if convert expression var conversion = expression.convert(memberexpression, typeof (string)); getting no coercion operator defined between types 'system.int32' , 'system.string'. please me resolve code methodinfo bodycontactmethod = typeof (string).getmethod("concat",new[] {typeof (string), typeof (string)}); parameterexpression parameter = expression.parameter(typeof (t)); body = expression.call(bodycontactmethod, cons, memberexpression); return expression.lambda<func<t, string>>(body, parameter); instead of trying cast string, try casting object

Facebook graph api, tell "comment" from "like" in the "post" list -

after getting json result of https://graph.facebook.com/me?fields=posts.fields(id,message,story)&access_token= * , how tell 1 of them "comment" , 1 "like" made on post list? thank much! i ran following in facebook's graph api: /?posts.fields(id,message,story) provides same result as: / note used post id, not page id. on page id, you'll see likes page while post id show people liked post. output shows commented , liked. if want number count of people have liked post, check out getting facebook api total number of likes per post .

iphone - Cells of CollectionView Not Displaying -

im using storyboard create collectionview displays incoming instagram pics. can take look @ project find out why not working? * edit main issue lies in either storyboard or class called streamviewcontroller.m project cut down essential parts dont worry digging through project. ** https://docs.google.com/file/d/0b9j0yais_bjpcfhvdzj3lvv2znc/edit?usp=sharing i've looked through streamviewcontroller , never set self delegate or datasource "collectionview".

ios - UI Activity Indicator not working from tableview -

the issue is, have been unable ui activity indicator activate animation or show when user selects cell table view. the execution cycle looks this: view loads table view user clicks cell - (uiactivityindicator fails @ step appear or animate) activity indicator appears while data being gathered new view called loaded data user clicks button navigation bar repeat cycle loading object activity indicator link storyboard. @synthesize jsonconnection, bakeryproductarray, bakerytableview, loading; - (void)viewdidload { [super viewdidload]; // additional setup after loading view, typically nib. [self retrievedata]; } - (void)didreceivememorywarning { [super didreceivememorywarning]; // dispose of resources can recreated. } - (void)viewwillappear:(bool)animated { [self.navigationcontroller setnavigationbarhidden:yes animated:animated]; [super viewwillappear:animated]; } - (void)viewwilldisappear:(bool)animated { loading.hidden = yes;

sms - Android: pass variables from Activity to BroadcastReceiver -

i have problem passing throught variable activity broadcastreceiver... here code: here broadcast receiver code... try catch sms 1 phone number have got activity... public class smsmonitor extends broadcastreceiver { private static final string action = "android.provider.telephony.sms_received"; public static string phone_number = ""; public static string msg_body = ""; public static final string sms_extra_name = "pdus"; @override public void onreceive(context context, intent intent) { string phone = intent.getextras().getstring("trusted_num"); if (intent != null && intent.getaction() != null && action.comparetoignorecase(intent.getaction()) == 0) { object[] pduarray = (object[]) intent.getextras().get("pdus"); smsmessage[] messages = new smsmessage[pduarray.length]; (int = 0; < pduarray.length; i++)

input - jQuery multiple value filter on table -

i'm trying filter table multiple keywords, if tr contain keywords, display. found work great on ul , behave strangly on table. here jsfiddle : http://jsfiddle.net/atknw/81/ the filter seems check second or third td of each tr . i'm missing ? use hand. $("#kwd_search").keyup(function () { var filter = $(this).val().tolowercase(), count = 0; var length = $(this).val().length; if (length > 1) { var filter_tags = filter.split(" "); $("#dep td").each(function () { var $this = $(this); var matches = true; $.each(filter_tags, function (i, a_filter) { if ($this.text().tolowercase().indexof(a_filter) === -1) { matches = false; } }); if (matches) { $this.parent("tr").removeclass("hidden"); } else { $this.parent("tr").addclass("hidden"); } }); } else { $("#dep td

Get rid of identical permutations in a matrix, Matlab -

i generated x-by-10 array of numbers matlab. array 'mentally' divided columns sets of 4, 3 , 3. 2 rows if array given below [1 2 3 4 ; 5 6 7 ; 8 9 10] [1 2 3 4 ; 8 9 10 ; 5 6 7] the semi-colons mental divisions. need process array further, 'mental column' permutations give same information. second row permutation of second , third 'mental row' of first one. is there simple way can rid of permutations built in functions of matlab ? sort of unique recognizes permutations. suppose rows stored in matrix a , , column set widths stored in len (in case len = [4, 3, 3] ). first should represent data in cell array: x = mat2cell(a, ones(size(a, 1), 1), len); then find possible combinations of columns in such cell array (without repetition): cols = perms(1:numel(len)); now, given 2 rows x indices r1 , r2 , check if 1 permutation of other ( i.e reordered "mental" columns): any(arrayfun(@(n)isequal(x(r1, :), x(r2, cols(n, :))), 1:

android - what is the difference between layout_weight and using dp? -

i want create scalable view. should prefer using linear layout property: layout_weight or using layout_width: x dp ? (which relative , not apolute pixels) what difference? this highly depends on exact use case. layout_weight depends on number , size of other views in same viewgroup. dp (density-independant pixels) depends on density of device. usually, dp used have view displayed @ same physical size on devices different screen densities, while weight makes sure view fills percentage of parent viewgroup.

java - CloudEndpoints: what is autogenerated "patch" API method and how to use it? -

after adding 2 methods @api annotaged class: get() , update() , there 3 methods generated endpoints: *.get generated directly get() method *.update generated directly update() method *.patch seems generated indirectly, after inserting both get() , update() methods annotated class. i can see 3 methods via apis explorer on local server. code used generate endpoint posted @ end of question. my question is: why third method, patch , being generated? there on purpose? if yes, how use method? usable external clients or served internal usage? here endpoint api class: @api (name = "sample_endpoint") public class sampleendpoint { public entity get() { return new entity(); } public entity update(entity entity) { return entity; } public class entity { public string parameter = "validated ok."; public string getparameter() { return parameter; } } } the "patch" meth