Posts

Showing posts from September, 2011

return value - Passing method argument through ternary operator in java -

code: public class foo { static void test(string s){ system.out.println("string called"); } static void test(int s){ system.out.println("int called"); } public static void main(string[] args) throws exception { test(5>8? 5:8); // line 1 test(5>8? "he":"ha"); // line 2 test(5>8? 5:"ha"); // line 3 system.out.println(5<8? 5:"ha"); //line 4 } } when execute code following error @ line 3 foo.java:24: error: no suitable method found test(int#1) test(5>8? 5:"ha"); // line 3 ^ using similar type in ternary operator not give error. using different types gives error method call test(5>8? 5:"ha"); works call system.out.println(5<8? 5:"ha"); when add overloaded method static void test(object s){} , //line 3 compiles. can please explai

Selection using Android IME -

in input method service trying select text before current cursor position. following code snippet inputconnection inputconnection = getcurrentinputconnection(); extractedtext extractedtext = inputconnection.getextractedtext(new extractedtextrequest(), 0); inputconnection.setselection(extractedtext.selectionstart-1,extractedtext.selectionend); inputmethodmanager inputmethodmanager = (inputmethodmanager) getsystemservice(context.input_method_service); inputmethodmanager.updateselection(null, extractedtext.selectionstart-1,extractedtext.selectionend, 0, 0); this has flaky behaviour, selects, moves cursor 1 step back. can point out doing wrong? addition: since question has remained unanswered time, pose alternate question. looking around alternate ways of selecting text , on hackers-keyboard, pressing shift , arrow key trick, not able replicate process. tried sending d-pad keys down , key-events along meta_shift_on

java - How to customize displayed task fields in task dashboard? -

when user login alfresco see task dashboard displays following task fields default. description (or task message) task name task status is there way add/remove fields users or default task dashboard?

scala.js - Fetching data from a webpage when a button is pressed in scala js -

i want fetch data text boxes i've in form on web page in scala js. i've tried using html'` onclick event : <button id="submit" type="button" onclick="tutorialapp().fun()">submit</button> and i've created function in tutorialapp object : object tutorialapp extends jsapp { @jsexport def main(): unit = { ..... } def fun():unit = { println("button clicked") } but showing error tutorialapp().fun() not function. wrong code ? as alternative, might want register onclick handlers in code: import org.scalajs.dom def main(): unit = { dom.document.getelementbyid("submit").addeventlistener("click", fun _) } the advantage not need export fun , compile time name safety (i.e. if rename fun , compiler tell if forgot rename somewhere).

gulp - GulpUglifyError:Unable to minify JavaScript -

Image
i trying minify script files using gulp task runner , trying gulp-uglify plugin code: gulp.task('concat', function() { return gulp.src('app/**/*.js') // .pipe(concat('script.js')) .pipe(uglify()) .pipe(gulp.dest('./dist/')) }); but getting error as when try run gulp task gulp concat appreciated to see error in console: var gutil = require('gulp-util'); gulp.task('concat', function() { return gulp.src('app/**/*.js') // .pipe(concat('script.js')) .pipe(uglify()) .on('error', function (err) { gutil.log(gutil.colors.red('[error]'), err.tostring()); }) .pipe(gulp.dest('./dist/')) }); to find exact file line no of error register , run task: var pump = require('pump'); gulp.task('uglify-error-debugging', function (cb) { pump([ gulp.src('app/**/*.js), uglify(), gulp.dest('./dist/') ], cb

Angular 2- what is the best way to set multiple components in one path without losing data using TypeScript -

export const routes: routes = [ {path: '', redirectto: 'login', pathmatch: 'full'}, { path: 'login',component: logincomponent }, {path: 'main', component: maincomponent ,}, { path: 'dashboard',component: dashboardcomponent, children: [ { path: ':id', children: [ { path: '',redirectto: 'registration', pathmatch: 'full'}, { path: 'registration', component: registrationcomponent, }, { path: 'contact', component: contactcomponent }, ] } ] },]; how maintain input fields data in contact , registration component. multiple child views data lost on moving 1 child component child. dashboard component 1: @component({ selector: 'registration', template: `<input ty

HTML - Open localization via explorer.exe / file via excel -

i have got hyperlink in html. used code, example: <a href="//test/test/test" target="_explorer.exe">open_me</a> question 1: want open localization in explorer.exe. how can make it? question 2: need open file (excel macro - xlsm) via hyperlink in excel. <a href="//test/test/test/test.xlsm">click_me</a> maybe should add meta? please write should do. thank you you can open same new browser setting property target="_new" , can't open in different browser. anyvay, can open popup window using javascript, not best. http://www.aspsnippets.com/articles/popups.aspx you need create shared folder on network , put workbook there. can use file:///server/path/file.xls format in <a /> links on intranet direct user actual file on server. i recommend start creating simple html doc on desktop familiar file:/// path format. eg <html> <head /> <body> <a href

php - How to highlight each cell in table that returns '0000-00-00', empty or invalid date? -

im trying highlight cells returning '0000-00-00', empty or invalid date table cant find solution.please see code below <table class="main_table_med"> <tr class="med_tr"> <th>exam location</th> <th>exam date</th> </tr> <tr> <?php while($row = mysql_fetch_array($select)){ ?> <td id='ex_date' class="tb_dt"><?php echo $row['exam_date']?></td> <td id='due' class="tb_dt"><?php echo $row['exam_due']?></td> </tr> <?php }

php - jQuery automatically updated value on view when button clicked -

i create button current value on database , when button has been clicked value must automatically updated on view. currently, value updated on database, not automatically updated on view. here jquery code: <script type="text/javascript"> $(document).ready(function(){ $('#like').on('click', function(e){ var id = '{{$news->id}}'; $.get('{{ url('view/like')}}/'+id, function(data){ console.log(id); console.log(data); $('#like_data').empty(); $.each(data, function(index, element){ $('#like_data').append("<p>"+this.like+"</p>"); }); }); }); }); </script> here controller: public function like($id){ $news = news::find($id); $news->like += 1; $news->save(); return $news; } you need

c# - How to change .wav format audio file bitrate -

in application have .wav format audio files, here check audio file bit rates using naudio dll, if bitrate below 128kbps want change above 128kpbs, wrote below code check bit rate, if less 128kbps convert above 128kbps. int bitrate; using (var reader = new wavefilereader(textbox1.text)) { bitrate = reader.waveformat.averagebytespersecond * 8; reader.dispose(); } if (bitrate < 128000) { using (var reader = new wavefilereader(textbox1.text)) { var newformat = new waveformat(8000, 16, 1); using (var conversionstream = new waveformatconversionstream(newformat, reader)) { wavefilewriter.createwavefile(@"c:\docs\files\", conversionstream); } } } for files working fine, files getting below error, an unhandled exception of type 'naudio.mmexception' occurred in naudio.dll additional information: acmnotpossible calling acmstreamopen i attaching error snap here. error error snap here, how can

Android studio 2.2.2 Cmake add prebuild FFmpeg 3.2 error -

i use android studio 2.2.2 version on windows , cmake function try add prebuild ffmpeg 3.2 version on mac. i search many question on here still got error message error:error: 'libs/armeabi/lib/libavformat-57.so',needed '../../../../build/intermediates/cmake/debug/obj/armeabi/libnative-lib.so',missing , no known rule make i did project include c++ support , ffmpeg prebuild lib , include place c:\users\fw\androidstudioprojects\myapp\app\libs\armeabi . i build project got error everytimes. does can , tell me why should do. thanks

java - JSOUP scrape html text from p and span -

i'm having hard time getting correct output. please see below sample text html: <p><span class="v">1</span> een psalm van david. de heere mijn herder, mij zal niets ontbreken.</p> <p><span class="v">2</span> hij doet mij nederliggen in grazige weiden; hij voert mij zachtjes aan zeer stille wateren.</p> <p><span class="v">3</span> hij verkwikt mijn ziel; hij leidt mij in het spoor der gerechtigheid, om zijns naams wil.</p> i want value of paragraph een psalm van david. de heere mijn herder, mij zal niets ontbreken. based on user's selected verse so far i've done: httpget = new httpget(url); httpresponse resp = client.execute(get); string content = entityutils.tostring(resp.getentity()); document doc = jsoup.parse(content); stringbuilder sb = new stringbuilder(); elements passage = doc.select("p > span.v"); sb.append(passage.text() + "

Laravel ElasticSearch aggregate groupby -

i'm using https://github.com/sleimanx2/plastic communicate elasticsearch server. hit problem trying groupby field. i'm doing @ moment dish::search() ->sortby('food_image', 'desc') ->aggregate(function ($builder) { $builder->terms('unique_dishes', 'title'); })->get(); and result looks array:1 [▼ "unique_dishes" => array:3 [▼ "doc_count_error_upper_bound" => 31445 "sum_other_doc_count" => 7376915 "buckets" => array:10 [▶] ] ] how continue here? there way group without using aggregates? guidance appreciated. in advance

angularjs - Should i implement view model for fast querying? -

i referring code sample in this website. however saw used both views , modelview. then, i've come across blog stated among 10 do's , don'ts faster sql queries, don’t use orms (object-relational mappers) when searched orm code samples, seemed entity framework. so, wise example follow? or should stick simple queries? because, thing is, in project, function has query multiple tables. should stick code-first implement conventional querying? or alright follow website showed? added is this tutorial following 'best practices'? found when searched dto tutorials. wondering since concept looked similar angularjs, should implement either 1 of them or implement both together?

javascript - Is it possible to test your react app entry point with jest? -

i have react app has following entry point: // import dependencies import react 'react'; import { render } 'react-dom'; import { browserhistory } 'react-router'; import { synchistorywithstore } 'react-router-redux'; import configurestore './store/configurestore'; import root './containers/root'; const store = configurestore({}); const history = synchistorywithstore(browserhistory, store); render( <root store={store} history={history} />, document.getelementbyid('react') ); a pretty common configuration. i'm wondering how test since doesn't export anything, , jest relies on importing want test.

java - Fetch an XML node-name as regex in XSL Stylesheet transformation -

i have xml (i know incorrect per xml standards restricted changes processing response external party) follows, xml snippet : <root> <3party>some_value</3party> </root> i fetch <3party> above snippet in xsl stylesheet transformation. fact <3party> element invalid can no refer follows fails xsl compilation. need way refer partial element may using regx way? following incorrect. <xsl:variable select="$response/root/3party" /> any answers me out. edit : possible solution above usecase be. <xsl:for-each select="$response/root"> <!-- node name --> <xsl:variable name="name" select="local-name()" /> <!-- check if contains party --> <xsl:if test="contains($name, 'party')"> <!-- node value --> <xsl:variable name="value" select="node()"

git - Allow Github Organization to read repository -

i have created repository inside organization, , want give members of organization access read/fork repository without making public. is possible? i know add members manually team called "all members" , give team access. organization large, people quitting , starting time. don't want have remember adding/removing people group. i know answer little late can adjusting default repository permission. go organisation on github move "member privileges" select wanted option "read" in "default repository permission" note apply of repositories organisation ownes. note rule applicable members of organisation , not outside collaborators.

One resource file per language for entire asp.net core project -

is possible have 1 resource file (per language) entire project in stead of per controller , per view (as mentioned in manual https://docs.asp.net/en/latest/fundamentals/localization.html )? a resource file per controller , language seems bit overkill. yes, possible. you've override stringlocalizer , stringlocalizerfactory . custom can store resource in 1 or many files, in database or in json files. or other magic... and need register custom service: public void configureservices(iservicecollection services) { services.addsingleton<istringlocalizerfactory, your_localizer_factory>(); }

javascript - AngularJS select dropdown not showing up -

i have problem select tag, got populated data wcf-service. when click on selectbox won`t open (see picture below), when navigate keyboard arrows, can select data. other sad thing is: not happen regular. occours, not. this happens after click on select box . point of time data loaded service. the concept of 2 select boxes shown below: after selecting in first select box ( name="kind" ), second should appear. works fine, when error occours , can select data keyboard. if bug in first select box, in second. setup: ie 11, angularjs v1.5.5, bootstrap v3.3.5 did not happen in ff or chrome datastructure of $agronomicservice.kindsoftasks.kindsoftasks it list of objects object: [{id: 1, name: "somename"}, {id: 2, name: "somename2"}] html-code <table class="tablepadding"> <thead></thead> <tbody> <tr> <td class="taskagronomicsfontsize">{{i18n.sometranslation1}}:&l

sql - Getting Error while run function MD5 -

my function: declare @data varchar(50) = 'rushang' declare @hash char(32) set @data = 'micro' + @data exec master.dbo.xp_md5 @data, -1, @hash output select substring(@hash,5,17) error: msg 17750, level 16, state 0, procedure xp_md5, line 1 not load dll xp_md5.dll, or 1 of dlls references. reason: 193(%1 not valid win32 application.). (1 row(s) affected) result:- null for md5 why not use 2008's built in hashbytes()? declare @in nvarchar(4000) = n'hello' declare @out varbinary(16) set @out = hashbytes('md5', @in) select @out

c# - Getting access to Hive using .Net Core? (Incompatible libraries) -

i've been searching around quite time now, see if possible connect .net core application (hadoop) hive service? i've found few libraries available .net connect hive, when try download these packages , restore .net core application, errors saying installed package not available/compatible .net core. i wondering if out there have knowledge of whether possible? for now, want input connection variables (ip, port number, username , password) , see if can start writing commands hive data it. i'm using mysql database, store data , connection , running using ef7 .net core application. want following function work: public bool gotconnectiontohive(string ip, int portnr, string username, string password) { bool connected = false; //get connection hive.. (using input parameters) //set connected = true if connection live, else leave return connected; }

javascript - Check selected image dimenions and alert if out of scope -

i have function displays selected image along image width , height. put in check alert if image dimensions greater 390x390. have marked place think size check should go, may wrong. not work anyway. if has time please take see how should dong size check. many in advance time. my script: window.url = window.url || window.webkiturl; var elbrowse = document.getelementbyid("image_field"), elpreview = document.getelementbyid("preview2"), useblob = false && window.url; // `true` use blob instead of data-url function readimage (file) { var reader = new filereader(); reader.addeventlistener("load", function () { var image = new image(); image.addeventlistener("load", function () { var imageinfo = '<br><br>your selected file size is<br> display width ' + image.width + ', display height ' + image.height + ' ' + ''; elpreview.appendchild( ); e

SCCM Powershell not logging to Network Drive -

i have written powershell script deployed via sccm. the scripts runs fine locally not when deployed via sccm. i have launched powershell script system account cannot change network share example \\server\logs.$\ but when change c:\temp works. setup share has correct permissions , being ran locally using system account. does have ideas on solve this.

python - Transforming and Resampling a 3D volume with numpy/scipy -

update: i created documented ipython notebook. if want code, @ first answer. question i've got 40x40x40 volume of greyscale values. needs rotated/shifted/sheared. here useful collection of homogeneous transformations: http://www.lfd.uci.edu/~gohlke/code/transformations.py.html i need treat every voxel in volume pair of (position vector, value). transform position , sample new values each coordinate set of transformed vectors. the sampling seems rather difficult, , glad find this: https://docs.scipy.org/doc/scipy-0.18.1/reference/generated/scipy.ndimage.affine_transform.html#scipy.ndimage.affine_transform the given matrix , offset used find each point in output corresponding coordinates in input affine transformation. value of input @ coordinates determined spline interpolation of requested order. points outside boundaries of input filled according given mode. sounds perfect. but usage tricky. here using code rotating image. rotation matrix 2x2,

ios - NSData to UIImage quality -

Image
i use uiimage *image = [uiimage imagewithdata: data] , larger size of image 4 times.original data.length=100 kb , image has more 400 kb.you might complete compression.but i'm through following method after compression data.length=200 kb . the following way compression method // spend size (kb) - (nsdata *)compressionimagedata:(nsdata *)data spend:(cgfloat)spend { if (data.length < spend) { return data; //no compression } uiimage *sourceimg = [uiimage imagewithdata:data]; cgfloat compression = 0.9f; cgfloat maxcompression = 0.1f; nsdata *imagedata = uiimagejpegrepresentation(sourceimg, compression); while ([imagedata length] > spend && compression > maxcompression) { compression -= 0.1; imagedata = uiimagejpegrepresentation(sourceimg, compression); } return imagedata; } download image method: - (void)loadposterimage:(nsstring *)i

php - Outputting Relation after Select - Eloquent Laravel -

i have laravel application , i've created relationship between 1 table , another. the relationship hasone on orderdetail model public function customer() { return $this->hasone('app\customer', 'cu_acc_code', 'od_account'); } i'm performing query on orderdetail $orders = orderdetail::where('od_entry_type','s') ->where('od_status','0') ->where('od_qtyreserved','<>','0') ->select( db::raw('case when sum(od_qtyord)=sum(od_qtyreserved)then 1 else 0 end fullallocated'), 'od_order_number', db::raw('sum(od_qtyord) ordered'), db::raw('sum(od_qtyreserved) allocated') ) ->with(['customer' => func

c# - Null Error Reading Connection String -

i getting null reference exception when trying connect database via connectionctrings["mydb"].connectionstring . this in using statement , same code i've used in many other projects, keeps telling me null reference , don't know why. the connection string named named correctly in web.config in same project wouldn't expect there permissions issues. what have missed? edit: have seen suggested answers, these solved putting string in web.config connection string is. code: connectionstring in web.config <connectionstrings> <add name="mydb" connectionstring="data source=192....; initial catalog=projectdb; integrated security=false; user id=user; password=password;" providername="system.data.sqlclient" /> </connectionstrings> function access db public static company retrievecompany(int id) { var cmp = new company(); try { using (var con = new sqlconnection(configurationmanager.con

testing - NUnit How will I get two data sources for my single testcase -

i have test data in locationtestdata class public static ienumerable validloc { { yield return new testcasedata("aaa", "qqqq"); //locationid , postal code } } public static ienumerable validpass { { yield return new testcasedata("bbbb", "wwww"); //locationid , postal code } } and here test case [test, testcasesource(typeof(locationtestdata),"validloc")] public void return(string value1, string value2, string value3, string value4) { } the error not enough arguments provided. i have tried in way, no luck [test, testcasesource(typeof(locationtestdata),"validloc")] [test, testcasesource(typeof(locationtestdata),"validpass")] public void return(string value1, string value2, string value3, string value4) { } any ideas around?

javascript - Access JSON Child Node via Variable - JSON2HTML -

i got following transform template: var transform = {'<>':'li','html':'${name} - ${version} - ${licensesources.package.sources[0].license}'}; now want transform json html json2html: var html = json2html.transform(data,transform); json looks this: { "id": "xxx", "name": "xxx", "version": "0.0.14-snapshot", "repository": "xxx", "directory": "./", "type": "(none)", "licensesources": { "package": { "sources": [{ "license": "bsd", "url": "(none)" } ] }, "license": { "sources": [{ "filepath": "xxx", "text": "xxx"

hive - Hadoop cluster and client connection -

Image
i have hadoop cluster. want install pig , hive on machines client. client machine not part of cluster possible? if possible how connect client machine cluster? first of all, if have hadoop cluster must have master node(namenode) + slave node(datanode) the 1 thing client node . working of hadoop cluster is: here namenode , datanode forms hadoop cluster, client submits job namenode. to achieve this, client should have same copy of hadoop distribution , configuration present @ namenode. client come know on node job tracker running, , ip of namenode access hdfs data. go link1 link2 client configuration. according question after complete hadoop cluster configuration(master+slave+client). need following steps : install hive , pig on master node install hive , pig on client node now start coding pig/hive on client node. feel free comment if doubt....!!!!!!

Android printscreen StreetViewPanoramaFragment -

i have relativelayout inside have streetviewpanoramafragment ( android:name="com.google.android.gms.maps.streetviewpanoramafragment") , wana able make screen shot of fragment when press button. what try : view v1 = this.getwindow().getdecorview(); v1.setdrawingcacheenabled(true); bitmap mbitmap = bitmap.createbitmap(v1.getdrawingcache()); v1.setdrawingcacheenabled(false); file photofile = null; try { if (ninstance instanceof streetview) { photofile = createimagefile(); } fileoutputstream outputstream = new fileoutputstream(photofile); int quality = 100; mbitmap .compress(bitmap.compressformat.jpeg, quality, outputstream); outputstream.flush(); outputstream.close(); } catch (ioexception ex) { } i overall printscreen should appear streetview capture.... is't transparent :( i great me capture streetviewpanoramafragment , not screen any ? thanks

javascript - D3.js Flipping text at the bottom half of a donut (arcs) -

i following this tutorial . made last part, data, code doesn't work (i explain later). here's jsfiddle of code far. have commented part flips text works. if (d.endangle > 90 * math.pi/180) { var startloc = /m(.*?)a/, middleloc = /a(.*?)0 0 1/, endloc = /0 0 1 (.*?)$/; var newstart = endloc.exec( newarc )[1]; var newend = startloc.exec( newarc )[1]; var middlesec = middleloc.exec( newarc )[1]; newarc = "m" + newstart + "a" + middlesec + "0 0 0 " + newend; } so far, have not understood regex (even before part, var firstarcsection = /(^.+?)l/; ). factor should angle, , should rotate text 180 degrees , place around arc again facing right way. here's data: var donutdata = [ {name: "firstarc", value: 16}, {name: "secondarc", value: 9}, {name: "thirdarc", value: 2}, {name: "fourtharc", value: 62}, {name: "fi

html - Create hreflang tags only using Liquid in Business catalyst -

i wondering if there more efficient way create hreflang tags, using liquid in bc, without need create webapp. i tried way makes sense, doesn't work reason. {% capture pagurl -%}{module_pageaddress}{% endcapture -%} {% if pagurl contains "http://us." -%} <link rel="alternate" href="{{ pagurl}}" hreflang="en-us" /> <link rel="alternate" href="{{ pagurl | replace: 'http://us', 'http://www' }}" hreflang="en-uk" /> <link rel="alternate" href="{{ pagurl | replace: 'http://us', 'http://au' }}" hreflang="en-au" /> <link rel="alternate" href="{{ pagurl | replace: 'http://us', 'http://eu' }}" hreflang="en" /> {% elsif pagurl contains "http://au." -%} <link rel="alternate" href="{{ pagurl}}" hreflang="en-au" /> <link rel="alternate&q

ios - Can table cell selection segues be configured within storyboard interface builder when using XIBs? -

i'm designing uitableview in storyboard. initially, designing prototype cells within storyboard; i've moved using xib cell design, can reuse in multiple tables. when cells designed within storyboard, cell selection segues configured in storyboard also. using xib, cell selection segues not triggered when select cell. is there way of configuring selection segues of xib-designed cells within interface builder?

c - IOT Client-server communication using JSON object -

i have written code client server communication using iot... using json object parsing... api json_object_object_foreach(jobj,key,val) not getting executed, giving segmentation fault. please find out solution , let me know. server.c #include <unistd.h> #include <string.h> #include <json/json.h> #include<stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <stdlib.h> #include<netinet/ip.h> #include<arpa/inet.h> #include<errno.h> #include<sys/ioctl.h> #include<fcntl.h> #define magic 'k' #define my_cmd1 _iowr(magic,1,int *) struct stepper { int rot; int dir; int angle; }step; char buf[1024]; int x,y,z,i=0; int a[3]; void json_parse(json_object *jobj,int *a) { enum json_type type; printf("type: ",type); printf("json parsed\n"); json_object_object_foreach(jobj,key,val) { type = json_object_get_type(val

java - Overloading or a normal method -

this question has answer here: is possible have different return types overloaded method? 10 answers the relationship of overload , method return type in java? 4 answers i gonna put question have clear idea overloading concept in java . per understanding while method resolution in overloading compiler method signature should have same method name , different argument types . if return type different ?? class test{ public void m1(int i) { system.out.println(" int arg"); } public int m1(string s) { system.out.println("string-arg"); return (5+10); } public static void main (string[] args) throws java.lang.exception { test t = new test(); t.m1(5); int = t.m1("ani"); system.out.println(i); }} the above program runn

angularjs - Recaptcha request from production server -

i using cors plugin chrome , works fine when uses local machine, in production server error occurs: no 'access-control-allow-origin' header present on requested resource. origin therefore not allowed access. i understand problem, domain server different domain send request, understand users not add cors plugin avoid chrome specific features. so how can off checking access-control-allow-origin concrete post request? use angular send request. return $http({ method: 'post', url: url, headers:{ 'content-type': "application/x-www-form-urlencoded" }, data: $.param(data) }); i need avoid error on prod server. i ran issue few days ago , searched everywhere response. gathered, way cross-domain ajax request if have control of both of servers hosting each domain. way can add necessary headers in http requests allow cross-domain requests. if don't have control of both serv

javascript - Single Page Menu, link highlights undefined is not an object for offset.top -

so i'm working on 1 page menu using guide here: http://callmenick.com/post/single-page-site-with-smooth-scrolling-highlighted-link-and-fixed-navigation html <div class="um-member-nav-menu"> <ul> <li><a href="#car">car</a></li> <li><a href="#about">about</a></li> <li><a href="#students">students</a></li> <li><a href="#reviews">reviews</a></li> <li><a href="#social">social</a></li> </ul> </div> <div class="um-member-profile-content"> <div id="car">content</div> <div id="about">content</div> <div id="students">content</div> <div id="reviews">content</div> </div> js

Android Chatting Application best approach -

i new android , want build chatting application in android. have read many articles on in people has suggested me select 1 of following methods in order create chat-application in android 1) socket programming 2) push notification etc before starting work on want opinions how should proceed buddies have 2 questions 1) regarding front-end designing : what best approach design chat-box in order show conversation? of developers have used "listview+adapter" method show conversation between 2 users in each message list item, developer has used scroll view show conversation, sure first approach better second, there other optimal way become efficient app whats-app/facebook messenger? 2) regarding backend support : let suppose app users in thousands figure 5,000-10,000 , if use push notification method(fcm service) think app still work perfectly? i thank full you.. 1) think listview , adapter better solution; 2) think when interact database getting

android - ImageView animate -

i have problem animation. wrote code, nothing happens. public void animate(view v){ imageview img = (imageview) findviewbyid(r.id.imageview); img.animate().translationyby(-1000f).setduration(300); } i using android studio 2.2.2 try may you public void slidetoy() { animation slide = null; slide = new translateanimation(animation.relative_to_self, 0.0f, animation.relative_to_self, 0.0f, animation.relative_to_self, -5.0f, animation.relative_to_self, 0.0f); slide.setduration(2000); slide.setfillafter(true); slide.setfillenabled(true); img.startanimation(slide); slide.setanimationlistener(new animation.animationlistener() { @override public void onanimationstart(animation animation) { } @override public void onanimationrepeat(animation animation) { } @override public void onanimationend(animation animation) { } }); }

swift - Weird right margin for a section in UITableView -

Image
i have uitableview there weird margin right prototype cells. i have in view 2 different prototype cells 1 of them scale fine devices other 1 has weird right margin. second prototype cell's width constant. iphone 6/7 plus (on ipad margin larger...) storyboard

angular - Can't get objectname out of objectobservable -

Image
i got issue wane try data db. receive data cant display cause object instead of strings. how can these object strings have tried quiet things nothing seems working. component.ts this.artistitems = af.database.object('/users/'+this.artistid, {preservesnapshot: true}); this.artistitems.subscribe(snapshot => { this.artistvalues = snapshot.val(); this.artistitemsid = this.artistvalues.releases; console.log(this.artistitemsid) }); output in console artistitemsid aroundthefur:object b-sides&rarities:object diamondeyes(deluxe):object gore:object koinoyokan:object saturdaynightwrist(explicitversion):object thestudioalbumcollection:object database everything try put in component.html crashes have no idee how can values out of object instead of getting object itself when have in component.html <ul> <li *ngfor="let item of artistitemsid"> {{ item.value }} </li> </ul> i recieve error

sql server - TSQL - Geography: Which polygon? -

using sql server, when result of 1 expression @multipolygon.stintersects(@points) , indicating point within 1 of polygons comprising multi-polygon is there way of finding out polygon inside many within multi-polygon contains point? try splitting single multi-polygon row many, single-polygon rows in query , doing intersect, return matching rows. i haven't done myself, link might https://social.msdn.microsoft.com/forums/sqlserver/en-us/d99cef8e-d345-44ee-87e1-f9d4df851c35/multipolygon-results-split-into-polygons?forum=sqlspatial

Conversion of json object to object in jmeter -

Image
i have post api consuming json object. need pass json body data api. conversion of json object intended class object failing. have specify other parameters? you have specify content-type header application/json using http header manager (add child http sampler of post request), jmeter sends post request telling server body contains json using header.

How to extract performance values from aggregate graph table of jmeter -

Image
i using jmeter performance testing. want performance values aggregate graph table of jmeter in csv/xml file format. you can save results in csv format using aggregate report listener using "save table data" option. http://jmeter.apache.org/usermanual/component_reference.html#aggregate_report both aggregate graph , aggregate report shows same tabular data. so, can load results file (.csv/.jtl) aggregate report listener (using browse option). click on "save table data" button , save file in csv format..

android - java.lang.IncompatibleClassChangeError causes app to crash, using Firebase and Google Play Services -

Image
i'm receiving following crash log when run app firebase , google play services exception in emulator: 11-10 17:14:39.716 2645-2645/com.winjit.musiclib.sample e/androidruntime: fatal exception: main process: com.winjit.musiclib.sample, pid: 2645 java.lang.incompatibleclasschangeerror: method 'java.io.file android.support.v4.content.contextcompat.getnobackupfilesdir(android.content.context)' expected of type virtual instead found of type direct (declaration of 'com.google.firebase.iid.zzg' appears in /data/app/com.winjit.musiclib.sample-1/base.apk) @ com.google.firebase.iid.zzg.zzec(unknown source) @ com.google.firebase.iid.zzg.<init>(unknown source) @ com.google.firebase.iid.zzg.<init>(unknown source) @ com.google.firebase.iid.zzd.zzb(unknown source) @ com.google.firebase.iid.firebaseinstanceidservice.zzib(unknown source) @ com.google.firebase.iid.firebaseinstanceidservice.zza(unknown source) @ com.goo

symmetric encryption in c# resembles JAVA -

private static byte[] encryptdata(bytearrayoutputstream data, byte[] symmetrickey) throws encryptionexception { try { secretkey seckey = new secretkeyspec(symmetrickey, "aes"); cipher cipher = cipher.getinstance("aes"); cipher.init(cipher.encrypt_mode, seckey); return cipher.dofinal(data.tobytearray()); } catch (nosuchalgorithmexception | nosuchpaddingexception | illegalblocksizeexception | invalidkeyexception | badpaddingexception e) { throw new encryptionexception(e); } } i have situation need encrypt data using .net , decrypt same data using java. essentially, need rewrite above encryption method in .net. public byte[] encrypt(byte[] key, byte[] plaintext) { using (aescryptoserviceprovider aesprovider = new aescryptoserviceprovider()) { using (icryptotransform encryptor = aesprovider.create

django - Trying to get Count('foo__bar') inside annotate() -

im trying following line works: artists = models.artists.objects.all().annotate(tot_votes=count('votes__work')).order_by('-tot_votes') (i.e. want annotate count of votes corresponding every artist.) but whenever above line executed fielderror error cannot resolve keyword 'votes' field . where class votes(models.model): work = models.onetoonefield(works, models.do_nothing, db_column='work') user = models.onetoonefield(authuser, models.do_nothing, db_column='user') and class works(models.model): artist = models.foreignkey(artists, models.do_nothing, db_column='artist') # other irrelevant fields or relation between tables (votes --> works --> artists) i think you've got relationship wrong way round, haven't you? artist doesn't have kind of direct relationship votes, works. annotate call should count('work__votes') . (also note normal naming convention django use singul

ionic2 - ng2-translate fails on iOS device when trying to set language with NetworkError (DOM Exception 19): A network error occurred -

i have been trying figure out why globalization.getpreferredlanguage() fail when running on ios device (not when running on simulator or android device / emulator) globalization.getpreferredlanguage().then((property) => { let lang = property.value; if (lang) { if (lang.startswith('en')){ this.translate.use('en_gb'); } else if (lang.startswith('fr')) { this.translate.use('fr_fr'); } else { this.translate.use('en_gb'); } } else { console.log("property.value null"); } }).catch((reason) => { this.translate.use('en_gb');// <-- not not work, reason given networkerror (dom exception

cordova - How to find out what is causing my white screen of death? -

i have ionic app. it's works couple of weeks, stops. splash screen followed white screen of death. when debug using chrome://inspect app following message in console: no content-security-policy meta tag found. please add 1 when using cordova-plugin-whitelist plugin. if clear data on app, starts working, , same message when debug working app on device, don't think it's plugin @ fault. however, have used plugin explore white-screen problem, because can white screen of death if add following index.html (a content security policy prevents loading resources source): <meta http-equiv="content-security-policy" content="default-src 'none'"> when that, error messages in console: refused load stylesheet 'file:///android_asset/www/lib/ionic/css/ionic.min.css' because violates following content security policy directive: "default-src 'none'". note 'style-src' not explicitly set, 'def