Posts

networking - How to request grunt serve from host machine? -

Image
trying setup angular on virtual machine yeoman avoid breaking machine packages management. after generate project yo myproject , install angular globally & locally, install grunt bower , more dependencies, i'm able run server using grunt serve the localhost accessible vm via wget localhost , not load host. i've tried modifying file /etc/network/interface static address , accessing static ip browser, , set dynamic dhcp port forwarding none have worked, browser can't make connection: firefox can't establish connection server @ i upload more useful files/output give more context, new grunt user have no idea look. set connect-middleaware listen on 0.0.0.0 ip address ensure host accessible. you can edit gruntfile.js this. find connect task in grunt.initconfig({}); change hostname in options 0.0.0.0 it should this: // actual grunt server settings connect: { options: { port: 9000, // change '0.0.0.0' access se...

ios - Match the data type of a object in Swift -

how match data type of object in swift? like: var xyz : xyz = 1; switch xyz { case let x xyz as?anyobject[]: println("\(x) anyobject type") case let x xyz as?string[]: println("\(x) string type") case let x xyz as?int[]: println("\(x) int type") case let x xyz as?double[]: println("\(x) double type") case let x xyz as?float[]: println("\(x) float type") default:println("none") } in case switch case run default case change var xyz : anyobject var xyz : any , add match case case let x int: from repl 1> var : = 1 a: int = <read memory 0x7fec8ad8bed0 failed (0 of 8 bytes read)> 2> switch { case let x int: println("int"); default: println("default"); } int from the swift programming language you can use , operators in switch statement’s cases discover specific type of constant or v...

How to convert pdf file to svg file using itextsharp in asp.net c#? -

i have project in project have convert pdf file svg file. note: pdf contains images. please suggest me how convert pdf svg file you have follow steps.. convert pdf images.. then use each image , convert svg using canvas(that possible way).. use final result per requirement.. note: post of work more clarity

java - android regex odd behavior -

what error following regular expression? working fine in java whereas android throws "pattern syntax exception". "((?<==)+(\"[^\"]+\"|[^,=+<>#;\r\n]+))" avinash raj pointed important mistake: + multiplier after positive lookbehind expression. using nested marking groups mistake. outer parentheses useless here , should removed reduce complexity. and backslashes in strings must escaped backslashes. think \r , \n should passed regular expression engine , not characters code value 13 , 10, string use is "(?<==)(\"[^\"]+\"|[^,=+<>#;\\r\\n]+)"

hadoop - Adding/Defining Jars in Hive permanently -

i trying add jar in hive classpath using below add command. command: hive> add myjar.jar but whenever login hive, need add myjar.jar using add cmd. there way can add permanently in hive classpath. regards, mohammed niaz add .hiverc file add jar myjar.jar have @ if require further info http://hadooped.blogspot.in/2013/08/hive-hiverc-file.html

java - i can't test the android wear sdk -

i'm trying launch test app eclipse on android wear, when create new projet, part of android wear not here. messages : watchactivity cannot resolved type (java file) error: no resource identifier found attribute 'roundlayout' in package (xml file) error: no resource identifier found attribute 'rectlayout' in package (xml file) i've installed sdk, , update adt 23. you'll need add android wear support library (android.support.wearable)to workspace. here full steps on how build android wear app using eclipse. hope help. https://medium.com/@tangtungai/how-to-develop-and-package-android-wear-app-using-eclipse-ef1b34126a5d

javascript - Sum similar keys in an array of objects -

i have array of objects following: - [ { 'name': 'p1', 'value': 150 }, { 'name': 'p1', 'value': 150 }, { 'name': 'p2', 'value': 200 }, { 'name': 'p3', 'value': 450 } ] i need add (summation) , other mathematical operation calculate average object same name appearing in it. like: - [ { 'name': 'p1', 'value': 300 }, { 'name': 'p2', 'value': 200 }, { 'name': 'p3', 'value': 450 } ] would appreciate can get. thanks in advance! first iterate through array , push 'name' object's property. if property exists add 'value' value of property otherwise initialize property 'value'. once build object, iterate through p...