Posts

Showing posts from January, 2013

javascript - Logout of Facebook Programatically -

in app users can register/login using oauth2 via facebook , google. when user logs out, give them option logout of oauth provider (e.g. in case they're on public computer). in case of google following javascript var img = new image(); img.src = 'https://accounts.google.com/logout'; is there equivalent solution facebook? i've seen this suggestion , ideally i'm looking client-side solution not require knowledge of access token (which keep on server-side). i'd prefer not have include facebook sdk if possible.

javascript - Parsing GitHub API response -

i want list of repositories github account , url using https://api.github.com/users/rakeshdas1/repos . want parse using jquery , output html page. code using achieve is: $(document).ready(function(){ var json = "https://api.github.com/users/rakeshdas1/repos"; $.each(json.parse(json), function(idx, obj) { $("#repos").append("<p>"+obj.name+"</p>"); }); }); syntaxerror: json.parse: unexpected character @ line 1 column 1 of json data the first character in json file '[' , don't know why jquery can't parse it as rory said in comments, no ajax request being made. trying parse string "https://api.github.com/users/rakeshdas1/repos" json. what may looking call $.get download result of api call, parse inside function. the following code fails me due network restrictions, should give right idea. might work you. $(document).ready(function () { var api = "https://

Android WebView WebChromeClient example app issue -

my source code sapmle app. import android.app.activity; import android.os.bundle; import android.view.view; import android.webkit.websettings; import android.webkit.webchromeclient; import android.webkit.webview; import android.webkit.webviewclient; public class androidmobileappsampleactivity extends activity { /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); webview mainwebview = (webview) findviewbyid(r.id.mainwebview); websettings websettings = mainwebview.getsettings(); websettings.setjavascriptenabled(true); mainwebview.setwebviewclient(new mycustomwebviewclient()); mainwebview.setscrollbarstyle(view.scrollbars_inside_overlay); mainwebview.loadurl("http://qatarcarsale.com/"); } private class mycustomwebviewclient extends webviewclient { @override

php - Set $_GET Using Yii HiddenField Method -

i trying set $_get if button selected. currently, trying set using following command: chtml::hiddenfield('hidden', $displaydata = "option1"); reloads page. suggestions? controller: <?php $data1 = new carraydataprovider(.......){ ....... } $data2 = new carraydataprovider(.......){ ....... } if(isset($_get['export'])){ $displaydata = $_get['export'] == 'option1' ? $data1 -> getdata() : $data2 ->getdata(); // export csv file content here } ?> view: <?php // button 1 chtml::hiddenfield('hidden', $displaydata = "option1"); // button , other data ?> <?php // button 2 chtml::hiddenfield('hidden', $displaydata = "option2"); // button , other data ?> read yii docs hidden field: link public static string hiddenfield(string $name, string $value='', array $htmloptions=array ( ))

R Life Line Plots for Survival Analysis -

i plot life lines diagram data readers can understand how data shaped , right censoring data. ideally [this][1] i need horizontal line each participant, starting date of observation , ending on last day observed him. people having last day of observation should in different color (or have indicator). the data this: regdate lastlogindate censor duration 2010-02-24 02:30:43 2010-05-27 07:58:17 0 92 2007-12-23 11:16:37 2008-03-07 10:36:29 1 75 2009-01-19 04:23:28 2009-01-24 06:33:38 1 5 2010-07-25 10:24:39 2010-08-11 07:13:25 0 17 2009-08-23 07:18:06 2009-08-24 06:25:35 1 1 2007-08-12 07:24:55 2010-06-01 06:53:57 0 1024 ucla has how done in stata . told advisor can match whatever did in stata in r. in need of here guys :) edit: managed right. here sample of data dput. structure(list(users_id = c(1747516, 913136, 921278, 1654913, 782364, 1371798, 1174461, 1493894, 1124186,

Calculate quantiles in R without interpolation - round up or down to actual value -

it's understanding when calculating quantiles in r, entire dataset scanned , value each quantile determined. if ask .8, example give value occur @ quantile. if no such value exists, r nonetheless give value would have occurred @ quantile. through linear interpolation. however, if 1 wishes calculate quantiles , proceed round up/down nearest actual value? for example, if quantile @ .80 gives value of 53, when real dataset has 50 , 54, how 1 r list either of these values? try this: #dummy data x <- c(1,1,1,1,10,20,30,30,40,50,55,70,80) #get quantile @ 0.8 q <- quantile(x, 0.8) q # 80% # 53 #closest match - "round up" min(x[ x >= q ]) #[1] 55 #closest match - "round down" max(x[ x <= q ]) #[1] 50

c - Convert uint8_t hex value to binary -

so says in title trying convert hexadecimal binary. problem have been facing that, given value uint32_t type. far, have convert uint32_t uint8_t such each of uint8_t variables hold 8 bits of original hex value. have succesfully converted hexadecimal binary, in code shown below. unable print in format. format is: 1101 1110 1010 1101 1011 1110 1110 1111 ---0 1010 1101 1011 1110 1110 1111 --01 1011 1110 1110 1111 void convert(uint32_t value,bool bits[],int length) { uint8_t a0,a1,a2,a3; int i,c,k,j; a0 = value; a1 = value >> 8; a2 = value >> 16; a3 = value >> 24; for(i=0,c=7;i<=7,c>=0;i++,c--) { k = a3>>c; if(k&1) bits[i] = true; else bits[i] = false; } for(i=8,c=7;i<=15,c>=0;i++,c--) { k = a2>>c;

How to write a java program that inputs strings to multiple text boxes on a web page and submit its? -

my schools class registration system can type in crns, , hit submit fastest. i'm looking guidance on how automate process. want able input strings ahead of time, , hit run, , have them inserted text boxes , submitted quickly. taking data structures. 2nd cs class, know java. not looking write code, point me in right direction. thanks actually, don't have insert things text boxes install proxy server on computer - 1 can see requests , responses. configure web browser route requests through proxy server. (set proxy server setting) submit sign on do, , @ gets sent in request. request sent using post (google more info on post). in case, once you've got copy of request, can build automated process in java or connect login url using socket / ssh connection , submitting request again (updated time info needs updated)

c# - Get screenshot with mouse cursor and send for client application -

i took this function getting screenshot client application. tried adapt function in project, can not capture desktop showing mouse cursor (coming remote pc) in server application (controller). here adaptation (in client side) without success: void sendscreenproc() { // send first bitmap memorystream streamscreen = new memorystream(); this.bmpscreensend = capturescreen(true);//new bitmap(this.boundscreen.width, this.boundscreen.height, pixelformat.format24bpprgb); graphics g = graphics.fromimage(this.bmpscreensend); g.copyfromscreen(0, 0, 0, 0, this.boundscreen.size); this.bmpscreensend.save(streamscreen, system.drawing.imaging.imageformat.png); compress.compressstream(streamscreen); byte[] bufferscreen = streamscreen.toarray(); mresenddata.waitone(); this.queuesenddata.addscreen(streamscreen.getbuffer()); streamscreen.close();

c# - WPF xaml dynamically adding checkboxes -

i new wpf/xaml , working on application checkboxes added dynamically window. have functionality working, there issues , feel there might better approach problem. have looked , found few different solutions, none of them seem work. (checkboxlist, panel) right using listbox hold checkboxes -- wondering if there better solution adding dynamic checkboxes. <window x:class="wpfapplication1.fileselectionwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="fileselectionwindow" height="368.917" width="701.669"> <grid margin="37,10,31.2,12.2"> <button height="22" horizontalalignment="left" margin="184,0,0,33.6" name="specificzip" verticalalignment="bottom" width="75" click="specificzip_click">zip</button>

rest - Basic HTTP Authentication doesn't work in AngularJS -

my angularjs driven frontend should use basic auth. i've tried different approaches, nothing works -- request sent without authorization header: $http service object config code (function() { var app = angular.module('portfolio', []); app.controller('projectslistcontroller', ['$http', function($http) { var projectslist = this; projectslist.projectslistdata = []; $http.defaults.headers.common.authorization = 'basic dxnlcjpwd2q='; $http.get(config['api_server_url'] + '/projects').success(function(data) { projectslist.projectslistdata = data; }); }]); })(); request headers options /projects http/1.1 host: foo.bar.tld connection: keep-alive access-control-request-method: origin: http://baz.buz.loc user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/41.0.2272.118 safari/537.36 access-control-request-headers: accept, author

java - Finding combinations of a HashSet of Strings -

i have hashmap<string, hashset> . string stores name of person, , hashset stores list of people friends person. key<string> value<hashset> dave steve steve dave bob dalton dalton bob, sue anne sue sue dalton, anne in above data, dave friends steve (line 1 , 2). line 4, dalton friends bob , sue. however, bob , sue not friends. program needs input bob , sue friends. in other words, bob should added sue's friend list , sue should added bob's friends list. however, dalton's friends list may have infinite amount of people. not allowed store friend list data array or arraylist . one solution considering (but haven't tried) edit read(string name1, string name2) method. (note: in runner class, whenever method called, called read(name1, name2) , read(name2, name1) ) in short, method reads in 2 friendships , adds in friendship map. in else block (if name1 key in hashmap ), thinking add in

c# - Convert Bitmap to Pixbuf -

i planing display generated bitmap in gtk image. but support pixbuf. how convert bitmap in pixbuf. can use typeconverter this? done different way. other convert have reloaded image. protected void onbtngenclicked (object sender, eventargs e) { bitmap bmp = new bitmap(300, 300); using (graphics g = graphics.fromimage(bmp)) { font font = new font("arial", 20, fontstyle.bold, graphicsunit.point); g.clear(color.white); g.drawstring(txtmessage.text, font, brushes.black, 0, 0); } bmp.save("d:/image.png", imageformat.png); var buffer = system.io.file.readallbytes ("d:/image.png"); var pixbuf = new gdk.pixbuf (buffer); image1.pixbuf = pixbuf; }

html5 - Javascript (jQuery) limit mouse movement speed inside an element -

the task draw curve ob canvas. problem if mouse moved fast, coordinates skipped , not captured. ( html5/js canvas capturing mouse coords when moves fast - previous post..) is there cross-browser way limit mouse speed inside element (div, canvas, etc.)? i assume "limiting mouse speed" mean enable capturing high volume of mouse events more detailed information, or resolution, of mouse path. the browser work @ high-level when comes mouse events. system capture mouse events, browser many other tasks such pushing events, bubbling them etc. , capture current mouse position when can. to compensate need use sort of tricks such splines. possible workaround i don't intend make broad answer become out of scope go through steps , scenarios need spline approach (interpolation, knee-breaks require relative angle tracking, smoothing etc.). however, there new api called pointer lock api (see demo , source in link well) allow browser work @ lower level closer sy

emacs - How can I underline marked text to differentiate the text from the pointer? -

Image
when first installed solarized-theme , set recommended values variables here . there great effect of marked text being vertically longer cursor made easier see cursor was. i'm not sure if effect of setting (setq x-underline-at-descent-line t) but after customizing colors of theme bit more, lost effect of saw before anymore (can't seem revert after reinstalling theme either). effect meant marking region (highlighting text) highlight capline down baseline. sometimes when start emacs. here 1 of lucky times it. here can see marked region going topline bottomline. edit: after accidentally getting work again. think desired effect on org headers on 1st/top level. how can effect everywhere?

Facebook Android SDK records "Unknown" App Version for "App Installs" events -

Image
i integrating facebook android sdk can correlate app installs facebook ads running. i've followed the instructions , i've confirmed events getting logged facebook. i've used jd-gui confirm obfuscation isn't happening on facebook classes. the weird thing "app installs" events show "app version" of "unknown" (this screenshot shows me filtering "app installs" events): this might benign (i'm still investigating), know cause? thanks!

.net - Cannot see detailed errors of Internal Server 500 errors -

i running microsoft asp.net web api 2.1 application in iis7.5 , getting generic: 500 - internal server error. there problem resource looking for, , cannot displayed. i have tried following more detail on actual error far, face palming: set globalconfiguration.configuration.includeerrordetailpolicy = includeerrordetailpolicy.always; added <system.webserver> <httperrors existingresponse="passthrough"/> </system.webserver> checked windows event log unhandled exceptions, none added exceptionlogger , nothing appears in log file: public class log4netexceptionlogger : exceptionlogger { private readonly ilog _log = logmanager.getlogger(typeof(log4netexceptionlogger)); public override void log(exceptionloggercontext context) { _log.error("an unhandled exception occurred.", context.exception); base.log(context); } } added <configuration> <system.webserver> <httperrors errormode=&quo

javascript - jquery load function with kwidget (kaltura player) -

i loading html page having kaltura player embed code in jquery using jquery.load(). idea load video in div tag through javascript on page. code in aspx page <%@ page language="c#" autoeventwireup="true" codebehind="default.aspx.cs" inherits="webapplication1._default" %> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="head1" runat="server"></head> <body> <script src="images/jquery-1.9.1.min.js" type="text/javascript"> </script> <script type="text/javascript"> function test() { var light = document.createelement('div'); light.id = "light"; document.body.appendchild(light);

android - Is there an easier way to add gson to my project? -

how add gson project gradle? see people adding files projects. don't want download project , put in mine. in app/build.gradle: dependencies { compile 'com.google.code.gson:gson:2.8.2' }

Javascript regex to match string not preceded by -

this question has answer here: javascript: negative lookbehind equivalent? 9 answers i've seen few answers deal question unable them work. what regex match "logged_in" not match "not_logged_in" ? ^logged_in$ first come mind

404 Error when running TicTacToe sample (Android) against sample Google App Engine project (Java) -

i set android app , google app engine backend seen in these 2 projects: android connected app engine project java app engine backend project when click tictactoe-field button, triggers request 404 error: "not found" 04-09 23:11:51.115: w/tictactoe(26247): getcomputermovetask: 404 not found 04-09 23:11:51.115: w/tictactoe(26247): not found that https:// myappname .appspot.com/_ah/api/ in browser shows "not found". here did: created api project on app engine console there created android client id com.google.devrel.samples.ttt package debug keys sha1-fingerprint there created web client id integrated android project in eclipse. updated default_root_url in tictactoe.java "https:// myappname .appspot.com/_ah/api/" there updated value of audience in clientcredentials.java replacing string "your_web_client_id" generated web-client-id step 3 integrated java backend project in eclipse.there updated value of application in appen

c# - Convert to Design Interface -

we have login structure replace structure. however, keep both incase new structure not work. what have right now passwordcontrol.cs public class passwordcontrol { public passwordcontrol() { // code here } public dologin() { // code here } } main.cs provide void btnlogin() { passwordcontrol pw = new passwordcontrol(); pw.dologin(); } we convert design structure iloginmanager.cs interface iloginmanager { void dologin(); } so can add second structure passwordcontrol2.cs public class passwordcontrol2 { public passwordcontrol() { // code here } public dologin() { // code here } } how need modify code in main.cs take advantage of new design? you want alternate between various implementations of same contract in runtime , that's why want use interface. interface contract: if class implements interface, provides services defined in interface. if class implements iloginmanager interface,

javascript - Highcharts series update with animation -

i can update data value of spider chart , see animated using method: chart.series[i].setdata(newseries[i].data); but, series in spider chart consists not of data other fields, in series: [{ name: 'allocated budget', data: [43000, 19000, 60000, 35000, 17000, 10000], pointplacement: 'on' }, { name: 'actual spending', data: [50000, 39000, 42000, 31000, 26000, 14000], pointplacement: 'on' }] along data, when need change value name: 'actual spending' , how can update series animation? because, example if call: chart.series[i].update({series: newseries[i] , name : newname}); there won't animation. if still unclear... well, jsfiddle worth 100 words. update name , set data desired animation: chart.series[0].update({name:'new title'}); chart.series[0].setdata(newdata); see working fiddle.

ios - How to use .isempty in OS X swift -

i new swift, , i'm trying make login program mac os x. know swift programming on ios, don't know os x swift. wrote program os x. finished it, need know how check whether text fields empty or not. in ios, can using .isempty property. doesn’t work on os x though. how can this? class insideviewcontroller: nsviewcontroller { @iboutlet var usernametext: nstextfield! @iboutlet var passwordtext: nssecuretextfield! @iboutlet var conformpasswordtext: nssecuretextfield! override func viewdidload() { super.viewdidload() // additional setup after loading view. } override var representedobject: anyobject? { didset { // update view, if loaded. } } @ibaction func signupbutton(sender: nsbutton) { let username = usernametext.stringvalue let userpassword = passwordtext.stringvalue let userpasswordcon = conformpasswordtext.stringvalue nsuserdefaults.standarduserdefaults().seto

php - codeigniter update method not working -

i new codeigniter , trying write update function update information in database. i've gone through few tutorials reason code not working! tips or assistance appreciated. i'm testing 2 fields right now, name , email, , blank page when go update view. here model method: function get_by_id($id){ return $this->db->get_where('table',array('id'=>$id)); } function update($id){ $attributes=array( 'name'=> $this->input->post('name'), 'email'=> $this->input->post('email') ); return $this->db->where('id',$id) ->update('table',$attributes); } and here relevant controller code: function edit(){ $data['row']=$this->mymodel->get_by_id($id)->result(); $data['name']= 'name'; $data['email']='email'; $this->load->view('updateview', $data); } function update($id){ $this->load->mo

c# - Moving javascript from view to javascript file -

i have several views contain same javascript. <script type="text/javascript"> $(function () { $("#addanother").click(function () { $.get('/questiongroup/questionentryrow', function (template) { $("#questioneditor").append(template); }); }); }); </script> i decided move logic javascript file. here did. on view added data-attr. <a method="get" action="@url.action("questionentryrow", "questiongroup")" href="#">add another</a> in javascript file added following code. var insertrow = function () { var $a = $(this); var options = { url: $a.attr("action"), type: $a.attr("method") }; $.ajax(options).done(function (data) { var $target = $($a.attr("data-cban-target")); $target.append(data); }); return false };

Doxygen LaTeX / PDF links point to page 1 -

Image
i using doxygen create product manual, , ran issue. some links in outputted pdf (created latex) broken; point first page of document. the accompanying html output not suffer issue; links work fine, shown below: the doxygen code page: /** @mainpage [product] developer's guide blah blah blah. manual divided following sections: - @subpage intro - @subpage [etc] */ further notes: i tried @ref instead of @subpage. no difference. some other references in pdf broken (automatic file references in sections), many work fine. here's latex intermediate page: this manual divided following section\-: \begin{doxyitemize} \item \hyperlink{intro}{product introduction} [etc] edit: manual solution found open refman.tex latex output directory change entry \hypertarget{d1/dfb/intro}{} \hypertarget{intro}{} repeat other pages run latex pdf tool this not viable solution automated processes though, question still open. as stated i

Is there a Django 1.7+ replacement for South's add_introspection_rules()? -

back in days of south migrations, if wanted create custom model field extended django field's functionality, tell south use introspection rules of parent class so: from south.modelsinspector import add_introspection_rules add_introspection_rules([], ["^myapp\.stuff\.fields\.somenewfield"]) now migrations have been moved django, there non-south equivalent of above? equivalent needed anymore, or new migration stuff smart enough figure out on own? as phillip mentions in comments, deconstruct() is official way handle custom fields in django migrations. to go on complete request clarification... appear there couple of examples of code out there written handle both. example, excerpt (to handle on parameter exclusivebooleanfield ) taken django-exclusivebooleanfield : from django.db import models, transaction django.db.models import q 6 import string_types six.moves import reduce try: transaction_context = transaction.atomic except attributeerror

xml - Can't find the file in Java web project -

i stuck here last night. in project, need read xml file , use relative path.(like string location = "auctionitem.xml"; file f = new file(location); below) string location = "auctionitem.xml"; file f = new file(location); document doc = builder.parse(f); it worked if used java text file. public static void main(string[] arg){ file f = new file("auctionitem.xml"); system.out.println(auctionitemscontrol.getvalue().size()); // here method below call function has relative path. } however, when used them in project jsp, gave error : java.io.filenotfoundexception:/users/xxx/documents/tool/web/eclipse/eclipse.app/contents/macos/auctionitem.xml (no such file or directory)

git rebase - Introduce local changes in git to specific comment in the past -

suppose have 2 commits on top master branch , uncommited local changes. master -> commit 1 -> commit 2 -> (uncommited changes) in commit 1 changed file a, in commit 2 changed file b. uncomitted changes contain both file , b modifications. want take uncommited changes file , edit commit 1 contain these changes. same commit 2 , file b. have not pushed yet. tried use git rebase -i git stash no success here's how it: $ git add -p [interactively add changes] $ git commit -m $ git add -p [interactively add b changes] $ git commit -m b now have 4 commits, each changing 1 file @ time. do $ git rebase -i master and reorder commits commit 1, a, commit 2, b , mark , b fixup. save , quit , should rebase cleanly giving want.

java - Adding integer to ArrayList adds -1 not value -

when add integer arraylist adding value of -1 , not value such 349823 . calling counter object named "c". syntax nameoflist.add(c.instructioncounter); does 1 know wrong? requested whole class, lot. trying add counter values arraylist , pass array method count standard deviation. bare me names. import java.util.arraylist; import java.util.random; import javax.swing.plaf.synth.synthseparatorui; public class comparator extends instrumentedsorter { static int count = 1000; static float selectionic = 0;static float selectione = 0;static float insertionic = 0; static float insertione = 0;static float bubbleic = 0;static float bubblee = 0;static float quickic = 0; static float quicke = 0;static float rquickic = 0;static float rquicke = 0;static float mergeic = 0;static float mergee = 0; static arraylist<integer> saic = new arraylist<integer>(); static arraylist<float> sae = new arraylist<float>(); static arraylist<inte

objective c - Make Video From Image iOS -

Image
i found tutorial http://codethink.no-ip.org/wordpress/archives/673#comment-118063 question screen capture video in ios programmatically of how this, , bit outdated ios, renewed it, , close having work, putting uiimages isn't quite working right now. here how call method in viewdidload [captureview performselector:@selector(startrecording) withobject:nil afterdelay:1.0]; [captureview performselector:@selector(stoprecording) withobject:nil afterdelay:5.0]; and captureview iboutlet connected view. and have class screencapture.h & .m here .h @protocol screencaptureviewdelegate <nsobject> - (void) recordingfinished:(nsstring*)outputpathornil; @end @interface screencaptureview : uiview { //video writing avassetwriter *videowriter; avassetwriterinput *videowriterinput; avassetwriterinputpixelbufferadaptor *avadaptor; //recording state bool _recording; nsdate* startedat; void* bitmapdata; } //for re

html5 - Priority charset detection in web browser -

i need know priority of processing of encoding indication in web browser(html5). answer please sources please. http header bom meta heuristic / user setting i dont know number of bom(somewhere second[ https://blog.whatwg.org/the-road-to-html-5-character-encoding] , somewhere first[ how html meta charset works ). dont know when browser detects according user setting when heuristic method. sources: http://www.w3.org/tr/html401/charset.html#h-5.2.2 , http://www.w3.org/tr/html5-diff/#character-encoding , http://www.w3.org/tr/html5/document-metadata.html#charset big thx. bom should go before http header. [1][2] there many official documents that say http header goes before bom. apparently , ignore them , reverse order such latter has higher precedence. therefore: bom http header content-type: <meta> / @charset css environment ( charset attribute of parent <iframe> , <link> elements, encoding of parent document, etc) and/or he

ios - How to get ALAsset from saved photo -

is there way know alasset corresponding uiimage? i use uiimagewritetosavedphotosalbum saving photo , need identify in asset list update : i used writeimagetosavedphotosalbum instead of uiimagewritetosavedphotosalbum alassetlibrary.writeimagetosavedphotosalbum(image.cgimage, orientation: orientation) { (url, error) -> void in alassetlibrary.assetforurl(url, resultblock: { (asset) -> void in //code }, failureblock: { (error) -> void in //code }) } i use uiimagewritetosavedphotosalbum saving photo , need identify in asset list if need identify resulting asset, why using uiimagewritetosavedphotosalbum ? "stupid" function. if want save image asset library in such way have access asset, need save "smart" way, such alassetslibrary's writeimagetosavedphotosalbum - has completion handler hands url of resulting asset.

javascript - File Upload Preview in AngularJS -

how can implement file upload preview( http://opoloo.github.io/jquery_upload_preview/ ). using file upload. https://github.com/danialfarid/angular-file-upload if add preview script, angular script not working in page. here controller structure. var app = angular.module('nomunoli.controllers', []); app.controller('nmnl012ctrl', ['$scope', '$routeparams', 'nmnl012service', '$location', function ($scope, $routeparams, nmnl012service, $location) { var request = {'groupid': $routeparams.id}; $scope.group = nmnl012service.nmnl012fun14.query(request); $scope.talentlist = nmnl012service.nmnl012fun01.query(request); }] ); this input div in page. <div class="form-group col-md-12"> <div class="col-md-4"> <input id="talentupload" type="file" ng-file-select ng-model="talentfile" accept="image/*&

2 C Errors Incompatible type and expected type -

this question has answer here: passing matrix function, c 5 answers i'm trying store 3 sets of 5 double numbers user input. need store information in 3 x 5 array , compute average of each set of 5 values. i can't figure out how fix 2 errors. first error: hw9.c:27:2 error: incompatible type argument 1 of 'set_average' set_average (array[row][col]); ^ second error: hw9.c:8:6: note: expected 'double (*)[5]' argument of type 'double' void set_average(double array[row][col]); thanks , suggestions. #include <stdio.h> #define row 3 #define col 5 void set_average(double array[row][col]); void all_average(double array[row][col]); void find_largest(double array[row][col]); int main(void) { double array[row][col]; int i, j; printf("enter 3 sets of 5 double numbers.\n"); (i = 0; < 3;

h.264 - AS3.0 Loopback H264 Flv by appendBytes is not smooth -

i use data generation mode loopback h264 flv real-time vide,the video data collected webrtc , pushed immediatly flash player. set buffer time=0, , sure there no "buffer empty" during time,but freeze while when camera move fast. if set buffer time=3, play smoothly. any 1 can me, thank you.

c - Print TCP Packet Data -

in tcp communication, when packet being transferred ethernet network(ip) layer, want print data present in packet? i working on linux. i got information can done of linux kernel code i.e in linux nat firewall code. kernel source code? these coding being done? how print data tcp packets below example need: hook received tcp packets , print payloads. if want print other information received packet (like binary data), need modify bit section under comment: /* ----- print needed information received tcp packet ------ */ if need trace transmitted packets instead of received ones, can replace line: nfho.hooknum = nf_inet_pre_routing; with one: nfho.hooknum = nf_inet_post_routing; save next files , issue make command build kernel module. sudo insmod print_tcp.ko load it. after able see sniffed information using dmesg command. if want unload module, run sudo rmmod print_tcp command. print_tcp.c : #include <linux/module.h> #include <linux/netfil