Posts

Showing posts from July, 2011

arm - Whether does cmake work on cross-compiler Linaro chain? -

i have c project, supports many platforms. generator has borland makefiles, nmake makefiles, msvc 6, 7, 8, 9, 11, eclipse cdt4 ‐ unix makefiles etc. have generated msvc 9 solution cmake on windows 7. ok. now, generate arm cortex a8 project on ti sitara sdk, of above c project. ti sitara sdk installed on ubuntu 14.04 os host computer. there cross-compiling tool chain: linaro on ubuntu pc. from original c project document, looks below selection appropriate sitara sdk because uses eclipse (but has 8.1.1 on window, higher cdt4) eclipse cdt4 ‐ unix makefiles = generates eclipse cdt 4.0 project files. i have set compiler path: export cmake_c_compiler=/home/u64rj/ti-processor-sdk-linux-am335x-evm-01.00.00.03/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc export cmake_eclipse_version=4.2 when run cmake, there still such errors: u64rj@u64rj-ms-7696:~/u64rj-fixed/sdk-2-src$ cmake -g "eclipse cdt4 - unix makefile

c# - Setting the text of a PasswordBox -

i creating application requires user login (username + password). secure application, i'm using wpf's passwordbox.securepassword securely create hash of password (using sha512cryptoserviceprovider, hashing custom stream) use password rfc2898derivebytes. let's have aes-256-cbc implementation securely retrieves , stores key+iv not issue. implementing way users able store password don't have put them every time log in. far able store password securely using aes custom implementation , can read password securely (that is, without ever putting in memory in plain text). having problem when try replace text in passwordbox. passwordbox.securepassword read-only , have tried use passwordbox.securepassword.appendchar(somechar) field/value remains empty. imagine passwordbox.securepassword returns copy (securestring.copy()) , not original variable ( looking @ .net source code confirms this ). there way can achieve want or need create custom wpf control? to set text o

php - Swift for server side -

i'm doing first app ios in swift . have website watching videos , want make app. i have used php server-side language. question is: should use swift client side language build app use html , javascript , call php scripts on server data want or should use swift both client , server side connect database, process data etc.? swift , programming language made apple, @ present runs on: ios , os x , watchos , tvos . the new perfect.org project allow write server side logic in swift.

php - Instagram API : Get Integer from JSON -

this question has answer here: how extract data json php? 2 answers using code can id fine, can't figure out how integer part of array, example follows value: $result = file_get_contents("https://api.instagram.com/v1/users/1234/?access_token={token}"); $obj = json_decode($result); echo $obj->data->id; instagram json example: object(stdclass)#1 (2) { ["meta"]=> object(stdclass)#2 (1) { ["code"]=> int(200) } ["data"]=> object(stdclass)#3 (7) { ["username"]=> string(6) "testy" ["bio"]=> string(51) "blah blah" ["website"]=> string(26) "http://domain.com" ["profile_picture"]=> string(110) "https://scontent.cdninstagram.com/hphotos-xfa1/some.jpg" ["full_name"]=> string(16) "my testy" ["coun

spring - HTTP Status 400 - Required Integer parameter 'id' is not present -

i have problem when build spring + spring mvc + hibernate + mysql project. everything works fine when "editpage" , want post editing information mysql, following error tomcat: http status 400 - required integer parameter 'id' not present controller class @requestmapping(value = "/users/edit", method = requestmethod.post) public string saveedit(@modelattribute("userattribute") user user, @requestparam(value = "id", required = true)integer id, model model){ logger.debug("received request update person"); user.setid(id); personservice.edit(user); model.addattribute("id", id); return "editedpage"; } service class public void edit(user user){ logger.debug("editing existing user"); session session = sessionfactory.getcurrentsession(); user existinguser = (user) session.get(user.class, user.getid()); existinguser.setlogi

javascript - CreateJS filter performance -

i have been developing game using createjs , noticed significant performance drop when filter applied image. created small test case showcase problem: var isinitialized = false; function start(preload) { egg = preload.getresult("kiausinis"); center = new vector(stage.canvas.width/2,stage.canvas.height/2); eggimg = new createjs.bitmap(egg); stage.addchild(eggimg); eggimg.x = center.x-300; eggimg.y = center.y; centerorigin(eggimg); eggimg.on("click",applyfilters); eggimg2 = new createjs.bitmap(egg); stage.addchild(eggimg2); eggimg2.x = center.x; eggimg2.y = center.y; centerorigin(eggimg2); eggimg3 = new createjs.bitmap(egg); stage.addchild(eggimg3); eggimg3.x = center.x+300; eggimg3.y = center.y; centerorigin(eggimg3); fpslabel = new createjs.text("fps:","150px verdana","black"); fpslabel.linewidth = 200; fpslabel.textalign = "center"

jsf - Dynamic dropdown is not coming -

while selecting dropdown,the second drop down values not coming properly.i attaching code here xhtml file: <?xml version="1.0" encoding="utf-8"?> <!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" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <f:event listener="#{userdata.handleevent}" type="prerenderview" /> </h:head> <h:body> <f:view> <h:form > <table> <tr> <td> <h:messages showdetail="true" /> </td> </tr> <tr> <td><h:outputtext value="enter name : "/></td> <td><h:inputtext value="#{userdata.clientname}"/></td> </tr> <tr> <td><h:o

mysql - Python MySQLdb crashing randomly without errors -

i'm using python mysqldb perform calculations on large 75m row database. basic program flow iterate through every row, process data, use cursor put new data in row. processing complex pure sql. db1 = mysqldb.connect(host=host, user=username, passwd=password, db=database) db1.ping(true) cursor1 = db1.cursor() db = mysqldb.connect(host=host, user=username, passwd=password, db=database) db2.ping(true) cursor2 = db2.cursor() cursor1.execute("select * table") row in cursor1: cursor2.execute("select * table") new_data = process_stuff(row) cursor2.execute("update table set column = '%f'", (new_data)) db2.commit() db1.close() db2.close() this works, usually. though, silently quits no error message. sometimes, not always, give "mysql has gone away" error. it's rather slow. know it's large database, takes 24 hours process everything. it's decent machine 24 gb of ram, should take long? i've spen

applying for loop such that counters are multiplied rather than being added in python -

hello relatively new python! there way using loops in python? java implementation of want in python for (i=1;i<20; i*= 2) {system.out.println(i);} solution in while loop in python` while i<20: print i*=2 i cannot figure out way using loops. implemented using while loop obviously, still curious know whether there method or not there lots of ways this, e.g. for in range(5): = 2 ** print or using generators from itertools import count, takewhile def powers_of_two(): in count(): yield 2 ** in takewhile(lambda x: x < 20, powers_of_two()): print but in end, depends on use case version gives clearest , readbale code. in cases, use while-loop, since it's simple , job.

c# - How to launch self-hosted OWIN-based web api on my domain? -

i deploy asp.net web api on domain bought. want self-host it, don't need iis. read tutorials, need launch console application on server can self-host web api: public class program { static void main(string[] args) { // specify uri use local host: string baseuri = "http://localhost:8080"; console.writeline("starting web server..."); webapp.start<startup>(baseuri); // startup class has configurations web api console.writeline("server running @ {0} - press enter quit. ", baseuri); console.readline(); } } the problem is, able drop files on domain ftp client (such winscp). need run application on domain can route http requests web api? you can run console application on machine @ home (although, need forward requests public ip of router, , allow port-forwarding on router appropriate private ip address hosting application) or run console application on ec2 instance in amazon

update data via php in mysql DB -

i have looked on www , forum, not find answer work. want update post on .........../post.php?id=19 this function: function update_user($conn) { if(isset($_get['id'])) { $id = $_get['id']; $name = $_post['name']; $age = $_post['age']; $sql = "update users set name =':name', age = ':age' id=':id'"; $query = $conn->prepare($sql); $query->execute( array( ':name'=>$name, ':age'=>$age, ':id' => $id )); } } and form: <h3>update user</h3> <?php update_user($conn) ?> <form name="myform2" method="post" action= ""> <label>name:</label><input type="text" id="name" name="name"> <label>age:</label><input type="text" id= "age" name="age"> <input type="submit"

exception - Why is my Java app getting killed? -

i wrong line causing problem, error changes everytime change if() statement: try { while(true) { string lru = hashoperation(); system.out.println("in worker thread, should valid json: " + lru); if (jsonvalidator.isstringvalidjson(lru) && !lru.isempty()) { hashmap<string,string> messagemap = jsongenerator.readjson(lru); so assume problem if() statement. if write this: if (jsonvalidator.isstringvalidjson(lru)) { then app starts , exception: in worker thread, should valid json: exception in worker thread in main::main: no content map object due end of input but if write this: if (jsonvalidator.isstringvalidjson(lru) && !lru.isempty()) { then app starts up, instantly dies: /usr/bin/java -cp /home/jenkins/run-nlp/ssam.jar com.sofar.ssam.main starting nlp app 2015/08/30 21:42:28 loading classifier dependencies/english.all.7class.distsim.crf.ser.gz ... killed the basic idea here app starts , s

object - Javascript - get number of elements in Document Fragment -

i'm creating counter passing number following function: function numbertohtml(n) { function createspan(n) { var span = document.createelement('span'); span.textcontent = n; return span; } function iter(n, container) { if (n === '') return container; container.insertbefore(createspan(n.slice(-3)), container.firstchild); return iter(n.slice(0,-3), container); } return iter(string(n), document.createdocumentfragment()); } this returns: documentfragment [ <span>, <span> ] i'm havibng trouble number of elements in documentfragment. tried $(myobject).length , returns 1. how can no of items in documentfragment? sorry first answer wasn't correct. had trouble figuring out, how got outcome (that have been helpfull). looking is: var myobject = numbertohtml(3231123123); va

Python: Create a list (at N length) of all possible proportions of 1 incremented by d decimal points -

i want make list of floats of n length total sum 1 , each float incremented d amount. for example, let n = 4 , d = 0.01 : the desired outcome so: [0.90, 0.02, 0.03, 0.05] [0.89, 0.02, 0.03, 0.06] .... # , continues until possible sums of 1 above settings reached. # individual value can not = 0 i'm trying think of logic need help. had asked question of similar nature, uses random numbers instead of possible combinations. i think itertools makes pretty easy: from itertools import permutations, ifilter n = 4 d = 0.01 d = int(1/d) perms = ifilter(lambda x: sum(x) < d, permutations(range(1,d-1), n-1)) tuples = [] in perms: tuples.append(i + (d-sum(i),)) mylist = [ [ i*d in eachtuple ] eachtuple in tuples ] print mylist i had assumed d 10^(-n) integer n , work integer reciprocal (0.05 , 0.2 should work, not 0.03). floats being floats, floating-point errors, control appropriate round inside nested list comprehension.

java - Cannot cast from and ArrayList to HashMap -

i'm having problem arraylist of list of hashmaps. tried cast not allowed. here offending code: list<list<hashmap>> myhashmaps = asyncmusichashmap.fillhashmap(path); hashmap<string, string> artisthashmap = (hashmap<string, string>) myhashmaps.get(0); hashmap<string, list<string>> albumhashmap = (hashmap<string, list<string>>) myhashmaps.get(1); hashmap<string, list<string>> songhashmap = (hashmap<string, list<string>>) myhashmaps.get(2); with following exception message: exception in thread "main" java.lang.classcastexception: java.util.arraylist cannot cast java.util.hashmap @ com.bkane56.mp3.mp3handlingdao.addmusictodatabase(mp3handlingdao.java:51) @ com.bkane56.mp3.mp3handler.main(mp3handler.java:21) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmetho

Apple Watch simulator stuck loading in iOS simulator -

Image
when run watchkit app, apple watch simulator stuck loading. this, but, can run first time, is, first time after restarting ios simulator. if quit ios simulator , restart that, can run apple watch simulator once. now need restart simulator every time. that's annoying. there method situation? version 8.4 (simulatorapp-565.9 coresimulator-117.15) when happens me, successful after second or third launch of app (without quitting xcode or simulator). has been case both xcode 6 , xcode 7. if provide more details, can refine answer better. here things may work you, depending upon whether you're running xcode 7 or 6: try deleting , re-creating target scheme: so: apple watch simulator issue a variant of above: tutorial on apple watch natasha robot some suggestions have worked people on xcode 6.x: so: watchkit simulator won't load app regardless of work-around, if isn't due user error, perhaps best thing submit bug report apple. here suggest

java - Training NNs on GPU with DL4J -

could train nns on gpu using dl4j , nd4j , system parameters? windows 7 64bit nvidia geforce gt 420m (cuda computing capability - 2.1) largely no. gpus 2016 @ least recommended. require compute level 3.

python - Wolfram Alpha and scipy.integrate.quad give me different answers for the same integral -

Image
consider following function: import numpy np scipy.special import erf def my_func(x): return np.exp(x ** 2) * (1 + erf(x)) when evaluate integral of function -14 -4 using scipy 's quad function, following result: in [3]: scipy import integrate in [4]: integrate.quad(my_func, -14, -4) /usr/local/lib/python2.7/dist-packages/scipy/integrate/quadpack.py:289: userwarning: maximum number of subdivisions (50) has been achieved. if increasing limit yields no improvement advised analyze integrand in order determine difficulties. if position of local difficulty can determined (singularity, discontinuity) 1 gain splitting interval , calling integrator on subranges. perhaps special-purpose integrator should used. warnings.warn(msg) out[4]: (0.21896647054443383, 0.00014334175850538866) that is, 0.22 . however, when submit integral wolfram alpha , different result: -5.29326 x 10 ^ 69. what's deal? i'm guessing has warning scipy has given

javascript - jQuery - IF ELSE - Not reading any variables -

problem: update: have found not returned data post. literally every if else statement disregards variables almost entirely. i have tried extremely simple verify statement above. when code below executed, nothing happens. added consol.log() in before if statement ( in place of alert ) make sure getting data dom , is. html <input type='submit' name='confirm' class='button' value='confirm' > <input type='submit' name='cancel' class='button' value='cancel' > js $( '.button' ).on( 'click' , function() { var btnname = $( ).attr( 'name' ) ; var cancel = "cancel" ; var confirm = "confirm" ; alert( btnname + cancel + confirm ) ; if ( btnname == cancel ) { //some function here . . } else if ( btnname == confirm ) { //some function here . . } edit if run code be

objective c - iOS: Is it possible to detect a non finger touch? -

i have app expects coin placed on top of phone after it's loaded. possible detect coin , surface area touching phone? want create circle around edges of coin. the hardware responds kinds of conductivity, such of human skin. have experiment see happens different types of coin. if hardware can detect coin, software reduce touch point. iphone not in business of detecting coin shapes more in business of detecting finger shapes. thus, app unable find out coin is.

java - How to replay basic High Low game? -

i finished second java assignment class, stuck on how take user's last choice , either play again or quit. ideas? import java.util.random; import java.util.scanner; public class highlow { public static void main(string[]args) { random randomnumber = new random(); int answer = randomnumber.nextint(100) + 1; int numberoftries = 0; scanner userinput = new scanner(system.in); string userguess = null; boolean gamewin = false; { while (!gamewin) { system.out.println("welcome guessing game, guess number between 1 - 100 or type 'quit' exit: "); userguess = userinput.nextline(); numberoftries++; if (userguess.equals("quit")) break; if (integer.parseint(userguess) == answer) { gamewin = true; } else if (integer.parseint(userguess) < answer) {

javafx - JavaFX8 Collision Detection for ImageView -

when googled it, many people using getboundsinparent() , intersects(bounds) methods. concerned bounds of image rectangle. mouseevent works perfect on imageview(it detects real image , ignores transparent background). mouseevent detection, there way make collision effect using 2 imageview objects while ignoring transparent background?

Oracle Data Source missing from Visual Studio 2015 Enterprise -

i'm trying set connection (for first time) oracle database using visual studio enterprise 2015. i've downloaded latese 64 bit oralce access components ( http://www.oracle.com/technetwork/database/windows/downloads/index-090165.html ). i followed instructions , run "install_odpm.bat c:\orcl x64" install components. restarted visual studio, , tried add new model, there no oracle data source option. how added?

html - jquery remove focus issue with twitter-bootstrap tooltip -

i have test page bootstrap 3 using tooltip display message user when user mouses on icon. clicking on icon displays modal , when modal closed, tooltip remains displayed user because focus still applied icon. the way remove displayed tootip when user physically clicks somewhere on form remove focus icon. i have noticed display of tooltip issue occurs on tooltip examples page . i have tried use jquery remove focus when user clicks on icon, approach did not work anticipated. here html code: <a href="" id="id_page_help" data-target="#mymodal" data-toggle="modal" rel="tooltip" class="no_decoration" title="help"> <i class="icon-bulb icon_size18"></i> </a> here jquery code: <script> $('#id_page_help').click(function () { $('#id_page_help').blur(); //alert('xxxx'); //alert display - code triggered. }); </scrip

python - Image is not uploading via form -

i making django project , have 1 problem uploading images in forms. so, tried add 1 object image, in admin working, in form on site - not. my views: def newbook(request, user_id): form = bookadd(request.post or none) if form.is_valid(): book = form.save(commit=false) book.author = get_object_or_404(user, pk=user_id) book.save() return redirect('../%s' % book.id) return render(request, 'userbook/newbook.html', {'form': form}) my model: class book(models.model): """book compilation of sections subjects.""" author = models.foreignkey(auth_user_model) name = models.charfield(max_length=100) description = models.charfield(blank=true, max_length=256) cover = models.imagefield(upload_to='img/bookcovers') def __str__(self): return self.name my form: class bookadd(modelform): class meta: model = book fields = ('name&

c++ - Shouldn't this recursive method end as soon as you get to the return? -

i know why output is: a-b-b-b-b-0 when think should a-1 . shouldn't recursive method end return? , why doesn't here? i put letters '-' clarify returns being met not stopping there. #include <stdio.h> #include <iomanip> #include <iostream> using namespace std; void printv(int mask[], int elements[], int n) { int i; printf("{ "); (i = 0; < n; i++) if (mask[i]) printf("%d ", elements[i]); printf("}"); } int next(int mask[], int size) { int i; (i = 0; (i < size) && mask[i]; i++) mask[i] = 0; if (i < size) { mask[i] = 1; return 1; } return 0; } void nsubsets(int mask[], int elements[], int size, int n) { int sum = 0; int temp[10], count = 0; (int = 0; < 10; i++) //this must here temp[i] = 0; (int = 0; < size; i++) { if (mask[i]) { count++; (int k = 0; k < 44; k++) if (temp[k] == 0)

Javascript how to allow period in script that removes everything except numbers? -

here code have period "." allowed entered. code right allows numbers. needs changed allow happen? function check(o) { v=o.value.replace(/^\s+|\s+$/,''); // remove whitespace if(o=='') { return; } v=v.substr(v.length-1); if(v.match(/\d/g)==null) { o.value=o.value.substr(0,o.value.length-1).replace(/^\s+|\s+$/,''); } }; also see if there more efficient way write code? can optimizations made it? allow numbers , periods entered. in advance. you want use regex match numbers , or periods: /(\.\d)*/ source: mdn page on string.prototype.match https://developer.mozilla.org/en/docs/web/javascript/reference/global_objects/string/match

jquery - Turn each child of a selector into a row in my table -

i have div has multiple uls . each ul has button goes it. when user clicks button i'd remove ul , siblings , , parent main div create table represents removed ul such item name , quantity each li displayed row in table append table secondary div . here's have far as have now, if ul has multiple lis , of item names , quantities displayed in single row. here full screen result. code: $(document).ready(function () { $('.accptordr').click(function () { var text = $(this).closest('fieldset').children().first(); console.log(text); var thistr = text.parent(); var itemname = $(this).parent().prev().find('.list-group-item').justtext(); var badgehtml = $("<div/>").append($(this).parent().prev().find('.badge').clone()).html(); var result = $("<div/>").append('<br>'); /*var finalresult = badgehtml + result;*/ /*var r

ajax - Unable to add custom header to response -

i unable add custom header response returned render(): response = render(request, 'my_template.html', {'ctx1': 1, 'ctx2': 2}) response['my-custom-header'] = 'abc12345' return response this response ajax request initiated using jquery's $.get() . on chrome, response has template rendered properly, not have custom header. if print response object before returning, see has custom header. i thought issue because of this answer , added django middleware add header responses: class customheadermiddleware(): def process_response(self, request, response): response['access-control-expose-headers'] = 'my-custom-header' return response all responses have header access-control-expose-headers: my-custom-header , still see issue. my request local; i'm using django development web server. if send non-ajax request, whatever custom header add in django visible in response on chrome. issue seems limited ajax

memory management - How do I know the page cache size of a linux process -

now can know overall cached pages of system /proc/meminfo, can further know specific process how many page caches consume? first thought add rsses in smaps of process. more suggestions? thanks. @bill randerson, maybe can try below command, information regarding vm, signals , on ... regarding particular process. cat /proc/<process_pid>/status

javascript - Concatenating chosen random property to object to get the array? -

i have object few arrays in it. trying return 1 of arrays randomly. have function returns 1 of properties in object, not sure how use when concatenating object name. example: object: var myobj = { itemone:['blue','red','green'], itemtwo:['sky','grass','book'], itemthree:['day','month','year'] } to array myobj.itemone return first array. want randomly return array. have function return itemone , itemtwo , or itemthree randomly, when concatenating function returns myobj. not work. can do. here function: function pickrandomproperty(myobj) { var result; var count = 0; (var prop in myobj){ if (math.random() < 1/++count){ result = prop; } } return result; } var getiteminobject = pickrandomproperty(myobj); using getiteminobject returns, try concatenate myobj return array. how that? here have tried: var getiteminobject = pickrandomproperty(

ios - map view custom annotation view images not loading properly in device -

i using multiple annotation views different images in map view. images loading in simulator not in device.i not able figure out reason issue..following code - (mkannotationview *)mapview:(mkmapview *)mapview viewforannotation:(id<mkannotation>)annotation { if ([annotation iskindofclass:[mkuserlocation class]]) return nil; static nsstring * const annotationidentifier = @"customannotation"; annotationview1 = [mapurcommview dequeuereusableannotationviewwithidentifier:annotationidentifier]; mkannotationview *annotationview2 = nil; if (annotationview1) { annotationview1.annotation = annotation; if(mapurcommview.userinteractionenabled) annotationview1.image = [uiimage imagenamed:@"mappindarkblue75@2x.png"];// map-pin-black.png else { //if(annotationview1.annotation == self.currentannotation|| annotation == self.previousannotation) nslog(@"in annotatio

java - How to stick TabWidget in top of the screen while scrolling the layout in Android? -

i have tabwidget in code. how stick in top of screen in layout? <tabwidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="55dp" android:tabstripenabled="false"> </tabwidget> how achieve this? try using relative layout <relativelayout android:layout_width="match_parent" android:layout_height="wrap_content"> <tabwidget android:id="@android:id/tabs" android:layout_width="match_parent" android:layout_height="55dp" android:layout_alignparenttop="true" android:tabstripenabled="false"> </tabwidget>

javascript - Reload the tabs in angularjs -

i have problem! i have 2 tabs user's info , in header-bar 1 switch change user. use this: $state.transitionto($state.current, $stateparams, { reload: true, inherit: false, notify: true }); with change user in title tabs don't show change, need refresh de app f5. any help? you can use location reload app this: $location.path('/url')

how to hide angularJs Code when page is refreshed? -

Image
how hide angularjs code when page refreshed ? please see : how hide {{userinfo.username}} when page refreshed ? this not user-friendly. just use ng-cloak : <div id="template1" ng-cloak>{{ 'hello' }}</div> <div id="template2" class="ng-cloak">{{ 'world' }}</div> it hides given elements until application loaded. note documentation states best results, should load angular.js in head section, ensures functionality accessible right after head has been processed.

javascript - Meteor returning method not found error -

drug = new mongo.collection('drugdata'); if(meteor.isclient) { template.drugs.events( { 'submit .new-drug':function(event) { event.preventdefault(); var name = event.target.name.value; var type = event.target.type.value; var rating = number(event.target.rating.value); meteor.call('adddrug',name,type,rating); event.target.name.value=""; event.target.type.value=""; event.target.rating.value=""; } }); template.drugs.helpers( { 'druglist':function() { return drug.find({},{sort:{createdat:-1}}); } } ); } if(meteor.isserver) { meteor.publish('druglist',function() { return drug.find(); }); } meteor.methods( { adddrug:funct

jsp - Handle ServletException - Java Servlet API 3.+ -

i understand handling servletexception web-inf/web.xml file using <error-page> tag: <error-page> <error-code>500</error-code> <location>/error.jsp</location> </error-page> i've read several times, should avoid using web-inf/web.xml file in combination java servlet api 3.+. how handle servletexceptions without web-inf/web.xml ? you read/understood wrong. not free want , work, can't entirely avoid using web.xml anyway - in case. the heart of matter modern servlet specifications have useful annotations @webservlet , @webfilter , @weblistener make unnecessary declare such things servlets, filters , listeners inside web.xml saving bit of redundant xml configuration annoyance. particularly useful web frameworks , libraries can make things deploy automatically without having define in web.xml first. if want use own servlets still you, might argue having configured in web.xml gives 1 place can lookup configuration ra

HLSL: Cut a texture radially -

i'm having pixel shader: float4 pixelshaderfunction(float2 coords: texcoord0) : color0 { float4 color = tex2d(sampler0,coords); float dx = coords.x - 0.5f; float dy = coords.y - 0.5f; float tpos = dx * dx + dy * dy; if(tpos <= 0.25f && tpos > 0.25f-width ) return color; else return float4(0.0f, 0.0f, 0.0f, 0.0f); } this way able draw circle. how cut circle, e.g. draw 30 degrees circle? or 60 degrees one? thanks. i suggest use intrinsic atan2 ( doc )( wiki ) compute angle of fragment in relation circle center , clipping distance clipping.

java - PicketLink ClassNotFoundException org.picketlink.Identity on deployment to WildFly -

i want use picketlink apis in web application on wildfly server. tried use picketlink quickstart "picketlink-authorization-idm-jpa" basic implementation , enhance needs. when deploying (unmodified) application server classnotfoundexception org.picketlink.identity , don't know how resolve it. did have same problem , found solution that? i'm using eclipse mars , jboss wildfly server 8.2.0 , 9.0.1. i haven't faced issue before , may try below solutions 1) try adding dependencies,here might picketlink-core-**.jar in manifest.mf 2) if (1) doesn't work try adding jboss-deployment-structure.xml

Full Clang warning list with descriptions -

i need full clang warnings list. descriptions. ios. i've seen list of warnings here clang warnings but there no description. there place can full list of clang warnings description? there's neat project shows flags alongside warning messages: https://github.com/nshipster/fuckingclangwarnings.com http://fuckingclangwarnings.com/ while these not comprehensive explanations in cases, helpful, when want switch off specific warnings. the project hasn't been updated in while , missing few new warnings. dive clang's source code. haven't worked in while, can tell start: 1) clone clang repository 2) browse /include/clang/basic/diagnostic.td . file includes couple of other .td files contain various warnings, though i'm not sure if of them publicly available, , think external names prefixed, depending on category. suggest searching known warning (or description) solve puzzle. 3) interesting file /include/clang/driver/options.td , includes texts

Grails war size is more than 60 MB by default -

i'am working on grails 2.4.5 project , observed war file size whopping 80 mb. so, tried sample grails 2.4.5 project without additional dependencies , created war. it's 60 mb. may know what's reason behind this? without additional jars why war size big? i went through lib folder in war file , saw compile time dependencies grails plugins present there.as per knowledge, runtime dependencies should appear in war. right? hi reason following: grails mix of many frameworks, spring, hibernate etc. frameworks included , need them baseline of grails every grails application comes many plugins default (look buildconfig.groovy): cache, asset, scaffolding... name few. every plugin has own dependencies classes, jars, js... of them add up sollution: war , jar containers. open them favorite unzip program , check anyway don't see point in having "large" war file. maybe answers helps in understanding reason why.

c# - Exactly which object have I clicked on? -

<border name="firstborder" grid.column="0" grid.row="0" borderbrush="black" borderthickness="1"> </border> <border name="secondborder" grid.column="1" grid.row="0" borderbrush="black" borderthickness="1"> </border> <border name="thirdborder" grid.column="0" grid.row="1" borderbrush="black" borderthickness="1"> </border> <border name="fourthborder" grid.column="1" grid.row="1" borderbrush="black" borderthickness="1&q

javascript - How to know all JSON object has been iterated? -

this question has answer here: wait until jquery ajax requests done? 18 answers i m working on phonegap product using jquery , jquery mobile, scenario is, when user logging in first time, sync data , after done forward user view. items retrieved in json format server. here portion of code. have called webservice , response returned json objects in response variable. $(response.data.module.registration).each(function(k,v){ //insert app's sqlite database }); $(response.data.module.attendance).each(function(k,v){ //insert app's sqlite database }); $(response.data.items.grocery).each(function(k,v){ //insert app's sqlite database }); //and on. there many rows in each loop above. my question how know rows has been inserted loop can forward user restricted area. more precisely, how know json object has been iterated successfully? what tri