Posts

Showing posts from May, 2012

php - Recursive function until done value is true and merge each response into a big one -

i have function: public function syncterritoriessoqlquery($veevatoken, $instanceurl, $tokenurl) { $soqlquery2 = "select id,name,lastmodifieddate territory"; $soqlurl2 = $instanceurl.'/services/data/v28.0/query/?q='.urlencode($soqlquery2); $curl = curl_init($soqlurl2); curl_setopt($curl, curlopt_header, false); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_httpheader, array("authorization: oauth $veevatoken")); $jsonresponse = curl_exec($curl); $status = curl_getinfo($curl, curlinfo_http_code); if ($status !== 200) { $respobj['error'] = "error: call token url $tokenurl failed status $status, response $jsonresponse, curl_error ".curl_error( $curl ).", curl_errno ".curl_errno($curl); return $respobj; } curl_close($curl); $soqlobj2 = json_decode($jsonresponse, true); return $soqlobj2; } when ca

Efficient way to iterate through JSON response in JavaScript -

i have been reviewing khan academy api ( https://github.com/khan/khan-api/wiki/khan-academy-api ) , identifies http://www.khanacademy.org/api/v1/topictree main api call. using following code list of categories represents same menu structure on actual website. $(document).ready(function() { $.ajax({ url: "http://www.khanacademy.org/api/v1/topictree", type: 'get', datatype: "json", success: function(data) { for(var = 0; < data.children.length; i++) { //$("#mylist").append("<a href='http://myurl.com/courses.html?catid="+data.children[i].id+"'>"+data.children[i].title+"</a><br/>"); } } }); }); i not able find efficient way @ children of categroy , print out value of url , name. everytime try call api browser hangs since json response 40mb of data. github site @ https

jquery - not able to set selected value for Html.Dropdown list -

i trying set selected value (value returned json result) html.dropdownlist. dropdown list has value. instance :json returned value:abc ,this value there in ddl jquery $("#action").each(function (state) { if (this.value == state.value) { var thetext=state.value; $('#action').val(thetext); //i think not suppose }); the if condition satisfies when try set value nothing happens ddl @html.dropdownlist("action", viewbag.actdict_action selectlist) what trying ddl (id:action)displays value json has retuned along other values . any appreciated . .. in ddl in view bag, list right? assuming array of things this: new selectlistitem{text="deactive", value="false"} for 1 want selected, initialize before passing through viewbag new selectlistitem{text="deactive", value="false", selected="true"}

orchardcms - Is it possible to add content to Orchard 1.8 directly in the frontend to logged users? -

i have created custom user role allow logged users submit content specific section in site. problem don't want users enter dashboard (even when role restricts other function in admin menu because site used people old 50 years , confused because cannot see frontend menu when in backend). possible add access upload "new content item" frontend? you use dynamic forms or create own module abstracts functionality need. the new dynamic forms in conjunction workflows useful here. create own module rather on admin ui or mixture or both.

json - Calculate driving distance between user location and many destinations via javascript loop -

i have json feed many locations: http://hcafeeds.medcity.net/rss/er/ntx_rss_feed.xml i plan on obtaining user's location via html5 geolocation. @ point, i'd loop through json feed , output items feed along distance user's location. i've tried every way can google maps api seem hit hurdle hour method. has done similar? update: here's existing code will output hospitals fine... can't figure out how distance: var hcafeed = 'http://hcafeeds.medcity.net/rss/er/ntx_rss_feed.xml'; var yql = 'http://query.yahooapis.com/v1/public/yql?q=' + encodeuricomponent('select * rss url="' + hcafeed + '"') + '&format=json&diagnostics=true&callback=?'; $.getjson(yql,function(data){ if(data.query.count > 0) { // run through hospitals , set html var hospitals = []; $.each( data.query.results.item, function( key, val ) { var hospitaladdress = val.address;

django - Apache is not interpreting python files -

so, followed tutorial on ubuntu 14.04 http://jee-appy.blogspot.in/2015/04/deploy-django-project-on-apache-using.html thing changed instead of example repository,i have used mine. , getting error not found requested url / not found on server. then, edited myproject.conf file change made - wsgiscriptalias /myproject /var/www/myproject.wsgi so, i'm having output index of/ directory , file name. it's not interpreting python files. had same issue , modified wsgi file this: import os import sys path = '/var/www/html/yourapp/' if path not in sys.path: sys.path.append(path) path = '/var/www/html/yourapp/yourapp/' if path not in sys.path: sys.path.append(path) os.environ['django_settings_module'] = 'yourapp.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler() hope helps

python - Django admin - remove "add another" button for a self-referential field -

i have django project includes model class optional self-referential foreignkey field. partial snippet: class site(models.model): name = models.charfield(max_length=100) parent_site = models.foreignkey('self', null=true, blank=true) i'm using django admin site create new objects. class' admin form i'd disable " add another... " button next parent_site field (i.e. when you're creating new site, can't open popup create new site parent). i can't remove has_add_permission user, need in current add view. don't mind removing function both add , change views, limiting removal add view helpful. i haven't been able work out how use inline field classes achieve this, or formfield_for_foreignkey , or custom modelform . got solution more elegant using javascript on customised form template? no css hacks add admin class: max_num=0 or try in admin.py ( older django versions): class model_admin(admin.modeladmin):

python - Django localmem size -

what default size of local memory cache django. https://docs.djangoproject.com/en/1.8/ref/settings/ not mention any. https://docs.djangoproject.com/en/1.8/topics/cache/#cache-arguments says 300, following code returns different value: for in range(0, 10000): cache.set(i, i) first = cache.get(0) if first none: print break i have seen values ranging 150ish 1500ish. thanks! the default cache size 300, according code . your snippet won't tell useful size of cache. when locmem cache full, subsequent set cause evict items based solely on modulus of key's position in dict, unpredictable. there no attempt evict based on lru, fifo or other algorithm. this yet reason not use backend n production.

foreach - How can I parallelize a double for loop in R? -

i've been trying parallelize code because i'm using double loop record results. i've been trying see how use snow , doparallel packages in r this. if replicable example, use residual_anomalies <- matrix(sample(c('anomaly','no signal'),300,replace=t),nrow=100) instead of using these 3 lines inputfile <- paste0("simulation_",i,"_",metrics[k],"_us.csv") data <- residuals(inputfile) residual_anomalies <- conceptdrift(data,length=10,threshold=.05) in nested loop. whole code below. source("getmetrics.r") source("slowdrift_resampling_vectorized.r") metrics <- unique(metrics) num_metrics <- length(metrics) f1_scores_table_raw = data.frame(matrix(ncol=10,nrow=46)) f1_scores_table_pred = data.frame(matrix(ncol=10,nrow=46)) rownames(f1_scores_table_raw) <- metrics colnames(f1_scores_table_raw) <- paste0("sim",1:10) rownames(f1_scores_table_pred) <- metrics colnam

c# - Serialize List Without an Extra Element -

Image
this question has answer here: xml serialization list of objects 2 answers i can generate following xml document i'm having trouble version attribute on 'iskeyvaluelist'element. using xmlserializer. should note xml being passed api requires exact structure follows. <userdata> <iskeyvaluelist version="1.00"> <item type="string" key="ageofdependents">8,6,1<item/> <item type="boolean" key="securitiesinposession"> true </item> <item type="boolean" key="securitiesowners"> true </item> </iskeyvaluelist> </userdata> i have read several stack overflow bounties have learned add version attribute list had move list class. following generates structure above adds element want avoid. c# userdata newuserdata = n

php - Error "You must enable the openssl extension to download files via https" -

on running composer global require "laravel/installer=~1.1" , error : [runtimeexception] must enable openssl extension download files via https i have error when trying install package. have seen many post on stack overflow. however, did do, , nothing works. check php cli path. php -i said c:\xampp\php\ uncomment extension=php_openssl.dll line in c:\xampp\php\php.ini . check if openssl extension in c:\xampp\php\ext all don't make work composer installation. thanks

javascript - Measure page download time and render time with page subelements -

i required measure page load times every visitor. think best way injecting javascript in page purpose. things little bit complex because need every subrequest in page time measured seperately. reponse times requests going 3rd party systems cdn or google need reported also. page has many ajax calls executed during page load. these should included , after page done event other periodic ajax calls should not included. , @ , these measurements should sent server storing (?xmlhttprequest) . has done such thing before ? recommendations or sample scripts ? thanks edit: while start, doesn't solve fact content asynchronously loaded. don't know how measure loading time images example. can used in ajax calls however. here's way it. http://jsfiddle.net/45lpwhyv/ function loadingtimer() { this.timestamp = null; this.parts = []; } loadingtimer.prototype.start = function (data) { this.stop(); var = this.parts.length; this.parts[i] = {}; this.p

scalatest - How do I unit test closures with deeply nested anonymous functions in Scala? -

i'm trying unit test method looks this: def foo() = { val = listener.registercallback( (bar: bar, baz: baz) => { val x = bar.declare().get bar.bind(x) }) return } i can test result of method. problem when run coverage report (with sbt-coverage plugin , scalatest) i'm bit short of meeting coverage threshold due methods holding unreachable anonymous functions local values such. is there way can test nested anonymous function improve coverage score? perhaps pull out out method test, let eta expansion turn method function? like: def bippy(bar: bar, baz: baz) = { val x = bar.declare().get bar.bind(x) } def foo() = { val = listener.registercallback(bippy) return } i.e., write unit test against bippy , score points sbt-coverage.

java - The right encoding for `URLEncoder.encode` -

i trying standardize messages in urls , using urlencoder.encode . problem that, output not seem valid url. example val text = some("test question (a) x (b) y").get val query = "http://localhost:8080/ask?text=" + text println(query) val queryenc = urlencoder.encode(query, "utf-8") println(queryenc) wich outputs: http://localhost:8080/ask?text=test question (a) x (b) y http%3a%2f%2flocalhost%3a8080%2fask%3ftext%3dtest+question+%28a%29+x+%28b%29+y is output valid url? (it doesn't valid, chrome , safari on machine don't recognize it). you must encode each parameter value. not whole url. val query = "http://localhost:8080/ask?text=" + urlencoder.encode(text, "utf-8")

javascript - ng-submit is not working when enter key is pressed from focused input -

for reason, when push enter after un-hiding input, submit_form() function not run. have ideas on why wouldn't work? <form name="theform" ng-submit="submit_form()" novalidate> <div ng-hide="show_form"> <div ng-click="show_input()">click me</div> </div> <div ng-show="show_form"> <input type="text" class="md_input" ng-model="inputstuff" placeholder="name" required /> </div> </form> inside controller: $scope.show_form = false; $scope.show_input = function() { $scope.show_form = true; } $scope.submit_form = function() { console.log("trigger"); }

javascript - REGEX: Add a pattern to not match my pattern in certain scenarios -

Image
i have wonderful pattern seems work me match links/urls /(\b(https?|ftp|file):\/\/[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|])/gi i'm using pattern find links , insert bbcode around links, if example text http://www.google.com , output [url]http://www.google.com[/url] the hard part if input text has bbcode in it, example [url]http://www.google.com[/url] output gets 2x bbcode placed around it. [url][url]http://www.google.com[/url][/url] im hoping somehow not match links have [url] encasing link. summary current pattern: /(\b(https?|ftp|file):\/\/[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|])/gi current output: http://www.google.com ==> [url]http://www.google.com[/url] [url]http://www.google.com[/url] ==> [url][url]http://www.google.com[/url][/url] [url="http://www.google.com"]http://www.google.com[/url] ==> [url][url="http://www.google.com"]http://www.google.com[/url][/url] desired output: http://www.g

javascript - custom x axis tooltip for nvd3 scatter chart -

i using nvd3 scatter chart , see tooltip content can customized using following function. chart.tooltipcontent(function (key, x, y, e, graph) { return '<p><strong>' + key + '</strong></p>' + '<p>' + e.value + ' in month ' + x + '</p>'; }); when mouse moves on bubble, custom tooltip content , x-value , y-value of point/bubble highlighted/shown. instead of displaying x-axis label, want display custom content. how can this? thanks, chart.tooltipcontent deprecated in nvd3 now. use custom content in tooltip, want use chart.tooltip.contentgenerator(function(obj) {code build tooltip}) in order see data have work in function, start adding line: chart.tooltip.contentgenerator(function (obj) { return json.stringify(obj)}) and you'll able hover on data point , see object working with. look in src/tooltip.js @ default function used contentgenerator starting around line 7

twitter bootstrap - Grunt with Bower Slow Process when including packages -

i have grunt workflow have problems compiling time of sass. use grunt-contrib-sass compile stylesheet problem loading assets bower imports (packages such bootstrap-sass have included.) i noticed when including such package take way longer compile file, 7-10seconds , if remove @import bootstrap scss file take second compile file if reload grunt compile. @import '../bower_components/bootstrap-sass/assets/stylesheets/bootstrap'; @import (my custom modules) there must smarter way of making work? suggestions? thank you you should try libsass , c/c++ port of library. http://sass-lang.com/libsass sass written in ruby. libsass c/c++ port of sass engine. point simple, faster, , easy integrate.

c# - "myList.Count" is less then the amount of elements inside the list -

i have task write program takes numbers , step input. must make sequence of binary representation of numbers , destroy bits @ positions 1 , 1*step , 2*step , 3*step ... here code: using system; using system.collections.generic; class bitkiller { static void main() { int amountnumbers = int.parse(console.readline()), step = int.parse(console.readline()), counter = 0, number = 0 ; int[] numbin= new int[8], numbers = new int[amountnumbers] ; var sequence = new list<int>(); for(int = 0; < amountnumbers; i++) { numbers[i] = int.parse(console.readline()); numbin = tobin(numbers[i]); sequence.insertrange(counter * 8, numbin); foreach(int b in sequence) { console.write(b); } console.writeline(""); counter++; }

min max flow graph cuts for image segmentation MATLAB wrapper -

my objective segment perform cell segmentation. cells of different sizes, , image grayscale using graph cuts used matlab wrapper shai bagon, , able run basic test code given here i not able label image desired. need interpret results method. also quick question, examples have looked far. graph cut seems used images single connected foreground , rest background. can not find examples foreground disjoint (as in case, cells on image) , background. makes me assume graph cuts not work on disjoint foreground ? if can let me know correct. your appreciated. thank regarding results on cell segmentation: provide little input work with. unclear trying , wrong get. you'll have post example input image , short code. as second question, in general graphcut image segmentation not restricted single connected output segment. number of segments depend on data , smoothness terms provided. rule of thumb, weaker smoothness term more connected-components you'll see @ output.

javascript - Price calculator (quote) based on word count -

i working on ad form local newspaper. not familiar programming side of things, still learning. able form count words, need quote price based on different packages/ word counts. here example of form , price structure example is. appreciated point me in right direction! please nice, practice/learning me!! one paper $6.50 15 words, 10 cents per word thereafter. 2 papers $12.50 15 words 15 cents per word thereafter. 3 papers $18.00 15 words 15 cents per word thereafter. 4 papers $22.50 15 words 15 cents per word thereafter. <!doctype html> <html> <head> <meta charset="utf-8"> <title>place ad</title> <link href="adform.css" rel="stylesheet" type="text/css"> <script type="text/javascript" src="js/jquery-1.10.2.js"></script> <script type="text/javascript"> counter = function() { var value = $('#text').val();

tsql - Collapse data ranges and overlapping data in SQL Server 2014 -

i have table ranges in below: id actioncode group1 type low high 33 840 mm 000295800 000295899 34 840 mm 000295900 000295999 i need collapse 2 rows consecutive data 1 row instance above actioncode group1 type low high 840 mm 000295800 000295999 for actioncode, group1, type... there can overlapping data ranges, preceeding zeros, etc. sample table: if object_id('tempdb..#testtable') not null drop table #testtable create table #testtable( [id] [int] identity(1,1) not null, [actioncode] [char](1) not null, [group1] [varchar](50) not null, [type] [varchar](2) null, [low] [varchar](50) not null, [high] [varchar](50) not null, constraint [pk_#testtable] primary key clustered ([id] asc) ) go insert #testtable (actioncode, group1, type, low, high) values ('a','840','jj','401299870','401299879') inse

Android: How to create a layout that slides up/down with button press? -

i'm working on android app (api 14 - 21), layout so: ----------------------- | layout 1 | ----------------------- | x | layout 2 | ----------------------- | | | | | layout 3 | | | | | ----------------------- when "x" clicked, need layout 3 slide off screen bottom, soft keyboard pop up, "x" , layout 2 slide down (but maintain size) above soft keyboard, , layout 1 expand downward fill space. looks this ----------------------- | | | layout 1 | | | ----------------------- | x | layout 2 | ----------------------- | | | soft keyboard | | | ----------------------- i tried have relativelayout main layout others. had layout 1 aligned top/left of parent, "x" + layout 2 container aligned left , layout_above layout 3, , layout 3 aligned bott

javascript - How to add a Facebook page-plugin on to Weebly? -

i have tried code copying both portions 'embed code' widget , came name 'perfectly posh'. <div id="fb-root"></div> <script>(function(d, s, id) { var js, fjs = d.getelementsbytagname(s)[0]; if (d.getelementbyid(id)) return; js = d.createelement(s); js.id = id; js.src = "//connect.facebook.net/en_us/sdk.js#xfbml=1&version=v2.3"; fjs.parentnode.insertbefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script> <div class="fb-page" data-href="https://www.facebook.com/pages/perfectly-posh/765054396873623" data-width="300" data-height="500" data-small-header="true" data-adapt-container-width="false" data-hide-cover="false" data-show-facepile="false" data-show-posts="true"><div class="fb-xfbml-parse-ignore"><blockquote cite="https://www.facebook.com/pages/perfectly-posh/76505439687

php - user auth vs app auth (Twitter API) -

i'm new using api (twitter api) , have little problem 2 terms, user auth , app auth , i'm using api version: https://github.com/j7mbo/twitter-api-php , , noticed have limited use each day, found thread http://stackoverflow.com/questions/27462106/difference-between-user-and-app-only-auth wasn't clear, there short example see difference between both? thank you.

angularjs - scroll to next item in ng-repeat -

with example below using angular.element , how scroll next item in ng-repeat on every click? this have far, don't know next: var app = angular.module('myapp', []); app.controller('maincontroller', ['$scope', function ($scope) { $scope.items = [{ name: "apple" }, { name: "pear" }, { name: "avacado" }, { name: "banana" }]; $scope.go = function ($event) { console.log(angular.element($event.currenttarget).parent().next()); }; }]); html: <div ng-app="myapp"> <div ng-controller="maincontroller"> <div class="box" ng-repeat="item in items track $index"> <h3>{{item.name}}</h3> <button ng-click="go($event)">go next box</button> </div> </div> </div> http://jsfiddle.net/0bwclfv4/2/ jquery included on site already, want anima

ios - Core Data to-one relationship returns NULL -

Image
the batting.team relationship doesn't save , returns null sometimes about 100 'team' nsmanagedobjects saved , can log attributes expected. 15000 'batting' nsmanagedobjects saved , attributes log correctly except relationship. i want batting.team relationship point team object has same team.teamid value batting.teamid. when setting batting relationship, create predicate search specific team.teamid, fetch request , supposedly set team object equal batting.team relationship. relationship attribute gets set times doesn't , can't figure out - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. nserror *error; nsstring* datapath_teams = [[nsbundle mainbundle] pathforresource:@"teams" oftype:@"json"]; nsarray* teams = [nsjsonserialization jsonobjectwithdata:[nsdata datawithcontentsoffile:datapath_t

javascript - Google maps styled marker z-index change not working -

in this page trying bring clicked (styled) marker (or 1 selected using vorige/volgende - previous/next - buttons) top setting zindex google.maps.marker.max_zindex + 1 (and restoring zindex previous value upon marker being clicked) using this.styleicon.set('zindex', google.maps.marker.max_zindex + 1); in following code: var thismarker; var markers=[]; var map; var zoem=0; function initialize() { var mapcanvas = document.getelementbyid('map'); var mapoptions = {center:new google.maps.latlng(latitudemid,longitudemid),zoom:zoom,maptypeid:google.maps.maptypeid.roadmap,streetviewcontrol:false,maptypecontrol:true,scalecontrol:true,scalecontroloptions:{position:google.maps.controlposition.top_right}}; map = new google.maps.map(mapcanvas, mapoptions); var i; var insertion; var previousmarker; var previouszindex; (i = 0; < fotocount; i++) { var mylatlng =new google.maps.latlng(latituden[i], longituden[i]); var marker = new styledmark

jquery - Knockout $root binding does not update UI element immediately -

i want display $root on page know what's in object. after first add event, added item added object, ui not reflect change. on second add event, first item displayed on ui, second 1 not displayed until third add event , forth. jsfiddle html <input type='text' data-bind='value: selecteditem' /> <input type='button' data-bind='click: additem' value='add' /> <pre>vm = <span data-bind="text: ko.tojson($root, null, 4)"></span></pre> js $(document).ready(function () { var basevm = function () { var = {}; return that; }; var testvm = function () { var = basevm(); that.relateditems = ko.observablearray(['pork', 'ham']); that.selecteditem = ko.observable(''); that.additem = function () { if (that.relateditems().indexof(that.selecteditem()) >= 0) { alert('existed');

json - How to filter list by nested element using JSONPath? -

how can 1 filter list of items nested value using jsonpath? test data [{ "identifiers": [ { "extension": "foo" } ] }, { "identifiers": [ { "extension": "bar" }, { "extension": "baz" } ] }] expected result [{ "identifiers": [ { "extension": "foo" } ] }] i've tried following, none of them work. used jsonpath tester validate results. $[?(@.identifiers.[*].extension == 'foo')] $[?(@.identifiers.*.extension == 'foo')] $[?(@.identifiers[0].extension == 'foo')] this $..identifiers.[?(@.extension == "foo")] works @ http://jsonpath.herokuapp.com/ when use goessner. at http://jsonpath.curiousconcept.com/ keep getting errors.

ios - How do I add a style? -

how add style font? golabel.font = uifont(name: "apple sd gothic neo" , size: 40) i've tried golabel.font = uifont(name: "apple sd gothic neo-thin" , size: 40) but went straight system font size 17. you should represent font name following: golabel.font = uifont(name: "applesdgothicneo-thin" , size: 40) you can available font names families ('apple sd gothic neo' in example) with: uifont.fontnamesforfamilyname("apple sd gothic neo") for example, when print that, see: [applesdgothicneo-bold, applesdgothicneo-thin, applesdgothicneo-ultralight, applesdgothicneo-regular, applesdgothicneo-light, applesdgothicneo-medium, applesdgothicneo-semibold]

Android Reverse GeoCoder not working -

hi trying lower battery consumption of application removing location updates in onstop: @override public void onstop() { if (mgoogleapiclient.isconnected()) { //stopping location updates causes error in geocoder can't address?? stoplocationupdates(); mgoogleapiclient.disconnect(); } super.onstop(); } protected void stoplocationupdates() { locationservices.fusedlocationapi.removelocationupdates( mgoogleapiclient, this); } however when geocoder stops working , throws , ioexception, though start location updates again in onconnected: @override public void onresume() { super.onresume(); //super class method close nav drawer updateandclosedrawer(positions.map.position); if (savedvalues != null) { if (savedvalues.getstring("email", null) == null) { onbuttonpressed(); } } servicesconnected(); checkgpsenabled(); if (!mgoogleapiclient.isconnected()) {

javascript - password check directive elem.add error -

i'm making password checking directive ensure password , confirm_password fields same: angular .module('mymodule') .directive('pwcheck', function() { return { require: 'ngmodel', link: function (scope, elem, attrs, ctrl) { var password = "#" + attrs.pwcheck; elem.add(password).on('keyup', function() { scope.$apply(function () { ctrl.$setvalidity('pwmatch', elem.val() === $(password).val()); }); }); } }; }); i error when adding keyup handler both pw , pw check fields: typeerror: elem.add not function so removed .add() , elem.on('keyup', function() { now i'm getting following error: referenceerror: $ not defined i'm following this codepen. i've set angular app correctly, , directive logs html elements (elem, attrs,

types - Scala: Generic Method -

i can not find solution problem: this trait: trait basicrepository[schema <: table[entity] identifiable[entity], entity] and this: trait profilepartrepository[schema <: table[entity] profilepart[entity], entity] this object: object phonenumberrepository extends basicrepository[phonenumbers, phonenumber] profilepartrepository[phonenumbers, phonenumber] { and method: def insertprofilepart[schema <: table[entity] identifiable[entity], entity](repository: basicrepository[schema, entity], entities: seq[entity]) : seq[future[int]] the method not compile. think can see achieve. signature have like? edit: not care "schema" in method, has valid basicrepository. edit2: compilation error (when calling method, agnosticdriver.api being slick.driver.jdbcdriver): inferred type arguments [persistence.slickschemas.phonenumbers,product serializable] not conform method insertprofilepart's type parameter bounds [schema <: persistence.agnosticdriver

c++ - gcc auto dependency full path -

i have simple project - has foo.cxx , bar.h : // bar.h // nothing // foo.cxx #include "bar.h" // nothing else if include bar.h "" s, dependency file has full paths: $ g++ -std=c++11 -mp -mmd -mf /home/barry/sandbox/foo.d -c /home/barry/sandbox/foo.cxx -o /home/barry/sandbox/foo.o $ cat foo.d /home/barry/sandbox/foo.o: /home/barry/sandbox/foo.cxx \ /home/barry/sandbox/bar.h /home/barry/sandbox/bar.h: however, if include <> s , add -i. , bar.h itself: $ g++ -std=c++11 -i. -mp -mmd -mf /home/barry/sandbox/foo.d -c /home/barry/sandbox/foo.cxx -o /home/barry/sandbox/foo.o $ cat foo.d /home/barry/sandbox/foo.o: /home/barry/sandbox/foo.cxx bar.h bar.h: is there way full paths all of files? the issue -i. when gcc determining include <bar.h> , find ./bar.h , , printed in dependency file in same way. if provide full path via -i well: $ g++ -std=c++11 -i/home/barry/sandbox -mp -mmd -mf /home/barry/sandbo

Sorting XML file by element -

i want sort xml file elements in same level alphabetically. means, sorting elements on first level, inside every element subelement , on recursively. must multilevel, not 1 level (that solved in other question). example (please ignore content , meaning): <example> <note> <to>tove</to> <from>jani</from> <heading>reminder</heading> <headb>head</head3> <heada>head</head3> <body>don't forget me weekend!</body> </note> <next> <c>blabla</c> <a>blabla</a> </next> </example> to: <example> <next> <a>blabla</a> <c>blabla</c> </next> <note> <body>don't forget me weekend!</body> <from>jani</from> <heading>reminder</heading>

iteration - iterative solution python (finding the last and second last iterative values) -

i total beginner in programming , have write short code in python. finding iterative solution variable when difference between successive iterations no more 0.0001. i thought of using infinite while loop how can check values obtained after second last , last iteration specify break condition. please can explain how that? here code i've written icl=0.5 tc= 25 def kelvin(tc): tk = tc +273.15 return tk #calculate initial value tcl tcl=kelvin(tc)+(35.5-tc)/(3.5*icl+0.1) #calculate final value of tcl when difference between successive values of tcl <0.0001 while true: tcl=35.7-0.028*(m-icl)*(3.96e-8*fcl((tcl+273.15)**4-(tr+273.15)**4+fcl*hc*(tcl-ta)) if .... #here not sure how break loop when above mentioned condition met in code, store tcl need store tcl , previous_tcl . @ minimum, can modify code way: cl=0.5 tc= 25 def kelvin(tc): tk = tc +273.15 return tk #calculate initial values tcl , tcl_previous tcl_previous = kelvin(tc)+(35.5-tc

jquery - Columns same height (part of column) + bootstrap -

Image
i'm trying figure out how can make part of columns same height other parts in column. image clarify: left data have column. full page this: my html looks this: <div class="container"> <div class="row"> <div class="col-md-5"> <div class="contacts"> <h2>business contacts</h2> <div class="infomation"> <div class="col-md-6"> <h3>industry</h3> <div class="name">joris<br> <span>vuerstaek</span></div> <div class="mail"><a href="mailto:joris.v@vkgroup.be">joris.v@vkgroup.be</a></div> </div> <div class="col-md-6"> <h3>public