Posts

Featured post

.net - Generate assembly with Roslyn -

Image
is possible build .net core or better .net standard library roslyn can referenced project? my goal build assembly on server , have people download can reference , use in own visual studio projects. i'm using roslyn generate c# code , compile it. seems work ok when "emit" compilation result memory stream, load assembly , execute code using reflection. using (var ms = new memorystream()) { var compilationresult = compilation.emit(ms); if (compilationresult.success) { ms.position = 0; var assembly = assemblyloadcontext.default.loadfromstream(ms); .. .. is can "save" assembly proving path emit method. results in .dll file on disk. var compilationresult2 = compilation.emit(@"d:\testassembly.dll"); i wonder kind of format .dll file is. doesn't seem "normal" assembly. i searched internet couldn't find doing this. misunderstand something? so questions are: what kind of format file create emit? full

java - Can't get itext Rectangle to work correctly with annotations -

i'm new itext , can't annotation icons appear correctly. i'm trying create rectangle annotation icon. example below: rectangle rect = new rectangle(164, 190, 164, 110); chunk_text.setannotation(pdfannotation.createtext(writer, rect, "warning", comments, false, "comment")); pdfcontentbyte pdb = new pdfcontentbyte(writer); chunk_free.setannotation(pdfannotation.createfreetext(writer, rect, comments, pdb)); chunk_popup.setannotation(pdfannotation.createpopup(writer, rect, comments, false)); but, icon fails appear or small dot in pdf. i cant find im doing wrong. you create rectangle this rectangle rect = new rectangle(164, 190, 164, 110); according javadocs : public rectangle(float llx, float lly, float urx, float ury) constructs rectangle -object. parameters: llx - lower left x lly - lower left y urx - upper right x ury - upper right y as l

javascript - Inserting HTML text in js code -

how import html file in javascript code? currently have like: document.getelementbyid("menu").innerhtml = '<li class="topline"><a href="#">some text</a></li> <li><a href="#">some text </a></li> <li><a href="#">some text</a></li> <li><a href="#">some text</a></li> <li><a href="#"some text</a></li> <li><a href="#">some text</a></li> <li><a href="#">some text</a></li>'; how separate js code , html code in separate files. later load html code javascript easily? you can this! taken below reference link! you need put ul , li tags inside file called import.htm , needs in same place current file. var ajax =

javascript - Set attribute for custom DOM nodes in text preview component -

i want add / setattribute class custom dom nodes while writing text in custom bbcode -like text editor. when innerhtml of <item></item> not empty i'm filtering through items array in order find value matches. there can unlimited amount of item nodes. (i.e 2, 5, 10) so whenever click on icon named item shows in textarea [item][/item] , in preview component <item></item> . once item written, lets [item]id123[/item] have in dom <item>itemname123</item> . now, i'm doing manipulating dom outside react with: const setattributes = (el, item) =>{ el.dataset.img = item.img; el.setattribute('class', _.tolower(item.color)) }; const updateitems = () =>{ if(document.queryselectorall('item')) { document.queryselectorall('item').foreach(el => items.find(item => { if(_.tolower(el.innerhtml) === _.tolower(item.id)) setattributes(el, item) })); } } the prob

typescript - Disable a button based on text field values in angular 2 -

i have requirement there multiple text boxes , drop down fields in ui. need enable button on ui when 1 of multiple field has values. calling function based on ngmodel values given these fields somehow disable property value never changes based on values when drop down selected, same old value, property value not change. html code goes <button [disabled]="searchbuttonstatus(x,y, z, a, b, c, d, e, f, g, h, i, j)" </button> <tbody class="position cell-height"> <tr> <td class="empty-cell" id="checkbox" ></td> <!--funding status--> <td class="input-cell" id="status"> <div class="dropdown"> <select [(ngmodel)]="x" (ngmodelchange)="onselectstatus(selectedstatus)" name="status" class="form-control form-textbox input-sm">

javascript - Syntax error : Unexpected identifier -

i making chrome extension , have problems i want make fetch() anilist.co , avoid problems, want use await have syntax error : https://i.imgur.com/icygref.png here code : async function getanimeprogress(animeid) { var result; chrome.storage.local.get('access_token', function (items) { var query = ` query ($id: int, $page: int) { page (page: $page) { media (id: $id) { id medialistentry { status progress } } } } `; var variables = { id: animeid, page: 1 }; var url = 'https://graphql.anilist.co', options = { method: 'post', headers: { 'content-type': 'application/json', 'accept': 'application/json', 'authorizat

batch file - filebot superstrict script: need tiny video sample or other solution -

seeing how filebot can make massive mistakes (even in strict mode) when renaming videos created script make sure there's no mistakes , lets me check suspicious ones manually. it uses dummy 0-size copy of video in dedicated folder figure out new name renamed , doesn't tagged video , audio info since it's not real video. it simpler , more accurate have variable tags in place need tiny part of video (with tracks) instead of 0-size dummy. what's easy way this? all unknown variables see extrapolated video filename in other script, should not relevant here ask away if need be. @echo off /f "tokens=*" %%f in ("%full%") ( set "fullpath=%%~dpf" set "file=%%~nxf" ) :: prep fake temp file set tempdir=%temp%\%date:~3,2%%date:~6,2%%date:~11,2%%time:~1,1%%time:~3,2%%time:~6,2% mkdir "%tempdir%" && copy /y nul "%tempdir%\%file%" >nul :: filebot string (to shorten lines) if "%type%"