Posts

Showing posts from July, 2010

How to alter the deprecated Camera class in Android -

in previous way, flashlight feature used using camera class. entire camera , camera-related classes in android.hardware packages deprecated, should alternatively use other classes in android.hardware.camera2 package. traditionally, coded flashlight part this. // getting camera parameters private void getcamera() { if (camera == null) { try { camera = camera.open(); params = camera.getparameters(); } catch (runtimeexception e) { log.e("camera error. failed open. error: ", e.getmessage()); } } } /* * turning on flash */ private void turnonflash() { if (!isflashon) { if (camera == null || params == null) { return; } // play sound playsound(); params = camera.getparameters(); params.setflashmode(parameters.flash_mode_torch); camera.setparameters(params); camera.startpreview(); isflashon = true; // chang

javascript - Type ahead - problems with json structure -

so i've been wrestling learning twitter's typeahead.js, , got say, documentation leaves desired. i've tried close dozen different methods found posted around adding typeahead functionality input , i'm stumped. what, if missing in below code? i'm not seeing errors in console, , idnums seems contain appropriate data, i'm still not seeing correct overlay. my javascript: var idnums = new bloodhound({ datumtokenizer: function (datum) { return bloodhound.tokenizers.whitespace(datum.value);}, querytokenizer: bloodhound.tokenizers.whitespace, prefetch: 'endpoint returns below json', }); idnums.initialize(); $('#prefetch .typeahead').typeahead({ hint: true, highlight: true, minlength: 1 }, { name: 'br_num', displayke

ruby - How to refer to root path in Sinatra views -

is there way refer root url of sinatra app? in 1 of views i'd following: <a href="<%= root_path/cats %>">show cats</a> does sinatra provide magic helper root_path or it's equivalent? there uri helper #uri(addr = nil, absolute = true, add_script_name = true) ⇒ object also known as: url , to generates absolute uri given path in app. takes rack routers , reverse proxies account. for example: <a href="<%= uri('/cats') %>">show cats</a>

css - Jquery terminal text formatting syntax, what am I doing wrong? -

i using jquery terminal , working great. however, life of me, cannot figure out correct syntax format string. the example says echo([string|function], [options]) — display string on terminal — (additionally if can call function function argument call function , print result, function called every time resize terminal or browser). there 3 options raw — allow display raw html, finalize — callback function 1 argument div container , flush — default true, if it's false not print echo text terminal until call flush method. can use basic text formating using syntax folow: [[guib;<color>;<background>]some text] display text: [[ — open formating u — underline s — strike o — overline — italic b — bold g — glow (using css text-shadow) ; — separator color — color of text (hex, short hex or html name of color) ; — separator color — background color (hex, short hex or html name of color) ; — separator [optional] class — class adeed format span element [optional] ] — en

centos - How to control ruby-devel presence in a Software Collections environment -

i'm trying build ruby app on centos 6.6 machine. there different ruby stacks installed through software collections. please not not have root on machine, , privileges limited, particularly, not include package installation. native extensions not build. seems ruby-devel missing, told admin correctly installed both stacks: dnf install rh-ruby22-ruby-devel.x86_64 ruby193-ruby-devel.x86_64 -y here problem: bob@server ~> scl enable rh-ruby22 bash bash-4.1$ ruby -v ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux-gnu] bash-4.1$ gem install json building native extensions. take while... error: error installing json: error: failed build gem native extension. /opt/rh/rh-ruby22/root/usr/bin/ruby -r ./siteconf20150625-17536-saskmd.rb extconf.rb mkmf.rb can't find header files ruby @ /opt/rh/rh-ruby22/root/usr/share/include/ruby.h extconf failed, exit code 1 gem files remain installed in ~/.gem/ruby/gems/json-1.8.3 inspection. results logged ~/.gem/

javascript - Rookie error while writing test with Chai, Mocha, Express, johnny-five and node -

hi there i'm trying learn bit of test driven development using express, mocha, chai , johnny-five. wrote little application can turn led on , off. application works test fails. can tell me doing wrong in test? thank you the output of npm test is > blink@1.0.0 test /users/me/documents/johnny-five/blink > mocha --reporter spec 1435257445439 looking connected device j5 .on() 1) should turn led on .off() ✓ should turn led off 1 passing (13ms) 1 failing 1) j5 .on() should turn led on: assertionerror: expected undefined equal 1 @ context.<anonymous> (test/j5.js:9:14) npm err! test failed. see above more details. this test/j5.js require('mocha'); var assert = require('chai').assert; var j5 = require("../j5"); describe('j5', function () { describe('.on()', function () { it('should turn led on',function(){ var result = j5.on(); assert.equal(result, 1);

javascript - Losing this reference in $scope.$on event -

i'm registering "$routechangesuccessevent" angularjs setting callback function. when event raised can not access controllers instance "this". current instance unedfined. my complete typescript code: export class ctlr { static $inject = ["$rootscope","$route"]; constructor(private $scope: ng.irootscopeservice) { this.scope = $scope; this.title = ""; //this.scope.$on("$routechangesuccessevent", this.onroutechangestart); this.registerevents(); } private registerevents(): void { this.scope.$on("$routechangesuccessevent",(event: ng.iangularevent, args: any) => { //this undefined console.log(this); }); } public scope: ng.iscope; public title: string; public onroutechangestart(event: ng.iangularevent, args: any) { //this undefined this.title = args.$$route.name); } } } i'm ab

Grunt LESS force compile on error -

i wondering if it's possible force grunt compile less if there error? the reason ask i'm outputting settings interface (moodle) less can changed users. when try see colour or math throws errors because it's either expecting rgba value or number value. an example of syntax be: div{background-color: rgba(0,0,0,~"[[setting:blockboxshadowalpha]]");} this works fine if put directly compiled css fails when using rgba() function or doing following: a:hover{color: darken(~"[[setting:linkcolor]]", 20%);}

reactjs - How to make initial authenticated request with token from local storage? -

i'm using vanilla flux utils communicating apis. on initial page load i'd read token local storage , make request api data. i've got localstorageutils.js library interacting window.localstorage . container component handles login/logout actions , reads current user on page load. app.js componentwillmount() { localstorageutils.get('user'); } localstorageutils reads value , brings flux via serveraction similar flux chat example . get(key) { var value = window.localstorage.getitem(key); if (value) { serveractioncreators.receivefromlocalstorage(key, value); } } that puts user userstore , views can show username , logout link, etc. i have apiutils.js requesting data server. question is: tell apiutils have logged-in user @ initial page load? i call method inside apiutils localstorageutils not feel right. or have make round trip whenever change event inside container component? you should pass user data apiutils class

java - Why eclipse complaining about the missing dependency I added? -

Image
eclipse says needs com.sun.jmx:jmxri:jar:1.2.1, added in pom below. complains dependency added, why that? thanks! i think found answer: maven failing resolve recursive dependencies multiple repositories need change log4j 1.2.15 1.2.16 <dependency> <groupid>log4j</groupid> <artifactid>log4j</artifactid> <version>1.2.16</version> </dependency>

javascript - Sliding an element "up" over another as the user scrolls down, without fixed positioning? -

the wording in title weird, apologies. it's hard explain effect. i have this, works best on chrome: http://mattluckhurst.com/dev/ my client wants each panel slide user scrolls down, covering previous panel. accomplishing setting "current" panel have position:fixed , top:0 page scrolls it. panels each have z-index corresponds vertical position on page. ideally: you scroll down. when next panel halfway window, scroll animates way there, panel snapped top next 1 can come in on it. it's working pretty in chrome, getting lot of flickering , stuff elsewhere. on mobile it's mess, want nice smooth swipe down. i know fixed elements can pretty funky on mobile, wondering if problem, or if should using other window scrolling animation / effect. i see more complex parallax stuff time, should pretty doable, i'm not sure start. thanks help! let me know if need more info. a few libraries might you: https://github.com/dirkgroenen/jquery-viewpo

scala - What are the ways to convert a String into runnable code? -

i not find how convert string runnable code, instance: val = "new string('yo')" // conversion println(i) should print yo after conversion. i found following example in post: import scala.tools.nsc.interpreter.iloop import java.io.stringreader import java.io.stringwriter import java.io.printwriter import java.io.bufferedreader import scala.tools.nsc.settings object funcrunner extends app { val line = "sin(2 * pi * 400 * t)" val lines = """import scala.math._ |var t = 1""".stripmargin val in = new stringreader(lines + "\n" + line + "\nval f = (t: int) => " + line) val out = new stringwriter val settings = new settings val looper = new iloop(new bufferedreader(in), new printwriter(out)) val res = looper process settings console println s"[$res] $out" } link: how convert string text input function in scala but seems scala.tools not available anymore, , i&

.net - Re-connection settings in IBM.XMS -

do have functionality in ibm.xms re-connection attempt count , re-connection attempt delay , re-connection attempt timeout settings, have in tibco ? i going use ibm.xms in .net application send/receive messages to/from ibm mq. if reason ibm mq goes down, believe these settings allow .net application attempt re-connection , thereby avoid crash in application. update i got info @ http://www-01.ibm.com/support/knowledgecenter/ssfksj_8.0.0/com.ibm.mq.msc.doc/xms_automatic_client_reconnection.htm . using using following: oconfactory.setintproperty(xmsc.wmq_client_reconnect_options, xmsc.wmq_client_reconnect_q_mgr); oconfactory.setstringproperty(xmsc.wmq_connection_name_list, string.format("{0}({1})", con.host, con.port)); oconfactory.setintproperty(xmsc.wmq_client_reconnect_timeout, ((con.reconnecttimeout.hasvalue && con.reconnecttimeout.value != 0) ? con.reconnecttimeout.value : xmsc.wmq_client_reconnect_timeout_default)); but not working. code breaking mom

How get only a few results ElasticSearch? -

i'm trying run query displays "indexes" appears count = 0 . don't want appear count = 0. i've tried use must_not not resolved. how do that? my search curl -xget 'http://127.0.0.1:9200/oknok/base_gerenciada/_search' -d '{ "from": 0, "size": 0, "query":{ "bool":{ "must":[{ "term":{ "last":true } }] } }, "facets": { "filters": { "terms": { "field": "spec_veiculo.raw", "all_terms": true,"size" : 999999, "order": "term" } } }}' my result (example) {"took":11,"timed_out":false,"_shards": {"total":5,"successful":5,"failed":0}, "hits":{"total":8375,"max_score":0.0,&q

c# - Insert text at cursor position -

i need insert text variable @ cursor position no matter in window/program located, whenever c# or vba (preferably c#) code run write text variable. pd: im using voicebot create custom scripts, c# default script looks this: using system; using system.drawing; public static class voicebotscript { public static void run(intptr windowhandle) { var mytext = "this simple text"; //how add text variable cursor position? } } to clarify: voicebot can run c# or visual basic scripts on voice commands, after writing script triggered voice. https://www.voicebot.net/ need run script example when playing game , chat selected, warn player x. you can use sendkeys simulate keyboard , send keystrokes active application. example: sendkeys.send("+this simple text"); note simulating keyboard, need explicitly invoke shift key (with + character, in example) uppercase character. there other caveats including other characters have escape, not feed method

java - Overriding method which is in a static inner class -

what i'm trying achieve override method: public boolean onkeypreime(int keycode, keyevent event) the method in searchview.searchautocomplete class http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/android/support/v7/widget/searchview.java#searchview.oncloseclicked%28%29 i know how extend searchview class: public class customsearchview extends searchview { public customsearchview(context context) { super(context); } public customsearchview(context context, attributeset attrs) { super(context, attrs); } } but possible extend inner static class , override method? onkeypreime method located in searchautocomplete class. actually set own implementation of class implements tintautocompletetextview can't that. private final searchautocomplete mquerytextview; modificator final of field means not accessible through via reflection.

window - How can I duplicate a non-editor panel in Eclipse? -

i had same problem user ( arghtype ) having here in question's thread: how enable duplicate tabs in eclipse? (i.e. duplicate windows) although, answer post doesn't achieve both want. recommends opening separate, duplicated window, bit resource heavy need. i wanted formally ask question in case has appropriate answer instead of work-around or compromise, or can open feature request in eclipse work item tracker, , way answer , history can become more apparent specific issue. note have tried menu options "window" > "show view" > "other...", , have selected view/panel wanted, current 1 in ui both selected , unselected in different cases, , still not receive duplicate panel. i appreciate sources such links documentation, or @ least screen shot answer, since not asking editor panel in ui, commonly found issue on internet. to add, specific case using rtc 5.0.2 eclipse 4.2.2 (juno), , multiple "work items" panels open workfl

html - Images and text aligment in footer -

i learning css , html while customizing wordpress theme, cannot make images , text scale mobile. the thing have 2 sections have white background, 1st 1 has 3 pictures links in them, 2nd 1 typical footer sitemap etc. i want center pictures , make them scale on mobile, footer one. currently last picture gets dropped down http://codepen.io/phoez/pen/rpjdrr #partnerzy { background-color: #ffffff; height: 80px; width: auto; } #rgw { padding-left: 10%; padding: 10px; float: left; } @media (max-width: 800px) { #rgw { padding-left: 10%; padding: 10px; float: left; max-width: 40%; } } #zgs { padding-left: 15%; float: left; text-align: center; width: auto; } @media (max-width: 800px) { #zgs { /* padding-left: 25%; */ float: left; text-align: center; width: auto; max-width: 40%; } } #sa { padding-left: 25%; float: left; width: auto; } @media (max-width: 800px) { #sa {

objective c - UILabel word wrap preventing -

Image
i have label 2 lines of text, problem word getting wrapped instead of getting smaller fit fixed width , fixed height ! any idea on how fix programmatically appreciated. thank you just set font readjust size according label width so: labelname.numberoflines = 1; labelname.adjustsfontsizetofitwidth = yes;

stemming - Analyzer not added to field with Elasticsearch DSL -

i'm using elasticsearch-dsl-py 0.0.5 , example @ https://github.com/honzakral/es-django-example usage django. i've got doctype: class pagedoc(doctype): title = string(analyzer='snowball') index = index('my_index') index.doc_type(pagedoc) and update index using management command below. page django model i'm trying index. class command(basecommand): def handle(self, *args, **kwargs): self.es = connections.get_connection() index.delete(ignore=404) index.create() self.verbose_run(page) def verbose_run(self, model, report_every=100): name = model._meta.verbose_name print('indexing %s: ' % name, end='') start = time.time() cnt = 0 _ in streaming_bulk( self.es, (m.to_search().to_dict(true) m in model.objects.all().iterator()), index=settings.es_index, doc_type=name.lower()):

R: How to match/join 2 matrices of different dimensions (nrow/ncol)? -

i want match/join 2 matrices, small 1 values should match in bigger 1 rownames/colnames. find this answer. however, cannot match locations codeline frn <- as.matrix(bigmatrix[[1]]) not work in case. answers of inner, outer ... join here did not help, want match/join on lot of different columns (and not e.g. costumerid x , customerid y). as matrices use 126x104 , 193x193 matrices. prepared example data: 1. bigger matrix smaller 1 should included (the letters in original data set country names): a = c("a", "b", "c", "d", "e", "f") full_matrix = matrix(nrow = length(a), ncol=length(a)) dimnames(full_matrix) <- list(levels(as.factor(a)), levels(as.factor(a))) full_matrix b c d e f na na na na na na b na na na na na na c na na na na na na d na na na na na na e na na na na na na f na na na na na na and smaller matrix: matrix = matrix(c(2, 4, 3, 1, 5, 7, 3, 1, 6), nrow=3, ncol=3) dimnames(matrix) <- l

How do i create a space while printing in java? -

i started learning java today , tried write basic program myself. worked fine while printing value of variable along text, noticed doesn't maintain space between two. how overcome this? see code : public class helloworld { public static void main(string[] args) { int a=43; int b=7; int c=a+b; system.out.println("the result is" + c); } } the output the result is50 how can maintain space between is , 50 ? just add space first string: system.out.println("the result " + c); in cases have 2 strings not literals (s1,s2) , want concat them space, add literal includes space: s1 + " " + s2

android - How to set the limit on date in Date picker dialog -

i want put limit on date user can not pick date more that, example if today 1 january user should not able select more 7 dates , mean can not select 9 january. want him not select month , year. putting limit set task in 1 week. what have done far showing date picker fragment , setting current date in it. code in main activity goes this: etselectdate.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { dialogfragment datepickerfragment = new datepickerfragment() { @override public void ondateset(datepicker view, int year, int month, int day) { log.d("date change", "ondateset"); calendar c = calendar.getinstance(); c.set(year, month, day); dateformat df = dateformat.getdateinstance(); etselectdate.settext(df.format(c.gettime()));

printing - print pdf417 barcode in zebra printer using c# and zpl -

i try send command zebra printer. use rawprinterhelper class , sendstringtoprinter function proplem nothing typing. got command zebra manual here code: public class rawprinterhelper { [dllimport( "winspool.drv", entrypoint = "openprintera", setlasterror = true, charset = charset.ansi, exactspelling = true, callingconvention = callingconvention.stdcall)] private static extern bool openprinter( [marshalas(unmanagedtype.lpstr)] string szprinter, out intptr hprinter, int32 pdefault); [dllimport("winspool.drv", entrypoint = "closeprinter", setlasterror = true, charset = charset.unicode, exactspelling = true, callingconvention = callingconvention.stdcall)] public static extern bool closeprinter(intptr hprinter); [dllimport("winspool.drv", entrypoint = "startdocprinterw", setlasterror = true, charset = charset.unicode,

kendo multiselect for mvc clears the selected values on submit -

my kendo multiselect control displays below clears selected values on page submit. when submit page , contains validations errors, selected items in multiselects lost. though gets fill in httppost method of controller. please me find solution behaviour. @(html.kendo().multiselectfor(m => m.gemeentesids) .htmlattributes(htmlattrmultiselect) .datatextfield("name") .datavaluefield("id") .placeholder(model.disabled ? "" : "selecteer gemeentes indien van toepassing...") .value(model.gemeentes) .autobind(false) .datasource(source => { source.read(read => { read.action("getgemeentes", "general").data("gemeentefilter").type(httpverbs.post); }) .serverfiltering(false); }) ) controller: if (model.gemeentesids != null) model.gemeentes = _organi

c++ - How to find out if final part of passed path is file, directory or mask? -

i'm trying make linux c++ code copy , list files arbitrary path, independently of protocol ( ftp, ssh, mtp, local, smb, etc ), wondering best way check if specified path simple folder path ( list in there ), path ending in file ( list 1 file ), or mask ( /path1/path2/*.xxx ). the first 2 ones transparently handled code, third 1 eluding me... right now, have this: entry newentry ( path ); if newentry.isdirectory () { newentry.listcontentsintoarray(array); foreach entry in array displayinfo ( entry ); } else displayinfo ( newentry ); but have no idea how if ends in wildcard mask... ideas? posix has got api wildcard expansion: glob() : c.f. man 3p glob (if have got posix manpages installed on system). note can hand plain directory , regular filenames glob() . might simplify code. can ask glob() append / each expanded entry if directory (flag: glob_mark ).

java - URI build error when using org.apache.http.client.utils.URIBuilder.URIBuilder.build() -

my codes follows: uri uri = new uribuilder().setscheme("http") .sethost("127.0.0.1:8080") .setpath("/test") .setparameter("openid", "openid") .setparameter("openkey", "openkey") .build(); i expect result this: http://127.0.0.1:8080/test?openid=openid&openkey=openkey result is: http://127.0.0.1:8080/test?openid%3dopenid%26openkey%3dopenkey i hope reason why "=","&" encoded, help

php not working with xampp, calling it from javascript returns full php source -

i'm making html5 web netbeans. when load page, call php function: <?php echo "ok"; ?> and show message returned on window.alert(), instead of showing "ok", shows full source of php file. this example, happen when try connect sqlserver database, doesn't anything. i guess apache xampp isn't working properly(in fact, when try execute php file directly, "can't connect localhost" page). have tried lot of things , modified apache' configuration archives many times still nothing. don't know doing wrong(something forget install?) appreciate help. pd: i'm spanish, sorry if have write stupid.

CRM 2013 on premise: Create sharepoint document location only when user selects on documents button at the record -

at present plugin creates sharepoint location when accounts record created, want avoid unnecessary sharepoint location created i.e. site/folder, when user clicks on documents menu (or may custom button) sharepoint location should created. can this? if yes, how? with custom button able create sharepoint locations. requirement create on navigation item "documents". not able bind click event of documents navigation item. if try document.getelementbyid(item.getid()).onclick = function () { calljsfunction() } i error of there error field's customized event field:window event:onload error:undefined 2 steps: 1.write customaction creates documentlocation 2.call javascript,which executed customcommand in ribbon see post further information: https://deepakexploring.wordpress.com/2013/10/23/actions-in-crm-2013/ if need more explanations add comment..

excel vba - Run-time error '-2147467259, Automation error,Unspecified error VBA macro to logon through IE -

i experiencing such error whenever run vba macro logon automatically sugarcrm via ie. code further below. 'needs references microsoft html object library , microsoft internet controls option explicit sub test() const curl = "http://sam.selexgalileo.com/sugarcrm/index.php?action=login&module=users&login_module=accounts&login_action=index" const cusername = "robertopecora" 'replace xxxx user name const cpassword = "rp3c0r4!!" 'replace yyyy password dim ie internetexplorer dim doc htmldocument dim loginform htmlformelement dim usernameinputbox htmlinputelement dim passwordinputbox htmlinputelement dim signinbutton htmlinputbuttonelement dim htmlelement ihtmlelement set ie = new internetexplorer ie.visible = true ie.navigate curl 'wait initial page load while ie.readystate <> readystate_complete or ie.busy: doevents: loop set doc = ie.document 'get form on page set loginform = doc.forms(0) '

hadoop - how hdfs removes over-replicated blocks -

for example wrote file hdfs using replication factor 2. node writing has blocks of file. others copies of blocks of file scattered around remaining nodes in cluster. that's default hdfs policy. happens if lower replication factor of file 1? how hdfs decides blocks nodes delete? hope tries delete blocks nodes have count of blocks of file? why i'm asking - if does, make sense - alleviate processing of file. because if there 1 copy of blocks , blocks located on same node, harder process file using map-reduce because of data transferring other nodes in cluster. when block becomes over-replicated , name node chooses replica remove. name node prefer not reduce number of racks host replicas, , secondly prefer remove replica data node least amount of available disk space. may rebalancing load on cluster. source: the architecture of open source applications

apache - Redirecting to multiple webapps in same Tomcat -

i must tried lot of possibilities knowledgment in apache ws not advanced. apache web server version: 2.2.22 os: centos 6 64 bits tomcat version: 7.0.57 what need achieve following: have plain websites defined way: <virtualhost *:80> serveradmin example1@example1.com documentroot "/opt/sites/example1/" servername example1.com errorlog logs/example1-error_log customlog logs/example1-access_log common redirectmatch permanent ^/(.*) http://www.example1.com/$1 </virtualhost> <virtualhost *:80> serveradmin example1@example1.com documentroot "/opt/sites/example1/" servername www.example1.com errorlog logs/example1-error_log customlog logs/example1-access_log common </virtualhost> i have tomcat several webapps, each 1 accessible own context. must access each 1 of webapps different domain. example, have following webapps: wbexample1, wbexample2, wbexamp

sql server - list all students who have not taken midterm for 1 or more subjects -

i have 3 tables likes student , subject ,and midterm tables. student table contains studid firstname lastname class 1 r 12a 2 b s 12a 3 c t 12a 4 d u 12a 5 e v 12b subject table contains subid subname 1 maths 2 science 3 english midterm table contains studid subid marks examdate 1 1 100 2014-09-24 1 2 92 2014-09-25 1 2 92 2014-09-26 2 1 74 2014-09-24 2 2 78 2014-09-26 2 3 73 2014-09-26 3 1 90 2014-09-24 3 2 84 2014-09-25 3 2 92 2014-09-25 5 1 87 2014-09-24 4 2 79 2014-09-24 4 3 90 2014-09-26 the result must be: firstname lastname subname based on below comment , assuming students must take midterms select firstname , lastname , subname ( select studid , firstname, lastname , subid , subname student , su

c# - how to call a server method in aspx.cs from javascript -

javascript code <asp:content id="content1" contentplaceholderid="headcontent" runat="server" > <script type="text/javascript"> function validatepage() { pagemethods.saveandmoveto_page3("abcd", callsuccess, callfailure); } </script </asp:content> button event trigger call function validatepage() <asp:button id="button2" runat="server" style="background-color: #cc0d0d; border-radius: 5px; " forecolor="#c8c8c8" onclientclick ="validatepage();" text="next" width="120px" /> aspx page <asp:scriptmanager id='scriptmanager1' runat='server' enablepagemethods='true' /> added in site master. i need javascript method call saveandmoveto_page3() method in code. somehow pagemethods not calling method in c# code. please help. [webmethod] public static

xml - Failed to generate java classes from xsd using binding -

i have lot of xsd in path generate java classes. in bindings file have: <jaxb:bindings schemalocation="../aiseo/xsd/aiseotypy.xsd" node="/xs:schema"> </jaxb:bindings> but throw error: [error] failed execute goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java (generate-sources-iszr) on project iszr-dataset: execution generate-sources-iszr of goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java failed: file:/some/path/resources/wsdl/binding/bindings.xml [16,79]: "file:/some/path/resources/wsdl/aiseo/xsd/aiseotypy.xsd" not part of compilation. mistake "file:/some/path/resources/wsdl/ais3/xsd/ais3typy.xsd"? so tried change advise me <jaxb:bindings schemalocation="../ais3/xsd/ais3typy.xsd" node="/xs:schema"> </jaxb:bindings> but throw error , advise use previous xsd. [error] failed execute goal org.apache.cxf:cxf-codegen-plugin:3.1.1:wsdl2java (generate-sources-iszr) on project i

c - argv prints out environment variables -

i experimenting randomly argc , argv in c, program(try.c): /* trying understand argc , argv.*/ #include<stdio.h> int main(int argc,char *argv[]) { int i=0; /* argv[4]="arg4"; argv[5]="arg5"; argv[6]="arg6"; argv[7]="arg7"; argv[8]="arg8"; argv[9]="arg9";; */ for(i=0;i<(argc+20);i++) { printf("arg %d: %s\n", i,argv[i]); } return 0; } when run as ./try arg1 arg2 arg3 prints out this: arg 0: ./try arg 1: arg1 arg 2: arg2 arg 3: arg3 arg 4: (null) arg 5: xdg_vtnr=7 arg 6: xdg_session_id=c2 arg 7: clutter_im_module=xim arg 8: selinux_init=yes arg 9: xdg_greeter_data_dir=/var/lib/lightdm-data/raman arg 10: gpg_agent_info=/run/user/1000/keyring-faajwi/gpg:0:1 arg 11: term=xterm arg 12: shell=/bin/bash arg 13: vte_version=3409 arg 14: windowid=58720268 arg 15: upstart_session=unix:abstract=/com/ubuntu/upstartsession/1000/1775 arg 16: gnome_keyring_co

parsing - How to parse Date in IST format in Golang? -

time.date(t.year(), t.month(), time.now().day(), 10, 0, 0, 0, time.utc) i want set datetime of 10:00:00 in ist format in golang. it depends on format of time have @ hand. go has standard time formats ready consts in time package, can specify own standard if it's custom. regarding time zone, can parse or output time in specific time zone. here example of parsing time string in ist, , outputting utc. it's not clear question precise problem hope helps: // first, create instance of timezone location object loc, _ := time.loadlocation("asia/kolkata") // our custom format. note format must point exact time format := "jan _2 2006 3:04:05 pm" // timestamp timestamp := "jun 25 2015 10:00:00 am" // parse it, considering it's in ist t, err := time.parseinlocation(format, timestamp, loc) // printing prints in ist, can set timezone utc if want fmt.println(t, err) // example - getting utc timestamp fmt.println(t.utc())

mongodb - Error while mongorestore - assertion: 17370 Restoring users and roles is only supported for clusters with auth schema versions 1 or 3, found: 5 -

i trying restore folder created using mongodump , , using mongorestore . there error: assertion: 17370 restoring users , roles supported clusters auth schema versions 1 or 3, found: 5 how can solve error , restore? i able restore individual databases 1 @ time using --db parameter.

How to get value from php inside a javascript? -

in below script default values used. use values database <?php $user->location ?> i.e., want use users loaction data inside var states . how do it? <script> $(document).ready(function() { var states = ['alabama', 'alaska', 'arizona', 'arkansas', 'california' ]; </script> <?php $ar = array('one', 'two', 1, false, null, true, 2 + 5); ?> <script type="text/javascript"> var ar = <?php echo json_encode($ar) ?>; // ["one","two",1,false,null,true,7]; // access 4th element in array alert( ar[3] ); // false </script> thank you!!

javascript - Apply a script on a html file called by Ajax -

this question has answer here: event binding on dynamically created elements? 18 answers everything in title ... i created code running on element range: (function($){ $('.range').each(function(){ var range = $(this); range.on('input', function(){ range.next().text($(this).val()); }) .next().text(range.val()); }); })(jquery); i wish works on same element called ajax. $('.ajax-global').on('click', function(){ var param = $(this).attr('id'); $('.ajax-window').load('./ajax/' + param + '.php'); }); here practical example of these tags range: online example . if call same html code via ajax, javascript not apply latter. code ajax (press "welcome stackoverflow" button). how proceed? dilemma can not solve, , while ... edit :

javascript - Node.js http server, function can't access response object -

i have following http server code var server = http.createserver(function (req, response) { body = ""; req.on("data", function (data) { body += data; }); req.on("end", function (){ parserequest(body); }); }).listen(8080); var parserequest = function (data) { try { jsondata = json.parse(data); handlerequest(jsondata); } catch (e) { console.log("json parse failed") console.log(e); response.writehead(500); response.end("json parse failed"); } } i thought parserequest function should able access it's variables in in parent function's scope. there doing wrong here? the error is, response.writehead(500); ^ referenceerror: response not defined change to: req.on("end", function (){ parserequest(response, body); }); and then: var parserequest = function (response, data) { ... and can access response. ;)

git - I really need to create each time I have new machine (virtual or not, vagrant, ...) an SSH key for GitHub -

on github configuration there ssh keys. 1 personal computer. 1 job computer. 1 parents computer , on. now, ... starting again new configuration "session", in front of vagrant machine. can create ssh keys , paste github. but, ... have ssh keys in host. how can provide unique personal key own vagrants? can create personal key? obviously, ... don't want public share of key. best practices this? if share vagrant machine, ... how can other developers fix ssh keys keys? finally, ... how possibile automate provisioning of ssh keys inside vagrang machine?

html - Bootstrap unwanted white space while display is mobile -

Image
i using bootstrap website , came across odd white space can't seem rid of. if has encountered before happening on few devices iphone6, galaxy s4, galaxy note 3. there margin: 0; padding: 0; , on <li> . <ul class="nav nav-justified"> <li class="active"><a href="#">home</a></li> <li><a href="#">faq</a></li> <li id="large"><a href="#" id="large" class="play">play</a></li> <li><a href="#">promotions</a></li> <li><a href="#">support</a></li> </ul> heres image of mean white space. this looks on devices: in intial question, that's screenshot developer view yes? i believe it's rendering fault when first switch mobile device mode. i can replicate here , notice happens when switch iphone 6 preview ,

web api - How to upload image in DotNetNuke(DNN) using HTML file upload control -

i in process of developing registration module has profile image upload functionality , using html file upload control web api access database., can 1 please share how file upload in code behind file name should store in files table 4 re-sized image in /portals/0/user path. please try have @ below link - http://www.codeproject.com/articles/1757/file-upload-with-asp-net it shows upload image using asp.net code

jasper reports - Ireport 4.0.2 band layout multiple column headers and footers -

is possible in ireport have band layout 1 below without using subreport? or there other workaround. tried use subreport unfortunately cannot solve issue. these have separate queries , use php fill in data each details. please me. column header 1 detail 1 column footer 1 column header 2 detail 2 column footer 2 try use table elements in report. can use there same dataset too.

Using firebase Java library on server without authentication process -

the server operating being used generate firebase tokens , read , write values firebase, use rest apis different type of token has different uid prefix. however, since many features have been added server, decided use firebase java library , migrating previous code written rest apis. the question is, how can use firebase java library tokens omitting authentication process? authentication process runs asynchronously can applied client application not server. what if fails authentication? or if takes time? the previous code used auth token every request this: https://abcd.firebaseio.com/ns/blahblah/event?auth=token so doesn't need authentication process. hope understand poor english. thanks! according firebase documentation authentication server-side processes , there 3 ways authenticate: using firebase app secret using secure jwt optional admin claim set true using secure jwt designed give access pieces of data server needs touch you

iphone - Can we send message from iOS app to facebook messenger programatically -

hy working on ios app , app has instant messaging feature user can send messages each other. requirement if user send message other user message send other user facebook messenger app automatically. possible? thanks no isn't possible. violation of privacy , construed spam receiver of messages send programmatically. link posted in comments 1) deprecated , 2) allowing user message through facebook via application, not send messages. @ best can request permission read user's inbox or inbox of page, read_mailbox or read_page_mailboxes permission. https://developers.facebook.com/docs/facebook-login/permissions/v2.3 look there list of facebook permissions can ask for. , before post question this, please please please take time google search. took me no more 5 minutes , it's burden on community when searchable questions 1 asked. if want build chat application however, there's lot of great options can at. first, building own chat application using webso

How to use ffmpeg for muxing steam into mp4 file and saving to iOS photo galllery -

i trying mux live stream mp4 file using ffmpeg on ios. after muxing, how should save mp4 file ios photo gallery? my mp4 file path this: file:///var/mobile/containers/data/application/560f1377-d16d-4322-8cbc-c6f521ba326d/documents/temp.mp4 i use: videoatpathiscompatiblewithsavedphotosalbum make sure right format file can saved ios photo gallery, it's return no. any comment appreciated!

java - UmbrellaException when accessing variable type List<File> (lib-gwt-file & GWT) -

i error in browser log: uncaught com.google.gwt.event.shared.umbrellaexception: exception caught: (typeerror) : cannot read property 'add_75_g$' of undefined castfireeventfromsource_0_g$ @ eventbus.java:77 fireeventfromsource_2_g$ @ simpleeventbus.java:67 fireevent_9_g$ @ droppanel.java:97 firenativeevent_1_g$ @ domevent.java:125 dispatch_87_g$ @ droppanel.java:125 handler_0_g$ @ droppanel.java:87 this exception raises when try use list<file> way. using other variable type works makes me suspect might not fault. i'm inexperienced sure. import org.vectomatic.file.file; import org.vectomatic.file.filelist; protected list<file> readqueue; protected file fileholder; private void processfiles(filelist files) { for(file file : files) { gwt.log(file.getname()); fileholder = file; // no error readqueue.add(file); // error } } even accessing readqueue.size(); raises exception. i'm using gwt-2.7