Posts

php - about regex, you find {else} and allow nested -

i created pattern: {if ([^}]*)}((?:[\w\s]+[^}]*)){\/if} but have done long time ago now, pattern is, example: {if $module=admin} {/if} but want find: {if $module=admin} {else} {/if} as far possible find both same pattern. any ideas? thank :) /{if ([^}]+)}([\w\w]*?)(?:{else}([\w\w]*?))?{\/if}/g {if literal text. ([^}]+) if condition : 1 or more non-closing-curly-brace ( } ) characters, captured. } literal text. ([\w\w]*?) inside if : 0 or more characters. match until next part found. (very inefficient; can rewrite make more performant.) (?:{else}([\w\w]*?))? optional group. {else} else : literal text. ([\w\w]*?) inside else : 0 or more characters. match until next part found. (very inefficient; can rewrite make more performant.) {\/if} closing : literal text.

gradle - Thymeleaf views not found with springboot -

Image
i trying follow tutorial adding thymeleaf springboot app can't seem work. tutorial: http://spr.com/part-2-adding-views-using-thymeleaf-and-jsp-if-you-want/ i able springboot work fine when started app using @restcontroller in logincontroller when changed @restcontroller @controller i'm getting error page saying: there unexpected error (type=not found, status=404). no message available i set breakpoint in controller , confirmed hitting index method in logincontroller. feel has how i've added thymeleaf since haven't done else application i've tried far results in same error page. my build.gradle buildscript { repositories { maven { url "http://repo.spring.io/libs-snapshot" } mavenlocal() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:1.4.0.release") } } apply plugin: 'java' apply plugin: 'eclipse' apply plugin: 'idea' apply plugin: 'spring-boot' jar { bas...

ms access - Show all records in a list box -

i'm making database records teachers , students , when scheduled have lessons. have list box taking data query being filtered combo box taking data table. the filter working there no way display records query. is there way add option combo box pull records query through list box instead of filtered few? ps. preferably using embedded macros, vb if necessary the row source of combo box ('teachers' table): select [teachers].[teacherid], [teachers].[forename], [teachers].[surname] teachers order [surname], [forename], [teacherid]; the row source of list box ('todaylessons' query, 'teacherid' using criteria of combo box on form): select [todaylessons].[lessonid], [todaylessons].[slotid], [todaylessons].[lesson date], [todaylessons].[lesson time], [todaylessons].[teacherid], [todaylessons].[studentid] todaylessons order [lesson date], [lesson time], [teacherid]; row source causing problem (i've tried adding 'from teacher...

if statement - Swift - How to check to see if sprite is assigned to certain image -

currently, in code, have skspritenode named ball randomly changes texture when makes contact anything. there 4 different textures/images each different colored ball. want use if else statement check see if ball equal specific texture can action. i have code far, not check texture of ball sprite func didbegincontact(contact: skphysicscontact) { if ball.texture == sktexture(imagenamed: "ball2") && platform3.position.y <= 15 { print("color matching") } else { print("not matching") } } the if platform3.position.y <= 25 part works, ball.texture part of code not check see texture ball has. set user data when assign color ball. ball.userdata = ["color": 1] // later can check if (ball.userdata["color"] == 1) { that proper way do. comparing integer faster.

orientdb2.2 - Performance tuning for loading Gigabytes of data in OrientDB -

i used etl tool insert bunch of csv data orientdb. system configuration used trial purpose ec2 m3 large ( 7.5 gib of memory, 2 vcpus, 32 gb of ssd-based local instance storage, 64-bit platform ). the data(masked) i'm trying upload of below format : "101.186.130.130","527225725","233 djfnsdkj","0.119836317542" "125.143.534.148","112212983","1227 sdfsdfds","0.0465215171983" "103.149.957.752","112364761","1121 sdfsdfds","0.0938863016658" "103.190.245.128","785804692","6138 sdfsdfsd","0.117767539364" the schema contains 2 node classes , 1 edge class. when tried loading data using etl tool in plocal option speed 2300 rows / second. etl configuration mentioned below : { "source": { "file": { "path": "/home/ubuntu/labvolume1/orientdb/bin/0001_part_00" } }, "extractor...

twitter bootstrap - Image is not passing in carousel in yii2 -

Image
i'm using pretty url. slider working fine can see imgage not sliding. i'm not sure if it's due prettyurl or i've missed source of images - c:\xampp\htdocs\amitopticals\frontend\images. code of index file - <?php /* @var $this yii\web\view */ $this->title = 'amit opticals'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="site-index"> <div class="body-content"> <div id="mycarousel" class="carousel slide" data-ride="carousel"> <!-- indicators --> <ol class="carousel-indicators"> <li data-target="#mycarousel" data-slide-to="0" class="active"></li> <li data-target="#mycarousel" data-slide-to="1"></li> <li data-target="#mycarousel" data-slide-to="2"></li> <li data-target=...

unix - Why wont the plus work properly with this sed command? -

i can't ([^/]+) sed regex work properly. instead of returning non-forward slash characters, returns one. command: echo '/test/path/file.log' | sed -r 's|^.*([^/]+)/(.*)$|\1.\2|g' expected: path.file.log result: h.file.log also tried got same result: echo '/test/path/file.log' | sed -r 's|^.*([^/]{1,})/(.*)$|\1.\2|g' the problem not [^/]+ , preceding .* . .* greedy, , consume maximal amount of input. usual suggestion use .*? make non-greedy, posix regexes don't support syntax. if there slash, add 1 regex stop consuming much. $ echo '/test/path/file.log' | sed -r 's|^.*/([^/]+)/(.*)$|\1.\2|g' path.file.log