Posts

Showing posts from July, 2015

doxygen - Is there a Ruby documentation tool that allows inclusion of diagrams and images? -

doxygen - Is there a Ruby documentation tool that allows inclusion of diagrams and images? - i big fan of doxygen have used years various languages. in particular, appreciate wiki-like ability include images , run graphviz dot generator have arbitrary inline diagrams inline dot code or external files. rdoc has diagramming back upwards generate class diagrams using graphviz can't see way include arbitrary images or diagrams. neither appear back upwards building arbitrary pages doxygen. is there any tool provides these doxygen-style features ruby? i have skimmed ruby toolbox list of tools , seem variants of rdoc. the solution me @ nowadays seems extending yard. rdoc automatically convert urls html links , urls point image files automatically converted html images. ruby doxygen documentation-generation rdoc yard

jquery - How to Insert JSON data into DataTable -

jquery - How to Insert JSON data into DataTable - i new javascript , trying dynamically load json info datatable on button click. my json info in below format [{"devicename":"and1","ipaddress":"10.10.12.1221"}, {"devicename":"and2","ipaddress":"10.10.12.1222"},{"devicename":"and3","ipaddress":"10.10.12.1223"}] here finish html code: when running code, getting uncaughttype error in processdevicedataresults @ ('#devicetable'). but, pretty sure not way load info in datatable. //set hubs url connection var url = 'http://localhost:8080/signalr'; var connection = $.hubconnection(url); // declare proxy reference hub. var hubproxy = connection.createhubproxy('hubclass'); hubproxy.on('devicedataresults', processde...

android - How can I add image recognition to a Google Glass application? -

android - How can I add image recognition to a Google Glass application? - i trying find free way image recognition / computer vision in google glass application. looking can recognize real-world objects money, book covers, , text. ideally, work google goggles (for reason google hasn't made goggle api). open cloud-based solutions or ones run locally. open running own server if not feasable image recognition locally on glass. i have looked several different technologies. opencv seems powerful, doesn't come library of images match against. camfind has cloud api need, costs lot of money. does have suggestions how add together image recognition application? in advance! i won glass foundry hackathon in nyc (in 2013) hacking same thing together. before native development kit glass announced, did mirror api. how implemented it: first, create server-side glass app using 1 of quickstarts. requesting right scope can interact mirror api , manipulate users' timeli...

Edit some excel-cells with clojure docjure -

Edit some excel-cells with clojure docjure - i'm trying edit cells in excel sheet clojure docjure (https://github.com/mjul/docjure). in documentation of docjure shown how create new spreadsheet don't want that. i'm trying read out info of excel sheet, calculate new values , write them specific cells of same sheet. well first 2 steps working. don't know how write values back. how can this? it's useful take @ tests, can document code degree. found file looked relevant: https://github.com/mjul/docjure/blob/master/test/dk/ative/docjure/spreadsheet_test.clj#l126 and in file found: (deftest set-cell!-test (let [sheet-name "sheet 1" sheet-data [["a1"]] workbook (create-workbook sheet-name sheet-data) a1 (-> workbook (.getsheetat 0) (.getrow 0) (.getcell 0))] (testing "set-cell! date" (testing "should set value" (set-cell! a1 (july 1)) (is (= (july 1) (.getdatecel...

java - How to persist two entities with JPA -

java - How to persist two entities with JPA - i using jpa in webapp , can't figure out how persist 2 new entities relate each other. here example: these 2 entities +-----------------+ +--------------------+ | consumer | | profilepicture | +-----------------+ +--------------------+ | id (pk) |---| consumerid (ppk+fk)| | username | | url | +-----------------+ +--------------------+ the consumer has id , other values. profilepicture uses consumer's id it's own primary key , foreign key. (since profilepicture not exist without consumer , not every consumer has profilepicture) i used netbeans generate entity classes , session beans (facades). this how in short consumer.java @entity @table(name = "consumer") @namedqueries({...}) public class consumer implements serializable { @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "id...

javascript - HTML5 canvas two canvas on top of another clear only top -

javascript - HTML5 canvas two canvas on top of another clear only top - i have 2 canvas 1 top of how can clear top canvas layer. illustration if utilize erase tool clear background, need clear drawings on top canvas. picture is picture link demo is jsfidledemo your 'foreground' canvas context beingness created background canvas. hence why erasing background. should attach mouse event html body; if move off canvas mousedown , mouse outside canvas going break logic . javascript html5 canvas

wxwidgets - WxPython AddSpacer -

wxwidgets - WxPython AddSpacer - i trying add together spacer using wxpython 3.0.1.1 wx.gridbagsizer. if following: import wx sizer = wx.gridbagsizer() sizer.addspacer((10,10)) it doesnt work (10,10) size. in documentation mentioning both add together method , addspacer method none of them seem work documented. i bit lost utilize add together spacer gridbagsizer, please help? http://wxpython.org/phoenix/docs/html/sizer.html#sizer.addspacer http://wxpython.org/phoenix/docs/html/gridbagsizer.html#gridbagsizer.add i have looked @ next example: http://nullege.com/codes/search/wx.gridbagsizer.addspacer does'nt work me. it grid, when adding things it, must tell to: sizer.add((10, 10), (0, 0)) which adds spacer of 10x10 grid's position (0, 0). (at to the lowest degree in wx 2.8) wxpython wxwidgets wx

javascript - "Object doesn't support property or method 'push'" -

javascript - "Object doesn't support property or method 'push'" - this question has reply here: javascript object push() function 6 answers i'm trying add together new value existing json object in angularjs i'm getting error message: "object doesn't back upwards property or method 'push'" here code: $scope.addstatus = function (text) { $scope.application.push({ 'status': text }); //i have tried 'put' getting error }; $scope.create = function( application ){ $scope.addstatus('under review'); } here application json looks like: {"type":"not completed","source":"mail","number":"123-23-4231","amount":"234.44","name":"john ","id":"1...

Rails RSpec not seeing new model attributes -

Rails RSpec not seeing new model attributes - i added new attribute booking model through migration. class addpickuptimeendandpickupdetailstobookings < activerecord::migration def alter add_column :bookings, :pickup_details, :string end end i adding validation code: class booking < activerecord::base [...] validates :pickup_details, length: { maximum: 150 } and booking model specs failing with: failure/error: create(:booking) nomethoderror: undefined method `pickup_details' #<booking:0x0000006d043e28> either messed things awfully, either i'm missing obvious... did run migrations test environment ? rails_env=test rake db:migrate ruby-on-rails rspec

How do you assign an event handler to multiple elements in JavaScript? -

How do you assign an event handler to multiple elements in JavaScript? - i know how jquery, , know how event delegation. how do in plain javascript? for example, how assign event handler bunch of li s? i see var li = document.queryselectorall('li'); . returns array-like thing. loop through , assign handlers? sense there must improve way. if not, what's best way loop through array-like thing (and array-like thing called?)? yes, should loop through collection , assign handlers individually. jquery behind scenes. queryselectorall returns nodelist array-like object. for looping through list, can either utilize for loop: var list = document.queryselectorall('li'), l = list.length, li; (var = 0; < l; i++) { li = list.item(i); // ... } or utilize foreach method: [].foreach.call(document.queryselectorall('li'), function(li) { // ... }); javascript javascript-events event-handling

javascript - Off-page Sliding Navigation -

javascript - Off-page Sliding Navigation - i trying create simple off-page sliding navigation stack on codes css. i trying create 3d effect instead of simple slide effect hides , unhide menu on sidebar. here's current jsfiddle work: http://jsfiddle.net/je9fa6zc/ what want create 3d slide in effect looks this: http://jsfiddle.net/f9bdm1te/2/ so tried re-create css jsfiddle did not want. see updated css after copying codes on 3d slide in effect jsfiddle. #site-wrapper { position: relative; overflow: hidden; width: 100%; height: 5000px; /* temp: simulates tall page. */ -webkit-perspective: 1500px; perspective: 1500px; -webkit-perspective-origin: 0% 50%; perspective-origin: 0% 50%; } #site-canvas { width: 100%; height: 100%; position: relative; -webkit-transform: translatex(0); transform: translatex(0); -webkit-transition: .3s ease all; transition: .3s ease all; padding: 5% 0; /* temp: spacing. */ } ...

java - Exception Handling and flow -

java - Exception Handling and flow - i have method , sql query i'm using , particular survey query returns no rows. 'questions' should empty , emptyresultdataaccessexception should thrown (i verified logger.warn(msg) executed in utilize case.) exception should caught in next method. private void addsurveyquestions(survey survey) throws customexception, dataaccessexception { stringbuilder sql = new stringbuilder(); //build sql query list<surveyquestion> questions = getjdbctemplate().query(sql.tostring(), new object[] { survey.getquestionnairekey() }, new surveyquestionrowmapper()); // should never happen, in case if (questions == null || questions.size() == 0) { string msg = "expected @ to the lowest degree 1 question survey " + survey.getquestionnairekey(); logger.warn(msg); throw new emptyresultdataaccessexception(msg, 1); } // loop through questi...

.net - Nullable-How to compare only Date without Time in DateTime types in C#? -

.net - Nullable-How to compare only Date without Time in DateTime types in C#? - how compare date without time in datetime types in c#.one of date nullable.how can that?? you can utilize date property of datetime object datetime x; datetime? y; if (y != null && y.hasvalue && x.date == y.value.date) { //dosomething } c# .net datetime

sql - Mysql Many to Many relationship -

sql - Mysql Many to Many relationship - i trying implement simple many many relationship between 2 tables. user , groups. user --------- user_id user_name grouping ---------- group_id group_name usergroup ---------- user_id group_id lets both user , grouping table each has 1000 entries. i have create 1 admin user belongs groups. should create 1000 entries in usergroup table "admin" user? can create boolean column "applicable_to_all_groups" in user table should checked first before selecting usergroup table? any suggestion on doing right way appreciated. well, there's no "true" solution kind of cases. let's on pros / cons solution 1, in usergroup table pros requests allowed groups easier write (no or clause) cons you have add together entry in table every time add together entry in grouping table. doable, of course, boring, , error-prone. if want new user "which can related groups", you'll...

rdf - Does Schema.org have actual data or just provide schemas? -

rdf - Does Schema.org have actual data or just provide schemas? - i'm trying understand rdf , trying utilize stuff provided schema.org. however, saw many schema info there, have actual info or microdata downloaded xml or other format can used? i new in area. no, schema.org vocabulary. don’t host data/content uses vocabulary (apart illustration snippets). you can inquire specific datasets on our sis site, open info se. rdf schema.org

c# - Processing Resources with error: Wrong Parameter -

c# - Processing Resources with error: Wrong Parameter - i'm developing visual studio 2013. target multilingual c# windows phone project. i've been working quite time , added sqlite back upwards yesterday (and changed platform target arm ). after still compiling , running on smartphone. however today simply changed think of harm (some minor changes in functions , translation), got next error message: processing resources error: wrong parameter. unspecified error occurred. i tried things: makepri dump /if resources.pri /of resources.xml vc2013 prompt, looks normal resource file me, edit it. verbose in build options gave me 2k line build log. copied out sections, says 'failed': 1>done executing task "generateprojectprifile" -- failed. (taskid:143) 1>done building target "_generateprojectprifilecore" in project "myproject.csproj" -- failed.: (targetid:98) i have no thought it. doesn't compile anymore...

android - intentChooser returns odd requestCode -

android - intentChooser returns odd requestCode - i trying grab response share chooser sends email attachment know when delete file sdcard. the intentchooser called fragment intent intent = new intent(intent.action_send); intent.settype("message/rfc822"); intent.putextra(intent.extra_email, new string[]{"email"}); intent.putextra(intent.extra_subject, "subject"); intent.putextra(intent.extra_text, "body"); uri uri = uri.fromfile(file); intent.putextra(intent.extra_stream, uri); startactivityforresult(intent.createchooser(intent, "send..."), consts.share_intent); where share_intent public static final int share_intent = 2; then in activity holds fragment, seek grab response via @override public void onactivityresult(int requestcode, int resultcode, intent data) { if (requestcode == consts.share_intent) { if (resultcode == result_ok) { //do } ...

javascript - Hiding the content before loading intro -

javascript - Hiding the content before loading intro - i intro before loading page content hidden , shown after loading intro $(document).ready(function() { $('#content').removeclass('fullwidth'); $('#content').removeclass('fullwidth').delay(10).queue(function(next){ $(this).addclass('fullwidth'); next(); }); homecoming false; }); http://jsfiddle.net/19r5l0x7/2/ try work around: class="snippet-code-js lang-js prettyprint-override"> $(document).ready(function() { $('#content').removeclass('fullwidth'); //$('body').load(function() { $('#content').removeclass('fullwidth').delay(50).queue(function(next){ $(this).addclass('fullwidth'); next(); }); $(".fullwidth").width(100); var intervalid = setinterval(function(){ var w = $(".fullwidth .expand...

How to replace element in multidimensional array in ruby -

How to replace element in multidimensional array in ruby - i having difficulty code , hoping insight: i have 2d array board , attempting replace number "x" when called, having struggles achieving this. class bingoboard def initialize @bingo_board = array.new(5) {array (5.times.map{rand(1..100)})} @bingo_board[2][2] = 'x' end def new_board @bingo_board.each{|row| p row} end def ball @letter = ["b","i","n","g","o"].shuffle.first @ball = rand(1..100) puts "the ball #{@letter}#{@ball}" end def verify @ball @bingo_board.each{|row| p row} @bingo_board.collect! { |i| (i == @ball) ? "x" : i} end end newgame = bingoboard.new puts newgame.ball newgame.verify i aware when verify called iterating through array1, unsure how go making fix. help appreciated. this root of problem: @bingo_board.collect! { |i| (i == @ball) ? "x" : i} in example...

flash - How to make .exe to .swf? -

flash - How to make .exe to .swf? - i have exe file, wanna convert swf file. when utilize "exe swf converters" error "no swf files found" can guys give help me create exe file swf file? the tools using used extract swf files exe files, rather convert them. as far beingness possible, flash isn't executed programme - it's run under actionscript virtual machine. that's why it's .swf file , not .exe file. no, isn't possible @ all. although, adobe have introduced feature (mostly orientated towards gaming) import c++ code stage3d framework (or that). if created programme , you're writing in pure c++, should check out. flash exe

events - Sitecore Overriding Content Tree -

events - Sitecore Overriding Content Tree - can't seem to find posted online anywhere - excuse me if is! i looking event/pipeline 1 can override main content tree in cms. need hide/disable items in tree according user roles not able select or view them. thanks! dan you should using access rights it. fit needs. you need select item need limit access, got security>assign. break inheritance everyone, set allow read specifc role want allow. hide items in tree users not in specified role. events treeview sitecore pipeline sitecore7.2

android - Retrofit POST with a json object containing parameters -

android - Retrofit POST with a json object containing parameters - i'm using retrofit send post request server: @post("/login") void login( @body user user ,callback<user> callback); where user object has email , password fields. checking logs, can see parameters sent format: d/retrofit﹕{"email":"example@test.com","password":"asdfasdf"} what need parameters sent this? {"user" : {"email":"example@test.com","password":"asdfasdf"} } edit: making right way, using custom jsonserializer : public class customgsonadapter { public static class useradapter implements jsonserializer<user> { public jsonelement serialize(user user, type typeofsrc, jsonserializationcontext context) { gson gson = new gson(); jsonelement je = gson.tojsontree(user); jsonobject jo = n...

gem - Sass --watch breaking after Yosemite update -

gem - Sass --watch breaking after Yosemite update - after updating yosemite on macbook pro, sass --watch no longer functions. following: >>> sass watching changes. press ctrl-c stop. ignoring bigdecimal-1.2.5 because extensions not built. try: gem pristine bigdecimal-1.2.5 ignoring ffi-1.9.5 because extensions not built. try: gem pristine ffi-1.9.5 ignoring ffi-1.9.3 because extensions not built. try: gem pristine ffi-1.9.3 ignoring json-1.8.1 because extensions not built. try: gem pristine json-1.8.1 ignoring libxml-ruby-2.7.0 because extensions not built. try: gem pristine libxml-ruby-2.7.0 ignoring nokogiri-1.6.3.1 because extensions not built. try: gem pristine nokogiri-1.6.3.1 ignoring psych-2.0.6 because extensions not built. try: gem pristine psych-2.0.6 "gem pristine" doesn't anything. tried on sass 3.4.5 , 3.4.6. unsure how resolve. iv'e encountered same issue, next command helped me, seek typing 'gem pristine --all'...

javascript - how to change tag with the function of edit and delete a record of a table using jquery -

javascript - how to change <a> tag with the function of edit and delete a record of a table using jquery - @foreach (var item in model) { <tr class="rows"> <td>@item.coursename</td> <td>@item.classname</td> <td>@item.stuname</td> <td>@item.age</td> <td>@item.scores</td> <td> @html.actionlink("edit", "edit", new { id = item.id }) <a id="@item.id" href="javascript:" onclick="deletescore(@item.id)">delete</a> </td> </tr> } here jquery code tried write. don't know how write lastly <td> of each <tr> class="snippet-code-js lang-js prettyprint-override"> function deletescore(id) { alert(id) homecoming false; jquery.ajax({ data:{"id":id}, type: "...

HTML/Javascript range slider -

HTML/Javascript range slider - <!doctype html> <html> <head> <script type = "text/javascript"> $(init); function init(){ $('input[type="range"]').change(gettotal()); } function gettotal(){ var total = document.getelementbyid("outtotal"); total.innerhtml = number(slide.value) + number(slide1.value0); } </script> </head> <body> <input id="slide" type="range" min="1" max="100" step="1" value="10" > <input id="slide1" type="range" min=1 max=100 step=1 value=10 > <div> <label>total</label> <output id = "outtotal"></output> </div> </body> </html> here's have now. i'm trying total 2 range sliders , display when c...

c++ - What is the correct way to set global parameters in hlsl shader? -

c++ - What is the correct way to set global parameters in hlsl shader? - what right way of setting global params in hlsl shader? if have next global params: float4x4 world; float4x4 view; float4x4 projection; and utilize them within vertex shader: void vertexshaderfunction( in float4 inputposition : position, in float4 colorin : color, out float4 posout : sv_position, out float4 colorout : colour) { //set values output float4 worldposition = mul(inputposition, world); float4 viewposition = mul(worldposition, view); float4 position = mul(viewposition, projection); posout = position; colorout = colorin; } then how set these global values c++ code f.e. when photographic camera moved? should create shader, sets these values can access buffer this? void setprojectionmatrix(float4x4 inputmatrix : matrix){ projection = inputmatrix; } please tell me proper way accomplish this. first, in shader want set matrices constant buffe...

Moodle database upgrade -

Moodle database upgrade - i want upgrade moodle databse 1.9.5 moodle 2.7.2. i have 1 site in moodle 1.9.5 , in moodle 2.7.2. i want whole database of moodle 1.9.5 in moodle 2.7.2. i read various docs in vain. please help. the steps upgrade 1.9x 2.7.2 easy process. before start process , please create sure first following read release notes moodle 2.2 , latest plugins in it. backup total database. backup total moodledata. check backups carefully. purge php caches also check updated versions of plugins in moodle 1.9x , download updated versions before upgrading. uninstall plugins not supported updated version. download latest version of moodle 2.2 - https://download.moodle.org/releases/legacy/ you should set site maintenance mode stop non-admin users logging in. once done, replace old code newer version code login moodle site , page upgrade moodle database or else go settings > site adminstration > notifications trigger moodle self-update. ...

javascript - Adding a button to change mesh in babylon.js -

javascript - Adding a button to change mesh in babylon.js - i'm having terrible time trying show/hide mesh in babylon.js scene button. assumed create function show/hide meshes , phone call said button page impact scene , wrote following: <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script src="assets/js/babylon.js"></script> <script src="assets/js/hand-1.3.8.js"></script> <script src="assets/js/cannon.js"></script> <!-- optional physics engine --> </head> <body> <div id="container"> <!-- page content --> <div id="content"> <div id="tablebuilder"> <div id='cssmenu'> <ul id="tops"> <button type="button" onclick="showtop('t115')">round</button> <b...

multithreading - Android wear doesn't start thread -

multithreading - Android wear doesn't start thread - i'm building application team robot auto allow drive controlled mobile device. works on phone, i've ported app android wear, thread lets me connect server on raspberry pi doesn't work. there way thread working? code: public class socketconnect { static dataoutputstream dout; static socket socket; public static void connect() { system.out.println("got connect"); new thread() { public void run() { seek { socket = new socket("192.168.2.9", 8899); system.out.println("trying @ 2.9"); dout = new dataoutputstream(socket.getoutputstream()); } grab (ioexception e) { e.printstacktrace(); } } }.start(); } ....further code logcat error: http://pastebin.com/0btf27p8 (couldn't format nice in editor) two problems approach: networkonmainthr...

amazon web services - What's AMI ImageType? -

amazon web services - What's AMI ImageType? - there image-type in describe-images filter, , imagetype in response, no info stands for, , cannot find info googling. there 3 types: machine, kernel, ramdisk, mean? if using ami images provided else, can ignore them -- you'll need utilize ami identifier when booting new instances. a bit more detailed answer: ramdisk image (ari) , kernel image (aki) used part of boot sequence of linux instance. more accurately: hardware virtualized (hvm) instances not utilize ari or akis @ all. of boot sequence part of ami itself. includes both ebs , instance-store backed instance types. paravirtualized (pv e.g. running on xen) ebs-backed instances need aki, , paravirtualized instance-backed instances need both aki , ari. while amis unique, aki/aris can reused. example, aki-88aa75e1 kernel image used (in us-east-1 , public images) 5413 amis , ramdisk ari-a51cf9cc 683 amis. both of these images provided amazon , trusted ot...

python - What does h = httplib2.Http('.cache') mean? -

python - What does h = httplib2.Http('.cache') mean? - what line 2 ( h = httplib2.http('.cache') ) mean here? >>> import httplib2 >>> h = httplib2.http('.cache') from httplib2.http() documentation string: if 'cache' string used directory name disk cache. otherwise must object supports same interface filecache. the line creates instance of http() class, , sets cache parameter .cache , meaning .cache directory in current working directory used cached data. from usage section of project documentation can see cache used cache responses according http caching rules; cache honour cache headers set on response unless override headers corresponding request headers. python httplib2

r - Create a confusion matrix from a dataframe -

r - Create a confusion matrix from a dataframe - i have info frame called conf_mat 2 columns including predicted values , reference values in each objects. have 20 objects in dataframe. dput(conf_mat) structure(list(predicted = c(100, 200, 200, 100, 100, 200, 200, 200, 100, 200, 500, 100, 100, 100, 100, 100, 100, 100, 500, 200 ), reference = c(600, 200, 200, 200, 200, 200, 200, 200, 500, 500, 500, 200, 200, 200, 200, 200, 200, 200, 200, 200)), .names = c("predicted", "reference"), row.names = c(na, 20l), class = "data.frame") i want create confusion matrix out of table kind of construction filled in conf_mat dataframe. allow me compute accuracu assessment of classification. help. 100 200 300 400 500 600 100 na na na na na na 200 na na na na na na 300 na na na na na na 400 na na na na na na 500 na na na na na na 600 na na na na na na 1) seek following: table(conf_mat) 2) if want ...

javascript - Phantom.js callback Reference errors when refactoring Phantom.js on Node.js/Express.js to avoid "callback hell" -

javascript - Phantom.js callback Reference errors when refactoring Phantom.js on Node.js/Express.js to avoid "callback hell" - i have crazy big block of code functions, hoping refactor properly. accordance callback hell, tried break downwards non-anonymous functions , seperate functions central code. however, running problem lot of different sections of code dependent on using others parameters. first error message received in sequence referenceerror: page not defined the un-refactored code is: function startmyfunction(firstlayerurl) { phantom.create(function (ph) { ph.createpage(function (page) { var main_file=firstlayerurl page.open(main_file, function (status) { var linkarray=[]; page.evaluate(function (linkarray) { (var i=0; < document.getelementsbytagname('a').length; i++) { linkarray.push(document.getele...

javascript - \s RegEx not capturing new line data -

javascript - \s RegEx not capturing new line data - i trying clean input , set desired way. basically, have serialnumbers entered several different ways - come in delimited (newline), space, comma, etc. my problem in code below in testing new line delimited isn't working. according w3schools , 2 other sites: \s metacharacter used find whitespace character. whitespace character can be: -a space character -a tab character -a carriage homecoming character -a new line character -a vertical tab character -a form feed character this should mean can grab new line. in netsuite, user entering value as: sn1sn2sn3 i want alter "sn1,sn2,sn3,". \s regex not picking newline? help appreciated. **for record - while using netsuite (crm) input, rest of code typical javascript , regex work. why using 3 tags - netsuite, js, , regex function fixserailnumberstring(s_serialnum){ var cleanstring = ''; var regexspace = new regexp('\\s',"g"); if(r...

readme.md links on npm vs github -

readme.md links on npm vs github - bottom line: there way create anchor links (table-of-content style) in readme.md file work in both npm , github ? hi all, i have readme.md file both on github , on npm. @ top of file, there's table-of-contents, list of links. each link should point header in file. after googling , reading stackoverflow answers, tried following: [overview](#overview) - resulted in npm pointing links github. i resorted hard-coding links point proper anchors on npm - means clicking link on github redirected npm page. the readme.md file can found here: https://github.com/ujc/layman.js/blob/master/readme.md thx in adv! what works me utilize plain html links. both github , npm markdown presentations allow embedded html , seems work fine. e.g. <a href="#my-heading">link heading</a> ... # heading github npm markdown

solrnet - Solr search not working when searching for more than one word -

solrnet - Solr search not working when searching for more than one word - i'm seeing problem in application when end user attempts search item more 1 word. illustration have title field , value "two words". if search "two" can item back, if search "two words" nothing. i using solrnet results don't think way pull out results. think it's how title field beingness tokenized. anyway, here's compressed version of solr schema file: <?xml version="1.0" ?><schema name="staging" version="1.1"> <types> <fieldtype name="ignored" indexed="false" stored="false" class="solr.strfield" /> <fieldtype name="string" class="solr.strfield" sortmissinglast="true" omitnorms="true"/> <fieldtype name="tint" class="solr.trieintfield" precisionstep="8" omitnorms="tr...

c# - How to get Entity Framework 6 to use SQL STUFF function inside CSDL? -

c# - How to get Entity Framework 6 to use SQL STUFF function inside CSDL? - i using ef 6.1 , create custom function in csdl section of edmx file can phone call stuff function built sql 2012. have simple. (note: assumes time hhmm without colon) <function name="stringtodate" returntype="datetime"> <parameter name="strdate" type="string" /> <parameter name="strtime" type="string" /> <definingexpression> cast(case when strdate &lt;&gt; '' strdate + ' ' + stuff(strtime, 3, 0, ':') end datetime) </definingexpression> </function> the above code works if remove "stuff" command "stuff" command "'stuff' cannot resolved valid type or function." i can utilize "entity.sqlserver.sqlfunctions.stuff" in linq entity fine not in csdl. note: using stuff command insert colon b...

android - Move ImageView with animation -

android - Move ImageView with animation - i'm trying move imageview code: img.animate().translationy(110).setduration(1500); but if seek move 1 time again later like: img.animate().translationy(-110).setduration(1500); the imageview moves used before moved in first place. expect homecoming it's original position. missing here? try this img.animate().translationy(0).setduration(1500); android animation android-studio imageview position

arm - How to initialize I2C on STM32F0? -

arm - How to initialize I2C on STM32F0? - recently i've been trying i2c bus working on stm32f030f4p6 mcu, little luck. i'm using stm32f0 module , have found plenty of resources stm32f1 module i2c initialization, nil specific stm32f0 initialization/transfer process. here's initialization code: void i2c_init(uint8_t ownaddress) { gpio_inittypedef gpio_initstructure; i2c_inittypedef i2c_initstructure; // enable gpioa clocks rcc_apb2periphclockcmd(rcc_ahbperiph_gpioa, enable); // configure i2c1 clock , gpio gpio_structinit(&gpio_initstructure); /* i2c1 clock enable */ rcc_apb1periphclockcmd(rcc_apb1periph_i2c1, enable); /* i2c1 sda , scl configuration */ gpio_initstructure.gpio_pin = gpio_pin_9 | gpio_pin_10; gpio_initstructure.gpio_speed = gpio_speed_2mhz; gpio_initstructure.gpio_mode = gpio_mode_af; gpio_initstructure.gpio_pupd = gpio_pupd_nopull; gpio_initstructure.gpio_otype = gpio_otype_od; gpio_init(gpioa, &gpio_initstructure); /* i2c1 res...

objective c - Hiding, then showing status bar loses background - iOS 7 -

objective c - Hiding, then showing status bar loses background - iOS 7 - i presenting view controller visible status bar view controller hidden status bar, dismissing it. upon dismissing, status bar doesn't have navigation bar's background color anymore - it's transparent. i'm using view controller-based status bar appearance - no , hiding , showing navigation bar in each view controller with: - (bool)prefersstatusbarhidden{} i believe problem lies navigation bar not resizing correctly when status bar comes back. this issue prevalent on ios 7.0 , 7.1. ios objective-c uistatusbar

Change status from not complete into completed PHP -

Change status from not complete into completed PHP - i wonder how create status not finish completed. 'not complete' link menu page user, after click link, redirect survey module. my question how if user submit survey module , redirect menu page, , @ same time status alter 'completed'. kindly need guidance , recommendation. tq. below code more understanding : class="snippet-code-html lang-html prettyprint-override"> <table border="1" align="center" cellpadding="0" cellspacing="0"> <tr><td> <table border="1" cellpadding="7" width="630" cellspacing="1"> <tr> <th><font size=2>modul</font></th> <th><font size=2>status</font></th> </tr> <tr><td><font size=2><center>modul 1<td><a href="indsurve...

plot circle with gradient gray scale color in matlab -

plot circle with gradient gray scale color in matlab - i want draw circle gradient color in matlab, can't. there 1 can help me? the sample image can found here here's 1 approach - n = 200; %// decides size of image [x,y] = meshgrid(-1:1/n:1, -1:1/n:1) ; nrm = sqrt(x.^2 + y.^2); out = uint8(255*(nrm/min(nrm(:,1)))); %// output image figure, imshow(out) %// show image output - if pad output white boundary shown in expect output image, can padarray - padsize = 50; %// decides boundary width out = padarray(out,[padsize padsize],255); matlab

ASP.NET MVC : Get text Box input in a controller action method -

ASP.NET MVC : Get text Box input in a controller action method - i have 2 2 textboxes in page , button. when user clicks button want pass text entered user in action method of controller. might silly. new mvc. pls tell me how this. here code have tried. view <input type="text" name="input_domain_id" class="form-control text-center" placeholder="domain id" autofocus required> <input type="password" name="input_domain_password" class="form-control text-center" placeholder="domain password" required> <div class="col-lg-12"> <p><button class="btn btn-lg btn-success btn-block" type="submit" onclick="location.href='@url.action("verifylogin", "ldaploginverify")'">login</button></p> </div> and in controller public actionresult verifylogin(st...

Windows batch script to list files in directory and assign to variables -

Windows batch script to list files in directory and assign to variables - i have scripted in unix, have requirement in windows. requirement property file contains path variable. script needs list files under path , phone call function on each file. have been trying @for /f "tokens=1* delims==" %%a in (c:\work\sample\myfile.properties) ( if "%%a"=="mpwr_export_path" set mpwr_export_path=%%b if "%%a"=="file_share" set file_share=%%b ) cd %mpwr_export_path% %%i in (*) echo %%i question is: how assign %%i variable , pass filename function dispay() you don't need assign variable pass function. called function receives parameter %1 , can refined %~1 syntax. i suggest alter cd command pushd . way (1) %mpwr_path% variable can contain drive letter or network path, , (2) bat can later cleanly restore current directory popd . so, read help pushd , help call , seek this. pushd %mpwr_path% %%i in (*) phone call...

java - how to get protocol details from packets stored in a pcap file -

java - how to get protocol details from packets stored in a pcap file - i want create switch loop (in java) cases protocol of ip header of packets stored in pcap file. i using jnetpcap library access packets. i know how ip address, port numbers etc. packet want know whether there function tells me straight protocol of packet i.e. tcp, udp, icmp etc. 1 can suggest if he/she knows other library has kind of function. thanks in advance. there exists jpcap library built-in functions available extract protocol of packet , other details. java protocols packet pcap jnetpcap

java - BlueJ how to get data from an array so that it can be compared with user input -

java - BlueJ how to get data from an array so that it can be compared with user input - i'm messing around bluej , trying objects interact each other , stuff. have created business relationship , accountlist class. accountlist allows add together business relationship objects puts arraylist. removing these accounts array index easy plenty loop position of each account, should remove business relationship account number specified parameter , can't work out how accountnumber array compare users input. accountlist class /** * creates accountlist store customers accounts * * @author ryan conway * @version 12/11/2014 */ import java.util.*; public class accountlist { private arraylist < business relationship > accounts; /** * create accountlist contain accounts. */ public accountlist() { accounts = new arraylist < business relationship >(); } /** * add together business relationship accountli...

Ubuntu 14.04 OpenStack Installation Failure -

Ubuntu 14.04 OpenStack Installation Failure - i've been repeatidly trying follow (http://www.ubuntu.com/download/cloud/install-ubuntu-openstack) guide on how install openstack/mass/juju etc... unfortunately every single time has failed. have been doing dedicated server blank ubuntu 14.04 every time. different errors each time. here of them: debug • 11-12 22:33:39 [line:50, func:global_exchandler] • cloudinstall.utils • tra$ file "/usr/share/openstack/cloudinstall/utils.py", line 64, in run super().run() file "/usr/lib/python3.4/threading.py", line 868, in run self._target(*self._args, **self._kwargs) file "/usr/share/openstack/cloudinstall/single_install.py", line 139, in do_insta$ utils.ssh_genkey() file "/usr/share/openstack/cloudinstall/utils.py", line 571, in ssh_genkey print("unable generate key: {0}".format(out['stderr'])) keyerror: 'stderr' debug • 11-12 22:32:17 [line:50, func...

html - How can I run Javascript from a local folder? -

html - How can I run Javascript from a local folder? - i new javascript , can't seem load simple javascript file html file. i have folder on desktop .html file , .js file the .html file contains next html: <html> <head> <title>simple page</title> </head> <body> <p> simple html page</p> <script src=“script.js”></script> </body> </html> inside .js file have simple javascript text: alert("hello world:); when open .html file in browser text: "this simple html page" it doesn't run script. can't seem find way create .html file point .js script though in same folder on desktop. doing wrong? also, i've tried set javascript straight within html code (with ( tags) , doesn't work either. what doing wrong? i've tried 2 different browsers. folder issue? thanks. three possibilities can see here: your scri...