Posts

Showing posts from February, 2015

cryptography - How to perform ECKA and have an ECPoint returned? -

i'm using bouncy castle perform elliptic curve key aggreement using ecdh protocol in smart card related software, defined in bsi-tr-03111 specs, §3.4 the purpose perform generic mapping of nonce in pace protocol, defined in icao sac technical report, §3.4.2.1.1 (i'm using java language not essential matter guess) the keyagreement class makes simple (as exemplified here ) allows output x coordinate of generated ecpoint , z ab (which often, not required.) is there way have actual ecpoint (that s ab ) returned without having reimplement algorithm? tho' formula in simple, 1 must check errors , anomalies , account variations (e.g. cofactor multiplication) i forgot question. solution implemented: package com.arjowiggins.arjonaut.crypto.ec; import org.bouncycastle.crypto.basicagreement; import org.bouncycastle.crypto.cipherparameters; import org.bouncycastle.crypto.params.ecprivatekeyparameters; import org.bouncycastle.crypto.params.ecpublickeyparamete...

python - How to use translations in Django? -

i'm following django tutorials translation, cannot make work. i'm missing simple didn't bother write, can't see what. my settings.py has following declarations : language_code = 'en-us' use_i18n = true _ = lambda s: s languages = ( ('en', 'english'), ('fr', 'french'), ) locale_paths= ( os.path.join( site_root, 'locale').replace('\\','/'), ) my view looks : from django.utils.translation import ugettext_lazy _ django.utils.translation import ugettext __ #... def translation_test(request): output = __("yes") return httpresponse(output) and projectroot/locale/fr/lc_messages/django.po file has : msgid "yes" msgstr "oui" so expect view generate "oui", however, generates "yes". missing here? p.s. tried template file, because need work too: my_template.html : {% extends "base_site.htm...

fuzzy search - ElasticSearch multi_match query over multiple fields with Fuzziness -

how can add fuziness multi_match query? if search 'basball' still find 'baseball' articles. query looks this: post /newspaper/articles/_search { "query": { "function_score": { "query": { "multi_match": { "query": "baseball", "type": "phrase", "fields": [ "subject^3", "section^2.5", "article^2", "tags^1.5", "notes^1" ] } } } } } one option looking @ this, don't know if best option. important keep sorting based on scoring. "query" : { "query_string" : { "query" : "subject:basball^3 section...

f# - Is there a more idiomatic way to generate an infinite sequence of uint64? -

let makeidgenerator startvalue = let index : uint64 ref = ref startvalue fun () -> let result = !index index := !index + 1ul result what need generator function has type unit -> uint64 shown above. the code above works uses reference variable memoize state of generator. trying use infinite sequence in seq.initinfinite (fun -> i) not work sequence inherently uses uint32 state. does here know way without reference variable? maybe means of recursion , yield or so? thanks in advance. you can use seq.unfold : let makeidgenerator (startvalue : uint64) = seq.unfold (fun -> some((i, i+1ul))) startvalue

php - How to validate input from database -

i develop captcha require user answer question randomly display. database consist of id,question,answer. problem although enter correct answer still redirected me error.php instead of success.php. <?php $database_db="test2"; $user_db="root"; $password_db=""; $host_db="localhost"; $link = mysqli_connect($host_db, $user_db, $password_db, $database_db); /* check connection */ if (mysqli_connect_errno()) { die ("couldnot connect: ".mysqli_connect_error()); exit(); } if (array_key_exists("answer", $_post) , array_key_exists("question", $_post)) { $id = intval($_post['question']); $sql="select question, answer captcha question='$id' , answer='".mysqli_real_escape_string($link, $_post['answer'])."'"; $result = mysqli_query($link, $sql) or exit('$sql failed: '.mysqli_error($link)); $num_r...

java - Oracle JDBC and Views -

i trying select statement view executequery cant resultset, meta data intact (names , number of columns) tried change preparedstatement , callablestatement , same here code private statement stmt=null; private resultset rset=null; ........ rset = stmt.executequery("select student_id,first_name,last_name student_view"); columnnum=rset.getmetadata().getcolumncount(); toclient.writeint(columnnum); for(int i=1;i<=columnnum;i++) toclient.writeutf(rset.getmetadata().getcolumnname(i)); if (rset.last()) { toclient.writeint(rset.getrow()); rset.beforefirst(); } while (rset.next()) for(int i=1;i<=columnnum;i++){ if(rset.getstring(i)!=null) toclient.writeutf(rset.getstring(i)); else toclient.writeutf(" "); } in debug mode java can't execute rset.last() command but when rset = stmt.executequery("select * student_view...

html - Difference between height 100% in FireFox and everyone else -

i'm trying make several nested containers stretch fill page. know there ton's of questions , answers out there , every 1 has different answer none explain why behavior exists. basically @ arbitrary point "height:100%" stops functioning , have switch on "min-height:100%" , if happen have both present layout massively screwed up. i have solution works in ie11, ff(latest), , chrome(latest) , 1 works in others doesn't work in ff , can't tell why. here jsfiddle explaining it, but i'd note jsfiddles display behavior doesn't match browsers @ all i'm going try , write out code. https://jsfiddle.net/2xa8rvek/ basically here's happens. place big block of content in center not scroll when window large enough scroll when window height reduced. observe different behavior based on color shown. i call senario a when scrollbar shown , window scrolled half way down. call senario b when page height large enough bottom of text block sh...

ssl - Gray triangle on firefox over HTTPS -

Image
i've been searching on net while don't seem find solution. i have tls connection app.spiderdoc.co works on chrome , safari have minor issue on firefox. had error sec_error_unknown_issuer , fixed providing intermediate chain certificate. so, don't know coming from. removed every requests external resources no success. i found resource on security.stackexchange don't know how fix warning looking @ url latest ff beta see: so looks objects support of rc4 tls cipher, fair enough point, quick google did not confirm ff actively detects potential problem. disable support cipher on web server , see if rectifies problem.

Selenium Java code hangs after opening second window -

i facing bit strange issue here. entire script hangs when second window opened clicking button. next line after action system.out.println(); , doesn't print in console until manually close window. have added logic window handles , switch, doubt code reaches point. please find code below. import java.util.set; import java.util.concurrent.timeunit; import org.openqa.selenium.alert; import org.openqa.selenium.by; import org.openqa.selenium.keys; import org.openqa.selenium.webdriver; import org.openqa.selenium.webelement; import org.openqa.selenium.ie.internetexplorerdriver; import org.openqa.selenium.ie.internetexplorerdriverservice; import org.openqa.selenium.keys; import java.util.iterator; public class achcleartransfer { public static void main(string[] args){ system.setproperty("webdriver.ie.driver","c:/progra~1/iedriverserver.exe"); system.setproperty("webdriver.ie.driver.extractpath", "c://progra~1"); webdriver driver = ...

c - ARM link error when calling a function residing in different memory -

i wanted clean code , a.c file included in b.c file. wanted build a.c file whole project , files in project can access functions defined in a.c file. after building a.c file whole project , not compile time errors. call function defined in a.c file different file arm link errors. ************* linking armlink : error l6291: cannot assign fixed execution region load address:. load address must greater or equal next available load address:. armlink : not enough information produce symdefs file. armlink : finished: 1 information, 0 warning , 1 error messages. make[1]: *** [common.axf] error 1 make[1]: leaving directory `/scripts' make: *** error 2 the file calling function in a.c resides in sram. while a.c resides in dram. if call function file resides in dram, not link error. following map files generated: function in a.c not called calling file. calling file resides in sram: 0x0000faa8 0x00000008 code ro 5150 i.time__delay_ticks rtos.o 0x0000fab0...

c++ - pointer to function wont work -

i'm trying learn how use pointer function properly. supposed make pointer function strcmp , inside function check , program opens , closes immediately. far understood, pointer function correct on code returntype (*pointer)(parameters)); going wrong? in advance. void check(char *a,char *b,int (*cmp)(const char*,const char*)) { printf("testing equality\n"); if(!(*cmp)(a,b)) printf("equals"); else printf("different"); } int main(void) { char s1[80] = "daniel" ,s2[80] = "daniel"; int (*p)(const char*,const char*); p = strcmp(); check(s1,s2,p); return 0; } this line incorrect: p = strcmp(); here you're calling strcmp 0 arguments, invalid. should have gotten clear compiler error this. instance, gcc gives me: error: few arguments function ‘ int strcmp(const char*, const char*) ’ you want assign strcmp : p = strcmp; also, don't need dereference function pointe...

ember.js - Bending Ember Data Records in Input Select -

with data structure: app.publisher = ds.model.extend({ name: ds.attr('string'), books: ds.hasmany('book', {async: true}) }); app.book = ds.model.extend({ title: ds.attr('string'), summary: ds.attr('string'), author: ds.belongsto('author', {async: true}), publisher: ds.belongsto('publisher', {async: true}) }; in book edit , book new forms, i'd display publishers using <input type=select> element. my questions: 1 : how bind ember-data publishers records input element. 2: how select current book publisher in element edit or default new book 3: how bind selected publisher book, when submitting form thanks lot. you can use ember's built in select view of need here. bind list of publishers view's content may need list of publishers in route. example: app.booknewroute = ember.route.extend({ var route = this; var modelpromise = new ember.rsvp.promise(function(resol...

C# Merging the results from SQL queries in datagridview -

good day, what i'm working on right now, have foreach loop going trough file list of servers. every time goes trough queries different server list provided text file. results displayed in datagridview. right every time querying new server, overwrites data in datagridview. tried merge datatable not working. idea? try { string select = "select @@servername servername, @@servicename instance,serverproperty('productversion') version, serverproperty ('productlevel') level, serverproperty ('edition') edition"; cnn.open(); // messagebox.show ("connection open ! "); messagebox.show("connection established"); sqldataadapter dataadapter = new sqldataadapter(select, cnn); sqlcommandbuilder commandbuilder = new sqlcommandbuilder(dataadapter); datatable table = new datatable(); table.locale ...

matlab - Exponential curve fitting without the Curve Fitting toolbox? -

i have data points need fit exponential curve of form y = b * exp(a/x) (without of curve fitting toolbox ). what have tried far linearize model applying log, results in log(y/b) = a/x log(y) = a/x + log(b) i can write in form y = ax + b now, if neglect b , able solve with a = pseudoinverse (x) * y but stuck values of b ... fitting curve of form y = b * exp(a / x) to data points (xi, yi) in least-squares sense difficult. cannot use linear least-squares that, because model parameters ( a , b ) not appear in affine manner in equation. unless you're ready use nonlinear-least-squares method, alternative approach modify optimization problem modified problem can solved using linear least squares (this process called "data linearization"). let's that. under assumption b , yi 's positive, can apply natural logarithm both sides of equations: log(y) = log(b) + / x or a / x + log(b) = log(y) by introducing new parameter b2 , d...

php - Data not being sent between multiple class methods without direct insertion -

i have class i'm developing methods call each other , send data, class template(){ public variables = array('text' => 'test'); public function loadtemplate( $filename ){ require project_path .ds. $filename; } public function render(){ extract($this->variables); $this->loadtemplate('index.php'); } } index.php displays extracted variables <html> <body> <?php var_dump($text); ?> </html> but doesnt display null values!! when require directly, works, doing wrong? thanks in advance. the simple answer need move extract() call function issues require call. the longer answer extract() extracts variables current function's scope. when call new function require template, has fresh scope. in fact, you'd have access $filename variable. one other point, please add extr_skip second argument extract() doesn't overwrit...

Facebook Tracking of In-Page Events with Conversion Pixel Code -

full disclosure - i'm not programmer, i'm 1 in organisation might able working. can following please? i'm trying use facebook's conversion pixel code track button clicks on our site. facebook's developer docs give following instructions tracking in-page events: after base code snippet installed, can track in-page actions, such clicks on button, making _fbq.push('track') call conversion pixel through registering different event handlers on html dom element. example: function trackconversionevent(val, cny) { var cd = {}; cd.value = val; cd.currency = cny; _fbq.push(['track', '<pixel_id>', cd]); } <button onclick="trackconversionevent('10.00','usd');" / the problem i'm facing it's not clear me facebook means "the base code snippet". initial assumption it's conversion pixel code give install in head section of page, i.e. <!-- facebook conversion code --> <scri...

javascript - What is the first parameter in Parse.User.signUp()? -

i'm using parse.com database of app , signup view, i'm trying reduce number of lines in code. user.set("username",$scope.user.email); user.set("email",$scope.user.email); user.set("password",$scope.user.password); user.signup(null, { success: function(user) { $ionicloading.hide(); $scope.state.success = true; }, error: function(user, error) { $ionicloading.hide(); if (error.code == 125) { $scope.error.message = "please specify valid email address"; } else if (error.code == 202) { $scope.error.message = "the email address registered"; } else { $scope.error.message = error.message; } $scope.$apply(); } }); my question this: first parameter supposed be? on parse.com, not use examples first parameter null (that have seen). , cannot find docs explain .signup() method detail. my instinct tells me parameter e...

c# - Multiple bootstrap sliders using asp:repeater control -

i have use multiple bootstrap carousel in single page, using asp repeater control doesn't work, show 1 slider on page here html , asp code <div class="col-md-12"> <div id="carousel" class="carousel slide"> <!-- carousel items --> <div class="carousel-inner"> <div class="item"> <div class="row"> <asp:repeater runat="server" id="slider1"> <itemtemplate> <div class="col-md-2"> <div class="row"> <a target="_blank" href="<%# eval("url") %>"> <img class="caption" src="../includes/gaceta/...

raw JDBC, Guice and Transactions -

i try create service multiple dao's addressdao , customerdao, know want create transaction spans two, like: @inject private customerdao customerdao; @inject private addressdao addressdao; customer getcustomer(int id) { customer customer = customerdao.getcustomer(id); customer.setaddress(addressdao.getaddress(customer.getaddressid()); return customer; } inside daos stuff lookin that public class customerdaojdbcimpl implements customerdao { private static final logger logger = loggerfactory.getlogger(customerdaojdbcimpl.class); @inject private database db; public customer getcustomer(int id) { try(connection connection = db.getconnection()) { } catch(sqlexception e) { ... } } } now since connection gets injected dao's can't span transaction. think don't right , maybe need book understand everything. what preferred solutions? or doing wrong? currently think have solution made up, lacks threading....

gulp - Unexpected end of input prelude.js -

i trying work replicate problem having adding react existing application. unfortunately, @ moment running different problem trying reproduce original problem. the basic structure new base module compiled browserify concatenated existing module bootsraps application now. var gulp = require('gulp'); var browserify = require('browserify'); var reactify = require('reactify'); var source = require('vinyl-source-stream'); var concat = require('gulp-concat'); gulp.task('default', ['browserify', 'concat']); gulp.task('browserify', function(){ return browserify({ entries: ['./src/app.js'], transform: [["reactify", {"es6": true}]], extensions: ['.jsx'], debug: true, standalone: 'app' }).bundle() .pipe(source('browserifypackage.js')) .pipe(gulp.dest('./oldsrc')); }) gulp.task('concat', ['b...

jsp - How to validate field conditionally using Struts 2 Validation? -

i newbie on struts2 , sorry poor english not mother language. assume form has 1 multiple select box , 3 text fields: multiple select box: name: sb01 , options: [value, label] : [1, type1], [2, type2], [3, type3] <s:select name="sb01" multiple="multiple" list="#{1:'type1', 2:'type2',3:'type3'}"></s:select> 3 text fields: ( textfield1 , textfield2 , textfield3 ) <s:textfield name="textfield1" /> <s:textfield name="textfield2" /> <s:textfield name="textfield3" /> if type1 selected, user needs input textfield1. if type2 selected, user needs input textfield2 . if type3 selected, user needs input textfield3. if type1,2,3 selected, user needs input textfields. on , forth. how can textfields validated conditionally? using xml or annotation instead of writing validate() method in action class because code long reading , maintaining when fields grow. i h...

c++ - How to properly explicitly instantiate a template class with fully-specialized members? -

let's have following files: foo.h namespace ns { template <typename t> class foo { public: foo(); ~foo(); void doit(); }; } foo.cpp #include "foo.h" #include <iostream> namespace ns { template <typename t> foo<t>::foo() { std::cout << "being constructed." << std::endl; } template <typename t> foo<t>::~foo() { std::cout << "being destroyed." << std::endl; } template <> void foo<int>::doit() { std::cout << "int" << std::endl; } template <> void foo<double>::doit() { std::cout << "double" << std::endl; } template class foo<int>; template class foo<double>; } is correct way explicit instantiation, assuming type ever used int or double type parameters? or need declare explicit special...

XSLT transform source xml elements into multiple different target xml elements -

the title of post not explain trying do. think example explain best. have source xml document follows: <x> <a>some data 1</a> <a>some data 2</a> <a>some data 3</a> <a>some not needed data 4</a> <a>some not needed data 5</a> </x> i need transform <a> elements (in example let's ones value "some data x") have put 1 section (starting section), since section can hold 2 elements, rest have put section (ending section). in between these 2 sections there other unrelated elements. example: <starting> <a>some data 1</a> <a>some data 2</a> </starting> <someotherxmlelements/> <somemoreotherxmlelements/> <ending> <a>some data 3</a> </ending> i have logic in template figures out elements (again in example, ones value "some data x") of whole set need pull. problem when processing in ele...

emulation - Smartface 4.3.0. IOS Emulator Error -

smartface emulator works on android ios gives me "keep calm ;) need download smartface in action app store , please try again. " error. installed it. my itunes version 12.1.2. checked firewall not block idb. restarted iphone , computer twice. cable original. allowed ios device. what can problem? if search web can see that, 8.3 update there unexpected changes effect connection between device , computer. fixed soon.

php - Pear - Cannot execute on Uninstalled MAMP -

may question little stupid. i've tried solved 2 hours , cannot find solution. firstly, i'm hobby , novice php developer. last year, installed mamp , pear on mac. today, uninstalled old mamp (from last year) , reinstall new mamp . now, when type pear command on terminal, following error occurs: /users/naylin/pear/bin/pear: line 28: /applications/mamp/bin/php/php5.4.10/bin/php: no such file or directory /users/naylin/pear/bin/pear: line 28: exec: /applications/mamp/bin/php/php5.4.10/bin/php: cannot execute: no such file or directory i know error occurs because php5.4.10/bin/php no longer exist on machine. currently, have /applications/mamp/bin/php/php5.5.18/bin/php according last updated mamp . don't know how solve problem. update as stony suggested in answer, try modify .pearrc file. file located under ~/.pearrc directory. @ last line of file, there config definition s:44:"/applications/mamp/bin/php/php5.4.10/bin/php"; . modified correct pat...

javascript - Anti-Clickjacking Code Causes Page to Continually Refresh -

i have wordpress site , have following code designed prevent clickjacking: <script type="text/javascript"> if (self === top) { var anticlickjack = document.getelementbyid("anticlickjack"); anticlickjack.parentnode.removechild(anticlickjack); } else { top.location = self.location; } </script> however, code cause 1 of admin pages refresh. page in customize section of the theme i'm building. happening because preview displayed in iframe. what can prevent clickjacking on legacy browsers, while fix issue of page reloading constantly? ideally, able modify javascript somehow. <script type="text/javascript"> if (self === top || self.location === 'yourpreviewpage') { var anticlickjack = document.getelementbyid("anticlickjack"); anticlickjack.parentnode.removechild(anticlickjack); } else { top.location = self.location; } </script> you can by...

ionic framework - White Screen in Slide-out on click back button -

i have app developed ionic. in navigation, when click go foward, slide-in animation runs ok. but, when click on button, slide-out animation shows blank screen before shows back-page. how can solve this? as not provide many info on project structure, can assume not using provide more info if expect people reply such : - html pages structure - ui routeur conf

Using android pull to refresh library draws layout on top of navigation drawer -

i'm using pull refresh library, know deprecated, unfortunately client i'm working reluctant change i'm unable so. i'm using library @chrisbanes: https://github.com/chrisbanes/actionbar-pulltorefresh in home activity layout have navigation drawer <android.support.v4.widget.drawerlayout android:id="@+id/drawer_layout" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/white" > the problem have no matter do, layout gets added view hierarchy pull refresh functionality gets drawn on top of else, includes navigation drawer, whenever have drawer open , refresh going on, have progress bar , pull refresh layout drawing on top of navigation drawer layout. i have been going though code , noticed layout gets added this: // create layoutparams adding view panel windowmanager.layoutpara...

jquery - jqGrid raises Load Error before receiving data -

i've got jqgrid working fine, i'm attempting stop loading data on page load. followed other instructions of setting datatype 'local', creating grid, , using setgridparam afterwards. however, after change grid parameters , call reloadgrid, 'load error' though no call ever hit server. function set_grid_params(){ $("#current").setgridparam({postdata:{emp:function(){return $("#employee").val();}}}); $("#current").setgridparam({edit_url: #the api url}); $("#current").setgridparam({mtype:'get', datatype:'json'}); $("#current").trigger('reloadgrid'); } #in main method $("#current").jqgrid({ name: "current balances", colnames: ["a","b","c"], colmodel: [unimportant], datatype: 'local' }); #do other stuff set $("#employee"). blank @ page load, # why need stop initial load, postdata empty. ...

c++ - Meaning of int (*) (int *) = 5 (or any integer value) -

i cannot figure out: int main() { int (*) (int *) = 5; return 0; } the above assignment compiles g++ c++11. know int (*) (int *) pointer function accepts (int *) argument , returns int, not understand how equate 5. @ first thought function returns 5 (from recent learning in f#, probably, haha), thought, briefly, function pointer points memory location 5, not work, clearly, , neither hex values. thinking because function returns int, , assigning int ok (somehow), tried this: int * (*) (int *) = my_ptr where my_ptr of type int * , same type second function pointer, in first case type int. not compile. assigning 5, or int value, instead of my_ptr , doesn't compile function pointer either. so assignment mean? update 1 we have confirmation bug, shown in best answer. however, still not known happens value assign function pointer, or happens assignment. (good) explanations on appreciated! please refer edits below more clarity on problem. edit 1 i using ...

excel - CSV Leading Zeros -

this question has answer here: csv exporting: preserving leading zeros 4 answers i got csv file may have columns leading zeros . if viewed in excel leading zeros not shown treated number . later csv has send sage 50 import record. my issue want see leading zeros when file opened in excel . don't want add in file has added in sage records. might not possible .but still work around. do open .csv excel directly? if so, try importing .csv file excel instead: save .csv start new instance of excel under data tab, external data group, select text select .csv file select 'delimited' 'next' select comma delimiter next click on column(s) retain leading zeroes, , under 'column data format' choose text repeat column need retain leading zeroes click finish there illustrated example of method here .

d3.js - Time format not working in dc.js LineChart -

i have following parsing code of time in h:m:s format var iso8601format=d3.time.format("%y-%m-%dt%h:%m:%sz"); var hoursandminsformat=d3.time.format("%h:%m:%s"); e.time=hoursandminsformat(iso8601format.parse(e.time)); i have json file reading @ different times different sensors. sample data is= [ {"id":1,"time":"2015-03-29t20:32:24z"}, {"id":2,"time":"2015-03-29t20:32:24z"}, {"id":3,"time":"2015-03-29t20:32:24z"}, {"id":1,"time":"2015-03-29t20:33:24z"}, {"id":2,"time":"2015-03-29t20:33:24z"}, {"id":3,"time":"2015-03-29t20:33:24z"}, ] i going plot dc.js rowchart there time in minutes in x axis , frequency in y axis. using following code this. returning nans. var freqchart= dc.linechart("#chart1"); var countbytime=ndx.dimension(fun...

java - Start Tomcat as Eclipse does -

well, gotta simple question experienced tomcat users. having specific issue since time, , thought through time , experience tomcat , eclipse , intellij, lead me answer, didn't. programming maven project using specific frameworks: jersey 1.8, spring 3.2.4.release (all spring framework, excluding security module) my project works fine, can start server within eclipse , intellij , debug application, developing android application parallel server side, running out of memory on work pc, so, want run app cmd (working on windows 8) , when http request received in server throws exception (when i'm running app ide, works fine) here trace of exception thrown when run tomcat command line severe: servlet.service() servlet [jersey servlet] in context path [/api] threw exception [servlet execution threw exception] root cause java.lang.abstractmethoderror: javax.ws.rs.core.uribuilder.uri(ljava/lang/string;)ljavax/ws/rs/core/uribuilder; @ javax.ws.rs.core.uribuil...

javascript - Crontab blocking winston to write to my log files -

i'm using winston log output node js app log file, when run app crontab job, not write log file. setup of winston transport: var winston = require('winston'), gettimestamp = function() { return new date().tostring(); } if(process.env.node_env === 'production' || process.env.node_env === 'test') { winston.add(winston.transports.file, { filename: environment.logfilename, maxsize: 1024*1024*10, //10mb timestamp: gettimestamp(), colorize: true }); winston.remove(winston.transports.console); } winston.exitonerror = false; winston seems work fine if direct output cron.log file, this: 0 12 * * 1 /apps/accounting/server/invoice_worker/test.sh >> /var/log/cron.log or if use console.log output. i tried doing , did not fix issue: 0 12 * * 1 /apps/accounting/server/invoice_worker/test.sh >> /dev/null 2>&1 winston not writing test or production logs ...

android - HorizontalScrollView not scrolling -

i have 1 horizontalscrollview , 1 gridlayout inside 3 images. never scrolls thought should, no matter - gestures, touch - nothing make horizontal scroll. my xml: <com.app4u.borala.atividades.layout.grideventopesqgeo android:id="@+id/horizontalscroll" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignparentbottom="true" android:background="@color/azulactionbartransparente" android:fillviewport="true" android:scrollbars="horizontal" > <gridlayout android:id="@+id/grideventos" android:layout_width="wrap_content" android:layout_height="wrap_content" android:rowcount="1" > <com.app4u.borala.atividades.layout.imagevieweventopesqgeo android:id="@+id/imageevento1" android:layout_width="match_parent" ...

java - Using two Fragment librarys -

i need use android.support.v4.app.fragment class in 1 piece of code. in one, need use android.app.fragment . mapfragment mapfragment = (mapfragment) getfragmentmanager() .findfragmentbyid(r.id.map); in part in getting message saying can't cast android.support.v4.app.fragment com.google.android.gms.maps.mapfragment . i know if import android.app.fragment error resolved, can't, because alreay have android.support.v4.app.fragment . how can fix it? wherever use fragment android.support.v4.app package, type in whole name ( android.support.v4.app.fragment ) once that, remove android.support.v4.app.fragment import, , replace import want.

Adding http request header to href link with coldfusion -

i scraping external website , using cfx_http5 tag data cfhttp slow, cfx_http5 , not resolveurl, cfhttp resolveurl make url point same domain file coming now need use cfx tag, url's coming as: with cfx_http5 <a href="details.cfm?acb=1>cick</a> with cfhttp: <a href="http://theddomain.com/details.cfm?acb=1>cick</a> so how can add code in coldfusion append url href tags please guide try this: <cfset httpresult = replacenocase(httpresult, '<a href="', '<a href="http://theddomain.com/', 'all')>

Haskell - Overwriting parameters causes unexpected behaviours -

i wrote simple function somefunc list elem = list <- elem:elem:elem:list return elem now, when i'm using it, i'm getting output this *main> somefunc [] 'a' "aaa" despite fact, function has no practical use, why happen? why editing list have effect in elem ? , how assign new value list avoiding situation? note function de-sugared this: somefunc :: [b] -> b -> [b] somefunc list elem = (elem:elem:elem:list) >>= \list -> return elem now note list in \list -> return elem different input list pass function. now see how monad instance list defined: instance monad [] return x = [x] xs >>= f = concat (map f xs) fail _ = [] so, code translated form finally: somefunc list elem = concat $ map (\list -> return elem) (elem:elem:elem:list) now can understand why getting output ? somefunc [] 'a' applied this: concat $ map (\list -> return 'a') ('a...

datetime - Current date/time in Java under Citrix Xenapp 6.5 -

we maintain legacy java application has migrated xenapp 6.5 platform. but when display current time displaying server time , not user's time on powered shared desktop. for example, user in timezone offset 9.5, when outputting timezone displayed 10. we have tried: timezone.getdefault().getid()); system.getproperty("user.timezone")); and getting time by: private final static dateformat dateformat = new simpledateformat("dd/mm/yyyy hh:mm:ss"); private calendar intcal; intcal = calendar.getinstance(); intcal.settimeinmillis(system.currenttimemillis()); string df = dateformat.format(intcal.gettime()); is there offical way user's time? also using vbs outputs same: strcomputer = "." set objwmiservice = getobject("winmgmts:" _ & "{impersonationlevel=impersonate}!\\" & strcomputer & "\root\cimv2") set coltimezone = objwmiservice.execquery("select * win32_timezone...

PowerShell remote invocation mysteriously hangs -

i have created series of functions collect iis configurations site, when run on server locally executes without issue (albeit slowly) when run them remotely using invoke-command in powershell 2 runs through , mysteriously stops approximately 15-20 seconds process. stalls on same request not always. same commands executed locally work without issues. no exception raised, hangs indefinitely. i can post code if necessary several hundred lines i'm more looking guidance on how investigate problem or if has encountered similar. comparing iisconfig between [targetserver] , localhost. checking installed iis version on [targetserver]: iis major version : 7 iis minor version : 5 iis7+ detected, using webadmin module , iis metabase name value ---- ----- name default web site id ...