Posts

Showing posts from February, 2012

javascript - Jquery - change the content of a div class to details of clicked video -

i making video playlist youtube hybrid app. populate/display data using each function , append them json data thrown webserver. i have sample json data here: [{"video_id":"1","video_youtube_title":"this latest video", "video_youtube_description":"discription primary video.", "video_youtube_thumbnail":"https://i.ytimg.com/vi/avs4w7gzsq0/hqdefault.jpg", "video_youtube_date_published":"2016-07-15 13:37:00", "video_youtube_duration":"pt16m15s", "video_youtube_link":"avs4w7gzsq0", "video_fb_link":"example/posts/1715658608683485", "video_date_added":"2016-07-14 23:45:58"}] , [{ "video_id":"2", "video_youtube_title":"title 1", "video_youtube_description":"description1", "video_youtube_thumbnail":"https://i.ytimg.com/vi/kpdnw3_1goi/hqd

java - create table user("user_id int auto_increment"); not working in derby (embedded database) -

i new in derby library. why got error when use auto_increment in query? here java code this.conn.createstatement().execute(create table user("user_id int auto_increment, primary key(user_id))"); i tried in mysql server , works in derby got error java.sql.sqlsyntaxerrorexception: syntax error: encountered "auto_increment" @ line 1 why got error? derby not have auto_increment keyword. in derby need use identity columns implement auto increment behaviour for example create table students ( id integer not null generated identity (start 1, increment 1), name varchar(24) not null, address varchar(1024), constraint primary_key primary key (id) ) ; above statement create student table id auto increment column , primary key well. hope helps

How do I include a JavaScript file in another JavaScript file? -

is there in javascript similar @import in css allows include javascript file inside javascript file? the old versions of javascript had no import, include, or require, many different approaches problem have been developed. but recent versions of javascript have standards es6 modules import modules, although not supported yet browsers. many people using modules browser applications use build and/or transpilation tools make practical use new syntax features modules. es6 modules note currently, browser support es6 modules not particularly great, on it's way. according this stackoverflow answer , supported (but behind flags) in chrome 60, firefox 54 , ms edge 15, safari 10.1 providing support without flags. thus, still need use build and/or transpilation tools valid javascript run in without requirement user use browser versions or enable flags. once es6 modules commonplace, here how go using them: // module.js export function hello() { return "hell

java - Intellij/Gradle - Can't see Jar in classpath although it exists in module -

Image
when running app in intellij following exception: exception in thread "main" java.lang.noclassdeffounderror: org/slf4j/loggerfactory while when running via gradle run task there no such error. when checking if slf4j jar (which not direct dependency build.gradle ) appears in classpath intellij runs, doesn't, but does appear in external dependencies tree: you need add intellij project classpath. can done clicking on red bulb on editor or adding manually in project settings

c++ - No speedup with OpenMP -

i working openmp in order obtain algorithm near-linear speedup. unfortunately noticed not desired speedup. so, in order understand error in code, wrote code, easy one, double-check speedup in principle obtainable on hardware. this toy example wrote: #include <omp.h> #include <cmath> #include <stdio.h> #include <stdlib.h> #include <time.h> #include <string.h> #include <cstdlib> #include <fstream> #include <sstream> #include <iomanip> #include <iostream> #include <stdexcept> #include <algorithm> #include "mkl.h" int main () { int number_of_threads = 1; int n = 600; int m = 50; int n = n/number_of_threads; int time_limit = 600; double total_clock = omp_get_wtime(); int time_flag = 0; #pragma omp parallel num_threads(number_of_threads) { int thread_id = omp_get_thread_num(); int iteration_number_local = 0; d

java - Retrofit Dynamic ResponseBody -

i planning make 1 common service class use of retrofit, @get call<responsebody> makegetrequest(@url string url); @post call<responsebody> makepostrequest(@url string url, @body requestbody parameters); in code need pass (responsebody) dynamic json pojo class name , loginres say example , call<loginres> // class dynamic i pass responsebody responsebody not know class wanted prefer. why want because , after result gson.fromjson(response, loginres.class); so, after getting result retrofit again need convert gson.fromjson. so wanted pass dynamic response retrofit response according pojo class, i know working fine when pass loginres instead of responsebody because told response need response in loginres. so if pass call<loginres> // if pass way working fine no need convert response can access properties loginres class directly. this example call web service. call<responsebody> call = apiservice.makepostrequest("/buyer/log

python - Issue creating a Numpy NDArray from PyArray_SimpleNewFromData -

i try python wrapper bind c++ functions , types python. issue when try convert custom matrix type numpy ndarray. convincing solution use pyarray_simplenewfromdata . to test behaviour, didn't manage wanted tried implement simple test: pyobject* converttopython(...) { uint8_t test[10] = {12, 15, 82, 254, 10, 32, 0, 8, 127, 54}; int32_t ndims = 1; npy_intp dims[1]; dims[0] = 10; int32_t typenum = (int32_t)npy_ubyte; pyobject* python_object = pyarray_simplenewfromdata(ndims, dims, typenum, (void*)test); py_xincref(python_object); return python_object; } and got in python these results: type(test) = <type 'numpy.ndarray'> test.ndim = 1 test.dtype = uint8 test.shape = (10,) but values inside array are: test.values = [ 1 0 0 0 0 0 0 0 80 8] i cannot figure out, doing wrong ? , not experienced doing python wrapper appreciable ! i try array has been allocated malloc, , perhaps settings flag named owndata in or

javascript - How to prevent default right click on canvas containing image -

Image
i have canvas , display image inside it. have attached jquery event it, this: $("#mycanvas").mousedown(function(e) { //do e.preventdefault(); e.stoppropagation(); }); i expect code operations , prevent default browser behavior. former fulfilled, however, latter, namely, default behavior prevention not happen. event runs though. wonder how prevent showing menu can see on image upon right-click: you can use contextmenu : $("#mycanvas").contextmenu(function(e) { //do e.preventdefault(); e.stoppropagation(); });

java - cannot find symbol:method getFactory() -

Image
symbol: method getfactory() location: variable mapper of type org.codehaus.jackson.map.objectmapper i added below jar below how import them <%@ page import="java.io.*,java.util.*, javax.servlet.*,java.text.*" %> <%@ page import="javax.swing.*" %> <%@page import="java.text.dateformat"%> <%@page import="java.text.simpledateformat"%> <%@page import="java.sql.preparedstatement"%> <%@ page language="java"%> <%@page import="java.sql.resultset"%> <%@page import="java.sql.statement"%> <%@ include file="dbconfig.jsp" %> <%@page import="java.io.file"%> <%@page import="org.codehaus.jackson.map.objectmapper"%> <%@page import="java.net.*"%> <%@page import="org.codehaus.jackson.annotate.jsonignoreproperties" import=" org.codehaus.jackson.jsonencoding" import="

ibm integration bus - How to subscribe to IBM MQTT through RfhUtil -

Image
i using ibm integration bus v10, comes builtin mqtt. want view existing topics , messages. can tell me how subscribe list , subscribe topic via rfhutil v7.5? you can ps tab of rfhutil. select queue manager , click "get topic names". topics listed shown below. select one, enter name topic field, , click subscribe. you message saying subscription created.

Rails: dependent delete of models where association has non-standard name -

i modeling directed graph in rails application (rails 4.2). among model objects vertex , edge . a vertex can part of many edges - hence have following relationship: vertex -- has_many --> edges an edge defined between 2 vertices - origin , terminus. thus, define 2 associations of edge vertex. edge -- belongs_to --> :origin, class_name: 'vertex' edge -- belongs_to --> :terminus, class_name: 'vertex' i have restricted deletion of vertex part of edge. ensures cannot delete vertex part of graph, unless floating one. but if try delete floating vertex (one part of graph not part of edge), still error: activerecord::statementinvalid (mysql::error: unknown column 'edges.vertex_id' in 'where clause': select 1 one edges edges.vertex_id = ? limit 1) now edges table obvious has no vertex_id, origin_id , terminus_id . how fix this? i suggest specify foreign_key option: specify foreign key used association. by default

Cordova Media Plugin not playing local file on iOS -

i'm having problem on playing downloaded audio file local storage using media plugin. i'm downloading file using filetransfer plugin localfilesystem.temporary directory. before playing, check existence of audio file using following code: window.requestfilesystem(localfilesystem.temporary, 0, function (filesystem) { var rootdir = filesystem.root; var dir_path = rootdir.tourl(); if (success_callback) { if (file_name && file_name !== "") { success_callback(dir_path + file_name); } else { success_callback(dir_path); } } }, function () { if (error_callback) { error_callback("error in filesystem request"); } }); the above method verifies file present in temporary storage directory. but when play file, error following logs on ios : > file transfer finished response c

asp.net - How to handle Caching before it has been set and multiple users access the website at the same time -

i have set caching website, expires after hour. problem if cache not exist , multiple users access website @ same time avoid users making same request @ same time. has impact on cpu usage @ 100% longer period of time. i using system.runtime.caching.memorycache. mvc asp.net application. i have thought of solution not sure how best implement it, thoughts are, one of many users first come in first, , start request , set flag fetching data , after more users come in shown no cache has been set before starting request check flag if request has been triggered. if has application should wait until response has come (is possible?), , use response cache. way 1 request sent , quicker response service , quicker response , cpu usage still quite low. please suggest alternative this, idea wrong can please advise? thanks

javascript - is there any way to bind ng-model to multiple input fields uniquely inside a directive? -

Image
in project got issue like.i need bind user hobbies in text field.if user comes single hobby can directly enter hobby has. when had multiple had click add multiple hobbies button.that working fine when displaying input fields dynamically using directives.but issue value coming ng-model input field binding input fields. here code. thanks in advance! these images this how getting this need in html <div> <div id="showhobbyfield"></div> <input type="number" class="form-control" placeholder="add hobbies" ng-click="addhoby()"> </div> in controller $scope.addhoby= function(){ var compiledehtml = $compile("<div my-hobby></div>")($scope); $("#showhobbyfield").append(compiledehtml); }; $scope.adduser = function(){ $scope.users= []; var obj = { userhobby : $scope.user.morehobies }; $scope.users.push(obj); menustorage.put($scope.user

filter - Laravel 5.2 Select Where Has Related Count Data -

i have table called 'templates' , 'details' has relation templates has many details @ model. i create list template table filter number or detail, when input 5 filter box, table show templates has 5 details. how this? this table structure : templates id | name | width | heigh 1 | a-5 | 112 | 100 2 | a-4 | 225 | 200 details template_id | x | y 1 | 10 | 10 1 | 20 | 10 2 | 10 | 10 2 | 20 | 10 $templates = template::wherehas( 'details', function( $detail ) { $detail->selectraw( 'count(id) aduh' )->whereraw( 'count(id) = 100' )->groupby( 'id' ); } ); i think should work: $templates = template::has('details', '=', 5)->get(); this return templates has 5 details .

MySQL - Using ORDER BY equals very poor performance -

using mariadb database containing table 1.7m uk postcodes, trying determine nearest postcode given set of latitude , longitude follows: mariadb [dev]> select count(*) total, postcode, ( 3959 * acos( cos( radians( 53.18526 ) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians(-3.01984) ) + sin( radians(53.18526) ) * sin( radians( latitude ) ) ) ) distance uk_postcodes limit 1; +---------+----------+--------------------+ | total | postcode | distance | +---------+----------+--------------------+ | 1751331 | ab10 1aa | 276.23821854757585 | +---------+----------+--------------------+ 1 row in set (0.35 sec) for purpose of example, included count(*) show how many records in table start with. discounting count(*) results in query executing in 0.01 seconds. i need nearest postcode, add order by statement: mariadb [dev]> select postcode, ( 3959 * acos( cos( radians( 53.18526 ) ) * cos( radians( latitude ) ) * cos( radians( longitude ) - radians

javascript - Is it possible to get negative coordinates for mouse movement -

i using function mouse location. receiving negative values logs. not able find scenario in function return negative values. function mousemovetracker(event) { var dot, eventdoc, doc, body, pagex, pagey; event = event || window.event; if (event.pagex == null && event.clientx != null) { eventdoc = event.target && event.target.ownerdocument || document; doc = eventdoc.documentelement; body = eventdoc.body; event.pagex = event.clientx + (doc && doc.scrollleft || body && body.scrollleft || 0) - (doc && doc.clientleft || body && body.clientleft || 0); event.pagey = event.clienty + (doc && doc.scrolltop || body && body.scrolltop || 0) - (doc && doc.clienttop || body && body.clienttop || 0); } var mm = {x: event.pagex, y: event.pagey, time: date.now()}; } try thi

javascript - How to show the custom error message without stack trace using suitescript 2.0 in netsuite -

i want show custom error message out stack trace user using "suitescript 2.0"version. in workflow custom error message showing without stack trace in suite script "error message " showing stack trace. error stack trace: {"type":"error.suitescripterror","name":"missing_contract_line","message":"please enter atleast 1 contract line item save contract.","stack":["createerror(n/error)","beforesubmit(suitescripts/ex_ue_contract_2.0.js:117)","createerror(n/error)"],"cause":{"name":"missing_contract_line","message":"please enter atleast 1 contract line item save contract."},"id":""} i want show custom error message without stack trace this: "name":"missing_contract_line","message":"please enter atleast 1 contract line item save contract." my code: t

sap - Does smarttable provide with single row editing? -

have simple fiori app displays smarttable now. have implement additional feature it, enables single row editing in ui. changes have captured , reflected backend. can single row editing implemented on smarttable control? if so, how? thanks for editable scenarios backend metadata/field controls, using smartfields in smarttable might provide you're looking for. can let smarttable automatically create smartfields using: <smarttable:smarttable id="itemsst" entityset="items" customdata:usesmartfield="true"...> this assuming view has custom data namespace declared correctly, enable ui5 shortcut notation custom data aggregations: xmlns:customdata=http://schemas.sap.com/sapui5/extension/sap.ui.core.customdata/1 if use editable smart table, should set property editable="true ". in addition, can use edittogglable="true" in order able switch between edit , display mode user.

Java bytecode, java Supplier and invokedynamic argument -

i have class, , compile it. package org.test; import java.util.function.supplier; public class test { static string get() { return "!!"; } public static void main(string[] args) { supplier<string> sup = test::get; system.out.println(sup.get()); } } then, trying it's bytecode, following beginning of public static void main function: public static void main(java.lang.string[]); descriptor: ([ljava/lang/string;)v flags: acc_public, acc_static code: stack=2, locals=2, args_size=1 0: invokedynamic #3, 0 // invokedynamic #0:get:()ljava/util/function/supplier; 5: astore_1 6: getstatic #4 // field java/lang/system.out:ljava/io/printstream; here can see invokedynamic call, which, if understand correctly, creates anonymous instance of supplier interface. passed invokedynamic 2 arguments, 1 #3. second argument 0. so, first question is: 0 stand here for?

Does socket mobile SDK support Xamarin APP or Windows Universal APP? -

Image
does socket mobile sdk support windows universal app ? use scanapi socket mobile. what xamarin support? does socket mobile sdk support windows universal app probably not, there no documents or blogs talk support windows runtime platform/uwp, although in scanapi document it mentioned windows mobile : the c# version uses wrapper. scanapi has been compiled native (unmanaged) dll. dll scanapidll.dll windows platforms , scanapidllwm.dll windows mobile platform. managed api assembled in scanapimanaged.dll windows platforms , in scanapimanagedwm.dll windows mobile platforms. but looks represents family of mobile operating systems developed microsoft several years before instead of our universal platform : wiki what xamarin support actually, barcode scanner api has added support several models of socket mobile, see here there similar question connecting socket mobile scanner in uwp app: unable connect socket mobile scanner(model: chs 7pi) in windows 10

mongodb - mgo: Find fields of type number (int, float64) doesn't work -

i'm developing restful api in go mgo driver mongodb. the problem i'm trying fetch documents field of type int , no results returned. for example have document: { "_id" : objectid("5797833e9de6f8c5615a20f9"), "id" : "28743915-9be0-427d-980d-5009bfe1b13a", "name" : "hunter", "rating" : 2.9, "downloads" : 5040 } and when trying fetch document with: conn.session. db("face"). c("papers"). find(bson.m{"rating": 2.9}). all(&papers) // papers instance of slice struct. it not return documents doing same in mongo shell returns documents, example: db.papers.find({"rating": 2.9}) but doing in mongo shell won't return documents: db.papers.find({"rating": "2.9"}) so think problem might when bson.m being serialized might convert value string, because bson.m map[string]interface{} this how paper s

nested exception is java.sql.SQLException: Invalid column type -

i have execute query in project,i have used jdbctemplate mapsqlparametersource execute mycode giving following excpetion exception ex : org.springframework.jdbc.uncategorizedsqlexception: preparedstatementcallback; uncategorized sqlexception sql state [99999]; error code [17004]; invalid column type; nested exception java.sql.sqlexception: invalid column type my query mentioned below: update inds_guest_account_mst_tbl set active_yn_flg = :activeflag , password = (case when :activeflag ='y' :password else null end), notes = (case when :activeflag='y' :notes else null end), company_name = (case when :activeflag = 'y' :companyname else null end), end_time = (case when :activeflag='y' systimestamp+1 else null end), updtd_on_dt = systimestamp, updtd_by_usr_id = :user ga_seq = :sequence and mapsqlparametersource : mapsqlparametersource paramsource = new mapsqlparametersource(); paramsource.addvalue("activeflag

java - How can I write an Object to my raw folder file -

this serializable class. public class person implements serializable{ private string name; private string surname; private int age; public person(string name,string surname,int age){ this.name = name; this.surname = surname; this.age = age; } public void setsurname(string surname) { this.surname = surname; } public void setname(string name) { this.name = name; } public void setage(int age){ this.age = age; } public int getage() { return age; } public string getname() { return name; } public string getsurname() { return surname; } public string tostring(){ return name + " "+surname+" "+age; } } i trying write person class raw folder using fileoutputstream, nothing working. can't create fileoutputstream, raw folder file. also tried fileoutputstream. fileoutputstream fos = getbasecontext().openfileoutput( "android.resource://com.cpt.sample/raw/text.txt",mode_private); you can't cha

jquery - Multiple transitions inside .css() -

i'm trying multiple sets of transitions jquery css object. in css write down this: css transition: opacity 600ms cubic-bezier(.4, 0, .2, 1), -webkit-transform 350ms cubic-bezier(.4, 0, .2, 1), transform 350ms cubic-bezier(.4, 0, .2, 1); but can see below, won't work in jquery because of comma ',' guess? jquery $('.current-slide').css({ 'transition': 'opacity 600ms cubic-bezier(.4, 0, .2, 1), -webkit-transform 350ms cubic-bezier(.4, 0, .2, 1), transform 350ms cubic-bezier(.4, 0, .2, 1)', 'opacity': '0', 'z-index': '1', '-webkit-transform': 'scale(.8) translatey(0)', 'transform': 'scale(.8) translatey(0)' }); tried find useful info problem online, can't find any. thanks! here solution try code $('.current-slide').css({ 'transition': 'opacity 600ms cubic-bezier(.4, 0, .2, 1),-w

rest - DocuSign Api - blank excel/word document throws a large exception - and returns stack trace -

during testing 1 of our developers has attempted create envelope containing blank excel document. has not caused creation process fail, returns large stack trace via rest api: { "errorcode": "unable_to_convert_document", "message": "system unable convert document pdf. unable convert document(blank xlsx document) pdf. error: userid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx ipaddress:xx.xxx.xxx.xx source:apirestv2:system.invalidoperationexception: operation fail: operationfailed\r\n @ platform.common.throws.invalidoperationexceptionif(boolean condition, string message, object[] args)\r\n @ sandbox.client.sandboxhostcommstcpclient.dosandboxoperation(string module, string method, byte[] payload)\r\n @ sandbox.client.sandboxclient.dooperation(string module, string method, byte[] payload, predicate`1 issuccess, string& errormessage)\r\nsystem.invalidoperationexception: operation fail: operationfailed\r\n @ platform.common.throws.invalidoperati

Jrebel clear Mybatis interceptors when reload Mapper XML files -

i'm using jrebel 6.3.0 hot reload mybatis's mapper xml spring boot web application. , used java configuration config mybatis. @configuration @conditionalonclass({ pageinterceptor.class }) @enableconfigurationproperties(mybatispageproperties.class) @autoconfigurebefore(mybatisautoconfiguration.class) public class mybatispageautoconfiguration implements applicationcontextaware { private static final logger log = loggerfactory.getlogger(mybatispageautoconfiguration.class); @autowired private mybatispageproperties properties; @override public void setapplicationcontext(applicationcontext applicationcontext) throws beansexception { beanutil.setapplicationcontext(applicationcontext); } /** * * * @return */ @bean public pageinterceptor pageinterceptor() { log.info("========pageinterceptor========"); pageinterceptor pageinterceptor = new pageinterceptor(); properties p = new pr

animation - Animate only new components -

i experimenting new animation api in angular 2, , have following challenge: i have parent component displays set of child components using *ngfor. ngfor references simple data array in parent component. requirements: when parent component rendered initial children, parent , children should rendered instantly (without animation) when new child components added (because of new object appended data array), new child should animated (e.g. bounce in left). how can configure animation handle this? the basic question is: how can child component know if rendered part of initialization of parent or later? some possible solutions: - can set boolean variable directly on data object says new object created after view , should animated. property checked component. however, don't want introduce kind of view logic in data model. - can use lifecycle hooks in parent component set property in parent says parent rendered , subsequent (new) children should animated. however, haven&#

gridview - C# Devexpress How to code the CheckBox column header to select or deselect all -

how use c# code program devexpress gridview checkbox column header show check box, once check or uncheck, select or deselect check box of data row. i know how program check box below, not find clue above. need advise master could. thank you, brian repositoryitemcheckedit repositorycheckedit1 = gridcontrol1.repositoryitems.add("checkedit") repositoryitemcheckedit; repositorycheckedit1.valuechecked = "true"; repositorycheckedit1.valueunchecked = "false"; gridview1.columns["item"].columnedit = repositorycheckedit1; i suggest go through below devexpress example , threads similar requirement: multiple selection using checkbox (web style) xtragrid checkbox column how show checkedit in column header adding checkbox xtragrid , iterating through it hope help.

ios - Facebook login completion block not called -

Image
i tried implement facebook login custom login button, i've completed setup steps , when tap button, web view present , ask me provide permission. however, if tap done(on top left of web view controller), completion block called but when tap cancel or ok, web view controller dismissed completion block never called? here's code used: let fbloginmanager = fbsdkloginmanager() fbloginmanager.loginbehavior = .native fbloginmanager.loginwithreadpermissions(["email"], fromviewcontroller: self) { (result, error) in // put breakpoint here won't stop here if tap ok if error != nil { print(error.localizedfailurereason) } else if result.iscancelled { // dismiss view } else { let token = result.token.tokenstring // token } } edit 1 here's open url method in appdelegate: func application(app: uiapplication, openurl url: nsurl, options: [string : anyobject])

angularjs - Angular2 Component Router : Capture query parameters -

i'm struggling capture url query string parameters being passed angular2 app 3rd party api. url reads http://example.com?oauth_token=123 how can capture value of "oauth_token" inside component? i'm happily using component router basic routing it's query string. have made several attempts , latest receiving component looks like import { component, oninit } '@angular/core'; import { activatedroute } '@angular/router'; @component({ template: '' }) export class twitterauthorisedcomponent implements oninit { private oauth_token:string; constructor(private route: activatedroute) {} ngoninit() { console.log('the oauth token is'); console.log( this.route.snapshot.params.oauth_token ); } } any advice appreciated. ** update if comment out routes query parameters stick however, moment include route query parameters removed on page load. below stripped down copy of routes file 1 route imp

angularjs - Facebook Account Kit in Ionic/Cordova app -

i try connect facbook account kit in ionic/cordova app, main problem faced in facebook account kit set client/server side domain name in ionic/cordova app webview serve file system("file:///android_asset/www/index.html#/app/request"). how in ionic app.

FluidTYPO3 dublicated Content Modules with Flux Grid at TYPO3 Backend -

Image
i'm using typo3 7.6 with latest flux -, vhs - , fluidcontent extensions ( fluidtypo3 ). i've wrote new flux-content element, tab-container zurb foundation 6 . element working fine (frontend), @ backend have row tabs , columns .. sth. dublicated tabs , content inside?! cleared cache. here's screenshot. tab-elements dublicated, don't know why? my flux fce: <div xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:f="http://typo3.org/ns/typo3/fluid/viewhelpers" xmlns:flux="http://typo3.org/ns/fluidtypo3/flux/viewhelpers" xmlns:v="http://typo3.org/ns/fluidtypo3/vhs/viewhelpers"> <f:layout name="content" /> <f:section name="configuration"> <flux:form id="tabs" options="{group: 'lll:typo3conf/ext/myelements/resources/private/language/locallang.xlf:grid.elements'}"> <flux:form.sheet name="tabs&q

Alternative way to write cUrl in PHP -

i trying create service on hook.io load token api. public function loadtoken() { $computedhash = base64_encode(hash_hmac ( 'md5' , $this->authserviceurl , $this->password, true )); $authorization = 'authorization: bearer '.$this->username.':'.$computedhash; $curl = curl_init(); curl_setopt($curl, curlopt_post, true); curl_setopt($curl, curlopt_postfields, ''); curl_setopt($curl, curlopt_httpheader, array('content-type: application/json' , $authorization )); curl_setopt($curl, curlopt_url, $this->authserviceurl); curl_setopt($curl, curlopt_returntransfer, 1); curl_setopt($curl, curlopt_ssl_verifypeer, false); $result = curl_exec($curl); $obj = json_decode($result); $info = curl_getinfo($curl); curl_close($curl); if($info['http_code'] != '20

Android - Get app package name from app(3rd party) which start my app activity -

guys need on :( componentname componentname = sharecompat.getcallingactivity(this);
 string callingpackage = sharecompat.getcallingpackage(this); i can app package name above code, if app (com.demo.app.a) startactivityforresult() app b. at app b, can : com.demo.app.a but, if app b() opened google chrome browser(from intent action.view scheme). let's app support https scheme. my app b, can't retrieve google chrome browser app package name. note: google chrome browser example. baseactivity.this.getreferrer().gethost(), return correct app package name want. available api 22+ any way detect app package name, if app opened 3rd-party app? thanks guys! my app b, can't retrieve google chrome browser app package name. correct. there no requirement app include extra_referrer in intent , , if do, can put fake uri in there. baseactivity.this.getreferrer().gethost(), return correct app package name want not necessarily. quoting the docume

python - Expire a view-cache in Django? -

the @cache_page decorator awesome. blog keep page in cache until comments on post. sounds great idea people comment keeping pages in memcached while nobody comments great. i'm thinking must have had problem before? , different caching per url. so solution i'm thinking of is: @cache_page( 60 * 15, "blog" ); def blog( request ) ... and i'd keep list of cache keys used blog view , have way of expire "blog" cache space. i'm not super experienced django i'm wondering if knows better way of doing this? here's solution wrote you're talking on of own projects: def expire_view_cache(view_name, args=[], namespace=none, key_prefix=none): """ function allows invalidate view-level cache. view_name: view function wish invalidate or it's named url pattern args: arguments passed view function namepace: optioal, if application namespace needed key prefix: @cache_page decorat

java - Getting number format exception in android -

i newbie android , have implemented class in data coming database, have used cursor gives me numberformatexception . my code is: package com.example.login; import android.os.bundle; import android.app.activity; import android.content.context; import android.database.cursor; import android.database.databaseerrorhandler; import android.database.sqlite.sqlitedatabase; import android.database.sqlite.sqlitedatabase.cursorfactory; import android.database.sqlite.sqliteopenhelper; import android.view.menu; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.toast; public class mainactivity extends activity { button b,b1; edittext e1,e2,e3; sqlitedatabase a; database db; cursor r; string s=""; string d=""; string w,t; int q; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layo

CloudForms and Openshift -

i have generic question here , have started using openshift enterprise , origin know details on cloudforms ui, know cloudforms ui can lot of things including managing openshift instances know following in terms of managing openshift instance, can cloudforms able following : order new openshift environments[for ex, dev, uat , prod], how many nodes , other details need environments? could able plug-in custom tools elk/splunk or appdynamics ordered environments part of provisioning or later? could able populate locally build images , publish users using them? ex: suppose middleware teams build images tomcat, nginx etc , able publish in cloudform , able add them newly ordered environments through cloudforms ui, done? could add multiple registries , integrate them ordered environments. does have features openshift enterprise console has? scanling, s2i etc. could promote images 1 environment other through cloudforms ui? can integrate ci/cd tools , build environments ordered envi

java - How to jump where exception caught in IntelliJ debugger? -

Image
i have throw new indexoutofboundsexception(); line in code. unfortunately, exception has no effect: i.e. no message appeared , no program crash. this because code called somewhere in system library , there exception caught , processed. how find place? if press f8 on line, jump code inside scene : try { tm = dndgesture.processtargetdrop(dragevent); } { dragboardhelper.setdataaccessrestriction( dndgesture.dragboard, true); } but code catches exception? think should execute finally block , go somewhere's catch block. doesn't happen: if continue pressing f8 see no try/catch/finally blocks. how can happen? you're looking exception breakpoint, can set break on exception though caught. in breakpoints dialog (it default bound ctrl+shift+f8 or cmd+shift+f8 depending on platform, or click in debug task pane), create java exception breakpoint notifications on

node.js - SyntaxError in plugin 'gulp-mocha' Unexpected token = -

i getting following error in travis-ci when using node 4.3.2: syntaxerror in plugin 'gulp-mocha' unexpected token = everything works when using node 6, not 4.3.2. here stack trace: [12:05:11] starting 'build'... [12:05:11] finished 'build' after 13 μs [12:05:11] starting 'tests'... syntaxerror in plugin 'gulp-mocha' message: unexpected token = stack: syntaxerror: unexpected token = @ exports.runinthiscontext (vm.js:53:16) @ module._compile (module.js:373:25) @ object.module._extensions..js (module.js:416:10) @ module.load (module.js:343:32) @ function.module._load (module.js:300:12) @ module.require (module.js:353:17) @ require (internal/module.js:12:17) this task running: gulp.task('tests', ['build'], (cb) => { if (haserror) { cb(); return; } return gulp.src('build/test/**/*.js', {read: false}) .pipe(mocha()) .on("error", handl

batch file - Changing part of a string -

i have question batch-file. have script connecting drive on other pc on network. have fill in whole pc-name. every pc-name same last 3 5 numbers different. example pc000012345, pc000001234 or pc000000123. now want if put 3 or 4 numbers in file other number(s) 0. example fill in 123 output must 00123 , if fill in 1234 output must 01234. possible within command/commands? set x=1234 rem sure put enough zeros set y=0000000000%x% echo %y:~-5% => 01234