Posts

node.js - how to get the raw version of a template string in iojs -

Image
is possible raw version of template string in iojs ? var s = `foo${1+1}bar` console.log(s); // foo2bar in previous example string: foo${1+1}bar edit1 : need detect whether template string depends on context of if is 'constant' string may contain cr , lf is possible raw version of template string in iojs ? no not. it's not possible raw representation of literal, there no way "raw" literal in these cases: var foo = {[1+1]: 42}; var bar = 1e10; var baz = "\"42\""; note term "template string" misleading (as may indicate somehow raw value of string (which not case shown above)). correct term "template literal ". my need detect whether template string depends on context of if is 'constant' string may contain cr , lf seems job static analysis tool. e.g. can use recast parse source code , traverse template literals. for example, the ast representation of `foo${1+1}bar` is : if suc...

Dynamically sum row values based on column headers? - Excel -

need solutions queries posted in below link, http://www.mrexcel.com/forum/excel-questions/334740-dynamically-sum-row-values-based-column-headers.html having personweek separate column sum of weeks should displayed. quest: dynamically sum row values based on column headers? it form re-post question in entirety on site; nevertheless: what looking relatively straight forward. there lot of ways accomplish suggest use combination of 'match' function , the 'offset' function. offset function creates range based on given start point, moving up/down / left/right indicated, given height / width. example: =offset(b2,1,2,3,4) indicates range d3:g5. range given starting @ cell b2, moving 1 row down , 2 columns right, , going total of 3 rows , 4 columns. so remaining point determine start , stop offset. first, first field in offset function cell a1, top-left corner of data table. find how many rows move down, need find project referring (i assume cel...

javascript - How to create ajax request in AngularJs? -

this question has answer here: what best practice making ajax call in angular.js? 4 answers i want send requests , responses using angularjs, haven't tried yet. the $http -service looking for. comes preconfigured get , post methods make easy requests, can configure requests wish.

.net - How do I use JSON.NET to deserialize into nested/recursive Dictionary and List? -

i need deserialize complex json blob standard .net containers use in code not aware of json . expects things in standard .net types, dictionary[string, object] or list[object] "object" can primitive or recurse (dictionary or list). i cannot use static type map results , jobject/jtoken don't fit. ideally, there way (via contracts perhaps?) convert raw json basic .net containers. i've search on way coax json.net deserializer creating these simple types when encounters "{}" or "[]" little success. any appreciated! if want generic method can handle arbitrary json , convert nested structure of regular .net types (primitives, lists , dictionaries), can use json.net's linq-to-json api it: using system.linq; using newtonsoft.json.linq; public static class jsonhelper { public static object deserialize(string json) { return toobject(jtoken.parse(json)); } private static object toobject(jtoken token) { ...

java - How to create many-to.many association with extra columns? -

i'm using hibernate , spring data. i have 3 tables, first composite primary key. table (grupo) ---------------- |pk idgrupo | |pk nombre | | | |______________| also created 2 more tables usuario , grupo_matricula(result of relation many many between grupo , usuario). table (grupo_matricula) ------------------ |pk idgrupos | | matricula_id | | grupos_id | | nombre | | aceptado | | propietario | | | |_________________| table (usuario) ---------------- |pk matricula | | nombre | | password | |______________| i created 3 clases 1 entity (grupo), other pk embeddedid of grupo last entity (grupo_matricula). @entity @table(name = "grupo") public class grupo implements serializable { @embeddedid protected grupopk grupopk; @onetomany( mappedby = "grupo_id", cascade=cascadetype.all) private set<grupomatricula> grupomatriculas=new hashset<>(0); } ...

AcroForm PDF to normal PDF in c# -

i have acroform pdf (a pdf can edited) i'm using api sign pdf requires pdf normal 1 , never acroform one. is there way transform acroform pdf normal one? i tried making read-only though cannot edited still acroform pdf. in answer comment, assume using itextsharp, though not specify. using itextsharp, believe need flatten form when done. here simple example: public void generatepdf(string filepath, list<pdffield> modifiedfields) { var pdfreader = new pdfreader(filepath); var folderstructure = filepath.split('\\'); if (folderstructure.length == 0) return; var currentfilename = folderstructure.last(); var newfilepath = string.format("{0}{1}", constants.saveformspath, currentfilename.replace(".pdf", datetime.now.tostring("mmddyyhhmmss") + ".pdf")); var pdfstamper = new pdfstamper(pdfreader, new filestream(newfilepath,...

ios - Transition without loose data with Storyboard and Swift -

i'm developing new project in swift i've big (and dumb) problem. i've 3 viewcontrollers: 1.- call webservices, take json , pass json second view 2.- parsing data , put data in view (tableview , ok). @ view go other view button (to view 3). don't need pass nothing. 3.- try go view 2 view empty because data posicioning @ tableview pass view 1. i try lot of solutions: navigationcontroller!.dismissviewcontrolleranimated(false, completion: nil) -> if link storyboard transition view 3 view 2, view 2 empty, if don't link in storyboard -> unexpectedly found nil while unwrapping optional value if change "!" "?" nothing the same every code have been test. my code is: view 1 view 2: (connected in visual part of storyboard (ib)) @ibaction func gorecibospendientes(sender: uibutton) { let controllervc = self.storyboard!.instantiateviewcontrollerwithidentifier("recibos") as! tablarecibostableviewcontroller ...