Posts

Showing posts from August, 2010

browser - Blocking floating toolbar options for PDF in kiosk mode -

i'm running pdf-based exhibit on public touchscreen , don't want users able execute of floating toolbar options (print, save, exit read mode). using url parameters (toolbar=0, navpanes=0,etc.), putting browser in kiosk mode, , disabling read mode in reader preferences work…until don't. let me explain: because pdf links html page (which iframes pdf), going , forth between pdf , html inevitably causes floating toolbar reappear. i've given on ever getting rid of floating toolbar. if that' off table, want thwart toolbar's functionality. so, when user clicks on symbol exit, don't crash kiosk/full screen mode. [note: previous similar exchange on didn't answer me, since effect of disabling read mode isn't persistent when user moves pdf html , back-again: can hide adobe floating toolbar when showing pdf in browser?

MongoDB not waiting for connections on port 28017 -

i started mongodb on windows 7. can connect port 27017, i'm not getting "admin web console waiting connections on port 28017" message, when visit http://localhost:28017/ , nothing appears. i following messages in console: 2015-06-02t17:54:43.271-0700 control hotfix kb2731284 or later update installed, no need zero-out data files 2015-06-02t17:54:43.281-0700 journal [initandlisten] journal dir=c:\data\db\journal 2015-06-02t17:54:43.282-0700 journal [initandlisten] recover : no journal files present, no recovery needed 2015-06-02t17:54:43.307-0700 journal [durability] durability thread started 2015-06-02t17:54:43.308-0700 journal [journal writer] journal writer thread started 2015-06-02t17:54:43.423-0700 control [initandlisten] mongodb starting : pid=5452 port=27017 dbpath=c:\data\db\ 64-bit host=myname-pc 2015-06-02t17:54:43.423-0700 control [initandlisten] targetminos: windows 7/windows server 2008 r2 2015-06-02t17:54:43.424-0700 control [initandlis...

c# - SelectSingleNode with XML Namespace -

my xml below <?xml version="1.0" encoding="utf-8" standalone="yes"?> <order xmlns="http://example.com/abc"> <class> <about></about> </class> <dataset> <subjects></subjects> </dataset> </order> i tried access node below ways xmlnode order = myxml.selectsinglenode("order"); xmlnode subjects= order.selectsinglenode("/order/dataset/subjects); xmlnode dataset= myxml.selectsinglenode("order/dataset"); even tried xml namespace manager below xmlnamespacemanager nsmgr= new xmlnamespacemanager(myxml.nametable); nsmgr.addnamespace("ab","http://example.com/abc"); xmlnode order= myxml.selectsinglenode("//ab:order", nsmgr); xmlnode dataset= myxml.selectsinglenode("//ab:order//ab:dataset",nsmgr); where doing wrong here? how access node in case. please me.

Drag an an initially centered TextView around RelativeLayout in Android -

so i'm messing around interacting touch events/gestures in android. 1 of first things did make textview in relativelayout can drag around. java code is: public class draggystuff extends actionbaractivity implements view.ontouchlistener { private textview mtextview; private viewgroup mrootlayout; private int _xdelta; private int _ydelta; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_draggystuff); mrootlayout = (viewgroup) findviewbyid(r.id.root); mtextview = (textview) mrootlayout.findviewbyid(r.id.textview); relativelayout.layoutparams layoutparams = (relativelayout.layoutparams) mtextview.getlayoutparams(); mtextview.setontouchlistener(this); } @override public boolean ontouch(view v, motionevent event) { final int x = (int) event.getrawx(); final int y = (int) event.getrawy(); switch (event.getaction() & motionevent.action_mask) { ca...

oracle11g - Oracle queue is not been imp or exp in Oracle 11g -

i exported oracle database using command exp system/password@sid file=c:\expdb.dmp after import in instance using imp system/password@sid file=c:\expdb.dmp everything looks in closer notice queues , queue_tables did not new database. after try exp/imp work while decide easier reinstall queues find had tables related queries in database first try delete table and got error: ora-24005: inappropriate utilities used perform ddl on aq table so try begin dbms_aqadm.drop_queue_table('table',true); end; and work. question is, how avoid trouble in first place? there way export database queues? missing flag? painful exersise each time have import new database queues. you don't export oracle queues using exp or expdp. you must create new queues in target database. exp/imp queues lead database catalog corruption. note: in 11gr2 documentation states: export import of queues supported @ queue table level granularity. user needs export queue ta...

r - Multiple line diagrams in the same ggplot -

Image
i creating line diagrams data. know how add line (with second set of recall , precision points) in same diagram? recall11point = c(0.2, 0.2, 0.4, 0.4, 0.4, 0.6, 0.6, 0.6, 0.8, 1.0) precision11point = c(1.0, 0.5, 0.67, 0.5, 0.4, 0.5,0.43,0.38,0.44,0.5) d = data.frame("recall" = recall11point, "precision" = precision11point); # old fashioned plotting #plot(y=precision11point, x=recall11point, type="l") ggplot(data=d, aes(x=recall, y=precision)) + geom_line(size=2, colour="red") + geom_point(size=10) d = data.frame( "recall" = c(0.2, 0.2, 0.4, 0.4, 0.4, 0.6, 0.6, 0.6, 0.8, 1.0) , "precision" = c(1.0, 0.5, 0.67, 0.5, 0.4, 0.5,0.43,0.38,0.44,0.5) , "recall2" = seq(0,0.9, = 0.1) , "precision2" = seq(0,0.9, = 0.1) ) library(ggplot2) ggplot(data=d) + geom_line(aes(x=recall, y=precision), size=1, colour="red") + geom_point(aes(x=...

javascript - Webstorm IDE and mocha tests using global.expect -

i run following command run mocha tests: ./node_modules/.bin/mocha --require ./my.js and in js file, using sinon , expect spyon... global.expect = require('must'); global.sinon = require('sinon'); how configure mocha task runner use external file. using --require ./my.js still see referenceerror: spyon not defined any thoughts on this? required modules resolved relative working directory specified in "working directory" field of mocha run/debug configuration. here configuration works me: working directory: c:\webstormprojects\mocha_sinon mocha package: c:\webstormprojects\mocha_sinon\node_modules\mocha options: --require ./with_req/util.js test directory: c:\webstormprojects\mocha_sinon\with_req my spec file: var eventemitter = require('events').eventemitter; var should = require('should'); describe('eventemitter', function(){ describe('#emit()', function(){ it('should invoke call...

html - Mixed content SSL Error -

i installed ssl certificate onto hosting website (just standard site). it's installed , have updated .htaccess file force users following code: rewriteengine on rewritecond %{http:x-forwarded-proto} !https rewriterule ^(.*)$ https://domainhere/$1 [r=301,l] when go site, padlock changes green yellow (as in logs says there mixed content). in case 3 images apparently loading on http. this code have in html 3 images causing problems. note other images hosted locally have no problems. <!-- slide 1 --> <li> <div style="background-image: url('images/homepage/slider-1/balcony-1.jpg')" class="header"> <div class="header-center"> <div class="text-white"> </div> </div> </div> </li> the errors receive mixed content show last 2/4 on first slider don't load on ssl ,...

Hosting a laravel application -

i'm new here. i've tried couldn't setup laravel app. i've tried solutions provided here how install laravel 4 web host subfolder without publicly exposing /app/ folder? but keep on getting http error 500.0 - internal server error page cannot displayed because internal server error has occurred.any please? change host php version php >= 5.4 mcrypt php extension http://laravel.com/docs/4.2#server-requirements

php - Out-dated NON-HTTPS pages..? -

quick question.. i believe has previously-cached versions of website have stored on browser.. but when type in website url (answers.legal) no www... outdated version of website (i.e. new programming have done throughout day not showing). however, when click on logo (which redirects https www url), current version loads. how come when type "answers.legal" search bar not redirect https www automatically?

Insert Line Split after the first group in Crystal Reports -

i need display line separator above group headers not on first groupheader eg. name course datejoined summercamp class 1 2 3 _____________________________________________________________ class b 1 2 3 ____________________________________________________________ class c draw line in group footer of group. edit................................ on supress part of group footer write below code. if onlastrecord true else false

ruby iterate through sql results -

i need iterate through records found sql , update them all. i need update couple of thousand records , requirements complex enough search records sql. code below works there way of doing without performing several thousand update statements? users = user.find_by_sql "select e.id users e inner join accounts on a.id = e.account_id e.account_id not in (1955,3083, 3869)" users.each |user| u = user.find(user.id) if u u.update_attribute(:last_name, 'x') end end this same thing code, single update : user.joins(:accounts) .where("users.account_id not in (?)", [1955, 3083, 3869]) .update_all(last_name: "x") you can find documentation update_all here .

node.js - Video Delivery Performance of Node+Express vs Apache -

i'm using nodejs+express server deploy website. on website, i'll have hundreds of videos (mp4) want users load , view. right now, i'm delivering videos putting them public directory of node, data piped through node , express. i'm wondering whether practice alright, or if should set separate apache webserver deliver videos. how performance compare? else should taken consideration, caching? i've tried find data on that, not successful. see people indeed streaming videos using node (eg here ), haven't found performance comparisons. kind of expect there not difference because server has read , output file contents, , i/o operations should happen @ similar speed. forgetting something? thanks lot! thats sounds quite big video service. if have many users in many different locations viewing videos , worried user experience, may want use sort of cdn service. in case not familiar these cache copy of content near 'edge' users in locations dista...

spring - REST sort descending with minus ('-') symbol, rather than <propertyName>.dir=desc -

i'm trying out spring data mongodb , rest shown here . 1 thing noticed sort results, add query parameter named .dir value of "asc" or "desc". in many rest apis i've used, mechanism sorting put minus ("-") symbol in front of property name in sort (or order) parameter. is there way customize spring allow behavior? i remembered stumbled on thread before made customized resolver. can use simplesorthandlermethodargumentresolver class on https://github.com/sancho21/spring-data-commons/commit/6c90a9cfcb50b2ed0e7a25db0cfd64d36e7065da please comment support adoption on https://github.com/spring-projects/spring-data-commons/pull/166/files as reminder, in order use class, need inject instance of existing constructor of existing pageablehandlermethodargumentresolver instance.

c# - Edit and display entity images -

i want able replace old images new. got 1 many relationship between entites -> many images 1 product. if change images, old staying in database. never used. after time database able make huge itself. how delete these old files ? public actionresult edit(int? id) { if (id == null) { return new httpstatuscoderesult(httpstatuscode.badrequest); } product product = db.products.include(p => p.filepaths).where(i => i.productid == id).single(); if (product == null) { return httpnotfound(); } return view(product); } [httppost] public actionresult edit(int id, ienumerable<httppostedfilebase> uploads) { var product = db.products.include(p => p.filepaths).where(p => p.productid == id).single(); if (modelstate.isvalid) { try { product.filepaths = new list<filepath>(); foreach (var upload in uploads) { if (upload != null && upload.content...

python - Flask application on google app engine - Showing database object -

i'm trying make flask app on google app engine shows database entries on own page. this bit of views.py code: @app.route('/posts/<int:id>') def display_post(id): post = post.filter('id =', id) return render_template('display_post.html', post=post) then display_posts.html {% extends "base.html" %} {% block content %} <ul> <h1 id="">post</h1> <li> {{ posts.title }}<br /> {{ posts.content }} </li> </ul> {% endblock %} now when have post id 5700305828184064 , visit page should see title , content: www.url.com/posts/5700305828184064 however traceback: <type 'exceptions.attributeerror'>: type object 'post' has no attribute 'filter' traceback (most recent call last): file "/base/data/home/apps/s~smart-cove-95709/1.384741962561717132/main.py", line 4, in <module> run_wsgi_app(app) file ...

arrays - What occurrs in a 'for loop' at the hardware level? Is memory automatically assigned? (C++) -

i have code here reverses array of characters: #include <iostream> #include <string> using namespace std; char s[50]; void reversechar(char * s) { (int i=0; i<strlen(s)/2; ++i) { char temp = s[i]; s[i] = s[strlen(s)-i-1]; s[strlen(s)-i-1] = temp; } } int main() { cout << "hello, program reverses words." << endl << endl; cout << "enter in word, no spaces please:" << endl; cin.getline(s, 50); cout << "this word, has been reversed:" << endl; reversechar(s); cout << s; return 0; } in loop can explain going on @ hardware level. understand 'temp' allocated byte, assigned value of s[i]. is memory allocated everything? the equals sign, s[i], etc? after byte assigned value in s[i], s[i] assigned other value in array s. other value assigned temp. i'm having trouble understanding these bytes going, , how being ...

android - drawerToggle not working right *Updated* -

i have followed documentation on developer page: https://developer.android.com/training/implementing-navigation/nav-drawer.html whats giving me error in open/close event listener section. tells me not putting in right argument used same 1 in documentation. don't know it's looking for. have line giving me issue marked comment line above it. thanks! ****update**** expected argument is: android.support.v7.widget.toolbar actual argument is: r.drawable.ic_drawer @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.gamescreen); //this stuff drawer player = createplayer(); sidemenu = (drawerlayout) findviewbyid(r.id.drawer_layout); menulist = (listview) findviewbyid(r.id.menu_list); //now filling drawer menulist.setadapter(new arrayadapter<string>(this, android.r.layout.simple_list_item_1, menustring)); menulist.setonitemclicklistener(new draweritemclicklistene...

asp.net - Converting dates in C# -

i have asp.net mvc app not converting dates values properly. reside in 1 time zone. users resides in another. @ time, assume have following string: var date = "7/1/2014 4:00:00 +00:00"; i converting string datetime using following: datetime temp; if (datetime.tryparse(date, out temp)) { temp = temp.toshortdatestring(); writetolog(temp); } when temp written log file, see being written 6/30/2014 . possibly cause this? i'm expecting 7/1/2014 . works on machine. however, not working on users machine. the answer timezones. you're parsing specific point in time (4:00 am, gmt). same point in time 10:00 pm cst day before. if keep in utc: var s = temp.touniversaltime().toshortdatestring(); you'll requested output.

javascript - Why my applyBindings doesn't work? Knockout -

hello trying create input , iframe , when paste youtube link iframe should change new src. have done far <div class="heading">id <input data-bind="text: youtubelink"/></div> <iframe id="player" type="text/html" width="444" height="250" frameborder="0" data-bind="attr: { src: linkembed }"></iframe> and in script: function myviewmodel() { this.youtubelink = ko.observable('https://www.youtube.com/watch?v=4unkmlckw9m'); this.linkembed = ko.purecomputed({ read: function () { var extract = this.youtubelink().replace("/watch?v=", "/embed/"); console.log(extract) return extract; }, write: function (value) { this.youtubelink(); }, owner: }); } ko.applybindings(myviewmodel()); this works want video wont change if paste link in input....

objective c - Remove port from NSURL -

how can 1 normalise nsurl, removing port in particular? http://en.wikipedia.org/wiki/url_normalization you can write code perform normalisation. nsurl may you, don't think it's documented so. removing port number won't work towards normalisation, can it. in both cases nsurlcomponents deconstructing url , allowing interact each of components parts, removing or modifying see fit.

Flow for iOS application that saves images and has a PHP backend: how to increase speed? -

i have ios application, , saves images user profiles. have page user can see other users. have endpoint on php backend allows me fetch image given user id. able to: 1) take picture on phone 2) save picture user in database (using base64 encoded string representation of png of image) 3) re-download image string in base64 4) display image on page user the problem is, though, these blobs on backend big (about 2.5mb each), , takes 20-30 seconds per image load or upload. there better way of doing this, increase performance? quick summary of spoke in comments: use gzip transfer (expected 25% increase of speed due base64 encoding) store images jpeg, performing nsdata *data = uiimagejpegrepresentation(image, 0.5); magic constant 0.5 number found still give image quality still heavy compression optionally reduce resolution of image

java - Spring Data Neo4J 4.0.0: BeforeSaveEvent not firing? -

i'm trying capture beforesaveevent when setting neo4j in spring, can call method beforesave() on class being saved. unfortunately, seems not being registered listener non of print statements being executed. ideas appreciated. @configuration @enableneo4jrepositories(basepackages = "com.noxgroup.nitro") @enabletransactionmanagement public class nitroneo4jconfiguration extends neo4jconfiguration { @bean public neo4jserver neo4jserver () { system.setproperty("username", "neo4j"); system.setproperty("password", "*************"); return new remoteserver("http://localhost:7474"); } @bean public sessionfactory getsessionfactory() { return new sessionfactory("com.noxgroup.nitro.domain"); } @bean applicationlistener<beforesaveevent> beforesaveeventapplicationlistener() { return new applicationlistener<beforesaveevent>() { ...

php - Function in function not returning array -

this function should iterate through multidimensional array , return collection of array's element_rule_id values. hovewer it's not returning anything. you can check var_dump of array here: http://pastebin.com/t5nwgmna function deepins($array = array(), $collect = array(), $str = '') { $count = count($array); foreach($array $i => $val) { if(is_array($val)) { if(array_key_exists('element_rule_id' ,$val)) { $collect[$val['element_rule_id']] = 1; } if(($count - 1) == $i) { if(array_key_exists('0', $val['condition'])) { deepins($val['condition'], $collect); } else { return $collect; } } } } } expected result be: array (size=5) 'rule_demo_rules1_1' => int 1 'rule_demo_rules1_2' => int 1 'rule_...

c# - Format XML Returned from SQL Server -

i have program have written in visual studio. here code: namespace sql_connectivity { class program { static void main(string[] args) { sqlconnection conn = new sqlconnection("server=************.database.windows.net,0000;database=testdb;user id=testuser;password= testpassword;trusted_connection=false;encrypt=true;connection timeout=30;"); conn.open(); sqlcommand cmd = new sqlcommand("select * district leaid <= 4 xml path('districtentry'), root('districts')", conn); sqldatareader reader = cmd.executereader(); string path = @"district." + datetime.now.tostring("yyyymmdd") + ".xml"; var writer = new streamwriter(path); while(reader.read()) { console.setout(writer); console.writeline(reader.getstring(0)); } reader.close(); conn.close(); } ...

jQuery Simple Slider not setting the values for both text boxes -

i following tutorial jquery simple slider examples my index.html goes under <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <script src="js/simple-slider.js"></script> <link href="css/simple-slider.css" rel="stylesheet" type="text/css" /> <link href="css/simple-slider-volume.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>home loan emi , eligibility calculator</h1> <table border="1"> <tr> <td>gross monthly income</td> <td><input type="text" data-slider="true" data-slider-range="15000,2000000" data-slider-step="1000"> </td> <td><input type="text" i...

ruby on rails - How to stub method in initialize with rspec -

class party attr_accessor :number include validations def initialize self.number = proccess_args(2) puts luhn? end def proccess_args(opt) argv[opt].downcase end end require 'spec_helper' describe party before :each new_method = party.method(:new) allow(self).to receive(proccess_args).with(2).and_return('add') @party = party.new end end spec_helper.rb require_relative '../' require 'yaml' how can use rspec, ensure proccess_args not called, simulated in order avoid argv blowing tests? example fake call of proccess_args(2) return "jason wade", , avoid argv[opt] ever being touched rspec. allow(argv).to receive(:downcase).and_return('whatever') you telling rspec allow argv receive method called :downcase and_return 'whatever' instead of calling in code being tested. (that part may not particularly useful, it's sort of explanation ...

database - Error Code 1261-- import csv file into mysql workbench 6.2 -

i trying load large csv file mysql using workbench 6.2. issues keep running en error message says " error code: 1261. row 4670297 doesn't contain data columns. below code using. changing fields terminated "," fields terminated '","' , there no difference load data infile 'c:/rates.csv' table rates fields terminated "," enclosed '' lines terminated '\r' ignore 1 rows; any assistance extremely appreciated.

python - Creating multiple QtGui.QWidget dynamically -

what want do: list of names changes on time an infinite loop ("while true:") creates qtgui.qwidget each name in list - when new name pops in list --> create new qtgui.qwidget what have far: pyqt4 import qtcore, qtgui import sys try: _fromutf8 = qtcore.qstring.fromutf8 except attributeerror: def _fromutf8(s): return s try: _encoding = qtgui.qapplication.unicodeutf8 def _translate(context, text, disambig): return qtgui.qapplication.translate(context, text, disambig, _encoding) except attributeerror: def _translate(context, text, disambig): return qtgui.qapplication.translate(context, text, disambig) class ui_form(qtgui.qwidget): def __init__(self, player_name): self.player_name = player_name qtgui.qwidget.__init__(self) self.setupui(self) def setupui(self, form): ... app = qtgui.qapplication...

javascript - Polymer 1.0 Dom-if check with attribute -

i want show template according attribute passed in element. say <template> <template is="dom-if" if="[[!multiline]]"> .. </template> <template is="dom-if" if="[[multiline]]"> .. </template> </template> in properties pass properties:{ multiline: { type: boolean, value: false } } and in html can pass multi-line attribute. how can achieve this? going in first one. if add multi-line attribute in element outside of dom-bind template, evaluate true , regardless of value passed, though can set false not adding attribute @ on element or setting falsy value in js.

App crashed on listview.getSelectedItem() (ListView inside Dialog) Android -

i have dialog screen , inside dialog have listview. want show item clicked listview toast message. tried display message of clicked item toast message using listview.getselecteditem().tostring() crashed when clicked on list item. no crash happen if display string toast when item clicked in listview. eg: toast.maketext(mainactivity.this, "hello world", toast.length_long).show(); but crashed in below code: private void showdialer() { //dialog screen final dialog dialog = new dialog(actionmodes.this); dialog.requestwindowfeature(window.feature_no_title); dialog.setcontentview(r.layout.dialer_dialog); final listview book_list = (listview)dialog.findviewbyid(r.id.listbooks); arrayadapter<?> adapter_booklist = arrayadapter.createfromresource( this, r.array.locations, android.r.layout.simple_spinner_item); adapter_booklist.setdropdownviewresource(android.r.layout.simple_spinner_dropdown_item); book_list.se...

linux - merge child directory to parent -

i tried clone git repository, created directory in wrong place. i have directory structure looks this: /home/tendesig/public_html/respond/app/respond/ and want merge contents of above directory with: /home/tendesig/public_html/respond/ i tried mv –f , , rsync did not work. suggestions? cloning wrong directory no big deal. here's how can fix it: delete cloned files , directories (including .git directory) , clone again right place move files , directories (including .git) right place.

I want to sort 3 dimensional array in javascript -

i post question php want javascript my array following : var inboxmessages = { 105775: { //index thread_id 0: { 'id': 85, 'thread_id': 105775, 'message': "hello", 'created_at': "may 20, 2015", 'datetime': 1432118191, 'sender_id': 13, }, 1: { 'id': 70, 'thread_id': 105775, 'message': "hii", 'created_at': "may 19, 2015", 'datetime': 1432021227, 'sender_id': 13, } }, 224199: { //index thread_id 0: { 'id': 88, 'thread_id': 224199, 'message': "yessss...", 'created_at': "may 20, 2015", 'datetime': 1432306513, 'sender_id...

c# - string.Empty vs. "" - Has this changed? -

according this answer , "" , string.empty different, in "" creates object, whereas string.empty not. answer has votes on question. however, this answer says there no difference. it's more recent answer well. so in 2010. case? string.empty , "" differ @ all, slightly? edit: question meant update linked questions, found confusing no modern answer had been presented, despite debate on matter. the language specification (c# 4.0) silent on subject. according clr via c#, depends entirely on clr , not on c# compiler. relevant quote p. 341: even if assembly has attribute/flag [compilationrelaxations.nostringinterning] specified, clr may choose intern strings, should not count on this. in fact, should never write code relies on strings being interned unless have written code explicitly calls string’s intern method yourself. so using "" may or may not create new string object. depends on clr (version) being used. ,...

java - How does OpenGL render YUV video on Android? -

i working on webrtc staff on android , trying figure out how videorenderergui.java works. unfortunately, have trouble understanding how following opengl code work: private final string vertex_shader_string = "varying vec2 interp_tc;\n" + "attribute vec4 in_pos;\n" + "attribute vec2 in_tc;\n" + "\n" + "void main() {\n" + " gl_position = in_pos;\n" + " interp_tc = in_tc;\n" + "}\n"; private final string yuv_fragment_shader_string = "precision mediump float;\n" + "varying vec2 interp_tc;\n" + "\n" + "uniform sampler2d y_tex;\n" + "uniform sampler2d u_tex;\n" + "uniform sampler2d v_tex;\n" + "\n" + "void main() {\n" + // csc according http://www.fourcc.org/fccyvrgb.php " float y = texture2d(y_tex, interp_tc).r...

java - Spring Boot testing with Spring Security. How does one launch an alternative security config? -

my spring boot application has application class. when run (as application), launches within embedded servlet container (tomcat, in case). somehow (through application's @annotations, suppose), websecurityconfig (extending websecurityconfigureradapter) in same package loaded. websecurityconfig contains 2 important blocks of configuration information: @configuration @order(securityproperties.access_override_order) @enableglobalmethodsecurity(prepostenabled = true) // enables method-level role-checking public class websecurityconfig extends websecurityconfigureradapter { @autowired public void configureglobal(authenticationmanagerbuilder auth) throws exception { auth .ldapauthentication() .usersearchbase("cn=users,dc=some,dc=domain,dc=com") .usersearchfilter("(samaccountname={0})") .groupsearchbase("ou=groups,dc=some,dc=domain,dc=com") .groupsearchfilter("(member...

git - Where is HEAD in the in the tree if I merge a branch, do some commits and then checkout the branch again -

Image
new git. person using git repository. (my organization not use git.) here's basic outline of workflow. name branches according number in our bug tracker. make changes, commit them branch. once things merge branch master git repository stays reflective of what's on our development server. move on other issues. some time later testing may send original bug worked on. if checkout branch again head still @ recent commit position in tree? i apologize if terminology off. here's diagram hope helps. if checkout branch again head still @ recent commit position in tree? no, head @ merge commit (when did git checkout master ; git merge yourbranch_bug1 ) testing may send original bug worked on if testing working on master , , need additional work on bug1 , can reset branch on master (in order fix bug1 in recent context possible) git checkout -b yourbranch_bug1 from git checkout man page : if -b given, <new_branch> created if doesn’...

asynchronous - Multiple POST Queue for Android w/Retrofit -

i'm putting android library grabs sensor data , posts azure event hub. right using retrofit , posting data 1 @ time user input. the next stage post data @ frequent intervals. sensor data @ 20 readings per second. i'm going capture data @ 2 per second, going send 2 captures event hub every second. these intervals parameterized go faster or slower needed. in ios, have grand central dispatch, create type of throttled queue i'm looking for. i'm wondering optimal way approach in android? retrofit doesn't support queues. have create logic handle it. another rest library has queues volley , problem.

angularjs - why the button is not visible for all time (visible while scroll )? -

i trying make pop on in there multiple selected element present .in there header present , contend footer not present .i need there close button on footer visible @ time .it visible when scrolling data .in other words please click on right icon "gear" icon open pop on when scroll data can see there close button present .i need button present on footer should display time here code <script id="my-column-name.html" type="text/ng-template"> <ion-popover-view> <ion-header-bar> <h1 class="title">show columns</h1> </ion-header-bar> <ion-content> <ul class="list" ng-repeat="item in data"> <li class="item item-checkbox"> <label class="checkbox"> <input type="checkbox" ng-model="item.checked"> ...

Android GridView setItemChecked dynamically -

Image
i have custom gridview . when activity starts, want set checked item dynamically. tried gridview.setitemchecked(5, true); didn't work. how can do? public class mainactivity extends activity { gridview gridview; arraylist<item> gridarray = new arraylist<item>(); customgridviewadapter customgridadapter; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); //set grid view item bitmap homeicon = bitmapfactory.decoderesource(this.getresources(), r.drawable.home); bitmap usericon = bitmapfactory.decoderesource(this.getresources(), r.drawable.personal); gridarray.add(new item(homeicon,"home")); gridarray.add(new item(usericon,"user")); gridarray.add(new item(homeicon,"house")); gridarray.add(new item(usericon,"friend")); gridarray.add(new ite...

java - Execute a method from a class in mainActivity (Android) -

i m trying execute method class called qrscann in mainactivity class when user click on button everytime app crash click button , gives me log crash output 06-02 17:00:24.890 7067-7084/t.n.app w/egl_emulation﹕ eglsurfaceattrib not implemented 06-02 17:00:24.890 7067-7084/t.n.app w/openglrenderer﹕ failed set egl_swap_behavior on surface 0xb3ee6da0, error=egl_success 06-02 17:00:27.473 7067-7067/t.n.app d/androidruntime﹕ shutting down vm 06-02 17:00:27.474 7067-7067/t.n.app e/androidruntime﹕ fatal exception: main process: snet.tuberlin.app, pid: 7067 java.lang.nullpointerexception: attempt invoke virtual method 'android.app.activitythread$applicationthread android.app.activitythread.getapplicationthread()' on null object reference @ android.app.activity.startactivityforresult(activity.java:3745) @ android.app.activity.startactivityforresult(activity.java:3706) @ snet.tuberlin.app.qrcode.scanqr(qrcode.java:23) ...

scala - EssentialAction: How to Get the Body of a Request without Parsing It -

given following essentialaction ... object mycontroller extends controller { ... def hastoken(action: token => essentialaction) = essentialaction { request => ... // doesn't compile val body = request.body match { case json: jsvalue => json.tostring case _ => "" } // calculate hash body content here ... } // here authenticated action def getuser(userid: strign) = hastoken { token => action(parse.json) { request => request.body.validate[user] match { ... } } } } ... how body of request without parsing it? i don't want , don't need parse request body in hastoken since body going parsed in action getuser . need raw content of body calculate hash. the code in hastoken doesn't compile because request of type requestheader whereas need request , defines body . will work ? object mycontroller extends controller { // hastoken action def a...

xpath - xmlstarlet delete all elements except one from xml data feed -

on debian vps, want keep element categoryname mobile phones , delete other elements having category names such mobile accessories laptops etc. total 20 different category names. xml file size big 800 mb. xmlstarlet el -u sd.xml products products/product products/product/brand products/product/categoryname products/product/categorypathasstring here sample xml : <products> <product> <productid>92545172</productid> <productsku>630348288360</productsku> <productname>self snap aux connected selfie stick</productname> <productdescription>this product charge free </productdescription> <productprice>353.00</productprice> <productpricecurrency>inr</productpricecurrency> <wasprice>649.00</wasprice> <discountedprice>0.00</discountedprice> <producturl>http://clk</producturl> <pid>8053</pid> <mid>159526</mid> ...