Posts

Showing posts from May, 2014

javascript - Key Value pair for cookies -

Image
i having image icon on clicking should navigate other page '        <input type="image" id="datareview_' + templates[i].datafilekey + '" title="data review" src="images/datareview.png" style="height: 15px; width: 15px" onclick="datareview_tasks(this); return false;"/>\n' + in datareview_tasks() function below function datareview_tasks(inputob)    { var info = new ioinfo(inputobj); var id = info.key(0); var tdlastdateid = "lastrun_" + id; var decoded_lastrundate = decodeuricomponent(trim($("#" + tdlastdateid).text())).split(" ")[0]; var lastrundate = encodeuricomponent(decoded_lastrundate); window.location('<%= resolveurl("~/gui/datareviewnew.aspx") %>'); i should making id , lastrundate cookies. how can approach this. i not sure why not holding value 54 while debugging, new javascript , not sure if giving them in d

php - Ajax Json data - How to access the returned Json data -

when click on listproduct (which invoice no) open collapsible table listing products matching invoice no. my view file: <script> $(document).ready(function(){ $(".listproduct").click(function(){ var value = $(this).text(); alert(value); $.post('<?=site_url("purchase_controller/getproductlist"); ?>', {data:value},function (result) { alert(result[1][1]["invoiceno"]); for(i=1;i<result["count"];i++){ //loop trough elements $('#products tr:last').after('<tr><td>' + result[i]['invoiceno'] + '</td><td>' + result[i]['productname'] + '</td><td>' + result[i]['price'] + '</td></tr>'); } }); $(".collapse").collapse('toggle'); }); }); </script> <table id="products"> <t

linux - How to display errors in PHP 7 on Ubuntu 16.04? -

i've set in php.ini file values: display_errors on display_startup_errors on and in laravel application: 'debug' => env('app_debug', true), but when purpose write gibberish in controller method page gets blank instead of displaying error. else suppressing show error message? add ini_set('display_errors', 1); on top of code. once finish debugging, can remove it. can set these based on environment variables. example can set constant development true in development environment , use following code enable error reporting if (defined('development') && development === true) { ini_set('display_errors', 1); error_reporting(e_all); ini_set("display_errors", 1); }

java - XSL transformation with xml node (key) starts with number fails -

i facing issue if xml response contains node (key) element starts number e.g. <3party /> , if try fetch node xml in xsl stylesheet fails following exception. code sample xsl 1.0 (i can't use xsl 2.0 informed in advance). xml snippet : <root> <3party>some_value</3party> </root> xsl snippet : above value in xsl variable response. <xsl:variable select="$response/root/3party" /> transformation exception : javax.xml.transform.transformerexception: syntax error in '$response/root/3party'. @ org.apache.xalan.xsltc.trax.transformerfactoryimpl.passerrorstolistener(transformerfactoryimpl.java:661) @ org.apache.xalan.xsltc.trax.transformerfactoryimpl.newtemplates(transformerfactoryimpl.java:836) error: thu nov 10 12:10:00 ist 2016.411 errorhandler.fatalerror(transformationconfig.java:46) thread: thread[main,5,main] - compilation of xsl stylesheet: error: not compile stylesheet java

How do you Print Json Object from Json Feed with Python? -

i new python , json , have question regarding getting values json file. let's have json feed fruits such 1 below: { "banana": { vitamin: "a", }, "apple": { vitamin: "b", }, "orange": { vitamin: "c", }, } let's want print object (in case fruits) has vitamin element "c" i loading json file using: import utils fruits= utils.load_json('feed.json') and storing vitamins element in variable so: fruit in fruits: list_of_vitamins= fruits[fruit]['vitamin'] i using if statement see if "c" available in list of vitamins , is: if ("c" in list_of_vitamins): print "yes" this working fine, trying find away see if "c" exists , if does, print object holds "c", in case, " orange " so in end want code search json file vitamin c , print fruit orange. import jso

osx - psql: FATAL: role "vimarshchaturvedi" does not exist. Postgres.app installation -

i working on os x el capitan version 10.11.3 downloaded postgres app , ran app. the elephant icon on top says version 9.6.1.0(9.6.1.0) when click on 'open psql' following output on terminal. $ '/applications/postgres.app/contents/versions/9.6/bin'/psql -p5432 psql: fatal: role <username> not exist where username. far understand app should create role username , no password. i tried doing: psql -h localhost -u <username> which gave same error. following various output got trying out answers posted on so. $ psql /applications/postgres.app/contents/versions/latest/bin/psql after searching bit more ran following command: psql -h localhost -u postgres postgres=# the postgres shell opened up. can explain what's happening? starting psql without given username ( -u ... ) tries log in db user of same name current os user. db user has not yet been created. postgresql error: fatal: role "username" not exist th

Cakephp 3.x Shopping cart Database scheme -

i planning build website using cakephp 3.x version, please suggest me flexible database schema project? thank you database schema depends on project requirements. take conventions of cakephp pattern project built easier details check here

itunesconnect - iOS Build not reflecting in iTunes Connect -

i uploaded ios build xcode 8.1 (macos sierra), uploaded not reflected on itunes connect tried same build uploading application loader, shown me error "redundant binary upload" error. so increased build number , tried uploading application loader, uploaded again not reflected on store. does came across issue ? please let me know if missing something. note: added permissions , entitlements. usually take time binary processed before can select in itunes connect. check email, , wait email title itunes connect: version 8.8.8 (23) awesome app has completed processing. or if binary have problem, itunes connect contact kind of email itunes connect: app "my awesome app" (apple id: 888xxx888) has 1 or more issues

ruby - Capistrano cap production deploy fails on migration but cap production deploy:migrate passes -

i've come across strange problem capistrano while getting production server ready. when run cap production deploy , fails on deploy:migrate step activerecord::adapternotspecified: 'production' database not configured. available: ["defaul… yet, when run cap production deploy:migrate , capistrano completes successfully. on actual server, able run rails_env=production bundle exec rake:migrate without problems either. the capistrano log spits out same command both: [deploy:migrate] run rake db:migrate my database config looks this: production: adapter: mysql2 encoding: utf8 database: foo host: localhost pool: 5 timeout: 5000 username: bar password: password socket: /opt/bitnami/mysql/tmp/mysql.sock i should mention have set rails env in deploy.rb so: set :rails_env, :production here relevent information in gemfile: gem 'mysql2', '~> 0.4.5' group :development gem 'capistrano', '~> 3.6&#

javascript - Trigger the click event on an element if a condition is true in Angular js -

i have angular js view.html page passing string called datadict $scope method of controller. value {{ datadict.days }} displaying value nearly everyday , {{ datadict.days.includes('nearly everyday') }} showing result true . here code : <div class="some_class"> <ul class="ex1"> <li><a ng-click ="datadict.days.includes('not applicable')" class="mdcl-tab1">not applicable</a> </li> <li><a ng-click ="datadict.days.includes('several days')" class="mdcl-tab1">several days</a> </li> <li><a ng-click ="datadict.days.includes('more half days')" class="mdcl-tab1">more half days</a> </li> <li><a ng-click ="datadict.days.includes('nearly everyday')" class="mdcl-tab1">nearly everyday</a> </li> </ul> </div> an

php - how to get all category,subcategory from amazon mws? -

how can categories using amazon mws. there api categories? have access token client id . if using $url = "https://mws.amazonservices.com/products/2011-10-01" . '?' . $url_string . "&signature=" . $signature; or similar can find category item itemattributes->productgroup if search api can return main category item either upc or isbn keyword search. the list has changed since last time amazon officially published in 2005 if go amazon.com , click departments give small list ( if click on gray link in search bar says give bigger list.

swing - Java JLayer : How to prevent delegeting events to underlying Component -

hi found jlayer function. want use wait lock. if activate layer underlying component receives events (key , mouse). how can catch event in layer , prevent delegating? thank in advance dbausnnd i took example http://docs.oracle.com/javase/tutorial/uiswing/misc/jlayer.html "animating busy indicator" , overrided methods: processmouseevent , processmouseevent conditionally e.consume(), , of course jlayer.setlayereventmask( awtevent.mouse_event_mask | awtevent.mouse_motion_event_mask ); class waitlayerui extends layerui<jpanel> implements actionlistener { private boolean misrunning; private boolean misfadingout; private timer mtimer; private int mangle; private int mfadecount; private int mfadelimit = 15; @override public void installui(jcomponent c) { super.installui(c); jlayer jlayer = (jlayer)c;

change sklearn metrics module python -

after downloading sklearn package i've add purity metric sklearn metric module adding supervised .py , init .py in cluster folder , init .py in metrics folder same other metrics in module. after installing package python recognize other metrics except one. attributeerror: 'module' object has no attribute 'purity_score never change code of library use !! if want add metric, sklearn allows using make_scorer function. make_scorer makes scorer performance metric or loss function have customized. then can use scorer perform cross-validation. take @ tutorial here .

c# - Normalizing Data for a monitoring statistic -

i tasked create charts our application monitoring tool. there couple of applications, produce enormous amount of errors, once hit first. that's totally normal these applications. since need statistic shows applications run against errors more usual have normalize data, have no approach follow.

c# - form closing An unhandled exception of type 'System.ComponentModel.Win32Exception' occurred in System.Windows.Forms.dll -

hi have form , want open form when user close current form can see here : private void frmdashboard_formclosing(object sender, formclosingeventargs e) { this.close(); frmconcerns = new frmconcerns(); a.showdialog(); } but when click on close button error : an unhandled exception of type 'system.componentmodel.win32exception' occurred in system.windows.forms.dll additional information: error creating window handle. this.close() closes current form - being done right because otherwise formclosing event wouldn't have been invoked. remove line . also, if want show dialog modal window, should provide parent form, instead of calling a.showdialog(); rather call a.showdialog(this); . if error still there can assure code you've shown correct after modifications i've suggested - i've done similar things before. in case error must occur in other parts of code you've not shown us.

java - how to connect and insert map keys and values into derby database? -

i have java program , produces output follows : termname :docname : termcount forexample termname hello , docname :2 , termcount :4 hello:doc1:4 ..... ...... i stored values in map. here following program public class tuple { public static void main(string[]args) throws filenotfoundexception, unsupportedencodingexception, sqlexception, classnotfoundexception, exception{ file file2 = new file("d:\\logs\\tuple.txt"); printwriter tupled = new printwriter(file2, "utf-8"); list<map<string, integer>> list = new arraylist<>(); map<string, integer>map= new hashmap<>();; string word; //iterate on documents (int = 1; <= 2; i++) { //map = new hashmap<>(); scanner tdsc = new scanner(new file("d:\\logs\\afterstem" + + ".txt")); //iterate on words while (tdsc.hasnext()) { word = tdsc.n

c# - read multiple Json data from webservice -

i have web service returns json string. problem have difficulties read it i tried with: javascriptserializer jsserializer = new javascriptserializer(); string jsondata = reader.readtoend(); var myobj = jsserializer.deserialize<list<cinforichiesta>>(jsondata); but how can values "students" , "locations"? javascript used :" var j = jquery.parsejson(msg.d);" think c# code different this example of string: {"questions":{ "id":"2", "book":"3", "students":{ "class":"3", "theme","43" }, "locations":{ "h":"0", "l":"3" } } } first off, json isn't valid thats first problem have. can verify @ http://jsonlint.com/ example. i have fixed in following way: { "questions"

Critical Error Occurs when Booting Up R ...."jvm.dll" is missing! Can't use libraries any more -

Image
i have critical problem has halted r programming environment. need java integration , rjava library use r program in many other packages, , specify library prerequisite ( rapidminer, sap predictive analytics etc). used work, don't know happened!. please assist. when boot r comes with: . message says " header is: rsession.exe- system error , body says: "the program can't start because jvm.dll missing computer. try re-installing program fix problem". what program (referred in message) must re-install , must install to? i have installed , reinstalled r ( version3.2.1)[2] ..see second image ( using r studio ( version 0.99893)) ![enter image description here][2] i deleted , re-installed java library rjava , , installs wont load i.e. library(rjava)..results in same error message in 1 above , when press ok continue console brings following text : error message in r console when using "library(rjava)" "library("rja

.net - Symbols for ngen-ed assemblies are not loaded -

Image
i trying decode following call stack line procmon: 29 system.management.automation.ni.dll system.management.automation.ni.dll + 0x897a0a 0x7fee2ae7a0a c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll as can see there ngen-ed assembly in it: system.management.automation.ni.dll . created pdb file ngen createpdb : ps> ngen createpdb c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a86698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll c:\symbols\ngen generated pdb native assembly 'c:\windows\assembly\nativeimages_v4.0.30319_64\system.manaa57fc8cc#\a8698074f28597f1fc5ceabfed6fed6\system.management.automation.ni.dll'. pdb generated in directory c:\symbols\ngen\system.management.automation.ni.pdb a86698074f28597f1fc5ceabfed6fed61\ my symbol path in _nt_symbol_path variable is: srv*c:\symbols\ngen*;srv*c:\symbols\dbg*http://referencesource.mic

Preview XML Android Studio -

Image
i using eclipse build android application. have switched android studio development. have issue in layout edit. have folder called layout, layout-large etc. in eclipse during layout edit, eclipse show preview of per suitable device screen. in android studio it's not switching automatic device screen per layout folder. have need time manually switch device screen drop down. using android studio 2.2.2. can please suggest me solve issue ? example if have layout folder called layout-sw360dp , layout-sw480dp , mainactivity.xml in both folder when preview xml, need choose device manually not showing automatic device per layout folder. thanks sadly, option preview screen sizes removed in android studio 2.2 :-( it replaced another, more powerful option - the bottom right corner of preview can dragged, making layout re-scale in real time . shows should drag each device size. this not best solution, gets quite convenient once used :-)

c++ - Building single qt module out of source in Qt 5 -

i use qt 5.5.1, c++, visual studio 2013 compiler. had build qt sources (shadow build mode). found later 1 module qttools skipped due -skip flag. aware nmake module-qttools command, full instruction concerning additional build (i failed it)? mean: should call configure , params? should call nmake module-qttools (build/source directory)? possible clean *.obj files before nmake install ? btw, can find exact module names? example, here module list . can't use -skip "qt multimedia" literally (for example).

angular - 'routed-outlet' is not a known element in Angular2 Routes -

i'm trying create simple application children routes in angular2 angular-cli ("nested routes" ng2-book). have 2 modules: app.module - module whole app navigation , home page products.module - "children" module has different "pages" under different routes app.module import { browsermodule } '@angular/platform-browser'; import { ngmodule } '@angular/core'; import { routes, routermodule } '@angular/router'; import { appcomponent } './app.component'; import { productscomponent } './products/products.component'; import { productscomponentmodule, routes childroutes } './products/products.module' import { homecomponent } './home/home.component'; const routes: routes = [ { path: '', redirectto: 'home', pathmatch: 'full' }, { path: 'home', component: homecomponent }, { path: 'products', component: productscomponent, children: childroutes } ] @

html - JQuery click works after refreshing the page -

my deepest apologizes. here link of question need assistance. below query, have fixed. please me out anyone. drag , drop localstorage html5 not working i prepared drag , drop widgets in html, css, jquery. drag , drop works fine. made icon show dragged widgets once dropped in place required. icon shows fine once dropped. i wanted remove widget when click on close icon. doesn't remove widget. tried refresh page see whether works after that. , is. i'm not sure why jquery behaves way. i tried solution. see many solutions. nothing fix problem. help? below code have used: /* ----- javascript ----- */ $(function() { if (localstorage.length != 0) { (var = 0; < localstorage.length; i++) { var dropclass = localstorage.key(i); var clonediv = $("." + dropclass.substr(4, dropclass.length - 4)).clone(); var droppable = $("#droppable"); droppable.append(clonediv.draggable({ helper: 'original',

bluetooth - How does BLE parameter negotiation work? -

i'm wondering how negotiation parameters work when "central" , "peripheral" have different parameters set. i might mistaken, understanding peripheral makes update request when connecting have it's parameter set connection. , central decides whether or not approve them. what don't understand how decided if parameters approved or not. , haven't found code it. for example if have following settings(just picking random values): central: interval 10ms, slave latency 0, supervisortimeout 500 peripheral: interval 50ms, slave latency 10, supervisortimeout 3000 how can know peripheral parameters used or criteras them approved ? if out there give nice explaination thankful. central wants, peripheral has abide parameters, or disconnect. peripheral can kindly ask other parameters ones edicted central, nothing tells must approved. acceptance criteria central mix of constraints: normative (these constant , global), implementation

typescript - Error: Could not find source map for ...ts in remap-coverage with karma -

i'm tryining generate cobertura coverage report on jenkins server typescript angularjs application. the karma.conf.js module.exports = function (config) { config.set({ files: [ 'app/**/*.ts', './build/vendor.js', { pattern: './bower_components/angular-resource/angular-resource.js', watch: false }, { pattern: './bower_components/angular-mocks/angular-mocks.js', watch: false }, { pattern: 'api/**/*.json', served: true, included: false }, 'build/app.js', 'test/**/*.test.ts' ], // source files wanna generate coverage for. // not include tests or libraries preprocessors: { "app/**/*.ts": ["coverage"], "**/*.ts": ["karma-typescript"], "app/**/*.js": ["sourcemap"] }, // browsers test against, sure install correct karma browser launcher plugin browsers: ["chrome"], // level of logging: log_disable || log_error || log_warn || log_info

wordpress - WooCommerce: Show an image as attribute term -

i'm relatively new woocommerce , php overall advice great! i'm trying show image attribute term products, image shows, can't figure out how can accomplish it.. i've tried putting link image directly title of term, inside img tags, didn't work. i've tried making new shortcode image stored displays shortcode tag .. when place shortcode on normal page show image. is there way possible show image instead of text in attribute term? thank you!

jQuery CookieBar Plugin not working in wordpress -

i used cookiebar plugin in wordpress. though include css , js file initialization cookiebar, it's not working. nothing shown in browser plus no console error. what doing wrong ? suggestions/help welcome. in advance. did include latest jquery version? if not here cdn it: <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hvvnyaiadrto2pzugmuljr8blusjgizsdygmijlv2b8=" crossorigin="anonymous"></script> http://jquery.com/

node.js - Accessing arguments sent via npm run-script -

i run command: npm run a_script --oki="odo" how value of oki in script? i'd use example: if(process.argv.oki === 'odo') . i tried: console.log(process.argv); it doesn't show there. i read https://docs.npmjs.com/cli/run-script , doesn't give example. you have insert 2 dashes between script name , argument list npm pass them script. e.g. npm run a_script -- --oki="odo"

sql server - Change Column1 to headers -

i getting amount of males/females have data on in our database. displaying as: gender | total ------------------ male : 24251561 female : 24886049 i need display as male | female ------------------ 24251561 : 24886049 here current code data select a.gender,count(1) ( select case when convert(int,substring(h.id_number,7,4)) < 5000 'female' else 'male' end gender cb_header h (nolock) h.id_number not null , dbo.vf_valid_id(h.id_number) = 1 )a group a.gender create table #pivot ( gender varchar(100), total int ) insert #pivot values ('male',24251561), ('female',24886049) select * ( select gender, total #pivot ) src pivot ( max(total) gender in ([male], [female]) ) piv; male female 24251561 24886049

ios - CTFrameDraw() causes app to crash -

i've been pulling hair trying sort problem out. i'm programatically creating pdf , drawing images , text every time try draw text ctframedraw() app breaks @ point. drawing image works fine. i've dumbed down function copy paste apple example still no luck. at top of page have included , added framework project. the function (disregard first 2 values type , entries): int createpdf(int type, const char** entries, const char *filename) { // create a4 pagerect cgrect pagerect = cgrectmake(0, 0, 612, 792); // code block sets our pdf context can draw cgcontextref pdfcontext; cfstringref path; cfurlref url; cfmutabledictionaryref mydictionary = null; // create cfstring filename provide method when call path = cfstringcreatewithcstring (null, filename, kcfstringencodingutf8); // create cfurl using cfstring defined url = cfurlcreatewithfilesystempath (null, path,

r - Extract 2 parts of a string -

assume have following string (filename): a <- "x/zheb100/tkn_var29380_timely_p1.txt" which consists of several parts (here given p1) or one b <- "x/zheb100/zhn_var29380_timely.txt" which consists of 1 part (so no need label p) how can extract identifier, 3 letters before varxxxxx (so in case 1 tkn , in case 2 zhn ) plus part identifier, if available? so result should be: case1 : tkn_p1 case2 : zhn i know how extract first identifier, cannot handle second 1 @ same time. my approach far: sub(".*(.{3})_var29380_timely(.{3}).*","\\1\\2", a) sub(".*(.{3})_var29380_timely(.{3}).*","\\1\\2", b) but adds .tx incorrectly in second case. you not using anchors , matching last 3 characters right after timely without checking these characters ( . matches character). i suggest sub("^.*/([a-z]{3})_var\\d+_timely(_[^_.]+)?\\.[^.]*$", "\\1\\2", a) details : ^ - start

java - Hibernate Inheritance: Load all entities but no subclasses -

given 2 classes @entity @table(name = "a") @inheritance(strategy = inheritancetype.table_per_class) public class a{ ... } and @entity @table(name = "b") public class b extends a{ ... } when calling sessionfactory sessionfactory = ...; session session = sessionfactory.opensession(); session.createcriteria(a.class).list() i receive instances of and b. how query instances of (no subclasses of a)?

plsql - How convert CLOB to BLOB in Oracle? -

firstly converted blob of image clob, , converted clob blob. cannot see reconverted image. how can solve problem? blob_to_clob function: create or replace function blob_to_clob (blob_in in blob) return clob v_clob clob; v_varchar varchar2(32767); v_start pls_integer := 1; v_buffer pls_integer := 32767; begin dbms_lob.createtemporary(v_clob, true); in 1..ceil(dbms_lob.getlength(blob_in) / v_buffer) loop v_varchar := utl_raw.cast_to_varchar2(dbms_lob.substr(blob_in, v_buffer, v_start)); dbms_lob.writeappend(v_clob, length(v_varchar), v_varchar); v_start := v_start + v_buffer; end loop; return v_clob; end blob_to_clob; clob_to_blob function: create or replace function clob_to_blob2(p_clob in clob) return blob v_blob blob; v_offset number default 1; v_amount number default 4096; v_offsetwrite number default 1; v_amountwrite number; v_buffer varchar2(4096 char); begin dbms_lob.createtemporary(v_blob, true); begin loop dbms_l

javascript - WebExtension browserAction.onClicked does not trigger -

i trying make content script work, contains : chrome.browseraction.onclicked.addlistener((tab) => { chrome.browseraction.disable(tab.id); console.log(tab.url); }); i have added these lines in manifest : "permissions": [ "activetab", "tabs" ], "browser_action": { "default_icon": "icons/premod-32.png", "default_title": "premod" }, "content_scripts": [ { "matches": ["*"], "js": ["content_scripts/jquery.js", "content_scripts/premod.js"] } ] i can see browser action, when click on it, not disabled , can not see log in console. solved : code had in background file.

language agnostic - Is floating point math broken? -

0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 why happen? binary floating point math this. in programming languages, based on ieee 754 standard . javascript uses 64-bit floating point representation, same java's double . crux of problem numbers represented in format whole number times power of two; rational numbers (such 0.1 , 1/10 ) denominator not power of 2 cannot represented. for 0.1 in standard binary64 format, representation can written as 0.1000000000000000055511151231257827021181583404541015625 in decimal, or 0x1.999999999999ap-4 in c99 hexfloat notation . in contrast, rational number 0.1 , 1/10 , can written as 0.1 in decimal, or 0x1.99999999999999...p-4 in analogue of c99 hexfloat notation, ... represents unending sequence of 9's. the constants 0.2 , 0.3 in program approximations true values. happens closest double 0.2 larger rational number 0.2 closest double 0.3 smaller rational number 0.3 . sum

audio - Front camera face detect (Android Studio) -

well heard there camera class on android studio. what im trying im trying make app turns on camera when pressed on , front camera , when detects face self says "you great today!" want record own voice , put own voice. so if can guide me how that, amazing! researched everywhere! i've downloaded made face detect interface. works need add voice it. open app waits until face detected says "you today" thats want! can give me advice or atleast give me steps how it? im noob take easy when explaining simply use face detection libraries of native android (and not opencv or more complex) , app starts, keeps track of face. can put if statement check if face recognized , if vocal message has been playes. if(recognized_faces != 0 && message_already_played == false){ //play message } this piece of code (an activity) takes photograms frontal camera , analyze them. code painted canvas on photograms , shows them sequentially (like vid

itcl - need to remove multiple "-" from the string which is alpha numeric using tcl -

i have string: svpts-7-40.0001 and need remove second '-' this. fetching values these come double '-' sometimes. if such variables seen have remove second '-' , replace same '.' , string should like: svpts-7.40.0001 [edit] have tried: % set list1 [split $string -] svpts 7 40.0001 % set var2 [join $list1 .] svpts.7.40.0001 % here's regular expression change 2nd hyphen: % regsub -expanded {( .*? - .*? ) -} "svpts-7-40.0001" {\1.} svpts-7.40.0001 % regsub -expanded {( .*? - .*? ) -} "svpts-7_40.0001" {\1.} svpts-7_40.0001 % regsub -expanded {( .*? - .*? ) -} "svpts-7-40.0001-a-b-c" {\1.} svpts-7.40.0001-a-b-c

IKVM: Is it possible to generate C# SOURCE CODE from Java source code? -

i generate not .dll .jar; c# project c# source code. have java source code well, not .jar file. currently, i'm able generate .dll file, , disassemble tool; , manually fix errors like: field names starting "__\u003c\u003e" don't compile. way can take, since have java source code, i'm interested in question: is possible generate c# source code java source code?

python - Creating a new list using for loop? -

i need write function normalizes vector (finds unit vector). vector can normalized dividing each individual component of vector magnitude. the input function vector i.e. 1 dimensional list containing 3 integers. the code follows: def my_norml(my_list): tot_sum = 0 item in my_list: tot_sum = tot_sum + item**2 magng = tot_sum**(1/2) norml1 = my_list[0]/magng #here want use loop norml2 = my_list[1]/magng norml3 = my_list[2]/magng return [norml1, norml2,norml3] there's couple of things here. initially, let me point out tot_sum = tot_sum + item**2 can written more concisely tot_sum += item**2 . answer question, use loop achieve want with: ret_list = [] in my_list: ret_list.append(i / magng) return ret_list but isn't best approach. it way better utilize comprehensions achieve need; also, sum built-in function can summing instead of needing manually perform for-loop : magng can computed in 1 line passing comprehen

git - Add encrypted variables to travis.yml and push to open source project -

i have been contributing open source project & in 1 of issues, have upload folder aws s3. have created amazon aws account , working. but not able find way correctly encrypt credentials in travis.yml file & make pull request. using travis gem encrypt variables giving me error repository not known. also read somewhere pull request containing sensitive information not allowed forks of project. please guide me on how task!