Posts

Showing posts from September, 2011

c# - How can I render databound values inside of a custom control? -

i'm placing custom control inside of existing repeater template. <itemtemplate> <custom:mycontrol> <something> <%# eval("firstname") %> </something> </custom:mycontrol> </itemtemplate> is there way can somehow value of <%# eval("firstname") %> without adding property custom control? <custom:mycontrol firstname='<%# eval("firstname") %>' /> i have bigger need, in want define entire html structured inner property inside of <something> , disaster inside of property. so, repeater databound, , apparently control i'm placing within not databound, yet values can passed through via property tags... i found answer stating wasn't possible, it's 5 year old question. eval inside asp.net repeater doesn't work inside control grasping @ straws, hoping solution. you have create templated user control properties having templatecontain

messenger - How I resolve a message about my Facebook webhook was desactived? -

Image
list facebook alert: i start tests of facebook messenger , problem appear, can't receive requests on server. i found response. when problem appear resolve using code. curl -x post " https://graph.facebook.com/v2.6/me/subscribed_apps?access_token=your_token " you need send post message again revalidate token. bye

android - Protect data so only verified client can read -

i creating rest server holding decent amount of proprietary information. want users able access information in intended way, through map built iphone/android app. require verified email registration access server. rate limiting amount of information identity can receive, want take step further , prevent (or @ least try prevent) identity pretending app , grabbing information in plain text. a successful example of spotify, can download music want difficult(impossible?) @ files unless using 1 of clients. i have seen questions saying impossible: https://stackoverflow.com/questions/32084631/how-can-you-lock-down-so-only-your-android-client-can-interact-with-your-parse-p however not explain techniques companies spotify use @ least obscure data. ok holding 1 request @ time on client , requiring online in order view information. tl;dr: way ensure rest communication verified client(android/ios), , decrypt information app can use it? you encrypt information, dont know this,

How to populate a text box inside a gridview in vb.net -

i have 1 gridview contains textbox in row 0 column 0. my question is, how can populate textbox in row 0 in column 0from vb.net code behind display letter "a" in textbox. i using instruction, textbox disapear. gridview.rows(0).cells(0).text ="a" thanks in advance. gridview.rows(0).cells(0).text ="a" place letter "a" in same rendered td textbox. you need find the specific textbox control want populate. if gridview databound can in gridview's databound event. or if it's not databound can use page.prerendercomplete event. there must form of backing data or gridview not render data rows contain textbox (or did place textbox in header or footer?) but in either case need find textbox control within specific row. in question looking in row 1 need this: dim row gridviewrow = gridview1.rows(0) dim tbx textbox = row.findcontrol("textbox1") if tbx isnot nothing tbx.text = "a"

animation - How to make an object dissappear in PPT using VBA? -

i trying make object disappear in ppt using vba. can make object appear in many ways don't know how make disappear. i wrote code below not work. looks "msoanimeffectdisappear" not exist. set benny = activewindow.view.slide activewindow.view.slide.shapes("textbox 114").select y = activewindow.selection.shaperange.name set sh = activewindow.selection.shaperange(y) benny.timeline.mainsequence.addeffect sh, msoanimeffectdisappear, , msoanimtriggerwithprevious activewindow.view.slide.shapes("textbox 114").visible = false

mysql - SQL, Recursive Query -

Image
can please me query working selecting data's tables wanted display fields connected other fields using recursive query. my table i have self query does'nt output connected , connected fibers query select closure_id, fiber_id , @pv:=fiber_id 'fiber_id2' (select * tbl_map_closure_fiber order closure_id) join (select @pv:=1)tmp closure_id=@pv just askin how can manage ouput both connected closure_id , connected fiber. please 1 . you need join table pair related rows. select t1.fiber_id, t2.fiber_id fiber_id2 tbl_map_closure_fiber t1 join tbl_map_closure_fiber t2 on t1.fiber_id = t2.closure_id http://sqlfiddle.com/#!9/3f83ee/2

ruby on rails - Puma: HTTP parse error, malformed request -

firing local server foreman , following whenever make request. http parse error, malformed request (): #<puma::httpparsererror: invalid http format, parsing fails.> env: {"rack.version"=>[1, 3], "rack.errors"=>#<io:<stderr>>, "rack.multithread"=>true, "rack.multiprocess"=>false, "rack.run_once"=>false, "script_name"=>"", "content_type"=>"text/plain", "query_string"=>"", "server_protocol"=>"http/1.1", "server_software"=>"2.9.1", "gateway_interface"=>"cgi/1.2"} running ruby 2.2.0 rvm and potentially relevant bits gemfile: gem 'rails', '4.2.5.2' gem 'puma', '2.9.1' completely stumped here , appreciate help. happy provide more context config, don't know start. edit: i error when run server foreman start . if fire rails

oracle10g - Create drop down list to populate foreign key fields -

i new oracle 10g. using build forms. have created tables in sql+ , have designed forms. having problem foreign key fields in form. i have table named class, class has 4 foreign keys represented on class form r_id primary key of table called room e_id primary key of table called exam t_id primary key of table called term sub_id primary key of table called subject in class form want user able create or update record of class. user friendliness want when put cursor on 1 of foreign key field enter value, want corresponding name parent table displayed drop down list instead/as numerical foreign key value. user's choice populate foreign key field of class table so if r_id = rm001 , name of room in parent table chemistry lab. want user see chemistry lab , choose populates class table in database rm001 i have created navigation manually via buttons, last thing have , im stumped. want user able click field , drop down list automatically appears. any ideas? much

Java Nested loops: Indent text -

can me solve problem? print numbers 0, 1, 2, ..., usernum shown, each number indented number of spaces. each printed line, print leading spaces, number, , newline. hint: use , j loop variables (initialize , j explicitly). note: avoid other spaces spaces after printed number. ex: usernum = 3 prints: the code given follows: public class nestedloop { public static void main (string [] args) { int usernum = 0; int = 0; int j = 0; /* solution goes here */ return; } } any suggestions appreciated. thank you. i don't think i , j necessary in sense... for (int = 0; <= usernum; i++) { (int j = 0; j < i; j++) { system.out.print(" "); } system.out.println(i); }

python - Replace items in column based on list -

i have dataframe so: date value 19990506 0.6 19990506 0.8 19990607 1.2 20000802 0.4 and have 2 lists this: list1 = ['19990506', '19990607', '20000802'] list2 = ['1999201', '1999232', '2000252'] the items in list1 coincide values in column date , want replace them items in list2 . in date 19990506 replaced 1999201 , 19990607 replaced 1999232 . think need zip lists this, after @ loss on best way go it. showing simplified dataframe using .replace not efficient me. desired output this: date value 1999201 0.6 1999201 0.8 1999232 1.2 2000252 0.4 if create dictionary maps list1 list2 can use series.map : df = pd.read_clipboard() list1 = ['19990506', '19990607', '20000802'] list2 = ['1999201', '1999232', '2000252'] # when read in data ints in date column # need ints in replacement map, if have # strings remove int() conversio

Conditional groupings in Cognos 10 -

i developing report university. require around 15 different groupings of choice (e.g. campus, faculty, course, school, program, major, minor, nationality, mode of study... , list goes on). require headcount , efts (equivalent full time student) each of these groupings. they may require single grouping, selection in order of groupings, or groupings. a solution provided here: https://www.ibm.com/developerworks/community/forums/html/topic?id=77777777-0000-0000-0000-000014834406#77777777-0000-0000-0000-000014837873 the solutions suggests use conditional blocks , multiple lists. mean have 50+ lists, every possible combination of groups (e.g. campus + faculty , campus + school, school + faculty, faculty + campus .... ) is these way users dynamically select order of groupings, , groups exclude/include? thanks

mysql - Uncaught PHP Exception Doctrine\ORM\Query\QueryException: "[Semantical Error] line? -

i trying create search field rejected transactions page in our web application project, i'm using symfony2 framework, i'm stuck coz there error saying, '[semantical error] line 0, col 235 near 'b join b.ediak403errorcodes': error: class matrix\matrixedibundle\entity\editransaction has no association named edi997details' and 'critical - uncaught php exception doctrine\orm\query\queryexception: "[semantical error] line 0, col 235 near 'b join b.ediak403errorcodes': error: class matrix\matrixedibundle\entity\editransaction has no association named edi997details" @ /tmxpage/apache/htdocsedi/editracker/vendor/doctrine/orm/lib/doctrine/orm/query/queryexception.php line 63 ' here code (in repository) : public function getdetails($gsnumber, $senderid, $receiverid, $page = 1, $limit = 5 ){ $em = $this->getentitymanager(); $query =

java - How can I properly download a file from Google Cloud Storage to an Android app? -

first of all, can download gcs using downloadmanager, gcs java api, , android asynchttpclient. resulting file or file stream has headers in it, prevents file being opened properly. example file saved downloadmanager/gcs api/android asynhttpclient: --5tc52jllclf7f49ccw5hdvb1bwmzzb content-disposition: form-data; name="example.pdf"; filename="example.pdf" content-type: application/octet-stream content-transfer-encoding: binary %pdf-1.4 %“Å’‹Å¾ reportlab generated pdf document http://www.reportlab.com % 'basicfonts': class pdfdictionary ... what libraries available or how use of libraries i've tried save file not have embedded header information? preferably, use header information. thanks! here code got working me. able use /r/n/r/n delimiter. note, modified storagefactory.java use androidhttp.newcompatibletransport() , use p12 keyfile. version here if figure out why git not adding changes since last week. new asynctask&l

SQL for filtering records with part of value is same -

i don't have expertise in sql. want filter records table below criteria. i want separate out records in below example result showing "klmnp03" , "uvxyz03". there similar records last chars 03 , 04, want filter out records 03 @ end for example: col1 --------- abcde03 abcde04 klmnp03 lmnop03 lmnop04 uvxyz03 i'm not sure use case is, pretty inefficient. it's better use whole columns. in case, asking for: select * yourtable col1 not ( '%03' ) this return not have 03 @ end. % wild card character, , represents number of characters before normal characters. can similar _ character, represents single random character. in sqlserver @ least. may different in other rdbms

java - Netbeans IDE 8.1 "Error: Could not find or load main class knowltech.KnowlTech" -

i started programming on netbeans ide 8.1 , basic program helloworld gives error error: not find or load main class knowltech.knowltech error: not find or load main class knowltech.knowltech knowltech name of project. appreciate if , tell me how deal in simple language you created wrong type of class or have create main class option unchecked. when create new project: select new projects button from choose project dialog window select java categories pane , select java application projects pane. select next button. the name , location dialog window displayed. enter name of project ( knowltech ). at bottom of same dialog window make sure create main class checkbox contains check-mark (in other words, it's enabled). the code trying work goes main() method automatically created you. your project should run providing have java installed on specific computer.

html - ::before css not working on mac safari -

i trying make sub menu full width on website using ::before css not working on mac safari. please check this screenshot idea of trying obtain , looks on mac-safari. below css code have used: #header .avia_mega_div .sub-menu::before { background:#003b70; content: ""; height: 43px; left: 0; position: fixed; top: 118px; width: 100%; } thanks! if want use :before this, try put space between quotes in 'content' content: " "; but full width navbar there better ways maybe can share of html first.

java - Adding Strings to List with the number of a certain letter in them increasing -

so have 2 int's v , w , string q , , list list . need make list adds string duplication of q , ranging v through w . for example: v 2, w 4, q "a". list should [aa, aaa, aaaa] time program done. i have done various programs similar this, , felt easy, , still think reason missing something. have attempted solve doing for (int j = v; j <= w; j++) { string s = ""; (int k = 0; k < j ; k++) { s+=q; } list.add(s); } but gives constant number of qs. not changing. first, prefer stringbuilder string concatenation (that pollutes intern cache one). , need begin looping v times create initial string ; append q . like int v = 2; int w = 4; string q = "a"; list<string> list = new arraylist<>(); stringbuilder sb = new stringbuilder(); (int = 0; < v; i++) { sb.append(q); } (int j = v; j <= w; j++) { list.add(sb.tostring()); sb.append(q); } system.out.println(list); output (as

jQuery Smartmenus parent item of dropdown clickable bootstrap website -

i have this bootstrap 3 website . use jquery smartmenus menu. want parent item clickable on dropdown links. thought had working before, parent item not clickable. how make parent item clickable within bootstrap theme jquery smartmenus plugin? in sites/all/themes/bootstrap/templates/menu/menu-link.func.php comment out line 43: // $element['#localized_options']['attributes']['class'][] = 'dropdown-toggle'; comment out line 44: // $element['#localized_options']['attributes']['data-toggle'] = 'dropdown';

swift2 - Array mutability in Swift -

according apple's swift guide : if create array, set, or dictionary, , assign variable, collection created mutable. means can change (or mutate) collection after created adding, removing, or changing items in collection. if assign array, set, or dictionary constant, collection immutable, , size , contents cannot changed. but in xcode 7.2.1, these results: import foundation //**added per comments** var data: [int] = [10, 20] print(unsafeaddressof(data)) data.append(30) print(data) print(unsafeaddressof(data)) --output:-- 0x00007ff9a3e176a0 [10, 20, 30] 0x00007ff9a3e1d310 because assigned array var , expected see same address data after appending value data. another example: class item { } var data: [item] = [item(), item()] print(unsafeaddressof(data)) data.append(item()) print(data) print(unsafeaddressof(data)) --output:-- 0x00007f86a941b090 [item, item, item] 0x00007f86a961f4c0 and another: var data: [string] = ["a", "b&quo

c# - How to add to a chain of methods by checking if statements -

i don't know right terminology have simple c# code snippet tweens objects this: camera.gameobject.transform.domove(target,3.0f) .setease(ease.inoutquad) .oncomplete(animation.fadein); but need add method chain based on condition this: camera.gameobject.transform.domove(target,3.0f) .setease(ease.inoutquad) //the general idea if(visible == true){ .onstart(animation.fadeout); } .oncomplete(animation.fadein); obviously syntax error, not know correct way handle syntax. how should approach it? you need place entire chunk in if - else statement, cannot break down: if(visible == true){ camera.gameobject.transform.domove(target,3.0f) .setease(ease.inoutquad) .onstart(animation.fadeout).oncomplete(animation.fadein); } else { camera.gameobject.transform.domove(target,3.0f) .setease(ease.inoutquad).oncomplete(animation.fadein); } alertnatively: var int

need help of a iOS crash log about UITableView -

i need of ios crash log uitableview. cause of crash? exc_bad_access kern_invalid_address 0x00000000ef59beb8 thread : crashed: com.apple.main-thread 0 libobjc.a.dylib 0x1931efbd0 objc_msgsend + 16 1 uikit 0x186d01238 -[uitableview _reusetableviewcell:withindexpath:didenddisplaying:] + 180 2 uikit 0x186c24688 -[uitableview _updateanimationdidstop:finished:context:] + 860 3 uikit 0x186a4bd84 -[uiviewanimationblockdelegate _didendblockanimation:finished:context:] + 408 4 uikit 0x186a4b8ec -[uiviewanimationstate senddelegateanimationdidstop:finished:] + 188 5 uikit 0x186a4b7f4 -[uiviewanimationstate animationdidstop:finished:] + 104 6 quartzcore 0x18636cd78 ca::layer::run_animation_callbacks(void*) + 296 7 libdispatch.dylib 0x19382d954 _dispatch_client_callout + 16 8 libdispatch.dylib 0x193832

spring integration - how to poll in a header-value-router -

i cannot find out, how configure poller header-value-router. <int:header-value-router input-channel="splittednewpaulaevents" header-name="eventname" resolution-required="true"> <int:mapping value="work_order_close" channel="be_work_order_close" /> </int:header-value-router> at startup error: no poller has been defined endpoint 'org.springframework.integration.config.consumerendpointfactorybean#0', , no default poller available within context. if add <int:poller id="defaultpoller" default="true" fixed-rate="1000" /> the context starts, seems, router doesn't work? there way more infos activities of polling event or header-value-router activities? thanks

javascript - Include jQuery SDK in my project -

this question has answer here: adding jquery sublime text 2 2 answers i using sublime text 2 on mac development, , not sure how include jquery sdk in project. have downloaded sdk already. to include jquery or any other external js resource need use <script> tag, example: index.html : <html> <head> <title>my first jquery page</title> <!--script src="/js/jquery.js" type="text/javascript"></script--> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(function() { $("#test").html("it works!"); }); </script> </head> <body> <div id='test'></div> </body> </html> c

active directory - filling attribute with concatenated string -

i looking way concatenate string , put in 1 active directory user account object, precise, in altsecurityidentities. value input following: " constant, , (firstname)(whitespace)(lastname) (custom value can taken attribute, in form x.yyyyyyyy.z (what matters me yyyyyyy part (.substring(2,8)) works charm here. i'd several accounts listed in variable of type typename: microsoft.activedirectory.management.aduser. can set accounts under $accounts variable. far have code create attribute value 1 account listed in there: $accounts | %{'constant value'+$ .givenname+' '+$ .surname+' '+'('+$(($_.attributename).substring(2,8))+')'} this, i'd put in altsecurityidentities attribute value, log event viewer success , errors you're there need apply value desired field: $accounts | foreach-object { set-aduser -identity $_ -add @{altsecurityidentities = "constant value $($_.givenname) $($_.surname) ($($_.attributename.substrin

html - image quality deteriorates when used more than once -

in html page, include image as <img src="http://i44.tinypic.com/w2o9kh.png" border="0" alt="image tinypic"> i style external css by img {width:2em;height:2em; } however notice image quality deteriorates when same image used more once in page. compare http://jsfiddle.net/aj333/50/ , http://jsfiddle.net/zxgqr/ in firefox. quality of smiley worse in first one. any insight on why happens , how retain quality ? p.s. ive checked happens if images in different div containers. p.s. seems browser specific: in chrome both quality in ie9 both bad quality in firefox quality of smiley worse in first fiddle. work in firefox @ least. im novice in html please bear in case obvious you setting height , width value on images. if values bigger or smaller actual dimensions of picture, browser must scale it. process changes resolution of picture making blurry.

C#, EPPLUS - cannot save_as excel another time -

we have excelpackage object given, saved using saveas(file) correctly. when try save_as time (after re-arranging worksheets), thrown exception: an unhandled exception of type 'system.invalidoperationexception' occurred in epplus.dll error saving file (report.xlsx) already using latest version 4.0.5 epplus. also tried other post without luck: var reportfileinfo = new fileinfo(reportfile); if (reportfileinfo.exists) reportfileinfo.delete(); excelreportstream.setlength(0); excelreport.stream.position = 0; excelreport.stream.copyto(excelreportstream); using (var exceltosave = new excelpackage()) { exceltosave.load(excelreportstream); exceltosave.saveas(reportfileinfo); <<<<< exception again! } an unhandled exception of type 'system.invalidoperationexception' occurred in epplus.dll error saving file (report.xlsx) the excelpackage property , first try, excelpackage.saveas(reportfile) works on first time. n

Create git Branch/Tag via ANT script -

i'um using ant scripts build jar files version. there oportunity create tag/branch in git repository in ant script? you can use rimerosolutions/ant-git-tasks common git tasks in ant. that include creating branch: <git:git directory="repositoryclonefolder" verbose="true" settingsref="git.testing"> <git:clone uri="https://github.com/rimerosolutions/playground-repo.git"/> <git:checkout branchname="dummybranch" createbranch="true"/> </git:git> or creating tag : <git:git directory="${testlocalrepo}" verbose="true"> <git:tag name="${dummy.tag.name}"/> </git:git>

wso2as - WSO2 application instance ID in program environment -

i developing application service based on wso2 as. intention application should deployed in as-cluster in order cope high volume traffic. the cluster should dynamic 1 in order scale or down per traffic changes. also, user's service might persist in 1 of instances quite time; in case of failure, user's service should restored in peer instance backup , restore mechanism of object archive(database). so, challenge is: i need tell load balancer instance in user service persists. load balancer route same user's requests same instance in cluster. , in case of failure, update load balancer new instance in user's service had been restored. preferably generated dynamically application server instance; accessible in program environment; understood , used load balancer route request... anyone has idea? thanks lot after googling around time. found alternative wso2 claimed supporting( http://wso2.com/products/elastic-load-balancer/ ). nginx plus comes fe

python - Entrez and SeqIO "no records found in handle" -

my code looks this: import re bio import seqio bio import entrez entrez.email = "...@..." # e-mail address handle1 = entrez.efetch(db="pubmed", id=pmid_list_2010, rettype="gb", retmode="text") data1 = handle1.read() handle1.close() handle2 = entrez.efetch(db="pubmed", id=pmid_list_2011, rettype="gb", retmode="text") data2 = handle2.read() handle2.close() handle3 = entrez.efetch(db="pubmed", id=pmid_list_2012, rettype="gb", retmode="text") data3 = handle3.read() handle3.close() handle4 = entrez.efetch(db="pubmed", id=pmid_list_2013, rettype="gb", retmode="text") data4 = handle4.read() handle4.close() handle5 = entrez.efetch(db="pubmed", id=pmid_list_2014, rettype="gb", retmode="text") data5 = handle5.read() handle5.close() handle6 = entrez.efetch(db="pubmed", id=pmid_list_2015, rettype="gb", retmode=&q

C++ left of getter() must have class/struct/union -

i trying exercise on class inheritance in c++. main idea have point class (defining point 2 coordinates) , have different shapes (such rectangle, square, triangle ...etc) my point class has getters called getx() , gety(), both return double values. in of shape classes (rectangle, square, triangle) have print method prints class members console. in method need x , y of instance of point. problem following compile error when : error c2228: left of '.getx' must have class/struct/union here pastebins rest of code : point class header : http://pastebin.com/va29dtke point class cpp file : http://pastebin.com/e8gkrsht rectangle class header : http://pastebin.com/pxnxx18q rectangle class cpp file: http://pastebin.com/r09vgfdb the issue occurs on lines 18 , 19 in rectangle class cpp file. in advance :) point rectangle::origin(double, double); is function takes 2 doubles, therefore have call like: double rectangle::draw() { std::cout << "

http content length - cURL failing on some input. What is Expect: 100-continue? -

probably, question asked , answered many times couldn't find simple comprehensive explanations. don't want disable until understand problem. understand, in principle, expect: 100 , waiting http1.1 100 continue performed let other side decide if needs remainder of content. what , for? understand correctly? giving client ability control data flow reason why done? other question why curl failing? server fault sends http1.1 200 ok before client sends data? [george@***** ***]$ curl -x post -d @test/curl/json/interact.json localhost/api/interact -v * connect() localhost port 80 (#0) * trying 127.0.0.1... connected * connected localhost (127.0.0.1) port 80 (#0) > post /api/interact http/1.1 > user-agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 nss/3.19.1 basic ecc zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > host: localhost > accept: */* > content-length: 3854 > content-type: application/x-www-form-urlencoded > expect: 100-continue > <

php - How to pass and get color code value with get request -

i have pass color code query string url. right passing directly not giving me desire output. $color = "#ff0000"; $name = "test"; $download = "1"; $url = "http://localhost/demo?name=".$name."&color=".$color."&download=".$download." "; with above url got below output. array ( [url] => http://localhost/demo [name] => test ) desire output: array ( [url] => http://localhost/demo [name] => test [color] => #fe8c1a [download] => 1 ) please me 1 best way solve problem. note: have used urlencode($color). working fine dont know correct or not. tell me if other method better this. yes, urlencode() works fine: $url = "http://localhost/demo?name=".$name."&color=".urlencode($color)."&download=".$download." "; if want alternative, use http_build_query : $query_string = http_build_query(array( '

how to display only numbers on a form field and stop other inputs using core javascript? -

when filling form field numbers should taken input , displayed on form field.when other characters 'a' filled,they not displayed on form field .only given numbers seen.it should done using core javascript. http://www.w3schools.com/html/tryit.asp?filename=tryhtml_input_number <input type="number"> that should need. edit : after seeing comment: not solution, because want javascript solution. should have been in question, because essential answering question.

Android Genymotion audio distorted -

i running app on genymotion emulator , yesterday ran program , audio working perfectly, today checked audio feature , result deep, slow version of song. have ideas on why happening? you maybe running on lollipop (5.0 or 5.1). known bug solved on next release. should not encounter same problem on other android versions.

java - Eclipse constantly removes src/it from souce folders -

i'm using maven-failsafe-plugin run integration tests stored in src/it source folder. eclipse removes .classpath . <classpathentry kind="src" output="target/test-classes" path="src/it"> <attributes> <attribute name="optional" value="true"/> <attribute name="maven.pomderived" value="true"/> </attributes> </classpathentry> does face same issue? how can fix problem? i'm using eclipse mars.1 release (4.5.1) the line <attribute name="maven.pomderived" value="true"/> sounds classpathentry being placed there pom or maven plugin eclipse. mean each time project refreshed or pom being read again, entry overwritten. can remove attribute?

java - Spring Security @Secured annotation and User authorities -

this spring v.4 (mvc + security). have implemented userdetailsserviceimpl , inside loaduserbyusername method user granted authorities. it's simply: public userdetails loaduserbyusername(string username) { ... collection<grantedauthority> authorities = new arraylist<>(); authorities.add(new simplegrantedauthority("admin")); return new org.springframework.security.core.userdetails.user(username, password, enabled, true, true, true, authorities); ... } and have security controller inside i've annotated method @secured annotation: @secured("admin") @requestmapping(value = "/users", method = requestmethod.get) public string users(model model ...) { ... } as can see inside loaduserbyusername explicitly grant admin role user. when i'm trying access /users access denied exception: 2016-04-19 10:25:16,899 debug (http-nio-8080-exec-9) [org.springframework.security.web.access.exceptiontransl

How to pass variables to other functions inside object in javascript -

var mycar2 = { maxspeed: 70, driver: "arnold", drive: function(speed, time) { console.log("speed " + (speed * time)); }, logbook: function(a , b) { console.log("max speed " + this.maxspeed + " " + this.drive(a , b)); } }; mycar2.logbook(3 , 6); if run code this.drive(a , b) undefined . how can pass variables drive() function using logbook() ? you passing variables drive, , defined within it. if weren't wouldn't speed 18 in output, speed nan . the undefined value return value of drive , because haven't put return statement in function.

ckfinder thumbnails slow -

we using paid version of ckfinder . when open pop-up see our complete structured folder images, takes ages load. this due ckfinder , not our server. if have coded own "finder" load images instantly, because deadline couldnt code myself , decided use ckfinder said, horribly slow. is there way speed process dont have wait seconds every single time go new folder? folders take 10 seconds load, , yes... there 50+ images in folder said. made small script same ckfinder , loads instantly. since paid ckfinder want use this, reduce load times. as said, if have coded own finder there no delay compared ckfinder. i hope knows how speed ckfinder :) there small problem in config.php may make ckfinder slow: default backend remote 1 (ftp), , it's used in privatedir section backend store ckfinder private files (including generated thumbnails). fetching data ftp slower in comparison local file system, , may cause delays. way solve creating additional backend in

xampp - PHP is working even without php.ini -

i have installed php xampp , want install phalcon dll, have add php.ini i did all phalcon installing steps did not not working; removed php.ini content , restarted apache php still working! is php able work without php.ini? how php working without php.ini? php.ini file not mandatory php work. allows set parameters, if there's none php defaults apply. why php.ini not working? you playing wrong one. run script with <?php phpinfo(); and location of php.ini . file need edit.

mfc - C++ CImage incomplete type is not alloweed -

i incomplete type not allowed cimage image; used this: what went wrong? never called class before. using namespace std; class cimage; myfunction(hbitmap bmp) { cimage image; image.attach(bmp); image.save("filename.jpg"); } class cimage; forward declaration , tells compiler class named cimage exists, not how class defined (hence incomplete type). you need include header file defines cimage class. try #include <atlimage.h> instead of class cimage; from msdn cimage class ducumentation : when create project using cimage , must define cstring before include atlimage.h . if project uses atl without mfc, include atlstr.h before include atlimage.h . if project uses mfc (or if atl project mfc support), include afxstr.h before include atlimage.h . likewise, must include atlimage.h before include atlimpl.cpp . accomplish easily, include atlimage.h in stdafx.h .

python - How to not add the same element in a list -

i need again... here code : def import_sudoku(): open("sudoku.txt") f: lines = f.read() sudoku = [[character character in line if not character == " "] line in lines.split("\n")] return sudoku sudoku = import_sudoku() print(sudoku) def grid_index(grid, value): i, row in enumerate(grid): j, cell in enumerate(row): if cell == value: return i, j return -1, -1 print("coords:",grid_index(sudoku, ".")) def solve_next_unsolved(sudoku): coords = grid_index(sudoku, ".") value_to_input = "3" cell in sudoku[0]: if value_to_input == cell: break else: sudoku[coords[0]][coords[0]] = value_to_input print(sudoku) my sudoku.txt... .3. ... ... ..8 39. 6.. 5.1 2.. 49. .7. 6.. ... 2.. ... .4. ... 5.3 98. ... ... 15. ... ..7 ..9 4.. .1. 3.. so, working first line @ moment. don't understand why 3 can stored in line...

django - DRF ModelViewSet ignore prefetch/select_related? -

i know question has been asked few times solutions doesn't work me. i'm using django-debug-toolbar , see there thousands of queries made related objects. there 2k rows in model, , takes 10 seconds drf's api page load. i've tried using possible combinations of prefetch/select_related don't work. here's code: class a(models.model): b = models.foreignkey(b) class b(models.model): pass class myviewset(viewsets.modelviewset): serializer_class = aserializer queryset = a.objects.all().select_related('b') pagination_class = pagination.pagenumberpagination def get_queryset(self, *args, **kwargs): return super(myviewset, self).get_queryset(*args, **kwargs).select_related('b') class aserializer(serializers.modelserializer): class meta: model = the biggest culprits pagination class , serializer. however, couldn't find suspicious in drf's built-in pagination class, while waiting page load, p

rx java - rx.exceptions.OnErrorNotImplementedException How do I avoid this error - its crashing my app -

com.myapp.test.debug e/messagequeue-jni: rx.exceptions.onerrornotimplementedexception @ rx.observable$31.onerror(observable.java:7134) @ rx.observers.safesubscriber._onerror(safesubscriber.java:154) @ rx.observers.safesubscriber.onerror(safesubscriber.java:111) @ rx.observers.safesubscriber.onnext(safesubscriber.java:137) @ rx.subjects.subjectsubscriptionmanager$subjectobserver.onnext(subjectsubscriptionmanager.java:224) @ rx.subjects.publishsubject.onnext(publishsubject.java:121)

Postgresql - Constraints on Ranges - Two tables -

with constraints on ranges , prevent adding overlapping values in existing table. example, in following room_reservation table, make sure no room reserved in conflicting time. create extension btree_gist; create table room_reservation ( room text, during tsrange, exclude using gist (room =, during &&) ); what need here consider table (rooms) having room , during fields , consider records within table while making reservation? our specific scenario exam management. have invigilation table (room reservation) , time table of classes. once adding invigilation record, need make sure not coincide other invigilation record , make sure there no lecture @ time in room. you cannot single exclusion constraint. instead, should use exclusion constraint on 1 table, invigilation , , use before insert trigger on same table checks if there conflict in second table, rooms . trigger function on first table simple range check on second table: create function c

node.js - Run NPM scripts synchronously -

to start project, have 4 terminal commands need executing in order, 1 after , in different terminal windows: npm install gulp php -s localhost:8001 browser-sync start --proxy "localhost:8001" --files "**/*" to speed things up, want put theses in package.json , execute them single command so: scripts: { "start": "npm install && gulp && php -s localhost:8001 && browser-sync start --proxy 'localhost:8001' --files '**/*'" } but won't run them asynchronously , in same shell? you must try exec-sync , provide scripts command 1 one. var execsync = require('exec-sync'); execsync('npm install'); execsync('gulp'); execsync('php -s localhost:8001');

ios - Multiple Navigation Bar -

Image
i need put 2 navigationbars. second below first one. my idea is: in first navigation bar have navigation buttons , in second have label centered. the rest uitableview controller. when users scroll, content hide below navigation bars. paulw11 right, should create custom view, add couple of buttons , attach bottom of navigation bar using autolayout. if need hide view when user scrolls, can implement func scrollviewdidscroll(scrollview: uiscrollview) method in uitableviewcontroller , change it's alpha zero.

java - How to identify Web request from PDA/Desktop/Server? -

i know if possible identify (with java) kind of computer used make request, example: server, desktop, pda (tablet,cellphone,etc)? thank you! yes degree. have user-agent string http request. how depend on java , framework implementation that's direction should take. have examin string browser versions, mobile, etc... here request mac: mozilla/5.0 (macintosh; intel mac os x 10_7_5) applewebkit/536.30.1 (khtml, gecko) version/6.0.5 safari/536.30.1 and here windows server: mozilla/5.0 (compatible; msie 9.0; windows nt 6.1; wow64; trident/5.0) and here iphone: mozilla/5.0 (iphone; cpu iphone os 6_1_3 mac os x) applewebkit/536.26 (khtml, gecko) version/6.0 mobile/10b329 safari/8536.25

php - Prevent Wordpress from adding headers to outgoing requests -

i'm making wordpress plugin makes http requests third party api. outside of wordpress works fine, when using on wordpress server, seems adding number of headers have duplicate headers, , request fails. can me prevent wordpress adding duplicate content-type , content-length headers? content-type: application/x-www-form-urlencoded user-agent: mozilla/5.0 (macintosh; intel mac os x 10_11_0) applewebkit/537.36 (khtml, gecko) chrome/49.0.2623.112 safari/537.36 content-length: 20 content-length: 20 content-type: application/x-www-form-urlencoded i fixed doing hard filter in script making call, making sure headers in curl header array once.

java - Adding and removing elements to a double ended queue -

i have create double ended queue can add,remove , peek elements both sides (i.e, front , rear) i got methods adding,removing , peeking elements @ 'head' unable figure out methods same thing 'tail' of queue here code far:- public class dequeue { private node rear; private node front; private int counter; class node { private string item; private node link; } public node() { rear = front = null; counter = 0; } public void hadd(string o) { node temp = new node(); temp.item =o; temp.link =null; if (rear==null) front = rear = temp; else { rear.link = temp; rear = temp; } counter++; } public boolean isempty() { if(counter==0) return true; return false; } public object hpeek() { return rear.item; } public object hremov

sql - How can I find a particular row from a particular table? -

i want find specific field of specific column particular table based on user provided value. unknown value contain specific column field. clear: table1 -------------- | range|value| -------------- | 100 |0 | | 200 |2 | | 300 |9 | | 400 |15 | | 500 |20 | -------------- from table1 if user provided value between 0 100 result 0, if user provided value between 101 200 result 2, if user provided value between 201 300 result 9 , on. example if user provided value 50 result 0, if user provided values 499 result 20. if range column value fixed can find result using between function or <= , >= operator. here range column value unknown. how can solve problem? you can use combination of order by , rownum pseudo column select best row: select value ( select * table1 range >= :p_range order range ) rownum < 2 alternatively, can compute explicit ordering using row_number() analytic function

git - "Open with difftool" doesn't do anything -

i have file local changes. right-click , select "open difftool" git extensions , nothing happens. difftool opens fine other files. file not shown neither in commit window , in git status . i had file marked --skip-worktree . fix, run following (mind case in filepath ): git update-index --no-skip-worktree <filepath> git gui allows adding custom commands. have 1 command --skip-worktree , other revert change.

javascript - Jquery Chosen get the Id of un-selected value in dropdown -

i have manage id of selected option chosen plugin . here jsfiddle demo . now not sure how id of unselected option. using code id of selected option. var selectedids = $(this).find('option:selected').map(function() { if ($(this).attr('value') == params.selected) return $(this).prop('id') }).get(); alert(selectedids); when option deselected, change event, params object has deselected property can use you're using selected . i made jsfiddle demonstrate: http://jsfiddle.net/1eut1c3d/ $("#chosen").chosen().on('change', function(evt, params) { if (params.selected !== undefined) { var selectedid = $(this).find('option:selected').map(function() { if ($(this).attr('value') == params.selected) return $(this).prop('id') }).get(); alert("selected: " + selectedid); } if (params.deselected !== undefined) { var deselectedid = $(this).find(

javascript - jquery checkbox triggering on first load only -

i have radio button controls checked attribute , disable/enable checkbox regards on radio button you've checked. the problem onload have radiobutton 2 checked. of checkboxes enabled. if checked radio button 1, first 2 checkbox must disabled , 3rd 1 should remain enabled , has checked. if repeat scenario. checking radio button 2 run smoothly if checked radio button 1 last checked box marked checked on attribute box doesn't have checked. basically need checked visually in order data sent. html: <span><input type="radio" name="attendee" id="guest1" value="1">1</span> <span><input type="radio" name="attendee" id="guest2" value="2" checked="checked">2</span><br> <span class="wpcf7-form-control wpcf7-checkbox wpcf7-validates-as-required jpccheck"><span class="wpcf7-list-item first"><input type="check

Saving multiple instances of same form in django -

in template user can add (with add button :) ) instance of same form (empty 1 ofc ) when click submit(save) ony last 1 entered being saved. views.py: def form_valid(self, form): self.object = form.save() return httpresponseredirect(self.get_success_url()) template: <form action="{{ action }}" class="form-horizontal form-inline" method="post" enctype="multipart/form-data"> {% csrf_token %} {% if object.id %} <legend>edit object2</legend> {% else %} <legend>add object2</legend> {% endif %} {{ form }} <div class="objects2"> {% objects2_form in form %} <div id="objects2-{{ forloop.counter0 }}"> </div> {% endfor %} </div> <div class="form-actions"> <a href="#" id="add-object2" class="btn btn-info add-object2" >add object2</a> <button type=

android - AlarmManager Call Method Within Class -

i use alarmmanager call specific method within class being called periodically alarmmanager. effectively, use alarmmanager rather timer, because timer's delay ignored when phone not in active use. so, instead of having timer this... timer thetimer = new timer(); thetimer.schedule(new timertask() { @override public void run() { if(checkifgoogleplay()) { getpostlocation(); stopself(); mlocationclient.disconnect(); } } }, two_minutes); i alarmmanager similarly. appears have call class periodically instead of letting me set timer-like function within same class. important within same class, in case, because giving locationclient 2 minutes connect. thanks help! i'm not sure why need give locationclient 2 minutes connect. shouldn't take long. in addition, calling locationclient.connect() synchronous, comes immediately. if connection fails because of problem,

In bash, how to retrieve string starting with a specific expression? -

given piece of file: a=as/dsdf b=fdfsf c=vcv c=15 b=1 a=azzzz))]ee a=12 z=19 r=15 i want retrieve parts starting a= so output in case be: a=as/dsdf a=azzzz))]ee a=12 i've dived bash documentation couldn't find easy, have suggestion ? thanks i'm assuming want starting a= next space. it's not supported versions of grep if have -o option easy: grep -eo 'a=[^ ]+' file -o prints matching part of line. -e enables extended regular expressions , enables use + mean one or more occurrences of preceding atom *. [^ ] means character other space. otherwise, use sed capture part you're interested in: sed -e 's/.*(a=[^ ]+).*/\1/' file as last resort, if version of sed doesn't support extended regexes, should work on version: sed 's/.*\(a=[^ ]\{1,\}\).*/\1/' file as rightly pointed out in comments (thanks), avoid printing lines don't match, may want use -n suppress output , add p command print lines

OpenLayers 3 : put one layer in grayscale without changing other layers -

i have tricky question concerning possibility put layers in grayscale open layers 3. i achieve put whole map in grayscale using possibilities of canvas element, can seen in examples proposed in following discussion : openlayers 3 - tile canvas context but need different these examples : want give users possibility put layers 1 one in grayscale, without changing colour of other layers. idea instance have 1 background layer in grayscale other data on in colour. does know how such thing can achieved ? thanks ol.source.raster looking for. here example . var raster = new ol.source.raster({ sources: [new ol.source.stamen({ layer: 'watercolor' })], operation: function(pixels, data) { // convert pixels grayscale return pixels; } }); this enables manipulate pixel data of arbitrary sources on per-layer base.

openerp - Odoo Keyerror in accounts list -

description in odoo accounting module,there 26 accounts each assigned unique codes.some used invoice(like creditors invoice) , other purpose.we can see in accounting module->configuration->accounts->accounts.i have imported many user defined accounts client's database.no error during import,all account entries shows in user interface. error but when open of entries,i getting error "keyerror:261" where 261 id of 1 of account name.it exists both in ui , db.i know keyerror means dictionary , cant find key called 261.since id 261 there in db why not able search it?

MingGW C++ compiler does not work -

i trying install c , c++ compiler on windows 8. have installed mingw, downloaded , installed mingw32-base , mingw32-gcc-g++ packages , other required packages, added user environmet path string "c:\mingw\bin", , tried following guide http://www.mingw.org/wiki/getting_started so after installation created new file named "fstab" containing "c:\mingw /mingw" in c:\mingw\msys\1.0\etc because present file named "fstab.sample". after typed on cmd : gcc sample.cpp -o sample.exe , doesn't work @ returning me error: gcc: fatal error: no input files compilation terminated but if typed gcc --version gives me gcc 4.9.3 etc... packages installed can't compile of programs are in correct directory in cmd when compiling? you can navigate correct 1 cd , check if .cpp there ls

Async download file in c# -

i need improve code not understand made mistake. file downloaded in corrupted format. using cookies required part of method. /*downlod task */ public static async task<int> createdownloadtask(string urltodownload,string sdestinationpath, string cookiedstr) { int buffersize = 4096; int receivedbytes = 0; int totalbytes = 0; webclient client = new webclient(); client.headers.add(httprequestheader.cookie, cookiedstr); using (var stream = await client.openreadtaskasync(urltodownload)) { using (memorystream ms = new memorystream()) { int read = 0; totalbytes = int32.parse(client.responseheaders[httpresponseheader.contentlength]); var buffer = new byte[buffersize]; while ((read = await stream.readasync(buffer, 0, buffer.length)) > 0) { ms.write(buffer, 0, read); filestream file = new filestream(sdestinationpath, filemode.append, fileaccess.wr

php - An exception occurred while executing 'INSERT INTO events (user_id, ET1, ET2) VALUES (?, ?, ?)' with params [null, 2, 3]: -

i trying create form inside default controller. want values both dropdowns in homepage stored in et1 , et2 columns of events table, able do. want user_id logged in user should stored in user_id column of events table. while trying gives me error: an exception occurred while executing 'insert events (user_id, et1, et2) values (?, ?, ?)' params [null, 2, 3]: sqlstate[23000]: integrity constraint violation: 1048 column 'user_id' cannot null here code defaultcontroller <?php namespace appbundle\controller; use appbundle\entity\events; //use appbundle\entity\eventtype; use appbundle\entity\users; use sensio\bundle\frameworkextrabundle\configuration\route; use symfony\bundle\frameworkbundle\controller\controller; use symfony\component\httpfoundation\request; use symfony\component\httpfoundation\response; use symfony\component\form\extension\core\type\submittype; use symfony\component\form\extension\core\type\choicetype; class defaultcontroller extends