Posts

Showing posts from July, 2015

Dailymotion js api cannot play de video into the apiready event [resolved] -

just trying play video after apiready event. code: var player = dm.player("dm-player", {video: somevalidid }); player.addeventlistener("apiready", function(e) { e.target.play(); }); the video player load, not start reproduce it i found problem. autoplay needs set in params object player = dm.player("player", { video: videoid, width: "800", height: "450", params: { autoplay: 1, } });

dependency injection - Cannot get a working Unity Session Lifetime Manager, ASP.NET MVC5 -

i've read , googled on this, can't seem work. created custom lifetimemanager unity in mvc5 application based on these posts: mvc3 unity framework , per session lifetime manager this may issue experiencing here sessionlifetimemanager public class sessionlifetimemanager : lifetimemanager { private string key = guid.newguid().tostring(); public override object getvalue() { return httpcontext.current.session[key]; } public override void removevalue() { httpcontext.current.session.remove(key); } public override void setvalue(object newvalue) { httpcontext.current.session[key] = newvalue; } } i have few types i'm playing with, here relevant registrations in unityconfig.cs : container.registertype<iepisession, episession>(new sessionlifetimemanager(), new injectionconstructor(config.appserveruri, config.pathtosysconfig)); container.registertype<ireportrepository, epicorreportreposit

c# - ODATA Separating the SERVICE from the DATA -

i have app 3 layers: a) service exposing web api odata b) business layer business logic , data access c) model if use odata queries directly in service, accessing db context, works ok, issues is....how can achieve same, adding 1 layer in middle? myservice web api 2 [enablequery] public iqueryable<individual> getindividuals() { individualbo bo = new individualbo(); return bo.getallindividuals(); } my business layer public iqueryable<individual> getallindividuals() { using (mycontext context = new mycontext()) { return context.individuals; } } this not working......however if remove bo equation, works fine....any ideas?

ios - Get "me" favorites JSON responses used soundcloud/CocoaSoundCloudAPI -

i using soundcloud/cocoasoundcloudapi implement app with. https://github.com/soundcloud/cocoasoundcloudapi what want fetch favourites login user means say: http://api.soundcloud.com/me/favorites.json but not them. know way fetch them: users/{id}/favorites if taking api, don't know how id of login user. any tips appreciate! cheers,

android - How to implement tabs on top along with side menu -

Image
i using ionic framework. need sliding tabs , side menu any idea ? how achieve uisng ionic framework? i tried ionic tabs . showing in footer there no menu icon thanks if want implement ionic side menus tabs have work little bit configuration routing system. first of need have abstract state menu: .state('app', { url: "/app", abstract: true, templateurl: "menu.html", }) then need add states main tab (container) , each single tab: .state('app.tabs', { url: "/tabs", views: { 'menucontent': { templateurl: "tabs.html", } } }) .state('app.tabs.articles', { url: "/articles", views: { 'articles-tab': { templateurl: "articles.html", controller: 'articlesctrl' } } }) .state('app.tabs.colonies', { url: "/colonies", views: { 'co

How can I create labels for given input ID in MS Access -

i'm working on northwind db, have problem in ms access. i want create labels dbo_products fields. till creating labels fine but, if user gives input ("ex. need labels products id's in between 10 - 30") output should display labels 10 till 30. how can operation ? it should give outcome of specific labels given user. want connect data entry form report such if user clicks button inserting id values labels in between specified id's should appear. thank you. appreciated. set filter property of report "id between 10 , 30".

c++ - boost::spirit::qi difference parser behavior -

i'm trying understand behavior of qi's difference parsers . with this: rulea = ruleaa | ruleab | ruleac ; ruleb = rulea - ruleac ; i imagining parser match ruleb iff input matches ruleaa or ruleab. in other words, ruleb subtract 1 alternative (ruleac) rulea. incorrect? in code, i'm doing above , compiles not seem behave expected. actual use-case involves other factors hard unwind here. in essence, i'm trying this: have rule rulea, contains set of alternatives. rule gets used in few different places in grammar. in 1 particular use, need avoid evoking 1 of alternatives. seems difference parser intended purpose, maybe i'm misunderstanding? thanks in advance! i imagining parser match ruleb iff input matches ruleaa or ruleab. in other words, ruleb subtract 1 alternative (ruleac) rulea. incorrect? (a|b|c) - c equivalent (a|b) iff c never matches (a|b) match. a simple example, assume: a = int_; b = +space; c = char_; because c

Python 2.5 Tkinter Highlight Spinbox Entry -

this question seems trivial me can't seem find related it, , spinbox docs don't seem help. is there way select of text in spinbox widget? i'm trying: self.spinbox.selection_clear() self.spinbox.selection('range', 0, end) to no avail. i have bound mouse-click on spinbox. first time click on it, entry text highlighted, , subsequent times not, unless boolean variable has been reset. i've had no problem doing entry widgets, spinbox seems give me trouble. using function wrong? from experimentation, think spinbox needs explicitly have focus in order selection anything. try: self.spinbox.selection_clear() self.spinbox.focus_set() self.spinbox.selection('range', 0, end)

android - Standard ActionBar icon without default left-margin / padding -

Image
with holo theme api level > 14 retrieve kown left margin icon in actionbar follows: <style name="appbasetheme" parent="@android:style/theme.holo"> when applying material-theme appcompat_v7 support (not changing code or using preferred new toolbar instead) left margin missing. <style name="appbasetheme" parent="@style/themeoverlay.appcompat.dark.actionbar"> why , how fix ? as first workaround added layer list drawable resource named icon.xml res/drawable/ this: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/ic_launcher" android:left="20dp"/> </layer-list> and referenced drawable logo instead of original icon in androidmanifest.xml : <activity android:logo="@drawable/icon"

How can I pass the model in jquery as a JSON variable? -

on mvc/razor page, have view model 1 element list of model. list written view using partial view. if list has 3 elements, there 3 rows on view. want send value of entire list using json can carry out calculations. how can pass values of model or elements in list part of model controller using json? so page looks this: ------------------------- | | | | id | | price | | | | id | | price | | | | id | | price | | | | ------------------------- i want send every id , price (a variable number of rows) controller using json perform calculations. this: $("#btncreatecontract").click(function () { var url = '/createcontract/checksalesslips'; $.getjson( url , { cashprice: $("#txtcashdownpayment_rev").val() , salesslip: model } , function (response) { status = response.status; } ); retur

php - morquee scroling left (fething from deta) , scroll one by one but all images scroll -

i adding images data in marquee wen direction works fine when direction left images collectively goes right left. need 1 one scroll. <div id="right"> <td height="auto" align="center" bgcolor="#ffffff" class="index-unwel" > <marquee direction="left" scrollamount="2" height="250" onmouseover="this.stop();" onmouseout="this.start();"> <div align="left" style="width:100% ;"> <span style="text-transform:uppercase;"> <? $qryadv = mysql_query("select * ".videonews." 1"); if(mysql_num_rows($qryadv) > 0) { while($adv = mysql_fetch_assoc($qryadv)) { ?> <a href="<?=$adv['adv_url']?>" target="_blank"&g

ios - Resize subviews on animated frame change (autoresizing mask)? -

i know works if change view's frame via changing of layer's transform (in case takes view subviews , works if single image). not enough me use because: it hard calculate appropriate position; i use hmlauncherview has logic based on frames not transforms. i tried lot of ways described here seems autolayout because none of them works. depending on type of autoresizing mask elements jump destination position , of them not affected @ or affected via strange ways. how solve such issue? there ways solve via autoresizing mask? edited animation code (the same result setting of center/bounds): [uiview animatewithduration:0.3 animations:^{ lastlaunchericon.layer.transform = catransform3didentity; cgrect r = self.bounds; r.origin.y = max(0, min(self.scrollview.contentoffset.y, self.scrollview.contentsize.height - self.bounds.size.height)); launchericon.frame = r; } completion:^(bool finished)

c - accessing xtime variable Linux kernel -

i implementing system call return current time of day (for learning purpose). have looked @ implementations of gettimeofday() on linux 3.19.2 books checked got current time of day (the wall time) defined in kernel/time/timekeeping.c: struct timespec xtime; [linux kernel development rober love] however couldn't able xtime variable definition in file. where xtime variable declared in linux kernel , how can access module or function? what headers should include? that reference obsolete. recent kernels no longer have xtime . though there still fields in kernel timekeeping structure prefix of xtime_ assume descended it. see, example, struct timekeeper in include/linux/timekeeper_internal.h . you want stick more stable functions defined in include/linux/timekeeping.h

javascript - Date.toString() not converting hours to proper timezone in Firefox -

i have html rendered django template formats timestamp in iso 8601 format, e.g: <span class="my-date">2015-06-04t13:00:00</span> i using javascript convert timestamp user's local timezone: $(document).ready(function(){ $('.my-date').each( function(){ var tz_date = new date( $(this).text() ); $(this).text( tz_date.tostring() ); }); }); this works fine in chrome (e.g, results in thu jun 04 2015 09:00:00 gmt-0400 (edt) ), i'm having issue in firefox, showing thu jun 04 2015 13:00:00 gmt-0400 (edt) . seems firefox correctly appending user's timezone, not adjusting hours. i wanted check here if there's poor assumption i'm making in code, or if bug in firefox. jsfiddle rather use iso 8601 timestamps, can use rfc 2822 timestamps. both django , javascript's date.parse() compatible this, , both chrome's , firefox's implementation work same way it. the change needs made in django template render

How to run a Java applet in Apache Wicket 6.5? -

i trying run applet in web application using apache wicket. put myapplet.jar , html page in same directory got error when deploying page: nullpointerexception : error occurred while running application any please ?? how can track down point error happens, or else can try? thanks in advance. my html page is <html xmlns:wicket="http://wicket.apache.org/"> <body> <wicket:extend> <div class="intro-lead-in">signing documents</div> <applet code=wct.applet.welcome.class archive="myapplet3.jar" codebase="http://localhost:8080/wicketspringdemo" width=550 height=300> </applet> </wicket:extend> </body> i have experience serving applets wicket. can nasty, because there many things need setup correctly. to tackle kind of problem: read , try understand stacktrace check if applet works in applet-viewer (without em

Phantomjs fails when Protractor is run with selenium hub -

i have protractor config file follows , use phantomjs run tests. works when use seleniumserverjar fails when use seleniumaddress (pointing hub) 'the driver executable not exist' message! there specific config run phantomjs selenium-hub? exports.config = { //fails when use //seleniumaddress:"http://selenium-hub.com:4659/wd/hub", //works when use selenium-standalone jar seleniumserverjar: '../../../node_modules/protractor/selenium/selenium-server-standalone-2.45.0.jar', framework: 'cucumber', specs: [ 'features/*.feature' ], capabilities: { "browsername": "phantomjs", "phantomjs.binary.path": require("phantomjs").path, "phantomjs.ghostdriver.cli.args": ["--loglevel=debug"] }, baseurl: '', rootelement: 'body', resultjsonoutputfile: 'src/test/report.json', cucumberopts: { require: 'features/s

go - How to print contents of channel without changing it -

i'm writing program in go language, , have simple problem: i have goroutines in program , channels goroutines use communicate. time time check inside channels. how achieve without interrupting goroutines' work? channels have function print contents? or should somehow copy them? var shelf chan int = make(chan int, 5) go depot(shelf) go shop(shelf) var input string fmt.scanln(&input) if (input == "print") { //here print on shelf } how achieve without interrupting goroutines' work? the simple answer can't, without interrupting. channels synchronization primitive, meaning enables concurrent programs communicate safely. if take out of channel, "taking out" happens atomically, nobody else can take same item out of same channel. , that's intended. what can take items out , put them after printing them. problem approach elements might never printed while others may printed more once goroutines involved race grab items ch

eclipse c/c++ not compiling source code in sub folders -

using eclipse ide c/c++ developers (see details below) try reorganize code in sub folders. however, if move source code file existing sub folder new sub folder, not being compiled. added new sub folder paths , symbols->source locations (and include) , , didn't help. project based on hello_world example https://github.com/cherts/esp8266-devkit.git , compiles it's own sub folder (user) not mine :-( release 1 (4.4.1) build id: 20140925-1800 eclipse c/c++ development tools version: 8.5.0.201409172108 if open makefile you'll finde lines: # modules (subdirectories) of project include in compiling modules = driver user it looks can add sub-folders there.

linux - Puppet pass SSH keys to VM for us in Git -

i'm using vagrant provision vm onto digitalocean using config puphpet. need clone private git repo. i've created ssh key used authenticate request using puppet vcsrepo module seems ssh key isn't being picked properly. i've set vagrant config.ssh.forward_agent true , config.ssh.private_key_path points local rsa file on mac. used digitalocean key. i can see key in ~/.ssh/authorized_keys on vm. the git clone fails if it's private repo. tried public repo , successful. here puppet vcsrepo command: vcsrepo { '/var/www/html': ensure => present, provider => git, source => 'https://******@bitbucket.org/****.git', require => '~/.ssh/authorized_keys', } this gives error no title provided , "~/.ssh/authorized_keys" not valid resource reference @ /tmp/vagrant-puppet/manifests-893fcd i tried identity property: vcsrepo { '/var/www/html': ensure => present, provider => git, so

javascript - How to concatenate files which are in <!-- build:js -->? -

i have multiple html files in have usemin comment this: html 1 <!-- build:js scripts/vendor1.js --> <script src="scripts/script1.js"></script> <script src="scripts/script2.js"></script> <!-- endbuild --> html 2 <!-- build:js scripts/vendor2.js --> <script src="scripts/script1.js"></script> <script src="scripts/script2.js"></script> <!-- endbuild --> html 3 <!-- build:js scripts/vendor3.js --> <script src="scripts/script1.js"></script> <script src="scripts/script2.js"></script> <!-- endbuild --> how concatenate files between build:js via gruntfile? , create vendor1.js, vendor2.js , vendor3.js thanks in advance help.

Qt Creator. Qt Quick Application screen doesn't show up on my Android device -

i'm new qt creator , i'm attempting create simple application. far it's basic main screen. have written qml code, , tried run on oneplus 1 android phone. have necessary components in order run program on phone, qt examples have worked fine. the application builds , installs on device, resolves in blank black screen, nothing on it. have tried 2 hours different possible solutions, nothing has worked. can point me in right direction, please? my qml code (the pictures correctly added directory), else unaltered: import qtquick 2.3 import qtquick.window 2.2 import qtquick.controls 1.3 window { id: applicationwindow1 visible: true width: 360 height: 360 color: "#343434" image { id: cammbutticon x: 208 y: 169 width: 150 height: 150 opacity: 1 fillmode: image.preserveaspectfit anchors.verticalcenter: parent.verticalcenter anchors.horizontalcenter: parent.horizontalc

java - JSONArray Parsing error -

i need parsing json array. [ { "header1": [ { "path": "upload/images/1430572021716.jpg" }, { "path": "upload/images/1430574003703.jpg" } ] }, { "header2": [ { "path": "upload/images/1430574124119.jpg" }, { "path": "upload/images/1430574203001.jpg" } ] } ] i receiving above jsonarray perfectly. want iterate through array , extract both header text "header1" , value of path i keep running following error message at 0 of type org.json.jsonarray cannot converted jsonobject after research, due system not being able parse json array. work if change "list" array objct, not array , loose ability iterate through it. here code tried parse array with js

c# - Unexpected "," from StreamReader to StreamWriter -

i've tried lot of things research , asking friends, can't seem write second line without "," replacing line. i'd have single line each item read in separate file. each read file has several of these items: 2/20/2014 7:33:10 operator: jason file: c:\ax14\setups\000062363106rh.prt units: english test result: pass channel 1 test type: velocity result: pass upper limit: 0.2260 lower limit: 0.2220 max thickness: 2.0110 min thickness: 1.0110 measured velocity: 0.2225 measured thickness: 1.5215 id have date , velocity line in 1 line this: "2/20/2014 7:33:10 am, measured velocity: 0.2225" and problem 2/20/2014 7:33:10 am, , , , , , , , , , , , , measured velocity: 0.2225 , 2/20/2014 7:52:28 am, , , , , , , , , , , , , measured velocity: 0.2224 , 2/20/2014 7:58:46 am, using system; using system.collections.generic; using system.text; using system.io; using system.collec

mysql - fill in data and missing dates -

i trying use sql take current query results: +------------+------------+------------+ | store_num | price | date_chng | +------------+------------+------------+ | 100 | 1.50 | 2014-05-01 | | 100 | 1.52 | 2014-05-03 | | 100 | 1.48 | 2014-05-05 | | 100 | 1.51 | 2014-05-10 | +------------+------------+------------+ and them more this, missing dates added, value of price filled in well: +------------+------------+------------+ | store_num | price | date_chng | +------------+------------+------------+ | 100 | 1.50 | 2014-05-01 | | 100 | 1.50 | 2014-05-02 | | 100 | 1.52 | 2014-05-03 | | 100 | 1.52 | 2014-05-04 | | 100 | 1.48 | 2014-05-05 | | 100 | 1.48 | 2014-05-06 | | 100 | 1.48 | 2014-05-07 | | 100 | 1.48 | 2014-05-08 | | 100 | 1.48 | 2014-05-09 | | 100 | 1.51 | 2014-05-10 | +---------

Docker inspect format retrieve port mapping -

i'd retrieve port mapped container using docker inspect, found that: docker inspect --format=" {{ .networksettings.ports }} " containerid output: map[1234/tcp:[map[hostip:0.0.0.0 hostport:49159]] 3306/tcp:<nil> 4444/tcp:<nil> 4567/tcp:<nil> 4568/tcp:<nil>] but i'd have output this: 1234/tcp:49159 is possible ? see answer how env variable when doing docker inspect guess can adapt , directly want

excel - Macro not executed after aborting execution -

i unable code macros because after execution macro not triggered again. use worksheet_change function, haven't had problem before. have tried macro on mac on excel 2011 , on pc on excel 2013 every time same result. not able code because have reopen excel file again make macro execute again. have developed macros quite time , never had problem before, maybe configuration thing? private sub worksheet_change(byval target range) msgbox "test" 'do

php - after signing up it still shows sign up -

i have code : if(!isset($_session['email']) && empty($_session['email'])) { ?> <a class="more float_l" href="signup.php">sign up/login</a> <?php } else { ?> <a class="more float_l" href="post/logout.php">logout</a> <?php } ?> now working correctly when user not logged in displays sign or login , when user login redirect home.php , displays logout button problem when signup , redirect home.php still displays sign or login, please me solve problem. some possibilities of may have gone wrong, ignoring the fact didn't provide login script: the login script did not set $_session['email'] correctly or left empty; or you miss session_start(); in login script and/or in one. i have edited script bit, may work better: <?php session_start(); if(isset($_session['email']) && !empty($_session['email'])): ?> <a class=&

Whats the best way to remove print brackets from a python list? -

the function below inserts list list @ specified location. what's best way remove middle brackets output while leaving outer brackets on? def insert(list1, list2, index): pos = 0 new_list = [] if index > len(list1): index = len(list1) elif index < 0: index = 0 pos in range(0, index): new_list.append(list1[pos]) #for pos in range(1): new_list.append(list2) while index != len(list1): new_list.append(list1[index]) index += 1 return new_list list1 = ["b", "o", "o", "m"] list2 = ["r", "e", "d"] index = 2 new_list = insert(list1, list2, index) print(new_list) output: ['b', 'o', ['r', 'e', 'd'], 'o', 'm'] you can use list slicing desired results: list1 = ["b", "o", "o", "m"] list2 = ["r", "e",

javascript - How do I find the fonts that are not loading in a CORS situation ( MoovWeb )? -

i in situation work on proxied websites on moovweb platform . fonts don't want load on proxy because of cors issues. know how these fonts load, need know which fonts not loading. console gives me error font origin ' https://www.example.com ' has been blocked loading cross-origin resource sharing policy: no 'access-control-allow-origin' header present on requested resource. origin 'cross-origin-example.com' therefore not allowed access. i looked @ networks panel, , see under "fonts" section 4 fonts status of 200. there other ways of knowing font console talking about? appreciated, thank you. alternatively use moovweb sdk logger see messages. http://developer.moovweb.com/docs/local/debugging this 'browser-free' alternative. juan

c# - Xamarin IMobileServiceTable Not Filtering -

i'm using imobileservicetable in data access layer class , bind listview. initial loading works fine filtering doesn't. returns initial loaded data. public class itemsmanager { imobileservicetable<item> itemtable; public itemsmanager (imobileservicetable<item> todotable) { this.itemtable = todotable; } public async task<list<item>> gettasksasync (string searchstring) { //following doesn't work var list = new list<item> (await itemtable.where(x => x.itemid.contains(searchstring)).tolistasync()); return list; } public async task<list<item>> gettasksasync () { return new list<item> (await itemtable.orderby(a =>a.itemid).tolistasync()); } } if matter, following page code : public partial class itemslistxaml : contentpage { imobileservicetable<item> itemtable; itemsmanager itemmanager; public itemslistxaml

Problems with automate Gradle Android Project and Crashlytics + Fabric.io in IntelliJ -

Image
i have project imported intellij, after cloned git computer. works fine build, run , etc., i'm trying add crashlytics in project using fabric plugin intellij. plugin works fine, library wasn't imported, resulting in problem: my problem is: need import crashlytics + fabric library, when tried add maven library dependency, received message nothing found, when thought in add dependency in build.gradle, project don't have build.gradle, when tried create build.gradle, problem wasn't solved , nothing happened... can me?

config - What does SGE mean by "positive submission priority requires operator privileges"? -

i relatively new sge , encountering error when try run jobs: "system error message: unable run job: job rejected: positive submission priority requires operator privileges." i have added several users, created access list (users) , added them it, set user_lists = users in main queue. do users each need added operators list well? why this? as error message implies, priority of jobs submitting, , value illegal? priority of jobs regular users cannot positive: -p priority available qsub, qsh, qrsh, qlogin , qalter only. defines or redefines priority of job relative other jobs. prior- ity integer in range -1023 1024. default priority value jobs 0. users may decrease priority of jobs. grid engine managers , administrators may increase priority associated jobs. if pending job has higher priority, earlier eligible being dispatched grid engin

python - sort 3D array by the sum of the second value -

i'm trying sort 3d array , having little success. have read various methods on how done 2 dimensions, can't seem scale up. i have array like: [[[0, 25], [1, 20], [2, 80], [0, 0], [0, 0], [0, 0]], [[0, 80], [0, 20], [1, 25], [1, 40], [2, 99], [0, 0]], [[0, 99], [1, 40], [2, 80], [0, 0], [0, 0], [0, 0]]] i want sorted sum of second value. criteria use order sum of second value. e.g: 25+20+80 = 125 80+20+25+40+99 = 264 99+40+80 = 219 so: [[[0, 80], [0, 20], [1, 25], [1, 40], [2, 99], [0, 0]], [[0, 99], [1, 40], [2, 80], [0, 0], [0, 0], [0, 0]]], [[0, 25], [1, 20], [2, 80], [0, 0], [0, 0], [0, 0]]] could me ? i think understand need. suppose array stored in a . >>> out[19]: array([[[ 0, 25], [ 1, 20], [ 2, 80], [ 0, 0], [ 0, 0], [ 0, 0]], [[ 0, 80], [ 0, 20], [ 1, 25], [ 1, 40], [ 2, 99], [ 0, 0]], [[ 0, 99], [ 1, 40],

networking - Adding and removing stations in 802.3 vs 802.4 vs 802.5 -

good day everyone. i've been searching information on how process of adding , removing stations occurs in different network standards, found scarce informations 802.4 standard. know using logical ring think makes medium access similar 802.5, adding , removing stations take place in same manner ? , ethernet ?

vbscript - Exception to overwrite -

i have vbscript - if run not want repeating words replacing. there if statement can add stop doing this? option explicit const forreading = 1 const forwriting = 2 dim objfso,objfile,strtext,strnewtext set objfso = createobject("scripting.filesystemobject") set objfile = objfso.opentextfile("c:\users\newtons\desktop\text.txt",forreading) strtext = objfile.readall objfile.close strnewtext = replace(strtext, "<jim","<!--<jim") '<pseudocode> if "<!--<jim" = exist nothing end if '</pseudocode> set objfile = objfso.opentextfile("c:\users\newtons\desktop\text.txt",forwriting) objfile.writeline strnewtext objfile.close set objfso = nothing set objfile = replace <jim <!--jim instead of <!--<jim avoid repeated replacements (i.e. make sure search string isn't substring of replacement string).

c++ - How to parse DXF hatch by means of dxflib -

Image
i using dxflib in order parse dxf files. have implemented class dl_creationadapter class entityhandler : public dl_creationadapter { public: /** called every hatch entity. */ void addhatch(const dl_hatchdata& data); /** called every hatch loop. */ void addhatchloop(const dl_hatchloopdata& data); /** called every hatch edge entity. */ void addhatchedge(const dl_hatchedgedata& data); }; but have problem while parsing entities of type hatch. is, not able find data related rounded paths . considering example following dxf image: for each dl_hatchedgedata receive dl_hatchedgedata.type equals 0 , list of vertices, able build path following one: please note difference between 2 images. where can find information fact conjunctions of path rounded ?

powershell - How to create multiple subfolders? -

how create folder structure have 1 root folder, approximately 9 differently named subfolders; within these subfolders there set of differently named subfolders. have made 1 .csv file script. not feel writing out 30 lines of same code make these subfolders. here have far: $logsdir = "d:\logs" if (-not (test-path $logsdir)) { new-item -path $logsdir -itemtype directory | out-null } else { write-host "directory exists!" } $subfolders1 = import-csv "subfolders1.csv"; $subfolders1 | where-object {$_.type -eq 'subfolder'} | foreach-object { $subfolders1 = $_.name; new-item "$logsdir\$subfolders1" -itemtype directory } # ******sbf1 = first set of subfolders****** # ******sf-** = second set****** new-item -path "$logsdir\sbf1\sf-a1" -itemtype directory new-item -path "$logsdir\sbf1\sf-a2" -itemtype directory new-item -path "$logsdir\sbf1\sf-a3" -itemtype directory new-it

Python Django REST API test -

as first attempt in python create api test, test file looks this: from django.test import testcase, requestfactory customer.models import customer, customerstatus customer.views import customerpartialview rest_framework.test import apirequestfactory import pprint django.utils import timezone class customertest(testcase) : def setup(self) : self.factory = requestfactory() self.cust_status = customerstatus.objects.create( status_id=1,name="banned",description="test desc" ) self.customer = customer.objects.create( guid='b27a3251-56e0-4870-8a03-27b0e92af9e5', created_date=timezone.now(), status_id=1,first_name='hamster') def test_get_customer(self) : """ ensure can customer db through api

Import data from an external sql server database into local database using php -

i have website query 1 of our external sql servers , insert records local server of website. i'm connecting external database, querying table, truncating local table, , running foreach insert data local table. the process works fine, problem takes long time. i want see if guys give me hints on how speed process. if there way this, please let me know. there many factors determine best approach. database copying supposed same source one, or have entries not in source one. if want them identical, , web site database read clone, have bunch of ways in sql server this: replication, log shipping, mirroring, ssis packages. depends on how want synchronize databases , lot of other factors.

php - Give an array as a value with OCI8 -

i make pre-version of website php , mysql. now, need change database in oracle. question : have type of query mysql/ php : $id = array("id" => $_get['id']); $sql = 'select * article id = :id'; $requete = $bdd->prepare($sql); $requete->execute($id); $compteur = $requete->rowcount($sql); so, started update php code : $sql = 'select * article id = :id'; $requete = oci_parse($identifiants, $sql); oci_bind_array_by_name($requete, ':id', $id, 1); oci_execute($requete); $compteur = oci_num_rows($requete); where $identifiants contains login, password database. now, refuses execute query because didn't accept array argument on line oci_bind_array; how can upate php query under oracle ? thanks in advance since oci_bind_array_by_name works arrays (it means in query there variable of type array) different execute(array()) work associative arrays in order set values (in case query has non-array

mysql - How to Insert and display Hindi character in Grails -

i have problem while insert hindi or other language characters database using grails. follow details solve problem. i create database using following syntax. create database hindi_test character set utf8 collate utf8_unicode_ci; table syntax is, create table `hindi` ( `id` bigint(20) not null auto_increment, `version` bigint(20) not null, `data` varchar(255) collate utf8_unicode_ci default null, primary key (`id`) ) engine=innodb auto_increment=3 default charset=utf8 collate=utf8_unicode_ci i mention <%@ page contenttype="text/html;charset=utf-8" %> on top of gsp. but hindi or other language text not insert , display in gsp.

bash - multi character separated sort -

how can sort !! delimited records using sort command? for file1 1!!2!!3 2!3!!3!!1 3!!2!!2 expected output 2!3!!3!!1 3!!2!!2 1!!2!!3 then sort -t \!\! -k 3 file1 result: sort: multi-character tab ‘!!’ why isn't working? multi-character delimiters not allowed in sort -t can use: sort -t '!' -k1 file 1!!b!!c 2!!f!!w 4!!e!!e edit: if ! can there in data can use trick: sed 's/!!/\x06/g' file | sort -t $'\x06' -k1 | sed 's/\x06/!!/g' 1!!b!!c 2!!f!!w 4!!e!!e edit2: doing in single command use awk : awk -f '!!' -v k=1 '{a[$k,$0]=$0} end{asort(a, b, "@ind_num_asc"); (i in b) print b[i]}' file

android - running an app and it crash -

hi when click on launch app, first page comes up, when want navigate next page app stop works , give me error: process: com.example.arel0002.pizzeria, pid: 4215 android.content.activitynotfoundexception: unable find explicit activity class {com.example.arel0002.pizzeria/com.example.arel0002.pizzeria.pizza}; have declared activity in androidmanifest.xml? define activity in manifest want go like this <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainpage" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </a

ios - Parse and Swift. Set tableViewCell accessory type from Parse relation -

so, have got tableview shows courses. user able set checkmarks on these courses (cells) , save them in pfuser object relation courses class (where courses stored). question is, how checkmark courses user has saved @ point before. this attempt, don’t know how continue. how cells specific label? (or there better way?) let courserel = pfuser.currentuser()?.relationforkey("usercourses") let query = courserel!.query() let qobjects :array = query!.findobjects()! println(qobjects) var qobjectscount = qobjects.count; qobjectscount > 0; --qobjectscount { var qanobject: anyobject = qobjects[qobjectscount - 1] var coursename = qanobject["coursename"] println(coursename) if let cell: anyobject? = tableview.dequeuereusablecellwithidentifier("coursecell"){ } } edit: code in override viewdidload edit2: override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindex

c# - EF GroupBy with concatenate string -

i have table entry below, columna columnb columnc columnd 16 651 european union 16 651 x membership 17 651 great britain 17 651 x economic integration 18 651 european union countries 18 651 x economic integration result list columna columnb 651 |a european union|x membership 651 |a european union countries|x economic integration 651 |a great britain|x economic integration the idea group 3 columns, ie, columna, columnb,columnc , concatenate columnd. so far have done this var sub = (from x in db.bs x.bid == bid group x new { x.bid, x.sd, x.tno, x.tr } g select new book { tagno = g.key.tno,

swift - How do I correctly print a struct? -

i'm trying store array of store structs within users struct, can't print correctly. struct users { var name: string = "" var stores: [store] } struct store { var name: string = "" var clothingsizes = [string : string]() } var myfirststore = store(name: "h&m", clothingsizes: ["shorts" : "small"]) var mysecondstore = store(name: "d&g", clothingsizes: ["blouse" : "medium"]) var me = users(name: "me", stores: [myfirststore, mysecondstore]) println(me.stores) you’re initializing them fine. problem store struct using default printing, ugly mangled version of struct name. if make conform customstringconvertible , should print out nicely: // swift 1.2, use printable rather customstringconvertible extension store: customstringconvertible { var description: string { // create , return string how // you’d store when printed

java - How to set user detail in session atttribute after login in spring secuiry xml -

i implement spring security in project. want put custom object(domain object) in session @ time of login, can check user details httpservletrequest object in controller. please me, how it? spring security file : <http auto-config="true" use-expressions="true"> <intercept-url pattern="/login/**" access="permitall" /> <intercept-url pattern="/forgotpassword/**" access="permitall" /> <intercept-url pattern="/css/**" access="permitall" /> <intercept-url pattern="/js/**" access="permitall" /> <intercept-url pattern="/images/**" access="permitall" /> <intercept-url pattern="/**" access="hasrole('role_user')" /> <!-- access denied page --> <access-denied-handler error-page="/403" /> <form-login login-page="/login"

c# - Windows 8 Layout on WPF using listbox or list view with data binding -

i'm trying custom layout windows 8 layout : horizontal scroll 4 rows of elements (one itemsource) i'm binding rss feed listbox , when use wrappanel have problems datatemplate . i want order of element : 1 5 9 ... 2 6 10 ... 3 7 11 ... 4 8 12 ... [scroll ] my xaml listbox : <listbox.itemtemplate > <datatemplate > <grid width="400" height="100" > <grid.columndefinitions> <columndefinition width="*"/> <columndefinition width="10"/> <columndefinition width="2*"/> </grid.columndefinitions> <image source="{binding xpath=enclosure/@url}" grid.column="0" horizontalalignment="left" vertica

sql server - SQL max by 2 column, or first and last aggregate function -

how max colum1 1 colum 2 in sql? , there aggregate function first or last? i tried 2 ways: 1-it's me max date max price not associated max date: select doc_kits_t.dateoper, kits_t.docid, kits_t.goodid,max(price_list_t._date), max (price_list_t.price) [ackits] kits_t inner join [docackits] doc_kits_t on kits_t.docid = doc_kits_t.id left outer join [pricelist] price_list_t on price_list_t._date <= doc_kits_t.dateoper , kits_t.goodid = price_list_t.acgoodsid group kits_t.docid,kits_t.goodid,doc_kits_t.dateoper 2- have not found aggregate function first: select doc_kits_t.dateoper, kits_t.docid, kits_t.goodid, /*top or first*/(price_list_t._date),/*top or first*/ (price_list_t.price) [ackits] kits_t inner join [docackits] doc_kits_t on kits_t.docid = doc_kits_t.id left outer join [pricelist] price_list_t on price_list_t._date <= doc_kits_t.dateoper , kits_t.goodid = price_list_t.acgoodsid group kits_t.docid,kits_t.goodid,doc_kits_t.dateoper order price_list_t

javascript - jQuery ui Selectable() need ctrl+click to select but I want draggable+ multi click to select -

i using selectable() of jquery-ui, working perfect me while clicking ctrl+click , dragging also. but want change ctrl+click single click, , click select squares row. here example, single click select squares. need this. http://www.social-contests.com/check-image/ thanks much... $cover.selectable({ stop: function () { var total = $('.square').size(); var selected = $('.square.ui-selected').size(); var percent = math.round(selected * 100 / total); var alert = $('#score').find('.alert').addclass('hide'); if (percent <= 20) { $('#score').find('.alert-success').removeclass('hide'); } else { $('#score').find('.alert-error').removeclass('hide'); } $("#score").find('span.score-value').html(percent); } });

swing - Java: How to extract text by a selected area from a PDF file using iText? -

Image
i working on program extract texts pdf file in specific area, using java , itext library. right now, can extract data taping area coordinations using code: import java.io.ioexception; import com.itextpdf.text.rectangle; import com.itextpdf.text.pdf.pdfreader; import com.itextpdf.text.pdf.parser.filteredtextrenderlistener; import com.itextpdf.text.pdf.parser.locationtextextractionstrategy; import com.itextpdf.text.pdf.parser.pdftextextractor; import com.itextpdf.text.pdf.parser.regiontextrenderfilter; import com.itextpdf.text.pdf.parser.renderfilter; import com.itextpdf.text.pdf.parser.textextractionstrategy; /** * créer par malek boubakri le 03/06/2015 à 15:45. */ public class extractpagecontentarea { // public void parsepdf(float x,float y,float width,float height,string pdf) throws ioexception { pdfreader reader = new pdfreader(pdf); rectangle rect = new rectangle(x, y, width, height); renderfilter filter = new regiontextrenderfilter(rect);