Posts

Showing posts from February, 2012

oracle - What is Java equivalent for .net EnvelopedCms -

i need rewrite .net function below java without using bouncycastle . because has run java stored procedure @ oracle 11g database (it has java 1.5). jars loaded database unpacked , that's why variant bouncycastle fails: jce cannot authenticate provider bc. or if know how load jar (understand whole jar) oracle database jvm. loadjava extracts classes that's why can't work bc. protected byte[] encrypt(ref byte[] content, ref x509certificate2[] recipients) { contentinfo ci = new contentinfo(content); envelopedcms cms = new envelopedcms(ci); cmsrecipientcollection rcps = new cmsrecipientcollection(); foreach (var recipient in recipients) { rcps.add(new cmsrecipient(recipient)); } cms.encrypt(rcps); return cms.encode(); }

Syncing db with existing tables through django for an existing schema table and also updating few columns for the tables and the rest automatically -

i doing poc in django , trying create admin console module inserting,updating , deleting records through django admin console through models , doing fine have 2 questions. 1.i need have model objects existing tables needs present in particular schema.say schema1.table1 here of doing poc public schema. can done in fixed defined schema , if yes how.any reference helpful 2.also wanted update few columns in table through console , rest of columns done automatically currentimestamp , created date etc.is possible through default django console , if yes kindly share reference steps 1 what have done of created class in model.py attributes author,title,body,timeofpost then used sqlmigrate after makemigrations app create table , after migrating have been using admin console django insert , update records table created.but poc only. now need same existing tables whom can interact , insert or update record existing tables through admin console. also tables getting created in pu...

java - Multiple Attributes of same name - JAXB -

is possible have xmlattributes have same name. have annotated list property xmlattribute(name="default") returns as < test default="abc cdf bhy"> expecting return < test default="abc" default="cdf" default="bhy"> is possible that? unfortunately can't. not because of jaxb shortcoming xml attributes cannot have multiple values definition. , xml strict regarding rules. the best workaround redefine attribute element. otherwise when need read attribute, you'll need parse , break value multiple tokens wouldn't recommend awkward , brittle.

Need this basic ansible variables explaination -

i know really basic question, want explanation of this: repos: - name: 'epel' url: 'http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm' key: 'http://ftp.riken.jp/linux/fedora/epel/rpm-gpg-key-epel-6' - name: 'rpmforge' url: 'http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm' key: 'http://apt.sw.be/rpm-gpg-key.dag.txt' - name: 'remi' url: 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm' key: 'http://rpms.famillecollet.com/rpm-gpg-key-remi' - name: 'webtatic' url: 'http://mirror.webtatic.com/yum/el6/latest.rpm' key: 'http://mirror.webtatic.com/yum/rpm-gpg-key-webtatic-andy' like "repo", think it's list? "name", "url" , "key"? , why "name" has "-" infront of it? thanks in advance perhaps helps if ...

javascript - Pass addl parameter to angularjs promise -

var dologin = function(username, password) { var request = $http({ method: "get", url: 'api/login', params: {}, data: {} }); return request.then(success, error); } function success(response, username) { ... } if remove username parameter success() method, response gets passed success(), , works fine. specific instance, need pass username (passed dologin) http success callback function. however, promise takes reference function. how pass username fn success()? you can pass anonymous function success callback: return request.then(function(data) { success(data, username); }, error);

What is the relationship between a 2d Cartesian coordinate grid and a matrix of arrays? -

i working complex problem involves array matrix. think of matrices having row index , column index. matrix[row][column] but particular problem think more useful think of in context of cartesian coordinates. when doing though noticed there few distinct issues such matrix indices can positive integers opposed cartesian coordinates can span in direction. find myself confused how x , y indices map rows , columns indices. what relationship between 2d cartesian coordinate grid , matrix of arrays? it seems major concern of yours how represent cartesian coordinate system using java 2 dimensional array. confusing part of how deal negative coordinates since java arrays can indexed positive numbers. here class cartesiangrid contains 2d array of integers. array can initialized range of cartesian coordinates. getter , setter offset negative coordinates map range of array java expects. public class cartesianarray { private int[][] grid; private int minx, miny; p...

javascript - Changing link URL after every 5 visits -

what i'm trying accomplish following. i have link on website, want change link after every 5 visits or "page refreshes" user , have loop. so example visit site , download button links site called "www.site1.com". refresh site 5 times , download button link changes "www.site2.com". if refresh 6th time goes original. i have not been able find searching through forums shows i'm trying accomplish here. experimenting window.onload , setinterval function changes link every 5 seconds. anyway transition every 5 seconds every 5 page visits? window.onload = function() { function changeurl(){ document.getelementbyid("link").href = "www.site1.com"; } setinterval(changeurl, 5000); } you want use javascript localstorage or sessionstorage this. below example of code using localstorage example window.onload = function() { if (localstorage.visits) { //if value in local storage increase it'...

swing - Java cant make TempListener work -

import javax.swing.*; import java.awt.*; import java.awt.event.*; public class circlepanel extends jpanel { private jtextfield xfield, yfield, diameterfield; private jbutton redraw; private jlabel xlabel, ylabel, rlabel; circle mycircle = new circle (150, 150, 30, color.red, color.white); graphics g; //paint objects on panel public void paintcomponent (graphics page) { super.paintcomponent(page); g = page; mycircle.draw(g); } public circlepanel(){ xlabel = new jlabel("x= "); ylabel = new jlabel("y= "); rlabel = new jlabel("r= "); xfield = new jtextfield(5); xfield.addactionlistener(new templistener()); yfield = new jtextfield(5); yfield.addactionlistener(new templistener()); diameterfield = new jtextfield(5); diameterfield.addactionlistener(new templistener()); redraw = new jbutton("redraw!"); redraw.addactionlistener(new buttonlistener()); add(xlabel); add(xfield); add(ylabel); ...

bash - Performing variable substitution in a string -

i have string contains use of variable, , i'd substitute variable's value string. right best have is #!/bin/bash foo='$name; echo bar' name="the name" expanded="$(eval echo "$foo")" echo "$expanded" which has obvious defects: prints the name bar while i'd print the name; echo bar instead of eval can bash's regex matching bash's string replacement: foo='$name; echo bar' name="the name" [[ "$foo" =~ \$([[:alnum:]]+) ]] && s="${!bash_rematch[1]}" && expanded="${foo/\$${bash_rematch[1]}/$s}" echo "$expanded" name; echo bar

actionscript 3 - AS3 Array Display button not working properly -

i'm working on program learn how use arrays in computer course , display button doesn't work after first press. first time click it, works , displays 2nd time stop showing first value , starts showing last value twice, 3rd time cuts off 2nd value , displays last value 3 times , on. , when press button find sum of values gives me sum of of values show after hit display button. here's code, , sorry french commentary, it's school. function afficherfunction(event:mouseevent):void { // compose cette fonction visant à afficher tous les éléments du tableau. txtsortie.text = ""; var entier:int; entier = -1 (var i:int=entier; < mesentiers.length; i++) { if (i+1 < mesentiers.length) { mesentiers[i] = mesentiers[i+1]; affichage = affichage + mesentiers[i] + "\n" } } txtsortie.text = affichage; affichage = ""; = -1; } //fin fonction afficher. mesentiers[i] = mesenti...

java - How to add an external folder to the class path? -

so have following folder structure: project lib (running jar folder) properties (property file load in folder) i trying load property file via x.class.getclassloader().getresource("properties/filename"). method works in eclipse when build jar using maven fails find file, giving file not found exception. i suspect folder not in classpath because if run getclassloader().getresources("") property folder never shows up. tried suggestions in previous questions on stackoverflow none have worked far. i tried running java -cp , -classpath still failed. when using maven, files *.properties , other not-compilable files must lie @ src/main/resources folder, default, available. additionally, recommend use thread.currentthread().getcontextclassloader() proper classloader, in order load resources. anyway, if want have custom folder @ classpath, suggest add resource, @ pom.xml , this: <project> ... <build> ... ...

excel - Show/hide columns based on input value -

i have 1 input sheet "sheet i", input cell: c3, input value integer, such 1, 2, 3... . output sheets "out 1", "out 2", "out 3", ..."out 10". output sheets contain content a2 g36, while others contain information a2 h36 or t36. ideally, see columns (starting column c) conditionally based on value in $c$3 in sheet i. here logic: if input value = 1, show column a, column b , column c if input value = 2, show column a, column b , column d if input value = 6, show column a, column b , column h ..... right have vba, input value in code set static number. can advise how should change code in order make work? private sub workbook_sheetcalculate(byval sh object) dim sharray dim dim myrange, c range application.screenupdating = false application.enableevents = false sharray = array("out 1", "out 2", "out 3", "out 4", "out 5",.. "out 10") = lbound(sharray) ubound(sharray) ...

reflection - Any API for TSYS(TOTAL SYSTEM SERVICES) -

it's credit card company , using system called "tsys" "total system services, inc". in order information "tsys", it's using reflecltion ibm 9 connect "tsys" server information. , sake of efficientcy, it's using vba macro simulate user's input in reflection information. it's still slow , easy interrupted other application. people familiar "tsys", there api(java or c#) allow people communicate tsys server directly without using third party software reflection ibm? yes. tsys offers transit api developer integration. see here sign , access.

css - chrome and IE layout Differences issue -

Image
i having weird layout issues between ie , chrome, can decent on one, not other. moving drop-down menu bars css gets great on chrome, moves 1 of bars way far middle of page in ie. not best @ web programming/layouts, may missing small/simple. attached @ pictures of issue. ie-prod chrome-prod ie-dev(changes) chrome-dev(changes) the changes have made far css , here are: ( top dropdown menu) #searchbar { margin: 3px 0; padding: 3px 0; width: 190px; clear: left; } /*translate element*/ #google_translate_element { color: transparent; } to: #searchbar { position:relative; top: 15px; right: -10px; margin: 3px 0; padding: 3px 0; width: 190px; /*clear: left;*/ } /*translate element*/ #google_translate_element { position: relative; left: -310px; color: transparent; } the related html/ascx code follows (no changes between prod/dev)(links removed): <div id="container"> <div class="skin-heade...

javascript - image retrieval from directory and session variable issues - php -

Image
i have problem when retrieving images directory on server, main sequence is: in page (multiupload.php) added input, allowed image previewed , when user submitted, new directory session id created, images stored in unique directory , page directed (drag.php). newly loaded page has canvas different divs controls filters attached canvas. problem lies retrieving image specified s_id directory name 1 page other. q: retrieving session variables properly? or using them appropriately? this necassary snippets multiupload.php's upload script. <?php $dir_id = session_id(md5(uniqid())); session_start($dir_id); $path = "uploads/"; $dir = $path.$dir_id; $path = $path.$dir_id."/"; if (file_exists($dir)) { system('/bin/rm -rf ' . escapeshellarg($dir)); } else { mkdir($path); chmod($path, 0722); } $_session["id"] = $dir_id; $_session["directory"] = "/" . $dir; $_session["path_name"] ...

node.js - Node resize image and upload to AWS -

i'm relatively new node, , want write module takes image s3 bucket, resizes , saves temporary directory on amazon's new lambda service , uploads images bucket. when run code, none of functions seem called ( download , transform , upload ). using tmp create temporary directory , graphicsmagick resize image. what wrong code? i have defined dependencies , array outside of module, because have depends on these. // dependencies var aws = require('aws-sdk'); var gm = require('gm').subclass({ imagemagick: true }); var fs = require("fs"); var tmp = require("tmp"); // reference s3 client var s3 = new aws.s3(); var _800px = { width: 800, destinationpath: "large" }; var _500px = { width: 500, destinationpath: "medium" }; var _200px = { width: 200, destinationpath: "small" }; var _45px = { width: 45, destinationpath: "thumbnail" }; var _sizesarray = [_800px, _500...

Python Object with @property's to dict -

i'm new python please excuse if i've glazed on simple this. i have object this: class myobject(object): def __init__(self): self.attr1 = none self.attr2 = none @property def prop1(self): return foo.some_func(self.attr1) and instantiate this: a = myobject() a.attr1 = 'apple' a.attr2 = 'banana' and method it's wrapped in expects return of dict, this: return a.__dict__ but prop1 not included in return. understand why is, it's not in object's __dict__ because holds real attributes. so question is, how can make return, return this: {'attr1': 'apple', 'attr2': 'banana', 'prop1': 'modifiedapple'} other right before return doing: a.prop1_1 = a.prop1 you should leave __dict__ be, use attributes live directly on instance. if need produce dictionary attribute names , values includes property, add property or method produces new dicitonary...

How to read gradle file properties from Android app programatically -

the build.gradle file has following section. how read android.defaultconfig.versioncode android app mainactivity android { defaultconfig { applicationid "com.gatta.e.gatta" minsdkversion 11 targetsdkversion 21 versioncode 1 versionname "1.0" } } you don't have read gradle file obtain version code. here direct way within activity: private packageinfo getpackageinfo() { packageinfo pi = null; try { pi = this.getpackagemanager().getpackageinfo( this.getpackagename(), packagemanager.get_activities); } catch (packagemanager.namenotfoundexception e) { e.printstacktrace(); log.e("yourtaghere", e.getmessage()); } return pi; } and use in oncreate(...) method example obtain version code: string versioncode = "" + getpackageinfo().versioncode; more info on packageinfo class here . , quick description of class: ...

java - Netty 4 and 5 - multicast not working for me -

i have been trying udp multicast working netty 4.0.26 , 5.0.0.alpha2, without success. have adapted code this post in edited form supposedly works, not me. attached code echoes "send 1", "send 2" etc. corresponding packets never received. in expression localsocketaddr = new inetsocketaddress(localaddr, mcast_port) have tried port 0 well, without success. kinds of other combinations of bind port , local address have been tried also. the various socket options copied other post mentioned. can tell me i'm doing wrong? java 8 on windows 8.1. thanks much, sean import io.netty.bootstrap.bootstrap; import io.netty.buffer.bytebuf; import io.netty.buffer.unpooled; import io.netty.channel.channelfactory; import io.netty.channel.channelhandlercontext; import io.netty.channel.channeloption; import io.netty.channel.simplechannelinboundhandler; import io.netty.channel.nio.nioeventloopgroup; import io.netty.channel.socket.datagramchannel; import io.netty....

python - Google App Engine: Correctly configuring a static site with advanced routing -

i've spent several shameful hours trying solve no avail... problem: i have static website developing 100% pre-processed via grunt & assemble (if familiar jekyll, same concept). has simple static blog component houses category directories of various names. such, need catch-all in app.yaml route them appropriately. however, also have custom error page show in place of standard gae page status. it seems cannot accomplish accounting both scenarios in app.yaml alone because can use catch-all target once. here logic in current app.yaml - url: (.*)/ static_files: dist\1/index.html upload: dist/index.html expiration: "15m" - url: /(.*) static_files: dist/\1/index.html upload: dist/(.*)/index.html expiration: "15m" this perfect use case because routes path index file if exists in current directory. however, because uses catch-all, cannot again use following - url: /(.*) static_files: custom_error.html or depend on error_handlers...

javascript - How do I make the Codeschools angular side look similar? -

i've tried quite time after passing codeschools "shaping angular" course make work. last thing tried copy source code make sure there no typos on side , results vary quite lot , don't know i'm doing wrong @ point. this site looks on gitpages: http://danieboy.github.io/codeschool-shaping-up-with-angular-master/index.html this looks on course website: http://i.imgur.com/r3xlcp7.png anyone able shed light on problem hero. the actual source can found here: http://discuss.codeschool.io/t/shaping-up-with-angularjs-source-code-demo/5363 it seems have style.css file not included in code. file specifies layout , appearance body tag, img-thumbnails, img-wrap, small-image, thumbnail classes , others. right now, add these classes elements in html files, there no css stylesheet define them. check out plunker share @ above link. you'll need create css file specifies appropriate styles these classes , reference in index file header.

Javascript Files Not Being Recognised Webstorm -

Image
all of sudden webstorm doesn't recognise javascript me. if add file : all see in ide afterwards : if refresh, restart webstorm, still not recognise file! webstorm has become unusable! if @bruno's link doesn't help, please try right click file , select "mark plain text". once done, right click again , select "mark javascript" - works me in phpstorm

java - Log4j2 smtp appender doesn't work for root logger -

i'm using log4j2.2 in app. i'd receive email when there error in application. so configured smtp appender: <smtp name="mailer" subject="ecall logs" to="${receipients}" from="${from}" smtphost="${smtphost}" smtpport="${smtpport}" smtpprotocol="${smtpprotocol}" smtpusername="${smtpuser}" smtppassword="${smtppassword}" smtpdebug="true" buffersize="200" ignoreexceptions="false"> </smtp> and added root logger: <root level="error"> <appender-ref ref="console" /> <appender-ref ref="asyncfile" /> <appender-ref ref="mailer" /> </root> unfortunately configuration never receive email when there errors in app. in fact i've others custom loggers: <logger level="info" name="org.flywaydb" additivity=...

vba - Excel file contains invalid hidden characters that can't be removed -

i have peculiar problem hidden characters in excel spreadsheet uses vba create text file. i've attached link test version of file, , i'll explain best can issue. the file creates plain txt file can used feed data system use. works normally, we've been supplied approximately 15,000 rows of data, , @ random points throughout there hidden characters. in test file, there's 1 row , it's cell b11 has hidden characters @ beginning , end of value. if put cursor @ end of it, , press backspace key, if nothing has happened, you've deleted 1 of characters. as far excel concerned, hidden characters question marks, they're not, text stream parse those, doesn't, , instead throws invalid procedure call error. i've tried using excel's clean formula, i've tried vba equivalent, tried using 'replace', nothing seems recognise characters. excel convinced they're question marks, ascii character call gives me same answer (63), replace doesn...

Eclipse: How to get the MenuManager for a specific menu id defined in plugin.xml -

i have standalone eclipse rcp application. main interaction happens through main toolbar. here relevant snippet plugin.xml: <extension point="org.eclipse.ui.menus"> <menucontribution allpopups="false" locationuri="toolbar:org.eclipse.ui.main.toolbar"> <toolbar id="my.toolbar.id"> ... <command commandid="my.command.id" id="my.connect.id" label="connect" style="pulldown"> </command> ... </toolbar> </menucontribution> <menucontribution allpopups="false" locationuri="menu:my.connect.id"> </menucontribution> i populate pulldown menu my.connect.id when shown, can hold different items every time opened. can done using menumanager id , add imenulistener . how obtain instance of...

log4j - Solr retaining disk space -

i'm experiencing following problem on productions solr slaves servers, solr keeps retaining disk space, if can't see file holding onto space , need solve issue restart solr every day, honest not ideal. we think way log4j log rotation, seems when actual log file rotated solr leaving kind of thread open , thread continuously writing on log file. this log4j.properties of now: solr.log=logs/ log4j.rootlogger=info, file, console log4j.appender.console=org.apache.log4j.consoleappender log4j.appender.console.layout=org.apache.log4j.patternlayout log4j.appender.console.layout.conversionpattern=%-4r [%t] %-5p %c %x \u2013 %m%n #- size rotation log cleanup. log4j.appender.file=org.apache.log4j.rollingfileappender log4j.appender.file.maxfilesize=4mb log4j.appender.file.maxbackupindex=9 #- file log , log format log4j.appender.file.file=${solr.log}/solr.log log4j.appender.file.layout=org.apache.log4j.patternlayout log4j.appender.file.layout.conversionpattern=%-5p - %d{yyyy-mm-...

eclipse - How to change project properties to run locally? -

i working on cvs in web project on eclipse, in address bar see: http://remote server address:8080/myproject/ . when needed test changes, had synchronize , commit able test. i want have own version of project on workspace different server, , address bar looks like: http://localhost:8080/myproject/index.jsp . i tried copy , paste, whenever put in workspace detects address of server. you need change server location, right click on project click run server , select local tomcat server , done. whenever done testing commit code. if doubt update here.

How to convert image into base64 string using javascript -

i need convert image base64 string can send image server. there js file this... ? else how convert it you can use html5 <canvas> it: create canvas, load image , use todataurl() base64 representation (actually, it's data: url contains base64-encoded image).

javascript - Mocha test factorization and backtrace -

i run many mocha tests : it('should fail blabla', function () { return <functionthatreturnsapromise>() .then(function () { assert(false); }, function (err) { assert.strictequal(err.message, 'foobar undefined'); assert.strictequal(err.code, 'eundefinedfoobar'); }); }); the things vary among tests function , code , message . i wanted factorize code this: function shouldberejected(promise, code, message) { return promise .then(function () { assert(false); }, function (err) { assert.strictequal(err.code, code); assert.strictequal(err.message, message); }); } (...) it('should fail blabla', function () { return shouldberejected(<functionthatreturnsapromise>(), 'eundefinedfoobar', 'foobar undefined'); }); it works when tests failed, backtraces reference shouldbe...

java - LIBGDX drawables on devices with different densities/resolutions -

i'm new libgdx game development, , have faced first problem. i've created 9.patch drawables (buttons) using texture packer. drawables can used on low density , high density screens , quality same. if run project drawable on desktop project image shown okay , perfect size. if run project on low density android device, drawable becomes huge (almost half of screen). , if run project on high density android device button becomes small. so question is, how handle drawables in libgdx, ratio (screen:image size), stays same no matter resolution/density..? if button text button. change font of text. if using image button, this might you

html - Bootstrap 3 checkbox doesn't align with form label -

Image
<div class="form-group"> <label for="property_feature" class="col-md-4 col-sm-4 control-label">ফিচার</label> <div class="col-md-8 col-sm-8 col-md-offset-4"> <label class="checkbox-inline"> <input type="checkbox" value="1" id="property_furnished" name="feature">আসবাবপত্রে সজ্জিত </label> <label class="checkbox-inline"> <input type="checkbox" value="2" id="property_sublet" name="feature">সাবলেট </label> <label class="checkbox-inline"> <input type="checkbox" value="3" id="property_mess" name="feature">মেস </label> </div> </div> the above code gives me following output. want disp...

javascript - Checking if function exist in same scope when supplied the function name -

i've got format prototype method (simplified) , wanna check if char alphabetic (case insensitive), and if it's function declared in same scope . if is, want call function. if pass in x should execute alert. i'm gonna using method format date given format string. e.g. format('h:i:s') check if h, i, , s function , call them. how can achieve that? i tried based on answer: https://stackoverflow.com/a/359910/1115367 here's code: function time() { //initialization } time.prototype = { format: function (char) { if (char.test(/[a-z]/i) && typeof window[char] === 'function') { //undefined window[char](); } function x() { alert('works'); } } }; if pass in value returns: uncaught typeerror: undefined not function there no way retrieve local variables (or function) name (as far know anyway). declared named functions assigned variable of same name: func...

jquery - Select only one checkbox in group -

i need in html select 1 checkbox in group. find example. can't realize it. doesn't works. here example: example here code html: <div> <li> <div class="radio"> <label> <input type="checkbox" name="mobil[1][]" id="optionsradios1" value="1" checked class="radi"> Сотовый телефон имеется </label> </div> </li> <li> <div class="radio"> <label> <input type="checkbox" name="mobil[1][]" id="optionsradios2" value="0" class="radi"> Сотовый телефон не имеется </label> </div> </li> <div> and cod...

ajax - Get the value of hidden input in the for with jquery -

hello guys (sorry english) i work symfony 2 , i' meet difficulty jquery, explain: i value of hidden input when mouse on item when doing : <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script> $(function(){ $(".item").each(function(){ $(this).mouseover(function(){ var value = $(".id_sous_item").val(); var data = { id: value }; console.log(data); $.ajax({ url: "{{ path('sous_item_page') }}", cache: false, data: data, success: function(msg){ $(".item_right .description").append(msg); ...

c++ - Why do I get a segmentation fault when adding ltalloc with MinGW -

i tried build application ltalloc . tried mingw32 4.9.1 , mingw64-32 4.9.2. compiles , links fine when run segmentation fault occurs. debugging pinpointed problem following code: #include <pthread.h> #pragma weak pthread_once #pragma weak pthread_key_create #pragma weak pthread_setspecific static pthread_key_t pthread_key; static pthread_once_t init_once = pthread_once_init; static void init_pthread_key() { pthread_key_create(&pthread_key, release_thread_cache); } static thread_local int thread_initialized = 0; static void init_pthread_destructor()//must called when block placed thread cache's free list { if (unlikely(!thread_initialized)) { thread_initialized = 1; if (pthread_once) { pthread_once(&init_once, init_pthread_key); // <--- causes segsegv pthread_setspecific(pthread_key, (void*)1);//set nonzero value force calling of release_thread_cache() on thread terminate } } } as far know ...

actionscript 3 - My var doesn't seem to want to inherit from a custom class -

i'm sorry if ends being noob question. i have var set new object of class. however, keep getting error 1120 whenever test it. know error means it's undefined property. tried changing scope of (to every possible place in main class. namely class, after imports , constructor). the code supposed part of character creator dungeons , dragons 4e. have tried hours find solution i'm not sure. include attributes class if it's help. var humon:attributes = new attributes it's declared part of main class: package { //imports import com.classes.attributes; import flash.text.*; public class main extends movieclip() { private var humon:attributes = new attributes; public function main() { atties.text = (humon.getstr()+", "+humon.getdex()+", "+humon.getcon()+", "+humon.getint()+", "+humon.getwis()+", "+humon.getcha()+"."); var res:int = humon.getstr(); tra...

Detecting Pinch gesture in Windows 8 Store App (Javascript) -

i using windows.ui.input.gesturerecognizer api , feeding events it. ie10, im not getting expansion property can implement zoom gesture. im getting in ie11. when perform zoom function processmouse(evt) { evt.stopimmediatepropagation = true; var pp = evt.getcurrentpoint(document.body); gr.processmousewheelevent(pp, evt.shiftkey, evt.ctrlkey); }; evt.ctrlkey comes false in ie 10 true in ie11. there fix detect zoom in ie10. for desktop, expansion property comes touchpad driver installing worked. pinch-zoom must enabled in touchpad settings.

vba - Shared Excel macro enabled workbook - Excel cannot access the file issue -

Image
what want do. send macro enabled excel document colleagues working macro opens save file dialog , generates csv. what have done? i have made vba-macro in excel 2013 , works fine on machine. however, when send macro enabled excel-sheet colleague gets: microsoft office excel cannot access file 'path document on computer'. there several possible reasons: the file name or path not exist. the file being used program. the workbook trying save has same name open workbook my source: sub convert2csv() dim filename string filename = "ordersedel_" & format(now, "yyyy-mm-dd hh mm") & ".csv" application.filedialog(msofiledialogsaveas) .title = "xxx" .allowmultiselect = false .initialfilename = filename .filterindex = 15 result = .show if (result <> 0) ' create file filename = trim(.selecteditems....

javascript - Why directly not able to call a function from `controller` in `AngularJs` -

i trying update clock time in h1 element. trying update time calling function setting interval, not able call. find solution apply . but understand logic behind this. explain me reason why not able call , why should use apply method..? here work: angular.module('book', []) .controller('mycontroller', function ($scope) { var updateclock = function() { $scope.clock = new date(); }; setinterval(function() { updateclock(); //not working when call here...? //$scope.$apply(updateclock); //it works! }, 1000); updateclock(); //it works in first time. }); <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script> <div ng-app="book"> <div ng-controller='mycontroller'> <input ng-model="name" type="text" placeholder="your name"> <h1>hello {{ clock }}</h1> ...

datetime - JavaScript time is an hour behind after ISO conversion -

i create new date in javascript, correct time, after use toisostring() convert it, it's hour behind. why be? https://jsfiddle.net/73nfyxel/ var createddatetime = new date('2015-04-01 11:53:00'); var isocreateddatetime = ""; alert(createddatetime); isocreateddatetime = createddatetime.toisostring().match(/(\d{4}\-\d{2}\-\d{2})t(\d{2}:\d{2}:\d{2})/); alert(isocreateddatetime[1] + ' ' + isocreateddatetime[2]); createddatetime.setminutes(createddatetime.getminutes() + 1); as far i'm aware should immune changes local time (eg. daylight savings), i'm giving pre-set time, , not timezone. what's going on? the toisostring method doesn't format date, first converted utc. the difference between local time zone , utc 1 hour.

jquery - Get value of select on change with class name -

this question has answer here: event binding on dynamically created elements? 18 answers i using jquery add select in each row of table. selects assigned class name. now, need value of select on change using dynamically assigned class name. $select = $('<select class="medname"></select>'); for(var = 0;i < tmp.length-1; i++){ $option = $('<option>'+tmp[i]+'</option>'); $select.append($option); } here tmp contains data fetched backend. finally, var $row = $('<tr></tr>'); var $data1 = $('<td></td>'); var $data2 = $('<td></td>'); var $data3 = $('<td></td>'); var $data4 = $('<td></td>'); //alert($select.html()); $data1.append($select); $d...

missing return statement in factory pattern c# -

i have following code code says return statement missing, though have put them in switch list. public imap map(string oldtheme) { switch (oldtheme) { case "archer": return new archer(); case "craftyblue": return new craftyblue(); case "minimal": return new minimal(); case "mintalicious": return new mintalicious(); case "misfit": return new misfit(); case "peach": return new peach(); case "queen": return new queen(); case "sketch": return new sketch(); case "takeaway": return new takeawaylemonfresh(); case "lemonfresh": return new takeawaylemonfresh(); case "vanilla": return new vanilla(); case "velvet": return new velvet(); case "victoriana": return new victoriana(); case "writer": return new writer(); }...

json - jq parsing get value -

i need values json file. need array (dimmer1, dimmer2) somebody idea? { "devices": { "dimmer1": { "protocol": ["kaku_dimmer"], "state": "off", "dimlevel": 1 }, "dimmer2": { "protocol": ["kaku_dimmer"], "state": "off", "dimlevel": 1 } } edit: after clarification in comments, retrieve states of devices key begins "dimmer", use jq '[ .devices | to_entries[] | select(.key | startswith("dimmer")) | .value = .value.state ] | from_entries' filename.json output: { "dimmer1": "off", "dimmer2": "off" } this works follows: .devices selects .devices attribute of json object to_entries explodes object array of key-value pairs describing attributes (the devices), attribute "foo": "bar" becomes ob...

java - Handling application events -

i building cross-platform app android , ios. far it's android , learning how use j2objc translate code later used ios. on question of architecture app - how 1 go around passing events in code platform-agnostic. example, have class downloads group of files , broadcasts message using android broadcast mechanism when each file downloaded - there way implement notification exchange in pure java? there tutorials available? guava has eventbus package , may meet needs , included in j2objc distribution. use it, include dist/lib/guava-14.0.1.jar (where "dist" path a recent j2objc release ) in j2objc command's -classpath, , link -lguava flag.

google app engine - Search index automatically deleted on restart on appengine devserver for python -

i developing on appengine using python sdk v 1.9.18 (the latest) i using search api, while server running ok, index created, , can perform search , result successfully, when restart devserver index no longer there, deleted think start command line: python.exe "c:/google/google_appengine/dev_appserver.py" --host 127.0.0.1 . on start logs: warning 2015-04-01 11:53:53,005 simple_search_stub.py:1115] not read search indexes c:\users\jos\appdata\local\temp\appengine.application\search_indexes indeed file not there, , not know why deleted any please ? does development server output successful search index save when shutdown ? info 2015-04-01 12:51:35,396 api_server.py:591] saving search indexes it works on os x version, seems people having same issue due windows or ide use (but apparently using command line), see question comments how write search index google app engine dev_appserver?