Posts

Showing posts from June, 2013

javascript - Include and reference an image in react with webpack -

what ist best way include , reference images react-usage in singlepage javascript app build , bundled webpack? so far have return (<img src={require('./pic.png'}</div>) is there better way? if you're using webpack's url-loader can tell automatically embed data uri if file size under specified limit. require("url?limit=10000!./pic.png"); // => dataurl if "pic.png" smaller 10kb

ios - Collection view is crashing for some reason -

//collection view uicollectionviewflowlayout *layout=[[uicollectionviewflowlayout alloc] init]; self.collectionview=[[uicollectionview alloc] initwithframe:self.view.frame collectionviewlayout:layout]; [self.collectionview setdatasource:self]; [self.collectionview setdelegate:self]; [self.collectionview registerclass:[uicollectionviewcell class] forcellwithreuseidentifier:@"cellidentifier"]; [self.collectionview setbackgroundcolor:[uicolor redcolor]]; [self.view addsubview:self.collectionview]; } - (nsinteger)collectionview:(uicollectionview *)tcollectionview numberofitemsinsection:(nsinteger)section { return 15; } // cell returned must retrieved call -dequeuereusablecellwithreuseidentifier:forindexpath: - (uicollectionviewcell *)collectionview:(uicollectionview *)collectionview cellforitematindexpath:(nsindexpath *)indexpath { uicollectionviewcell *cell=[collectionview dequeuereusablecellwithreuseidentifier:@"celliden...

How to attach sources to scala sbt project at Intellij Idea? -

Image
i new @ scala. , start want use intellij 13.1.5 ide . however ide can't attach sources. here how looks anyval : search @ internet can't find source. i tried attach sources , attach unpacked scala archive. doesn't work either. update: here sbt onfiguration: name := "scalatest-selenium" version := "1.0" scalaversion := "2.11.1" librarydependencies ++= seq( "net.sourceforge.htmlunit" % "htmlunit" % "2.14", "org.seleniumhq.selenium" % "selenium-java" % "2.42.2", "org.scalacheck" % "scalacheck_2.10" % "1.11.4" % "test", "org.scalatest" % "scalatest_2.11" % "2.2.0" % "test" ) testoptions in test += tests.argument(testframeworks.scalatest, "-u", "target/test-reports") how solve trouble? i rid of trouble following way: removed .sbt directory in home ...

twitter bootstrap - Controller using Spark framework is nesting html in <pre> -

i'm trying use spark , freemarker framework site i'm building. now, i'm going through tutorial , trying implement bootstrap well. working in sense spark mapping resource file proper endpoint. however, reason seems nesting of html in pre element displays on endpoint raw html. here's have: the controller: import static spark.spark.get; import java.util.hashmap; import java.util.map; import spark.modelandview; import spark.template.freemarker.freemarkerengine; public class bulkuploadcontroller extends basecontroller { private static final string controller_root = "/bulk-upload"; @override public void registerendpoints() { get(controller_root, (request, response) -> { map<string, object> attributes = new hashmap<>(); return new modelandview(attributes, "bulk-upload.ftl"); }, new freemarkerengine()); } } the main method in ...

grails, jquery chosen multiselection with g:select -

i'm using jquery chosen plugin multiselect in conjunction grails <g:select> . should selector multiple users defined in domain class via has many = [users: user] . works in cases pretty if example 3 users selected , want delete one, nothing happens. if delete 2 updates correctly. if nothing selected can add users 1 one , works. that code in gsp: <g:select id="pickusers" name="users" from="${usermanagement.user.list()}" multiple="true" optionkey="id" value="${projectinstance?.users*.id}" class="many-to-many"/> <script type="text/javascript"> $('#pickusers').chosen({width: "25%", no_results_text: "keine ergebnisse für", placeholder_text_multiple: "mitarbeiter suchen..."}) $('#pickusers').trigger("chosen:updated") $('#pickusers').on('change', ...

javascript - Angularjs not rendering $rootscope data -

i stuck on problems , in problem solved , problem header not enableing response (like cors issue) ,overcome using header , transformrequest shown in below code. after got webservice data in 1 controller used $rootscope render of id of data of second method (api) use in controller put on third 1 api data , getting minute throw error : cannot read property 'companies data' of null field in third api. when used $rootscope.test.companies[0].companyname store data, , unique api primary key. var request = $http({ method: "post", url: "http://app.xyz/xyzapp/public/user/login", headers: {'content-type': 'application/x-www-form-urlencoded'}, transformrequest: function(obj) { var str = []; str.push(encodeuricomponent('email_id') + "=" + encodeuricomponent('demo@xyz.com')); str.push(encodeuricomponent('password') + "=" + encodeuricomponent...

asp.net mvc - How do you send data to controller with ajax.beginform? -

Image
this method on controller "sale" [httppost] [validateantiforgerytoken] public actionresult create(models.account account) { models.sale creaventa = new models.sale(); //creaventa.account = cliente; creaventa.createdon = datetime.now; creaventa.idaccount = account.id; creaventa.modifiedon = datetime.now; creaventa.status = 0; context.sales.add(creaventa); context.savechanges(); // return "venta creada"; return view(); } and partial view @model list<modal3.models.account> @{ viewbag.title = "create"; } <select class="form-control" id="control1"> @{ foreach (var cliente in model) { <option value="@cliente.id"> @cliente.name</option> } } </select> @*@using (html.beginform("create"...

android - Fix Can't create handler inside thread that has not called Looper.prepare() -

edit: did of stack overflow friends inside thread display video view inside of dialog in android freezes application me big in advance this activity thread : auto_bucket_tests_thread = new thread(new runnable() { @suppresswarnings("deprecation") @override public void run() { while(test_completed==false) { if(login.bucket_status==true && video_status==false) { new handler(looper.getmainlooper()).post(new runnable() { @override public void run() { bucket_open_error(); } }); } else if(login.bucket_status==false && video_status==true) { videodialog.cancel(); } ...

wordpress - After click on send button of Contact Form 7 plugin, it's whole page is refreshing and goes to top of the page but I want to reload contact form only -

in project(website on wordpress) had added contact form 7, when click on send button it's goes top of page , whole page redirecting want contact form 7 refresh , submit value's name,message,email. please help...thanks in advance. make sure called <?php wp_footer(); ?> in footer, that's how ajax files contact form 7 theme.

appcompat - Vertical alignment of an Android SwitchCompat? -

Image
in android, possible vertical align switchcompat , is, put text above switch instead of on left of switch ? are looking ..? try <linearlayout android:id="@+id/switchlayout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:padding="5dp" android:orientation="vertical"> <textview android:id="@+id/switchtxt" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textcolor="#000000" android:text="switch"/> <switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:rotation="90" android:layout_margin="10dp" android:layout_marginleft="3dp" android:id="@+id/switch1...

c# - Unable to display view page using ASP.NET MVC2 -

i getting following error while trying display data in view page using asp.net mvc2. error: server error in '/' application. compilation error description: error occurred during compilation of resource required service request. please review following specific error details , modify source code appropriately. compiler error message: cs0234: type or namespace name 'person' not exist in namespace 'test3.models' (are missing assembly reference?) source error: line 170: line 171: [system.runtime.compilerservices.compilerglobalscopeattribute()] line 172: public class views_home_index_aspx : system.web.mvc.viewpage<test3.models.person>, system.web.sessionstate.irequiressessionstate, system.web.ihttphandler { line 173: line 174: private static bool @__initialized; source file: c:\windows\microsoft.net\framework\v4.0.30319\temporary asp.net files\root\86f20dd8\a41e18c\app_web_index.aspx.a8d08dba.z89z2bzv.0.cs line: 1...

amazon web services - Restore object from AWS Glacier to S3 -

i have configured life cycle policy in s3, of objects in s3 stored in glacier class, of object still in s3, trying restore objects glacier, can object list in s3 java aws sdk, how can know object in glacier storage aws sdk? reason when try restore object not in glacier, have exception. wanna avoid this. the listobjects amazon s3 api call can used obtain list of objects in given bucket. the list of files returned includes storageclass field. can 1 of: standard reduced_redundancy glacier the glacier storage class indicates contents of object in glacier.

android layout - DocumentView shows me error while using custom font -

Image
friends using documentview justifying , using custom font in it. works fine justifying font when place path of custom font in it.it shows error me. here project. http://www.mediafire.com/download/ggobgpzzxjc412m/customfonttest.zip here error stack. process: com.example.xperts98.customfonttest, pid: 11279 java.lang.runtimeexception: unable start activity componentinfo{com.example.xperts98.customfonttest/com.example.xperts98.customfonttest.mainactivity}: android.view.inflateexception: binary xml file line #11: error inflating class com.bluejamesbond.text.documentview @ android.app.activitythread.performlaunchactivity(activitythread.java:2314) @ `enter code here`android.app.activitythread.handlelaunchactivity(activitythread.java:2388) @ android.app.activitythread.access$800(activitythread.java:148) @ android.app.activitythread$h.handlemessage(activitythread.java:1292) @ android.os.handler.dispatchmessage(handler.java:102) @ andro...

ruby - Rails: 500 error page showing up instead of back trace or debug page in development -

the problem: every time start rails server in development , navigate page has error, 500 error page instead of trace page details specific error , line can found. for example: navigate http://localhost:3000/articles/new , , this: 500 internal server error web server cannot perform request. please try again later. things have done avoid this: (1) commented out in environments/production.rb #consider_all_requests_local = false #config.action_controller.perform_caching = true (2) ensured in environments/development.rb config.consider_all_requests_local = true log files: started post "/articles" 127.0.0.1 @ 2015-06-19 21:40:19 -0700 processing articlescontroller#create html parameters: {"utf8"=>"✓", "authenticity_token"=>"iiavgs285snzmcs32nne4wqnfcizjifeb8kn/6j7wac=", "article"=>{"title"=>"dog", "text"=>"home"}, "commit"=>...

php - Retrieving Database Data during LogIn -

i'm using slim , ajax develop mobile application. in database have column stores session codes logins. need able once logged in, compare username entered database , retrieve sessioncode based on that. my current php this: $app->post('/login/', 'login'); function login() { $request = \slim\slim::getinstance()->request(); $q = json_decode($request->getbody()); //$hashedpassword = password_hash($q->password, password_bcrypt); $sql = "select * users username=:username , password=:password"; try { $db = getconnection(); $stmt = $db->prepare($sql); $stmt->bindparam("username", $q->username); $stmt->bindparam("password", $q->password); $stmt->execute(); //$row=$stmt->fetch(pdo::fetch_assoc); $row=$stmt->fetch(pdo::fetch_obj); //$verify = password_verify($q->password, $row['password...

java - JAVA_HOME not defined correctly -

i attempting update jasper reports server, , having issue java. uses tomcat run java. did not install java on server, , not familiar java. java installed in folder called /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/ . not believe java installed correctly, , telling me java_home not defined correctly. we cannot execute /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/java java located in directory. i ran following in bash shell: export java_home=”/opt/jasperreports-server-cp-5.0.0/apache-tomcat/java” export path=$java_home/bin:$path can please me on doing wrong when setting java_home , or have java folder? should reinstall java altogether? you file /opt/jasperreports-server-cp-5.0.0/apache-tomcat/java/bin/java exists, right ? can execute ? can execute standard jar file ?

Python cant see files or folders in C:\Windows\System32\GroupPolicy -

i'm running problem python unable see folders or files exist on computer. have ensured path has no symbolic links in , have full control on ntfs file permissions. have removed hidden attributes. below script using , output: import os path = 'c:\\windows\\system32\\grouppolicy\\machine' print path test = os.path.exists(path) print test c:\windows\system32\grouppolicy\machine false i unsure why returning false when have ensured folder exist. if remove "\machine" path, returns true. have verified following command works command prompt: if exist c:\windows\system32\grouppolicy\machine echo found any advice on how working in python appreciated. here version of python using: python 2.7.6 (default, nov 10 2013, 19:24:18) [msc v.1500 32 bit (intel)] on win32 alright, after digging, found nothing permissions has file system redirection. using x86 version of python on windows x64 (using x86 using py2exe), windows redirecting queries on system32 ...

javascript - What is an alternative to using 'eval' to accessing a variable by name to "sync" it with another? -

i want keep 2 javascript variables in sync when run function. variable pointed in object. code have far this: var myname = "bob"; var thevar = ""; var varobj = {tvar: "myname"}; var syncvar = function() { thevar = eval(varobj.tvar); }; syncvar(); alert(thevar); // bob myname = "eve"; syncvar(); alert(thevar); // eve how can similar without using dreaded eval? keep in mind want function universal i.e. want work anyone's objects. thanks in advance. clarification edit: client side. want variable "pointer" variable (maybe not in strict definition sense). have made function can sync variables, uses eval, makes me skeptical. "universal" part can make tvar point sync it. example, if include above code, can then: myage = 20; varobj = {tvar: "myage"}; syncvar(); alert(thevar); // 20 myage = 100; syncvar(); alert(thevar); // 100 thus making "universal" varobj.tvar can "point" keep ...

r - How to apply a function to the entire table in a dplyr chain -

i have dplyr chain follows myresults <- rawdata %>% filter(stuff) %>% mutate(stuff) now want apply function myfunc myresults . there way in chain or need do: myresults <- myfunc(myresult) if function takes dataframe first argument, can simple add @ end. > myfunc <- function(x) sapply(x, max) > mtcars %>% filter(mpg > 20) %>% myfunc() mpg cyl disp hp drat wt qsec vs gear 33.900 6.000 258.000 113.000 4.930 3.215 22.900 1.000 1.000 5.000 carb 4.000 it worth mention magrittr::%>% used dplyr works argument can this: > inc <- function(x) x + 1 > 1 %>% inc(.) %>% sqrt(.) %>% log(.) [1] 0.3465736 and useful magrittr aliases: library(magrittr) set.seed(1) intrain <- sample(1:nrow(mtcars), 20) mtcarstest <- mtcars %>% extract(-intrain, ) summarypipe <- function(x) {print(summary(x)); x} mtcars %>% extract(intrain, ) %>% ...

javascript - Debugging After Effect Scripts -

i have after effects script wont work in unless running cs6 version. need usable in older versions of after effects, have no experience scripting after effects. i'm web dev, have no idea begin debugging process type of jsx script. kindly point me in direction start debugging process? in order check scripts older versions of ae, need have: whatever older version(s) of ae installed, extendscript toolkit (estk) installed, , make sure "sees" version(s) of ae running (by checking "target application" popup in upper left; it may you'll have install older versions of estk work older versions of ae -- thankfully small app) frankly, use estk; debug other means, if you're used various debugging tools available in other programs, should able utilize estk offers (breakpoints, results of script execution, etc.).

Resetting the scene in processing by pressing any button -

does know how reset scene when key pressed after animation done. want use method: void keypressed() { //what code? } but not know code put inside make scene reset. can help? you have store "scene" in variables. reset scene, reset variables. here's simple example shows moving ball resets when press key: int ballx = 0; void setup() { size(500, 100); } void keypressed() { ballx = 0; } void draw() { background(0); ballx++; ellipse(ballx, height/2, 10, 10); } your real "scene" has more 1 variable, idea same. store "scene" in variables, , reset variables when want reset scene.

html - jquery animate() called on 2 elements only works on one? -

just wondering if had insight why might happening. have map on website scrolls when move mouse borders of container in. highlights specific city when hover on it, accomplished creating map overlay same dimensions original map. therefore apply same left , top css 2 images move in unison. example here: http://www.bestattorney.com/locations/ my problem when hover on links below map, area you're hovering on supposed come center of screen. works add little bit of animation move isn't jarring. when change animate({}) 0 1000, result overlay image moves, so: http://www.bestattorney.com/locations/locations2.html i wondering if there reason think of off top of heads why happens? great if both images moved in first example. what suspect there's setinterval(100) runs animate function, mean there 10 animates() running time first animation finishes. i'm not quite sure if there's done provide insight! all! (scrolling plugin mjfisheruk: https://github.com/mjfisheruk/jq...

javascript - Encoding and decoding within bookmarklet -

i want create bookmarklet lengtens shorte.st links using website. example link: http://sh.st/**abcde** has turned http://longurl.org/expand?url=http%3a%2f%2fsh.st%2**abcde** i created following code: javascript:(function(){var str = window.location.tostring();var str1 = str.substring(13,18);var str2 = "http://longurl.org/expand?url=http%3a%2f%2fsh.st%";var str3 =str2.concat(str1);alert(str3);window.location=str3;})(); code bad, know, i've never written in javascript before. works. except 1 thing: % in bookmarklet decoded / . , dont want happen. guess somewere along way supposed encode string, i'm not sure. appreciated.

uac - How do I remove/stop Visual Studio 2013 from running as Administrator? -

when click on visual studio 2013 icon, uac asks me if want run administrator and, when click ok, works. need restore default behavior . how do it? you need go properties program. under advanced, there's checkbox says "run administrator".

Can I get results from Search.List for a specific region via the YouTube API V3 -

when search on youtube in india, see different search results search same term in united states. we need know how see india sees when search using youtube api. have tried setting regioncode "in" seems make absolutely no difference. we have tried setting userip property ip address in india before calling search.list our servers in united states need see gets returned in india. thank help!

javascript - Find the HTTP status code of an image at `onload` event -

this question has answer here: how http status code of <img> tags 3 answers suppose following code: var img = new image(1, 1); img.onload = function() { console.log(arguments); }; img.src = 'some.place.com/some/image.jpg'; when image load, print arguments , contains event object, information request event, can't find anywhere status code. the firing of onload event doesn't distinguish between direct successful request or successful else redirect. i need distinguish in code if request direct or redirect, can't find out how without http status code. there somewhere information available? it's not possible http status of request made image element in javascript, you'd need use ajax loader in order access information this. alternately, can use img.complete : htmlimageelement.complete returns boolean true...

AngularJS + Jasmine + JWT Token in $http requests -

i'm trying build test api works jwt authentication tokens, factories i'm trying test use $resouce , needs configured jwt token . in app configure in .config , in jasmine have no idea how should be, because jasmine runs before app. i'm trying find way configure jasmine's requests or maybe run tests after app configured. here i'm trying configure jasmine 's requests. describe("sync.remote", function () { var remote = angular.injector(['sync.remote']).get('remote')('test', 'test') , testingobject = { name: "mario", lastname: "lópez" } beforeeach(inject(function (_$httpprovider_, _jwtinterceptorprovider_, _$resourceprovider_) { $httpprovider = _$httpprovider_ jwtinterceptorprovider = _jwtinterceptorprovider_ $resourceprovider = _$resourceprovider_ jwtinterceptorprovider.authprefix = "jwt " jwtinterceptorprovider.tokengetter = f...

excel vba - Using VBA: Assign value to label control on userform -

i working in vba code behind userform. have string variable named block corresponds name of text label on userform. after looking @ other questions seems using controls function gives ability control settings of label on userform. block variable string of labels name.i error @ attempts below me.controls(block).backcolor = &hffff& when try hard code make sure exact name of label still error me.controls("s111").backcolor = &hffff& the following line work: me.s111.backcolor = &hffff& when try similar technique error with: me.block.backcolor = &hffff& what doing wrong , doing possible? the control me.s111 object. dim objobject object '(not type string) set objobject = me.s111 objobject.backcolor = &hffff&

c# - SignalR not call a seconf Hub Class -

i have 2 hub class in project public class foldermanager : hub { public foldermanager() { } public void validator() { } } public class seocontentvalidator : hub { public seocontentvalidator() { } public void validator() { } } i have start class public class startup { public void configuration(iappbuilder app) { app.mapsignalr(); } } in view have script <script src="~/scripts/jquery.signalr-2.2.0.js" type="text/javascript"></script> <script src="~/signalr/hubs" type="text/javascript"></script> <script> jquery(document).ready(function(){ var foldermanager = $.connection.foldermanager; var seocontentvalidator = $.connection.seocontentvalidator; $.connection.hub.logging = true; $.connection.hub.start().done(function () { foldermanager.server.validator(); seocontentvalidator.server.validator(); }); }); ...

Getting Geometry of Intersection of Road SQL and Inserting Into Table -

i need find intersection of various roads each road divided multiple segments there many records 1 road. have query can use find geometries each shows null. need have 1 geometry can insert 1 record. select sdo_geom.sdo_intersection(coll_a.geometry, coll_b.geometry, 0.05) ottawacollectors coll_a, ottawacollectors coll_b coll_a.road_name = 'kent' , coll_b.road_name = 'metcalfe'; the efficient approach sort of problem use sdo_join() filter. designed efficiently match spatially many objects many others using spatial indexes. i assuming table looks this: create table ottawacollectors ( road_id number, segment_id number, road_name varchar2(30), geometry sdo_geometry, primary key (road_id, segment_id) ); it contains road segments. each road segment identified road identifier , segment identifier. the following creates new table intersections contain 1 row each intersection, i.e. whenever 2 road segments interact. intersection computed geometr...

wordpress - How to make conditional field on cmb2 plugin? -

i want make condition members info page. $biometabox[] = array( 'id' => 'first-section', 'title' => 'member data', 'object_types' => array('dausfmembers'), 'fields' => array( array( 'name' => 'gender', 'type' => 'radio', 'id' => $dausf.'gender', 'options' => array( 'male' => 'male', 'female' => 'female' ) ), array( 'name' => 'gender', 'type' => 'radio', 'id' => $dausf.'mstatus', 'options' => array( 'married' => 'married', 'single' => 'single' ) ), i wan...

linux - How to read parts of a command output (after a certain character) into a bash variable? -

so have command returns output in following form ># command var1=abc var2=def var3=123 and want read var1 , var3 command shell script. logically, run following 2 commands ># command | grep var1 var1=abc ># command | grep var3 var3=123 how capture part comes after first equal sign? (so "${var1}" = "abc" , "${var3}" = "123"). of note, there equal sign in vale of either variable, need keep after first equal sign, including subsequent ones you can use awk: command | awk -f = '/var1|var3/{print substr($0, index($0, "=")+1)}' abc 123 breakup: /var1|var3/ # searches var1 or var3 index($0, "=") # search = in record substr # gets substring after first =

ruby on rails - Why do I now get the error ActionView::MissingTemplate: Missing template user_mailer -- when the template exists already? -

on application have been sending out email messages, until today. when run rake task or run method mannually console, following error: usermailer#admin_test: processed outbound mail in 23.6ms actionview::missingtemplate: missing template user_mailer/admin_test "mailer". searched in: * "user_mailer" this lead me check if there template, there in user_mailer/admin_test.html.erb , user_mailer/admin_test.text.erb . my method in user_mailer.rb is: def admin_test(user) @user = user mail(to: @user.email, subject: "text") end running usermailer.admin_test(@user).deliver_now! (or deliver! ) renders error. came upon running rake task scheduler , error replicated straight console. edit here's rest of error message: from /users/xxxx/.rvm/gems/ruby-2.2.1/gems/actionmailer-4.2.1/lib/action_mailer/base.rb:915:in `each_template' edit 2 okay - pushed current form heroku , working in production not in development.

Why is Breeze resetting OriginalValues hash map when detaching an entity? -

i using sandboxed entitymanager , partial entity patterns in project. in sandboxed entitymanager, have full entity changes (modified) apply master entitymanager. approach taking follows: detach "unmodified" partial entity wish update master entitymanager. detach "modified" full sandboxed entity sandboxed entitymanager. attach detached sandbox entity master entitymanager. the issue i'm experiencing detachentity() call resets originalvalues hash map on sandboxed entity. expecting when reattach modified entity master entitymanager a) partial entity replaced full entity , b) entitystate still "modified" , originalvalues hash map still contain list of changed properties. however, isn't case. state of entity in master entitymanager "modified" originalvalues has map empty. as result, when call savechanges() on entitymanager, full object sent server instead of changeset. my question why calling detachentity() (or indire...

jquery - Display validation error messages below the multi-select instead of above it -

when validate multi-select field using jquery validation plugin, error messages getting displayed above multi-select. how can display under multi-select? $('.multiselect').multiselect({ onchange: function(element, checked) { $('.multiselect').valid(); }, buttonwidth: '100%', numberdisplayed: 6, buttoncontainer: '<div class="btn-group ng-multiple-bs-select" />', buttontext: function(options) { if (options.length === 0) { return 'choose'; } else { var selected = ''; options.each(function() { selected += $(this).text() + ', '; }); return selected.substr(0, selected.length - 2); } }, }); $('#frm').validate({ rules: { kimliktipi: "required", kimlikserino: "required", cinsiyet: "required" }, ignore: ':hidden:not(".multiselect")', highlight: function(element) { $(...

rdf - What is the use of @vocab in JSON-LD and what is the difference to @context? -

what @vocab attribute in json-ld for? see can "import" remote vocabulary, isn't same can @context ? if i'm not wrong can "import" remote source @context well. difference between @vocab , @context ? extra question: can have more 1 @vocab ? example first referrers schema.org , other rdfs? @vocab used declare default vocabulary terms derive, without having declare specific mappings each term (as in @context ). for example, see snippet (taken json-ld 1.0 spec ): { "@context": { "@vocab": "http://schema.org/" } "@id": "http://example.org/places#breweats", "@type": "restaurant", "name": "brew eats" ... } in fragment, @vocab used define in context, terms derive schema.org vocabulary. in following fragments, restaurant maps http://schema.org/restaurant , , name maps http://schema.org/name . of course have done explicit mappings in ...

cypher - neo4j shortest with connector node and multiple options -

i have cities, roads , transporters in database. road connected , relationship 2 (different) cities. each road has property distance (in kilometers). multiple transporters have relationship roads. every transporter has price (per kilometer). now question. want cheapest option packet city b. there direct road or else have go via other cities , transporters. , want explicitly use dijkstra algorithm this. can query done in cypher? , if not, how can done using neo4j java api? based on sample dataset , think there modelisation problem makes maybe things difficult, matching on directed relationships. however how can find lowest cost path : match (a:city { name:'citya' }),(d:city { name:'cityd' }) match p=(a)-[*]-(d) p, filter(x in nodes(p) 'road' in labels(x)) roads p, reduce(dist = 0, x in roads | dist + x.distance) totaldistance return p, totaldistance order totaldistance limit 5

Need help hangman c# -

when try run, says: system.collections.generic.list' not contain definition 'length' , no extension method 'length' accepting first argument of type 'system.collections.generic.list' found (are u missing using directive or assembly reference?) this points code written in case '3'. i've used google , tried reading in book, cant seem find solution. static void main (string[] args) { char meny;// för att kunna göra menyval. string s;// ordet som spelaren kommer skriva in. list<string> dinaord = new list<string> { "varg", "apor", "besvärad", "människor", "komplettering" };// array för spelarens ord, samt mina egna. bool visameny = true; // visameny blir tilldelat true. console.writeline("\n\t\thejsan, och välkommen till hänga gumma!"); do// Återvänder till menyn så länge den är true. ...

c# - how do i log full http request using log4net -

i want able log full http request values every error message log. current conversion pattern have looks - <conversionpattern value="%date{g} [%thread] %-5level [%aspnet-request{auth_user}] [%aspnet-request{remote_addr}] %newline%message%newline all_raw::%aspnet-request{all_raw} %newline%newline%newline" /> which gives me output follows 06/19/2015 11:56:02 [60] info [user@email.com] [mo-machine] message :: boommmm all_raw :: cache-control: no-cache connection: keep-alive content-length: 0 content-type: text/plain;charset=utf-8 accept: */* accept-encoding: gzip, deflate accept-language: en-us,en;q=0.8 host: localhost:43899 user-agent: mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.124 safari/537.36 csp: active origin: chrome-extension://fhbjghcddcbncdddomop postman-token: 38f023c1-3298-5726-e43f-650bab852cf2 url :: post localhost:43899 /controller/test internalid=10124&mid=...

jquery - How to search and filter which table columns are displayed -

i have data table has 100+ columns: california - los angeles california - sf illinois - chicago texas - austin texas - houston ..... etc how can create search input field allows me filter columns being shown? i'm thinking similar this . except instead of searching & filtering table rows, want filter & search table columns. if full search text found in of columns, display columns. for example, if search text "cal", "california - los angeles" , "california - sf" columns visible. if search text "t", column letter 't' in displayed. you can make use of columns().visible() api method set column visibility. see example below code, comments , demonstration. $(document).ready(function() { var headers = {}; $('#example') .on('init.dt', function () { // enumerate headings once $('#example').datatable().columns().every( function (){ ...