Posts

Showing posts from August, 2011

javascript - Error properties not defined when pointing to a local variable -

i have following configuration file : /* env.js */ env_to_use = [ "local" ]; // local; dev; rec; pre; prod module.exports = { env_properties : { local : { root_url : "localhost", port : 3000, root_dir : "/home/user/project/" }, dev : { root_url : "devdomain", port : 3000, root_dir : "/apps/project/", } }, global_properties : { path_include : { path_express : env_properties[env_to_use].root_dir + 'express' } } }; and in file, want print 'path_express' value : /* test.js */ var env = require('./env.js'); console.log(env.global_properties.path_include.path_express); but when launch script command node test.js , following error : path_express : env_properties[env_to_use].root_dir + 'express' ^ referenceerror: env_pro...

scala - Missing HiveContext Dependency -

i trying : val hivecontext = new org.apache.spark.sql.hive.hivecontext(sc) this build.sbt file : name := "spark-sql" version := "1.0" scalaversion := "2.11.8" librarydependencies += "org.apache.spark" % "spark-core_2.11" % "2.0.0-preview" librarydependencies += "org.apache.spark" % "spark-sql_2.11" % "2.0.0-preview" librarydependencies += "org.apache.spark" % "spark-hive-thriftserver_2.10" % "1.6.2" the error getting : error:scalac: missing or invalid dependency detected while loading class file 'hivecontext.class'. to work org.apache.spark.sql.hive.hivecontext , need have following configuration combination in build.sbt or pom.xml , switch scala 2.10.6 because of compatibility issue of spark-hive_2.10: <dependency> <groupid>org.apache.spark</groupid> <artifactid>spark-core_2.10</artifact...

jsf - Getting duplicate id error in xhtml pages after upgrading ICEfaces -

i getting duplicate id error in xhtml pages after adding below context param in web.xml <context-param> <param-name>org.apache.myfaces.serialize_state_in_session</param-name> <param-value>false</param-value> </context-param> below error message org.icefaces.impl.application.extendedexceptionhandler handle warning: queued exception java.lang.illegalstateexception: component duplicate id "v9g4o62-retrieve-update" found @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletu tils.java:100) @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletu tils.java:116) @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletu tils.java:116) @ org.apache.myfaces.view.facelets.compiler.checkduplicateidfaceletutils.checkids(checkduplicateidfaceletu tils.java:8...

playframework - Play java 2.5 guice eager loading and stop hook not working -

this code in app/ folder : public class guiceconfiguration extends abstractmodule { @override protected void configure() { bind(kafkaconnection.class).aseagersingleton(); } } @singleton public class kafkaconnection { public kafkaconnection(){ try { serviceutils.startkafka(); } catch (ioexception e) { playloggerutils.logerror("[global]", this.getclass(), e); } } public kafkaconnection(applicationlifecycle lifecycle) { lifecycle.addstophook(() -> { playloggerutils.logdebug("kafka shutting down", this.getclass()); serviceutils.shutdownkafka(); return completablefuture.completedfuture(null); }); } } in application conf play.module.enabled += "guiceconfiguration" the class being initialized if call inject in controller. not loading @ time of application startup. , stop hook not bein...

Android Support Library in Xamarin Build -

Image
i set xamarin build : i have these errors : i understand he's telling me, widget.design.tablayout comes android support library. need add android support library in xamarin build. classic xamarin project, works way : no resource found matches given name '@style/theme.appcompat.light' but on build setting, trully don't know ! have ideas ? the android support package not automatically added xamarin.android application. xamarin provides android support library v4 component simplify adding support libraries xamarin.android application. you can follow article below add components in project: https://developer.xamarin.com/guides/cross-platform/xamarin-studio/components_walkthrough/

html - How to apply scrolling according to height of a div? -

i facing alignment issue while height getting expanded. scenario : have div tag need apply scrolling if height of div more fixed height.for fixed height scrolling not applicable. please on this. #configurator .content .white-box { background-color: white; border: 1px solid #cecece; /*overflow:scroll;*/ } #configurator .content .white-box-accessory { background-color: white; border: 1px solid #cecece; height: 50px; overflow: scroll; } #configurator .content .white-box-services { background-color: white; border: 1px solid #cecece; height: 50px; overflow: scroll; } <div class="white-box"> <div> <p>accasory header </p> </div> <div class="white-box-accessory"> <p> accesory 1 <br>accesory 2 <br>accesory 3 <br>accesory 4 <br>accesory 5 <br>accesory 6 <br>accesory 7 ...

excel - VBA: Range method failure -

i writing code select data entries of workbook 'open' in range, compiler gives error @ last line (set range rng) dim wb workbook set wb = workbooks.open(range("c2") & range("c3")) 'here range("c2") & range("c3") contains location of file's path dim ws worksheet set ws = wb.activesheet dim frow long frow = ws.range("a" & rows.count).end(xlup).row dim rng range dim frow1 long frow1 = ws.cells(1, columns.count).end(xltoleft).column set rng = wb.activesheet.range(cells(1, 1), cells(frow, frow1)) try: dim frow long frow = ws.range("a" & ws.rows.count).end(xlup).row dim rng range dim fcol long fcol = ws.cells(1, ws.columns.count).end(xltoleft).column set rng = ws.range(ws.cells(1, 1), ws.cells(frow, fcol)) remember if using set worksheet u have reference in range objects

testing - Detect whether test has failed within fixture -

i debugging intermittent test failure. purposes want dump lot of debug information if test failed. dumping debug stuff quite slow process produces lot of data, not want every test. i using pytest , yield autouse fixture should work great @pytest.yield_fixture(scope="function", autouse=true) def dump_on_failue(request): prepare_debug_dump() yield if test_failed(request): debug_dump() the problem can't figure out how detect whether test has failed or not. there a questions already , note on pytest website : if request.node.rep_setup.failed: print ("setting test failed!", request.node.nodeid) elif request.node.rep_setup.passed: if request.node.rep_call.failed: print ("executing test failed", request.node.nodeid) unfortunately code not work anymore. there no rep_setup , rep_calls symbols in node object. tried dig request , node object, no luck. anybody knows how detect whether test ...

how to make the layout alignment not change if the language changed from English to Arabic Android Developing -

i developing android app , when try app on android phone arabic language alignment of text-view , edit-text change wan't change them. example: (textview)(edittext) when phone language english when language changed arabic layout changed (edittext)(textview) want them (textview)(edittext) if phone language arabic or english. declare in app manifest app supports rtl mirroring. specifically, add android:supportsrtl="true" <application> element in manifest file. for more refer here

c# - How to show an image in imagebox and specify a value for combo when i select a row of dateagrid? -

i field of table , show them in datagrid code: in xaml: <datagrid x:name="dgvaddpersontab" height="158" width="396" autogeneratecolumns="false" canuserdeleterows="false" selectionchanged="dgvaddpersontab_selectionchanged" canvas.left="520" canvas.top="20"> <datagrid.columns> <datagridtextcolumn binding="{binding firstname}" width="78" /> <datagridtextcolumn binding="{binding family}" width="80" /> <datagridtextcolumn binding="{binding departmentname}" width="78" /> <datagridtextcolumn binding="{binding occupation}" width="80" /> <datagridtextcolumn binding="{binding personalcardno}" width="78" /> </datagrid.columns> </datagrid> and in code behind: var queryofdgvaddperson = j in facedb.tblkno...

jquery - my Ajax call does not hit breakpoint in controller action -

hi have following code in controller httppost action trying save applicant detail in database using ajax in mvc entity framework [httppost] [validateantiforgerytoken] public async task<jsonresult> saveapplicantdetails() { try { careerapplicant ca = new careerapplicant(); if (request.files.count > 0) { var file = request.files[0]; ca.resumelink = uploadfile.uploaddocfile(file, "uploads"); } ca.email = request["email"].tostring(); ca.contactno = request["contact"].tostring(); ca.name = request["name"].tostring(); ca.careerid = convert.toint32(request["careerid"].tostring()); db.careerapplicants.add(ca); db.savechanges(); and following ajax call $("#btnsave").click(function () { if ($("#form1").valid()) { ...

docusignapi - Can we pass custom URL for 'Send' option, in Docusign embedded sending -

we want integrate docusign e-signature in our web-application. want use embed sending , signing both features in our application. below scenario: 1> user logs on our application. selects document wants signed user. 2> create envelope in draft mode(by calling rest api) , calls embeddedsending flow sender can review/make other changes in document. 3> once review done sender, on clicking 'send', want send emails recipient/s, point url redirecting them our application embeddedsigning flow start. can achieve functionality using both embedded flows(embeddedsending/signing) or need call different rest apis separately work way? help/pointers appreciated. yes can use embedded sending , signing flows on same envelope. sounds you're on right track, you'll this: login api retrieve user's baseurl , other data. embedded sending (aka sender view) api open sending view of envelope user can add tabs, documents, recipients, etc. note: make sure ...

SMS conversation as threads in android -

i developing application in receiving text numbers. receiving text sms app , doesnot allow user send message through it. if message comes saved in listview. if message comes same number saved new list view item. want merge thread if different messages coming same number saved in thread normal messaging apps. remember receiving text , not sending. apply thread technique develop application save messages different listview items? not posting code because dont know post because asking suggestion , helping link can apply thread technique. it simple, add click listener each number initiates layout. @ example below: http://www.tutorialspoint.com/android/android_list_view.htm

what is the optimal cache setting for Grail 2.x app running on Travis CI -

on travis ci can specify cached directories: https://docs.travis-ci.com/user/caching/ so i've specified following configuration: cache: directories: - node_modules - modelcataloguecoreplugin/target/work/plugins - modelcataloguecoreplugintestapp/target/work/plugins - $home/.m2 - $home/.grails/ivy-cache - $home/.grails/wrapper yet when run ./grailsw test-app lot of dependencies not retrieved cache download instead. are there other directories suitable caching i'm missing?

c# - SOAPUI check request then mock response -

Image
i have set-up mock soapui project returns mock responses when call endpoint. i'm trying return different mock result depending on requested content is. @ moment when hit endpoint url, returning same response of time. is possible groovy script @ content of request , send mock response based on content? request soap i'd inspecting xml here have 2 mock requests. i'm looking @ request details node , type i.e. telephonenumber or postcode , send response based on that. possible check node type i.e telephonenumber, postcode , send response based on that? post code request <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:lin="http://llu.webservices.opalonline.co.uk/linecharacteristicsws"> <soapenv:header/> <soapenv:body> <lin:getlinecharacteristics> <lin:request> <!--optional:--> <lin:usercredentials> <!--optional:...

php - Symfony : Detached entity cannot be removed in test suite w/ phpunit -

i'm doing functionnal testing on api , i'm facing problem don't understand. i want test api interact remote web hosting server. goal manage virtualhosts, dns zones, database etc... have test remote server , avoid conflicts, remove created stuff after test (in teardown() function) , create base (in setup() function). in setup() load fixtures in setup. after test add child of main entity, want clean remote server : $service = $this->fixtures->getreference('service-web'); $this->container->get('webmanager')->deletehosting($service, true); the deletehosting() function deletes remote stuff (the true parameter "force" parameter, ensure function doesn't stop after error. the $service variable contains main service entity. have in entity one-to-many relationship addondomain 's entity. functionnal test creates addondomain. test ok, when try delete service, attached entity makes doctrine yell hell : doctrine\orm\ormi...

gitlab: change number of projects limit -

i've encountered 10 projects limit in gitlab. looked in /etc/gitlab/gitlab.rb , couldn't find mention number or limit. how can 10 projects per person limit changed? i'm running gitlab ce 7.10.1-omnibus.2 on ubuntu 14.04. use admin account login gitlab , visit http://your_gitlab_host/admin/application_settings change default_projects_limit value wish.

perl - DBD::mysql::st execute failed: called with 181 bind variables when 172 are needed -

i getting error dbd::mysql::st execute failed: called 181 bind variables when 172 needed @ line 110, <$fh> line 1. i think problem lies within section of code while ( $row = <$fh> ) { chomp $row; @dna = split('\|', $row); $participant_id = $dna[0]; $participant_id =~ s/\>//g; $array = $dna[1]; $length = length $array; $array =~ tr/a-z/a-z/; $array =~ s/(...)/$1 /g; $array =~ s/\s+/,/g; @dna1 = split (',', $array); unshift @dna1, $participant_id; $sth4->execute(@dna1); # line 110 } $sth4->finish; with 172 placeholders assume sql statement has been produced automatically you need @ code around like my $sth4 = $dbh->prepare(...); which contains 172 placeholders ? whereas statement my @dna1 = split (',', $array); results in @dna1 having 181 elements the problem in these lines $array =~ tr/a-z/a-z/; $array =~ s/(...)/$1 /g; $array =~ s/\s+/,/g;...

save cookies with same name but different values in php -

i designing real estate website have many ads in website , when user click on ad goes page viewmore.php gives user more details ad. now see in viewmore.php file save ad's id in cookies , send ad's id favorite page , user can review post time or wants in favorite page. the problem: consider visit page localhost/viewmore.php?id=10 when go favorite page u see ad data belong id when visit ad localhost/viewmore.php?id=11 , go favorite page see ad data belong id=11 , previous add gone. want save both of them in favorite page or matter of fact save posts visit. how can that? //reviewmore.php <!doctype html> <?php (is_numeric($_get['id'])) ? $id = $_get['id'] : $id = 1; ?> <?php $cookie_name = "favoritepost"; $cookie_value ="$id"; setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); // 86400 = 1 day ?> <html> <body> <?php error_reporting(0); include("config.php...

java - Non recursive scan for packages in Spring -

apparently, annotationconfigapplicationcontext#scan() scans packages recursively. i not sure of it, 1 of @component classes apparently loaded without being explicitly mentioned anywhere except being inside of subpackage of mentioned package. so first question: true spring scans package recursively? the second question, if true, how disable this? as noted in spring @component api indicates annotated class "component". such classes considered candidates auto-detection when using annotation-based configuration , classpath scanning . about scanning and/or annotating configuration & settings check this answer , can't explain better

javascript - svg-pan-zoom not working 100% of the time -

i use svg-pan-zoom library ( https://github.com/ariutta/svg-pan-zoom ), , works 75% of time on page on site (both in chrome , firefox, latest versions). because im assuming due misconfiguration on part, wondering if made error, or if there specific scenario's may causing this. my code: (function (mw, $) { $(document).ready(function () { panzoominstance = svgpanzoom('#stylometricanalysis-svg1', { zoomenabled: true, controliconsenabled: true, fit: true, center: true, minzoom: 0.1 }); panzoominstance = svgpanzoom('#stylometricanalysis-svg2', { zoomenabled: true, controliconsenabled: true, fit: true, center: true, minzoom: 0.1 }); }); }(mediawiki, jquery)); the error: 145 typeerror: this.options.svg.createsvgmatrix not function library version: 3.2.9 <object class='stylometricanalys...

url rewriting - IIS URL Rewrite - how to see rewritten URL? -

in iis i've set basic url rewrite inbound rule perform rewrite action domain: pattern match: ^somedirectory/(.*) action type: rewrite rewrite url: http://www.google.com/ {r:1} (using google test) the problem is, how can see server has rewritten url to? when check iis logs (i have "log rewritten url" option ticked), expect see www.google.com somewhere - it's found. the pattern matching because error: "502 - web server received invalid response while acting gateway or proxy server." how can see going on behind scenes (how iis has changed request)?

Excel VBA selecting data from a sorted Table -

i running problem in vba in excel. trying create participant registration program in excel sports tournament. 1 can add data weight, age , name of participant. , based on that, participants divided poules named letters a, b... until z. have table can sort these poules letters , example display participants in poule such below example now want count numbers vba macros of participants in poule displayed sorted table. example when sort on poule has return 3 , when sort on b, has return 2. determined number of participants in poule program print different poule scheme, depending on number of participants. (i have part in vba) the problem when have sorted table below example 2 it counts participants, , not ones in b or other sorted letter. i have this: sub count() dim nrows integer nrows = range(range("a18"), range("a18").end(xldown)).rows.count msgbox (nrows) end sub this works if sort a, when sort other letter, counts table until letter. eg...

html - Universal favicon file for all sizes on all platforms? -

i know there many devices uses favicon website in different ways... on these favicon generator websites can easy put image there , website rest (generating several scaled images devices) if want cover devices (apple, android, windows metro tiles, , more) have store 26 images (that same picture different sizes) and have add 19 lines of html code refer devices images. is there way use 1 file sizes? i know ico-file can contain multiple dimensions of image. know svg-file doesn't depend on pixel resolution @ because it's vector based. (so svg can support every imaginable size) i imagine implement sizes of image ico or svg file every device can pick it's optimal size. is possible? its not possible serve different sized pngs' in single file. svg file best hope here but.. browsers today don't them alternate option use tool manages process automatically. i had same frustration you, came tool called makefavicon it helps create multiple fav...

javascript - Social Security Number input validation -

i have sample: link code html: <input class="required-input" id="ssn" maxlength="9" type="text" name="ssn" placeholder="123-45-6789"> code css: .valid{ border:1px solid blue; } .invalid{ border:1px solid red; } code js: function ssnformat(){ $("#ssn").on('blur change', function () { text = $(this).val().replace(/(\d{3})(\d{2})(\d{4})/, "$3-$2-$4"); if ($(this).val() == '' || $(this).val().match(text) || $(this).val().length == 0) { $(this).removeclass('valid').addclass('invalid'); }else { $(this).removeclass('invalid').addclass('valid'); } }); } $( "#ssn" ).on('blur change', function() { ssnformat(); }); what want these things are: 1.if write following text want validate format 123-12-1234 2.if write 123456789 want transform when cl...

arrays - Nativescript multiple fetch http post -

i'm facing little problem. how should make looping post (arrays of data) need send 1 one waiting earlier post response before sending one. ideas welcome! i'm using newest nativescript , stock fetch module. sounds recursive call me, like: function postdata(arr, index){ let itemtopost = arr[index]; fetch('https://xyz/some/url', { method: 'post' content: json.stringify(itemtopost)// }).then(function(response) { //success //recursive call here postdata(arr, ++index) }).catch(function(err) { // error :( }); }

r - DT::datatable clearing default filters -

Image
i put default filters on dt::datatable in shiny application. i'm able default filters in place, removing filters not behaving expect. example 1 an example of datatable no filters: library(shiny) library(dt) shinyapp( ui = fluidpage( dt::datatableoutput("mtcars") ), server = shinyserver(function(input, output, session){ output$mtcars <- dt::renderdatatable({ mtcars$gear <- factor(as.character(mtcars$gear)) datatable( data = mtcars, filter = "top", options = list( pagelength = 50 ) ) }) }) ) notice in example, when manually select "3" under gear column, little gray box appears let's know "3" selected. then, when out of filter selection, there little x in circle lets clear filter. example 2 in example, i've preloaded "3" filter when datat...

ssis - execute sql task error -

an execute sql task has been defined below.the parameter mapping system:username input varchar 0 -1 system:packagename input varchar 1 -1 declare @dataloaderusername varchar(100) declare @packagename varchar(100) declare @code varchar(5) declare @runnumber int set @dataloaderusername = ? set @packagename = ? set @code = 'bbb' insert tbl_log (loaddatetime,dataloaderusername,packagename,code) select getdate(),@dataloaderusername,@packagename ,@code select @runnumber = max(runnumber) tbl_log select @runnumber loadid it shows error execute sql task] error: executing query "declare @dataloaderusername varchar(100) the same query executed in ssms , works fine(with hardcoded username) put semi-colons @ end of each sql command. when ssis sends command sql server, sends single line, semi-colons needed show sql server each new command begins.

angularjs, spring boot, apache poi, can't generate excel document -

i'm trying generate excel document. i'm using apache poi version 3.14 my controller: @restcontroller @requestmapping("/excel") public class excelrest { @autowired private profildao profildao; @requestmapping(value = "/get", method = requestmethod.get) public modelandview getexcel(httpservletrequest request, httpservletresponse response) throws exception{ response.setheader("content-disposition", "attachment; filename=testexcel.xls"); response.setcontenttype("application/vnd.ms-excel"); // list of profil. list<profil> profils = profildao.findall(); return new modelandview(new excelprofilsbuilder(), "profils", profils); } } my modelview : public class excelprofilsbuilder extends abstractxlsview { @override protected void buildexceldocument( map<string, object> model, workbook workbook, httpservle...

matlab - extract elements between two number from a matrix/vector -

for example, have 4x4 matrix = [1, 2, 3, 4; 2, 1, 4, 3; 1, 2, 4, 3; 4, 1, 2, 3;]; for each row, want extract elements between 1 , 3 (assume matrix has elements between 1 , 3, , 1 comes before 3). example, return cell [{2}, {4}, {2,4}, {2}], or better matrix b= [0, 1, 0, 0; 0, 0, 0, 1; 0, 1, 0, 1; 0, 1, 0, 0;]; now doing loop each row, find index of 1 , 3, set index between them zero, i.e., b = zeros(4,4); = 1 : size(a,1) ind1 = find(a(i,:) ==1); ind2 = find(a(i,:) ==3); b(i, a(i,ind1+1:ind2-1) ) = 1; end any easier way generate matrix b or cell? suggestion appreciated. okay, might not easier solution, remove loop, should computationally faster: the idea instead of trying find numbers between 1 , 3 , set them 1, going find numbers outside 1 , 3 , set 0: b=zeros(4,4); b(a == 1) = 1; b(a == 3) = 1; c = cumsum(b...

django - Page not found (404) Request Method: GET Request URL: http://127.0.0.1:8000/ -

i following django documentation , making simple poll app. have come across following error : using urlconf defined in mysite.urls, django tried these url patterns, in order: ^polls/ ^admin/ current url, , didn't match of these." settings.py root_urlconf = 'mysite.urls' mysite/mysite/urls.py from django.conf.urls import include,url django.contrib import admin urlpatterns = [ url(r'^polls/',include('polls.urls')), url(r'^admin/', admin.site.urls),] mysite/polls/urls.py from django.conf.urls import url . import views app_name= 'polls' urlpatterns=[ url(r'^$',views.indexview.as_view(),name='index'), url(r'^(?p<pk>[0-9]+)/$',views.detailview.as_view(), name='detail'), url(r'^(?p<pk>[0-9]+)/results/$',views.resultsview.as_view(),name='results'), url(r'^(?p<question_id>[0-9]+)/vote/$',views.vote,name='vote'...

Convert from encoded unicode String into Java String -

i have string in json data looks this: #0023sat apr 30 10:46:11 utc 2016#000a[interoperability]interoperability#005c index=unknown (r03)#000a[exif]shutter#005c speed#005c value=1/1999 sec#000a[exif]bits#005c per#005c sample=8 8 8 bits/component/pixel#000a[exif]exposure#005c bias#005c value=0 ev#000a[exif]sub-sec#005c time#005c original=00#000a all #xxxx words unicode. how convert java string? pattern p = pattern.compile("#([0-9a-fa-f]{4})"); matcher m = p.matcher(s); stringbuffer sb = new stringbuffer(); while (m.find()) { int c = integer.parseint(m.group(1), 16); m.appendreplacement(sb, string.valueof((char) c)); } m.appendtail(sb); return sb.tostring(); this assumes #xxxx encodes utf-16 unicode code point. unicode code points supercede 16 bit range of #xxxx.

hibernate - Oracle 11g What is recommended charset for international appliaction -

what nls_nchar_characterset , nls_characterset should use? use varchar2 store text. want support chinese , other characters. application writen in java , hibernate. should use al32utf8 both? there issues using utf16 instead of utf8? utf-16: each character either 2 or 4 bytes long. utf-8: each character takes 1 4 bytes store. usually use foreign languages (russian , turkish, arabic..) utf8 , , have never had problem in documentation. the benefits of utf-16 on utf-8 follows: more compact storage asian scripts because of commonly used asian characters represented in 2 bytes. better compatibility java , microsoft clients utf-16 encoding 16-bit encoding of unicode. extension of ucs-2 utf-8 8-bit encoding of unicode. variable-width encoding , strict superset of ascii. read more in oracle supporting multilingual databases unicode , choosing character set maybe contains information might

ios - Will optional values be de-initialized automatically? -

i new swift, please ignore if asking dumb questions ;) is required explicitly set optional values nil, if not needed more? how weak, strong reference works in swift? if normal variables has de-initialized manually? since there no way assign nil normal variables in swift, please let me know how it. difference between? var somevar:string? vs var somevar:string! i see difference in accessing them. first prints values within optional , second doesn't , second throws exception when value nil. difference? is required explicitly set optional values nil no, automatic reference counting frees memory automatically. unless there circular reference, e.g., there strong reference classa in classb , vice-versa. also, automatic reference counting applies instances of classes , not value types ( string , int , enum , etc). memory of these value types freed when parent instances deinitialized. is difference? var somevar:string! creates implicitly unwrapped option...

windows - Get a list of IN persons -

i have file have many lines , want able, in batch file, echo lines of persons in now... my text file : ledee in 2016-07-11 07:49:59 stephan in 2016-07-11 07:56:14 nadiab in 2016-07-11 07:58:30 angee in 2016-07-11 07:58:59 stephan out 2016-07-11 08:05:25 stephan in 2016-07-11 08:05:29 angee out 2016-07-11 08:06:05 angee in 2016-07-11 08:06:11 angee out 2016-07-11 08:16:11 john in 2016-07-11 08:44:42 ...

doctrine2 - Doctrine dql with left join using the same table -

i trying transform following query dql: select cm.* conversation__conversation cc inner join conversation__message cm on cm.conversation_id = cc.id inner join vehicle__vehicle vv on vv.id = cc.vehicle_id (cc.driver_id = 25 or vv.owner_id = 25) , cm.id in (select m1.id conversation__message m1 left join conversation__message m2 on m1.conversation_id = m2.conversation_id , m1.id < m2.id m2.id null) order cm.created_at desc; i see 2 main difficulties in query. first 1 have subselect, check how in dql difficult part make left join using same table. cannot make work... knows how it?

c++ - Point cloud ICP aligmnet -

i have 2 point clouds want match. after alignment, input cloud, not merged 2 point clouds. problem ? i have updated code , still doesnt align @ pcl::pcdreader reader; pcl::passthrough<pcl::pointxyz> pass; pcl::normalestimation<pcl::pointxyz, pcl::normal> ne; pcl::sacsegmentationfromnormals<pcl::pointxyz, pcl::normal> seg; pcl::pcdwriter writer; pcl::extractindices<pcl::pointxyz> extract; pcl::extractindices<pcl::normal> extract_normals; pcl::search::kdtree<pcl::pointxyz>::ptr tree (new pcl::search::kdtree<pcl::pointxyz> ()); // datasets pcl::pointcloud<pcl::pointxyz>::ptr input_cloud (new pcl::pointcloud<pcl::pointxyz>); pcl::pointcloud<pcl::pointxyz>::ptr cloud_filtered (new pcl::pointcloud<pcl::pointxyz>), cloud_projected(new pcl::pointcloud<pcl::pointxyz>); pcl::pointcloud<pcl::normal>::ptr cloud_normals (new pcl::pointcloud<pcl::normal...

multithreading - Unable to get any speedup by making the huffman's algorithm parallel -

i trying implement huffman'a compression algorithm. right working on part of algorithm builds sequence table. idea count down number of times each letter occurs within text. text in case represented string read file. trying make counting of letters parallel. give each thread equal number of letters. unfortunately don't speedup. don't know might reason. use pthread_spinlock should no issue using since array small. see: #include <string> #include <streambuf> #include <vector> #include <pthread.h> #include <stdio.h> #include <iostream> #include <string.h> #include <stdlib.h> #include <fstream> #include <memory> #include <errno.h> #include <time.h> using namespace std; void parse_arguments(int argc, char* const* const argv, bool& random_edges, int& vertex_count, int& threads_count, char* &input_file, char* &output_file, bool& enable_logging); pthread_t * threads; bool* us...

ios - White Space from top -

Image
i have added storyboard project. these settings of project, have attached reference. i have googled , search on stackoverflow community well, unable remove white space before title.please refer below screen. thanks guidance edit 1 how want how getting after following j.hunter's answer edit 2 i created project , try duplicate issue via add navigation bar view controller in storyboard. may note add leading, trailing , top constraints title . want know kind of constraints had added title . constraints edit: implement in new storyboard snapshot