Posts

Showing posts from May, 2010

How to convert a string into a date in swift -

i parsed code "1442351280" json , and want convert date in swift in medium style. you have with foundation api let date = nsdate(timeintervalsince1970: 1442351280)

html - How to get value of generated row value for another action when generated submit button is clicked -

i want know how dynamically generated table row value (eg. empp_id) when clicking submit button generated each row dynamically. below code. used generate each row , submit button each row. don't know how use submit button , pass value of 'id' column action. struts.xml <?xml version="1.0" encoding="utf-8"?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.3//en" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.enable.dynamicmethodinvocation" value="false" /> <constant name="struts.devmode" value="false" /> <package name="default" namespace="/" extends="struts-default"> <action name="edit" class="com.ojt.database.edituseraction" method="execute"> <result name="success">e...

python - Accessing `http://localhost:8080/admin/djcelery/` returns 403 in Django -

i trying access http://localhost:8080/admin/djcelery/ in django admin. can access http://localhost:8080/admin , can run celery task can't access djcelery admin site. here url url(r'^admin/', include(admin.site.urls)), here settings.py import djcelery djcelery.setup_loader() broker_url = "amqp://guest:guest@localhost:5672//" celery_result_backend='djcelery.backends.database:databasebackend' celerybeat_scheduler = 'djcelery.schedulers.databasescheduler' do have add additional access admin/djcelery/ ? i assume have installed package pip install django-celery make sure added in installed_apps installed_apps += ("djcelery", ) and run migrate python manage.py migrate djcelery if still not load can glance detailed documentation

regex - PHP Web Crawler doesn't crawl .php files -

this simple webcrawler trying build <?php $to_crawl = "http://samplewebsite.com/about.php"; function get_links($url) { $input = @file_get_contents($url); $regexp = " <a\s[^>]*href=(\"??)([^\" >]*?)\\1[^>]*>(.*)<\/a> "; preg_match_all("/$regexp/siu", $input, $matches); $l = $matches[2]; foreach ($l $link) { echo $link."</br>"; } } get_links($to_crawl); ?> when try run script $to_crawl variable set url ending file name, e.g. "facebook.com/about", works, reason, echo's nothing when link ending '.php' filename. can please help? to links , inner texts, can use domdocument this: $dom = new domdocument; @$dom->loadhtml($input); // input (html code) $xp = new domxpath($dom); $links = $xp->query('//a[@href]'); // xpath <a> tags href attr...

add dns record in from c# -

how add record in dns using c#, trying use below code, no luck. manage dns server c# code addarecord("dns01.iaxus.com", "iaxus.com", "10.0.0.20", "14.145.101.55"); 14.145.101.55 wan ip. its throwing below error. the rpc server unavailable. (exception hresult: 0x800706ba) please help. try running application administrator if doesn't work try disabling firewall , run administrator.

How can I extend ApplicationUser in ASP.NET Identity but with properties that can be null? -

i extend application user. here's example: public class applicationuser : identityuser { public async task<claimsidentity> generateuseridentityasync(usermanager<applicationuser> manager) { var useridentity = await manager.createidentityasync(this, defaultauthenticationtypes.applicationcookie); return useridentity; } public string address { get; set; } public string city { get; set; } public string state { get; set; } i tried seems when login if of these properties set null in database when /token call made returns error. can tell me. need make change way these properties set here or in place? if understand question correctly, simple solution problem create nullable type . can please share do? create custom identity provider, example?

javascript - How can I generate kendo tree view from hierarchical data? AngularJS -

how can add data source kendo-tree-view data, id in case projectattachmentfolderid , parent id - projectattachementfolderparentid var flatdata = [{ "projectattachmentfolderid": null, "projectattachementfolderparentid": -1, "projectattachmentfoldername": "root", "projectiattachmenthasuniquepermissions": 1, "projectiattachmentisfolder": 1, "cancreate": true, "candelete": true, "canread": true, "canupdate": true, "projectattachmentfolderid2": null, "projectiattachmentid": -1, "foldertype": null, "id": 0 }, { "projectattachmentfolderid": 5112, "projectattachementfolderparentid": null, "projectattachmentfoldername": "dokumenty klienta", "projectiattachmenthasuniquepermissions": 1, "projectiattachmentisfolder": 1, "cancreate": true, "candelete": true, ...

json - Rails: Calling Model methods in to_json(:methods => [:model_method]) -

i've defined 2 methods in model image_url & thumb_url to absolute url of images , thumbs , calling them in controller .to_json() method. when view json response shows image_url not thumb_url please guide me doing wrong here. model : class post < activerecord::base include rails.application.routes.url_helpers validates :image, presence: true has_attached_file :image, styles: { :medium => "640x", thumb: "100x100#" } # # means crop image validates_attachment_content_type :image, :content_type => /\aimage\/.*\z/ def image_url relative_path = image.url(:medium) self.add_host_prefix relative_path end def thumb_url relative_path = image.url(:thumb) self.add_host_prefix relative_path end def add_host_prefix(url) uri.join(root_url, url).to_s end end controller : class api::imagescontroller < applicationcontroller def index @posts = post.all.order(id: :desc) paginated_recor...

android - Creating a Sliding Scale Similar to Noom -

i want create sliding weight scale app 1 in screen shot. cannot figure out layout or ui components use. please suggest way or tutorial this. thanks link screenshot did not reference tried creating on own. check out in github. slidingscale - github

.net - Unknown Windows Message 0xC052 -

i'm working on problem ( how detect form open inside application ) , stumbled on windows message can't understand: 0xc052. this first message receive in messagefilter when form opens. since didn't found reference don't want rely on assumption, message tells me reliable form opened. edit: added code application.addmessagefilter(new messagefilterimpl()); class messagefilterimpl : imessagefilter { public bool prefiltermessage(ref message m) { control wnd = form.fromhandle(m.hwnd); if (wnd form) knownforms.add((form)wnd); //m.msg 0xc052 return false; } } assuming well-formed windows message, it's dynamically allocated id returned registerwindowmessage function (note range 0xc000-0xffff ). function used when need define new windows message that's supposed system-unique. in other words, you can't rely on id - different next time reboot. .net winforms uses internally plenty of times - it...

ios - Unable to set initialtext in ios9 in native facebook share dialog -

i trying set initial text slcomposeviewcontroller in ios 9 , displaying blank in dialog. here code. slcomposeviewcontroller *composecontroller = [slcomposeviewcontroller composeviewcontrollerforservicetype:slservicetypetwitter]; nsstring *initialtext = @"tesing text issue."; if (initialtext != nil) { [composecontroller setinitialtext:initialtext]; } dispatch_async(dispatch_get_main_queue(), ^ { //show progress hud here [self presentviewcontroller:composecontroller animated:yes completion:nil]; }); i have aslo check in sharing app, have same issue. can have workaround here? facebook has deprecated api set initial text programmatically while sharing. below references: https://developers.facebook.com/docs/apps/review/prefill https://de...

Getting "No Json serializer found for type scala.concurrent.Future..." exception in Scala Play application -

i trying web application scala play 2, slick 3 , postgresql. purpose return json controller. these dependencies - librarydependencies ++= seq( "org.postgresql" % "postgresql" % "9.4-1201-jdbc41", "com.typesafe.slick" %% "slick" % "3.0.0", "com.typesafe.play" %% "play-slick" % "1.0.1", "com.typesafe.play" %% "play-slick-evolutions" % "1.0.1", specs2 % test ) this 1 of model - package models import play.api.libs.json.json import slick.driver.postgresdriver.api._ import play.api.mvc._ import play.api.libs.json._ import play.api.libs.functional.syntax._ case class user (id: string, name: string) class usermodel (tag: tag) extends table[user](tag, "users") { def id = column[string]("id", o.primarykey) def email = column[string]("email") def * = (id, email) <> (user.tupled, user.unapply _) ...

c# - IsDefault causes focus instead of click -

Image
i have control 3 text boxes , 1 button set isdefault . when typing in 1 of text boxes , press enter key expect isdefault button clicked, instead focuses button instead of clicking it. have made sure there no other isdefault buttons, have checked isdefaulted property of button true when press enter button. <grid dockpanel.dock="top"> <grid.rowdefinitions> <rowdefinition height="30"/> <rowdefinition height="30"/> <rowdefinition height="30"/> <rowdefinition/> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition/> <columndefinition/> </grid.columndefinitions> <textblock text="new:" verticalalignment="center" margin="5,0,0,0" grid.column="0"/> <textbox undolimit="10" name="txtaddnew" grid.column="1" height="...

label - Custom progress bar in ios -

Image
i trying make custom bar label , progress bar adjust according each other's width..is there open source code this. right using built in progress bar don't know how adjust progress bar , text relative progress bar length. cell.candidatespollprogress.backgroundcolor = [uicolor bluecolor]; cell.candidatespollprogress.progresstintcolor = [uicolor bluecolor]; cell.candidatespollprogress.tracktintcolor = [uicolor bluecolor]; where start?any appreciated. inorder make ui of screenshot shared, need use uiview background color instead of uiprogressview. set uilabel(percentage text)'s leading space constraint uiview(progress view)'s trailing end. adjust uiview's width (progressvalue)/(maxvalue) * (max width of progress view)

excel - Transfer data from one worksheet to another automatically -

i want transfer data 1 excel worksheet automatically. have tried visual basic editor using command button in excel. works successfully, want without clicking command button. when insert value 1 sheet should transfer sheet automatically. is possible so? it's not possible since macro or vba needs have command. therefore need make command button have work. there won't reference action macro or vba work without command.

scala - Apache Drill query data serialized with Kryo -

i saving complex object ( scala.vector[(int, double)] ) in hbase table column means of serializing byte array ( scala.array[byte] ) kryo ( com.twitter.chill.kryoinjection ). now query data apache drill , convert serialized byte array human readable. i imagined somehow "register" own converter apache drill , provide drill query. unfortunately unable find information on if , how possible accomplish. if encode data in big endian in hbase meaningful results. better performance on conditional queries. think this doc helps describe problem/solution.

windows - Batchfile to search a string in the filepath -

i wan search specific string in file-path , double particular string. example: if filepath c:\users\xxxx\desktop\g%h.txt want search , % symbol , need double c:\users\xxxx\desktop\g%%h.txt how batch file? in batchfiles, have escape special chars, cmd knows not treat them "special". percent-sign escaped percent-sign: @echo off setlocal enabledelayedexpansion %%i in (*.txt) ( set name=%%i echo old name: !name! set name=!name:%%=%%%%! echo new name: !name! )

PHP date next tuesday 1pm -

$tuesday_slot = strtotime('next tuesday'); above code give me unix time next tuesday. how unix time e.g next tuesday, 1pm. thanks! easy : $tuesday_slot = strtotime('next tuesday'); $tuesday_slot = strtotime('+ 13 hours',$tuesday_slot); echo date("r",$tuesday_slot); or $tuesday_slot = strtotime('next tuesday 1pm'); echo date("r",$tuesday_slot);

java - Trying to do a boolean loop -

i'm new , wanted try , loop kinda how i'm stuck. i'm getting these errors not sure though. duplicate local variable minutes duplicate local variable choice type mismatch: cannot convert double string operator / undefined argument type(s) string, double operator / undefined argument type(s) string, double type mismatch: cannot convert double string `import java.util.scanner; public class looptest { public static void main(string[] arge) { scanner scanner = new scanner(system.in); double minutes = 0; double minutesperday; double minutesperyear; double years; double days; double choice; boolean keepplaying = true; while (keepplaying) { string minutes; string choice; system.out.print("number of minutes"); minutes = scanner.nextdouble(); minutesperday = 60 * 24; minutesperyear = minutesperday * 365; years = (minutes / minutes...

jquery - How do I stop the duration of the scrollTop -

the directive have works enough far, not every page has same height want stop duration when @ bottom. this code of directive: function (scope, elem, attrs) { $(document).on('contentchanged', '#maintext', function () { $("html, body").animate({ scrolltop: 0 }, 0), $("html, body").animate({ scrolltop: $(window).height() }, 4000); }); } so example @ first page view @ bottom can't go lower , when go next page bit lower continuous scrolling down. my question how can stop scrolling ? .animate( properties [, duration] [, easing] [, complete] ) so this: .animate( {scrolltop:'300px'}, 300, swing, function(){ alert(animation complete! - custom code here!); } ) here jquery .animate function api page: http://api.jquery.com/animate/

.net - Assume local instead of Unspecified DateTime from SQL Server -

because sql server datatype datetime not keep timezone information, sqlclient in .net instantiating datetime objects kind set datetimekind.unspecified . of cause right thing - theoretically. every application have worked on has stored datetime assuming local, , lived happy long time. but when globalization demands arise, there trouble assumption / convention. instance json serialization not trusted! so question: possible either on database, or on web server, enforce datetime read database (via sqlclient.datareader.getdatetime ) assumed datetimekind.local ? i don't think there's way enforce datetime pulled reader automatically assumed local time, it's easy enough change afterwards using specifykind method: var unspecifiedvalue = yourreader.getdatetime(yourcolumn); var localvalue = datetime.specifykind(unspecifiedvalue, datetimekind.local); you wrap in extension method if prefer (either hardcoding datetimekind i've done here, passing in argument...

Javascript - How to do get accurate the timer delay of setinterval? -

this question has answer here: setinterval delays not accurate 2 answers i having problem delay of setinterval follows: var playball = setinterval(function() { // code here // measure offset time console.log('time: ' + new date().gettime()); }, 20); when execute, delay actual 21 or 22 or more than...which not 20 milliseconds. where problem? it's commonly known setinterval() method isn't accurate. see link find out how method works: https://dzone.com/articles/how-javascript-timers-work

webview - Should I close HttpURLConnection in android? -

i override following function cache myself (to bypass networking lookup) public webresourceresponse shouldinterceptrequest(webview view, string url) { // depending on android version, use below function // public webresourceresponse shouldinterceptrequest(webview view, webresourcerequest request) { httpurlconnection urlconnection = null; try { urlconnection = (httpurlconnection) url.openconnection(); in = new bufferedinputstream(urlconnection.getinputstream()); data = new string(bytestreams.tobytearray(in)); } catch (exception e) { return null; } // stuff data omitted here return new webresourceresponse(mimetype, "utf-8", in); } i'm not closing urlconnection because i'm passing inputstream tied urlconnection. since it's common idiom if open something, should close it, i'm worried if i'm ok code. do need call httpurlconnection.disconnect after finish using it discusses it, ...

java - Is there any way to rebuild a sessionFactory? -

we building application connect multiple database schemas. first schema contains schema name , other details of second schema. application runs fine first time. pops error when login again. error : org.hibernate.service.unknownserviceexception: unknown service requested [org.hibernate.engine.jdbc.connections.spi.connectionprovider] i have 2 sessionfactories,one each database. properties change according logs in. i understand it's because sessionfactory not getting built again.is there way rebuild sessionfactory? here.. in advance.. edit so figured need use multi tenancy in hibernate. on how that? kind of examples links.. etc appreciated.. thanks. you should use two session factories . once created session factories immutable .

java - how to get vm permissions in vijava -

i'm trying permissions of virtual machine using vijava this: managedentity me = new inventorynavigator(rootfolder).searchmanagedentity("virtualmachine", vmname); virtualmachine vm = (virtualmachine) me; (permission permission : vm.getpermission()) { system.out.println(permission.getprincipal()); } with permissions applied vm. how can total permissions on virtual machine including inherited? i'm not sure if that's possible, because each list of permissions associated specific entity (i.e. virtualmachine, hostsystem, etc..). the way i'd i'd underlying entities virtual machine , permissions well. example, since have virtualmachine object, underlying hostsystem , retrieve it's permissions, , on. managedentity me = new inventorynavigator(rootfolder).searchmanagedentity("virtualmachine", vmname); virtualmachine vm = (virtualmachine) me; // assuming have serviceinstance object s...

java - How to add Authority Certifcate to use HTTPS client in Jetty War Application - -

i use jetty web application server. deployed application needs use https client (my war calls external web service). have authority certificate (ca) file. what have suppose do, because each time call external web service, error (certification path error). i suppose have add ca truststore associated jetty ? thanks help

javascript - Google marker is not being displayed on map -

i have written code display marker on googlemap. code copied verbatim, google api docs. yet marker not displaying on page. here code: doing wrong? var map; var central_location = new google.maps.latlng(42.745334, 12.738430); function initialize() { var mapcanvas = document.getelementbyid('map'); var mapoptions = { center: central_location, zoom: 14, maptypeid: google.maps.maptypeid.roadmap } map = new google.maps.map(mapcanvas, mapoptions); } google.maps.event.adddomlistener(window, 'load', initialize); $(document).ready(function() { var infowindow = new google.maps.infowindow({ content: '<div>hello</div>' }); var marker = new google.maps.marker({ position: central_location, map: map, title: 'this title' }); marker.addlistener('click', function() { infowindow.open(map, marker); }); marker.setmap(map); }); #map { width: 500px...

java - Tomcat commits abnormal amount of virtal memory and dosen't release it -

issue: java commits big amount of virtual memory , doesn't release it.then server goes down. java(tomcat) consumes normal amount of memory. example real heap 1gb, commited virtaul memory 30g... parametrs old config: min/max heap - 512m/2048m, tread stack size 512kb, perm 64m, max perm 256m server status now: physical memory: 16383.55 mb available memory: 4917.84 mb total page file: 47103.55 mb free page file: 34961.65 mb memory load: 69 process kernel time: 1701.58 s process user time: 9451.538 s ps eden space heap memory 129.00 mb 509.50 mb 634.50 mb 467.03 mb (73%) ps old gen heap memory 341.50 mb 1064.00 mb 1365.00 mb 884.52 mb (64%) ps survivor space heap memory 21.00 mb 9.00 mb 9.00 mb 0.00 mb (0%) code cache non-heap memory 2.43 mb 21.75 mb 48.00 mb 21.50 mb (44%) ps perm gen non-heap memory 64.00 mb 178.50 mb 256.00 mb 178.47 mb (69%) what have: windows server 2012r2, 4vcpus, 16gb of ram (was 2vcpu , 8gb of ram) apache to...

how to show only status bar in android -

i working on application of activity in full screen. implemented using theme. <style name="apptheme" parent="theme.appcompat.light.noactionbar"> <!-- customize theme here. --> <item name="windownotitle">true</item> <item name="windowactionbar">false</item> <item name="android:windowfullscreen">true</item> <item name="android:windowcontentoverlay">@null</item> </style> now stuck situation in 1 activity need show status bar. buddy know how forcefully made changes first apply theme how can code forcefully show status bar not actionbar. thanks in activity want status bar, can try code: getwindow().addflags(windowmanager.layoutparams.flag_force_not_fullscreen); getwindow().clearflags(windowmanager.layoutparams.flag_fullscreen); then if have title defined make visible, example ((view) findviewbyid(...

javascript - How can I use the JQuery Validation Plugin to validate this form that have this specific constraint? -

this question has answer here: jquery validate plugin, 1 out of 2 fields required 2 answers i pretty new in jquery , have following problem related form validation. so think not write validator myself use jquery validation plugin , one: http://jqueryvalidation.org/ from have understand provide me built in required() method make specific field required (if user don't insert value field error message shown). ok...my problem in form have this: <form method="post" action="consultazionericercaform" id="consultazionericercaform"> <div class="row"> <div class="col-md-4"> <label style="display: block;">regioni:</label> <select name="regioneselezionata" id="selreg"> <option value="-"...

android - insert id returns always -1 and data is not inserted in database. please somebody help me -

when insert data insert id returns -1 data base table.my database created successfully. so, please tell me solve problem. query3 = "create table if not exists `" + staticdata.subject_table_name + "` (" + "`subject_id` int(11) not null," + "`subject_name` varchar(100) default null," + " primary key (`subject_id`)" + ");"; public long insertsubject(teachermodel queryvalues) { long insertid = -1; contentvalues values = new contentvalues(); values.put("id", queryvalues.getsubject_id()); values.put("name", queryvalues.getsubject()); if(database != null) { insertid = database.insert(staticdata.subject_table_name, null, values); } log.w(datainteract.class.getname(), "subject::" + values + ...

r - Handle Continous Missing values in time-series data -

i have time-series data shown below. 2015-04-26 23:00:00 5704.27388916015661380 2015-04-27 00:00:00 4470.30868326822928793 2015-04-27 01:00:00 4552.57241617838553793 2015-04-27 02:00:00 4570.22250032825650123 2015-04-27 03:00:00 na 2015-04-27 04:00:00 na 2015-04-27 05:00:00 na 2015-04-27 06:00:00 12697.37724086216439900 2015-04-27 07:00:00 5538.71119009653739340 2015-04-27 08:00:00 81.95060647328695325 2015-04-27 09:00:00 8550.65816895300667966 2015-04-27 10:00:00 2925.76573206583680076 how should handle continous na values. in cases have 1 na, use take average of extreme values of na entry. there standard approaches deal continuous missing values? the zoo package has several functions dealing na values. 1 of following functions might suit needs: na.locf : last observation carried forward. using parameter fromlast = true corresponds next observation carried backward (nocb). na.aggregate : replace na 's aggregated value. default aggregation funct...

symfony - get Input values dynamically in php -

i devolping web application using symfony framework. have problem in forms. here code: $value = array(); foreach ($myarray $value) { $fieldnameappend ='<input type="radio" name="'.$value.'cleaning'.$id.'" value="'.$value.'cleaning'.$id.'" id="'.$value.'cleaning'.$id.'" class="inputfields">'.$value.''; } print_r($fieldnameappend); in loop got data in allvalues variable.but when access outside loop got 1 value. please help its because u keep overwriting $fieldnameappend. you can try way put inputs in same string (notice .=) fieldnameappend = ''; foreach ($myarray $value) { $fieldnameappend .='<input type="radio" name="'.$value.'cleaning'.$id.'" value="'.$value.'cleaning'.$id.'" id="'.$value.'cleaning'.$id.'" class="...

javascript - Can't submit form when add scope to directive AngularJS -

when remove scope everyting works fine... here directive: function addcomment(commentfactory) { //creating button comment , call link function var addcomment = { link: link, restrict: "e", scope: { valid: '=' }, template: '<input type="submit" ng-disabled="valid" class="btn btn-default pull-right" value="send" />' }; .... here html: <form name="maincomment" ng-submit='addcomment(param)' class="dd animated slideindown" novalidate> <div class="form-group"> <text-angular name="maintxt" required ta-max-text="600" ta-min-text="15" ng-model="form.comment"></text-angular> <span style="color:red" ng-show="maincomment.maintxt.$dirty && maincomment.maintxt.$invalid"> ...

ember.js - Lazy loading leads to undefined data in Ember -

i'm using ember.js week , ran problem concerning ember-data , ember.js. have simple 1:n-relationship on model called user . user hasmany slots defined start_time , end_time . in component called slots-per-day slots of given user rendered filtered day following js code: /* ... rest of component.js of slots-per-day ... */ filteredslots: ember.computed('user', function() { let time = moment(); return this.get('user.slots').filter( (slot) => { let left = moment(time).startof('day'); let right = moment(time).endof('day'); let start_time = moment(slot.get('start_time')); let end_time = moment(slot.get('end_time')); console.debug(slot.get('start_time')); return start_time.isbetween(left, right) || end_time.isbetween(left, right); }); }) /* ... rest of component.js of slots-per-day ... */ there several problems faced different approaches: using code above fil...

javascript - Scripts that get weeknumber, but changes to the next week every friday -

i have screen running , showing jobs of current week. use script calculate current week: date.prototype.getweek = function() { var onejan = new date(this.getfullyear(),0,1); return math.ceil((((this - onejan) / 86400000) + onejan.getday()+1)/7); } but show next week every friday. there easy way change current script changes on friday instead? maybe way change @ 10 (my timezone - cest) all hints , pointers appreciated :) if understood correctly can increment reutrned value if today friday . date.prototype.getweek = function() { var onejan = new date(this.getfullyear(),0,1); var weeknr = math.ceil((((this - onejan) / 86400000) + onejan.getday()+1)/7); return this.getday() == 5 ? weeknr + 1 : weeknr; } keep in mind getday() returns day of week (from 0 6) specified date. sunday 0, monday 1 , friday 5. can more details here .

Error while adding a field of type array in quickblox custom object -

i trying add field type "array of interger", every time try create such field giving error: "error error occurred during request" with console error log: "failed load resource: server responded status of 500 (internal server error)" with stack trace : send qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:3 re.extend.ajax qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:3 t.fn.ajaxsubmit qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:11 e qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:11 re.event.dispatch qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:2 m.handle qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:2 re.event.trigger qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:2 (anonymous function) qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:2 re.extend.each qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:1 re.fn.re.each qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:1 re.fn.extend.trigger qb.generic-92c8111bc4006f10fb3d0bcf2d9b3497.js:2 re.fn.(anon...

semantic web - Difference between ontology and gazetteer? -

according gate.ac.uk gazetteer is: a gazetteer consists of set of lists containing names of entities such cities, organisations, days of week, etc. these lists used find occurrences of these names in text, e.g. task of named entity recognition. word ‘gazetteer’ used interchangeably both set of entity lists , processing resource makes use of lists find occurrences of names in text. how different "ontology"? an ontology (in semantic web context) set of axioms in formal language defined inference procedure; allows verify entailments. a gazetteer, can find online, has no inference procedure defined: given assertion, can considered entailed gazetteer if found explicitly expressed in it. so, gazetteer represented in formal language (rdf, rdfs, or owl, semantic web languages) equivalent ontology of minimal expressivity, no new inferences can drawn.

SULU CMF: Direct upload in media_selection -

Image
i have page field of type media_selection. configuration one. <property name="images" type="media_selection"> <meta> <title lang="de">bilder</title> <title lang="en">images</title> </meta> <tag name="sulu.search.field" role="image" index="false"/> <tag name="sulu.content.sortmode.show"/> </property> is possible upload file directly page in backend? work's me if have image uploaded in media-manager that's kind of inconvinient users. yeah, that's possible, when choose selection in overlay can drag&drop images or click button plus sign saying click or drag'n'drop :

javascript - How can I check DNS using nodejs? -

Image
i need recursive check dns, linux's command $ dig +recurse some.site with nodejs. 'request' have return object of dns, because need work them. i need feature take rightly dns, have round ttl(i'm not sure correctly sounds on english). can standard dns module this? you use the core dns module . first example give lookup of www.google.com also have @ native-dns module

sql - question mark in IN statement -

this query: select top 6 nr,'<a href=[url]?id=' + convert(varchar,nr) + '&ch=tra&channel=tra>' + isnull(menutitle,title) + '</a>' title vwactive nr in (select nr dbo.fn_recursechildren('4',0)) , parent not in (6985,54092,29,28,98086,97126) , nr not in (?) , isnull(showfrom,adddate) >=(getdate()-14) , contenttype<>7 , hiddenchild=0 , (body not '' , body not '<p>&nbsp;</p>' or description not '' , description not '<p>&nbsp;</p>' ) , nr not in( select replace(ctspecificvar1,char(91)+'item'+char(93)+'=','') link vwactive hiddenchild=0 , parent=6985 , contenttype=7 , isnumeric(replace(ctspecificvar1,char(91)+'item'+char(93...

mergesort - I made 'merge sort' algorithm by using MATLAB. But not O(N*log(N)) -

Image
i made merge sort using matlab. and tried bar - elements' # vs elapsed time. but graph y=x. please me tt my code following function result = merge_sort2(input, p, r) global a; = input; if p < r q = floor((p+r)/2); merge_sort2(a, p, q); merge_sort2(a, q+1, r); merge2(p, q, r); end result = a; end function merge2(p, q, r) global a; n1 = q - p + 1; n2 = r - q; l = []; r = []; = 1 : n1 l(i) = a(p+i-1); end j = 1 : n2 r(j) = a(q+j); end l(n1+1) = inf; r(n2+1) = inf; = 1; j = 1; k = p : r if l(i) <= r(j) a(k) = l(i); = + 1; else a(k) = r(j); j = j + 1; end end end and next code finding running time code. function running_time2(func, incr, num) y = []; max = incr * num; = incr : incr : max data = i:-1:1; len = length(data); = tic; res = func(data, 1, len); elapsed = toc(a); y = [y elapsed]; fprintf('[the number of elements: %d]\t', i); fprintf('[el...

html - svg icons in IE9 do not display correctly -

our svg icons included using img tag getting incorrectly resized, cut off, or hidden when displayed in ie9. the solution in https://gist.github.com/larrybotha/7881691 (setting viewbox, removing width , height) not , neither including images background. when included using tag, svgs display (but not display in modern browsers chrome) one of icons use has following source: <?xml version="1.0" encoding="utf-8" standalone="no"?> <!-- generated icomoon.io --> <svg id="svg2" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" viewbox="0 0 640 640"> <metadata id="metadata167"> <rdf:rdf> <cc:work rdf:about=""> <dc:format>image/svg+xml</dc:format> <dc:type rdf:re...

jquery .hide/show form still sends data to the controller -

simple, if #parentpermission hidden, send post variable of (parentpermission) controller, there 2 variables works sending id=link controller, if 1 hidden should not send data, happens not recognize html select #link form. code: $(document).ready(function () { togglefields(); $("#link").click(function () { togglefields(); }); }); //this toggles visibility of our parent permission fields depending on current selected value of underage field function togglefields() { if ($("#link").val() == 'other') $("#parentpermission").show(); else $("#parentpermission").hide(); } html mvc view : <!-- select basic --> <div class="form-group"> <label class="col-md-4 control-label" for="assign_article">assign article menu</label> <div class="col-md-4"> <select id="link" name="link...

scala - Spark: OutOfMemory despite MEMORY_AND_DISK_SER -

i wrote piece of code reads multiple parquet files , caches them subsequent use. code looks simplified this val data = sparkstartup.sqlcontext.read.parquet(...) data.setname(...).persist(storagelevel.memory_and_disk_ser).collect() map += data the parquet file in total 11g. config application by: val sparkconfig = new sparkconf().setappname(...).setmaster("local[128]") sparkconfig.set("spark.serializer", "org.apache.spark.serializer.kryoserializer") sparkconfig.set("spark.kryoserializer.buffer.max", "512m"); sparkconfig.set("spark.kryoserializer.buffer", "256"); sparkconfig.set("spark.driver.maxresultsize", "0"); sparkconfig.set("spark.driver.memory", "9g"); i thought using memory_and_disk_ser , spark spill out disk if memory used. however, `java.lang.outofmemoryerror: java heap space errors @ at java.util.arrays.copyof(arrays.java:3230) @ java.io.bytearrayoutputs...

r - how can i find the total frequency of a given range in a histogram? -

i created histogram simulation, , need find total number of instances x-variable greater given value. specifically, data correlation (ranging -1 1, bin size 0.05), , want find percent of events correlation greater 0.1. finding total number of events greater 0.1 fine, because it's easy percent compute. library(psych) library(lessr) corrdata=null (i in 1:1000){ x1 <- rnorm(mean=0, sd = 1, n=20) x2 <- rnorm(mean=0, sd = 1, n=20) data <- data.frame(x1,x2) r <- with(data, cor(x1, x2)) corrdata <- append(corrdata,r) } describe(corrdata) hist <- hist(corrdata, breaks=seq(-1,1,by=.05), main="n=20") describe(hist) count(0.1, "n=20") try this: n=500 bh=hist(runif(n,-1,1)) #str(bh) sum(bh$counts[bh$mids>=.1])/n

javascript - page jumps on scrollbar show and hide -

i have sample code in jsfiddle. problem when click on heading 1 , opens panel. content long shows scrollbar. when collapse page sudden hide scrollbar back. during scrollbar show , hide. page looks jumping. either can hide , show animation smooth(i think not possible have tried) or else. please me find solution. demo <div class="bs-example"> <div class="panel-group" id="accordion"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="panel-title"> <a data-toggle="collapse" data-parent="#accordion" href="#collapseone">1. html?</a> </h4> </div> <div id="collapseone" class="panel-collapse collapse in"> <div class="panel-body"> <p>html stands hypertext markup language. html m...

RavenDB - deleting previously-conflicted documents with "/conflicts" in URL -

i’m trying programmatically delete once-conflicted documents no longer conflicted, still showing duplicates in raven. e.g. if query index on entity’s property know unique 2 documents back document url entities/12345 document b url entities/12345/conflicts/54321 my goal delete document b. loading document session not throw conflictexception, not flagged being conflicted more. can delete document b via web ui, can’t via code yet, can see in transient context via stream. here’s sample code explains getting various client calls when trying resolve this… using (var enumerator = session.advanced.stream(query)) { while (enumerator.movenext())) { var entity = enumerator.current.document; // attempt id returns null var id = session.advanced.getdocumentid(entity); // throws invalidoperationexception var url = session.advanced.getdocumenturl(entity); // returns null, can’t use session delete session.load<tent...

Android Add Place to Google Places database doesn't work -

i'm developing android application using google maps , google places. when user makes long click on map, show him form in can add details clicked place, , want add google database new google place. when before , after submits form: in oncreate(): mgoogleapiclient = new googleapiclient .builder(this) .addapi(places.geo_data_api) .enableautomanage(this, 0, this) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) .build(); after submitting form: private void addplacetogoogledbandtotrip() { final double lat = getintent().getextras().getdouble("lat"); final double lng = getintent().getextras().getdouble("lng"); final string placename = newplacenameet.gettext().tostring(); final string address = newplaceaddresset.gettext().tostring(); final string website = newplacewebsiteet.gettext().tostring(); final string phonenumber =...