Posts

Showing posts from May, 2013

json - Pass Text from stdin as an Argument to a Shell Script from Python -

i have json file on have following: run "text" field on json through syntaxnet. from syntaxnet output, create new json field looks like: text_syntaxnet = [{'word' = <word1>, 'position = <word_position>, 'pos_tag' = <pos_tag>}, {...........}] add new json field original json came in input. i doing using pig streaming. stream input data function parse.py contents are: import sys import re import subprocess import json def create_new_json_field(tags_list): word_tags = {} new_json_field = [] line in tags_list: line = line.strip() if not line: continue else: words = line.split() word_tags['word'] = words[1] word_tags['position'] = words[0] word_tags['pos_tag'] = words[4] new_json_field.append(word_tags.copy()) return new_json_field def main(argv): try: line in sys.stdin:

node.js - Gulp task fails to write files sporadically -

i following error, not always. , not file, other file, or generated .map file. [20:39:24] error: unknown: unknown error, open 'c:\projects\somewebsite\buildartifacts\styles\framework\customer-signup.css' the gulp task looks this: function styles(cb) { var stream = require('merge-stream')(); var stylebundles = bundleconfig.filter(function (bundle) { return bundle.type === 'stylesheets'; }); stylebundles.foreach((bundle) => { let starttime = process.hrtime(); gutil.log('starting', gutil.colors.green(bundle.name), 'with', gutil.colors.blue(bundle.files.length), 'files'); let stylestream = gulp.src(bundle.files, { root: './website', base: './website' }) .pipe(sourcemaps.init()) .pipe(less({ compress: false }).on('error', errorhandler)) .pipe(postcss([ autoprefixer({ browsers: con

java - Failed to parse a String to int -

i don't know what's wrong parsing string int part in code. before parsing, looks correct. import java.io.ioexception; public class thewindow { public static void main(string[] args) throws ioexception{ string s = "13.16"; double d = double.parsedouble(s); system.out.println(d); char[] ch = s.tochararray(); char[] ch2 = new char[s.length()]; for(int = 0; < ch.length; i++){ if(ch[i] == '.'){ break; }else{ ch2[i] = ch[i]; } } string s2 = new string(ch2); system.out.println(s2); try{ s2.trim(); int newi = integer.parseint(s2); system.out.println(newi); }catch(exception e){ system.out.println("failed"); } } } the problem code breaking out of loop when '.' character reached. since created ch2 length of 5 me

ssh - Ansible giving ssh_exchange_identification ERROR -

my ansible playbook connects remote node using proxy. when ansible play book runs; gives following error while doing ssh step. [root@vm1-msdp ansible]# ansible-playbook fend_file.yaml -i env/target -vvvvv play [lab1] ******************************************************************* gathering facts *************************************************************** <10.169.99.222> establish connection user: msdp <10.169.99.222> remote_module setup <10.169.99.222> exec sshpass -d9 ssh -c -tt -vvv -o proxycommand="nc -x 142.133.134.161:1088 %h %p" -o stricthostkeychecking=no -o gssapiauthentication=no -o pubkeyauthentication=no -o user=msdp -o connecttimeout=10 10.169.99.222 /bin/sh -c 'mkdir -p $home/.ansible/tmp/ansible-tmp-1473708903.98-28407509853006 && echo $home/.ansible/tmp/ansible-tmp-1473708903.98-28407509853006' fatal: [10.169.99.222] => ssh error: ssh_exchange_identification: connection closed remote host useful re-run co

javascript - jquery window width issue -

in demo if click inputs in dark blue area (numarani gonder) gonna see nothing happend if click on responsive mode (less 768px) u gonna see modal has been opening it's okey thing want if u click again on dekstop mode black element has been opening i'm using bootstrap modal , js codes var $window = $(window), $nogonder = $('.add-modal'); $(window).on('resize', function () { if ($window.width() < 768) { $nogonder.on("click",function(){ $("#parallaxpopup").modal('show'); }) }else{ $("#parallaxpopup").modal('hide'); $("#rezervasyonpopup").modal('hide'); $("#popupcheckin").modal('hide'); }; }); cause: notice happens if hit case window < 768 , resize larger. if start large fine. this because not unbinding event. solution: var $window = $(window), $nogonder =

how to assign the background image using javaScript? -

i want change background image using javascript. , taking below approach: document.getelementbyid("country").style.backgroundimage="url('images/dropdown.jpg')"; but not working. could please me in error?

smartcard - SSLv3 mutual authentication using libcurl and smart card -

i need establish communication channel consume webservice using sslv3 mutual authentication, libcurl , smart card, store client certificate, key pair , responsible signatures, encryptions, etc. for testing purposes, without using smart card, following brief code runs smoothly: .... (soap message configurations) .... curl_easy_setopt (curl, curlopt_use_ssl, curlusessl_all); curl_easy_setopt (curl, curlopt_sslversion, 3); curl_easy_setopt (curl, curlopt_ssl_verifypeer, 1); curl_easy_setopt (curl, curlopt_ssl_verifyhost, 2); curl_easy_setopt (curl, curlopt_sslcert, "clientcertificatefile"); curl_easy_setopt (curl, curlopt_keypasswd, "testprivatekeypass"); curl_easy_setopt (curl, curlopt_sslkey, "testprivatekeyfile"); curl_easy_setopt (curl, curlopt_cainfo, "cacertificatefile"); curl_easy_setopt (curl, curlopt_url, "urltowebservice"); curl_easy_perform (curl); after running code, can establish communication using sslv3 , expect

mysql - HTTP POST Transmission suggestion -

i'm building system requires arduino board send data server. the requirements/constraints of app are: the server must receive data , store them in mysql database. a web application used graph , plot historical data. data consumption critical web application must able plot data in real time. so far, system working fine, however, optimization required. the current adopted steps are: accumulate data in arduino board 10 seconds. send data server using post data containing xml string representing 10 records. the server parse received xml , store values in database. this approach historical data, not realtime monitoring. question is: there difference between: accumulating data , send them xml, and, send data each second. in term of data consumption, sending post request each second much? thanks edit: can provide mathematical formula benchmarking 2 approaches in term of data consumption? for data consumption question need figure out how each p

database - How can i update the data within my app without having the user update the app in the playstore -

i'm taking break simple game development totally different. create android/ios app (something news app , new technology app) can daily update data in without having user update app every day within playstore. question(s) , easiest , less confusing way so. , required have website correlate , sync data app. i've researched days , have gotten leads none clarifies how it's done. if show me step step or tutorials on topic it'll appreciated!! the best way make data available web service , have app go fetch data.

tableadapter - Tableau : Update external file in published twbx (Package Workbook) -

we have packaged workbook going publish on client machines. part of package have 1 external file needs updated (not refresh) new data (file format remain same) quarterly. and problem comes here team dont want go maintenance mode. want user update external file quarterly. possible user access file in published data source in server , upload new file when ever available ? not aware of client file system not going option of placing in tableau repository. , dont want upload file part of db (has external file). please suggest thanks you have multiple options. in cases described, should separate workbook data , publish workbook, not packaged workbook (i.e. don't check include files button) briefly, can put file on share drive must accessible tableau server using run user account via same path used publish. kind of brittle , can have security issues if not careful. you create extract , publish data separately tableau data source, , use tableau data extract command

Getting Facebook Album Photo's on External Website using Graph API -

i'm trying facebook album data on site, using facebook graph api. i'm trying via ajax or postman can't work. i can make normal https://graph.facebook.com/me call , name (i.e. shows got proper access token in postman , can see json). it's when try call json album error below (again access token there call above) from url, id of album: https://www.facebook.com/amir.sobhi.94/media_set?set=a.693877xxx02412.100004404098018&type=3 and error ... { "error": { "message": "unsupported request. object id '693877xxx02412' not exist, cannot loaded due missing permissions, or not support operation. please read graph api documentation @ https://developers.facebook.com/docs/graph-api", "type": "graphmethodexception", "code": 100, "fbtrace_id": "dhwlsshjttu" } }

chef - Chefspec with Hashicorp Vault -

i'm trying use chefspec test implementation of chef , hashicorp vault recipe chef_gem 'vault' compile_time true if chef::resource::chefgem.instance_methods(false).include?(:compile_time) end require 'vault' vault.address = 'https://address:8200' vault.token = citadel['foo/bar'] vault.auth_token.renew_self test require_relative '../spec_helper' describe 'wrapper::default' context 'role foo' let(:chef_run) chefspec::solorunner.new(platform: 'ubuntu', version: '14.04') |node| node.default['role'] = 'foo' const_set(:vault, module.new) end.converge(described_recipe) end before(:each) allow_any_instance_of(chef::recipe).to receive(:require).and_call_original allow_any_instance_of(chef::recipe).to receive(:require).with('vault').and_return(true) allow_any_instance_of(::vault).to receive(:address).and_call_original

What's the best way to reduce repetition of form element attributes in angularjs? -

i'm designing angularjs 1.5.x app have lots of forms , lots of fields per form. i'm finding i'm repeating attributes lot, e.g.: <div class="form-group"> <label class="control-label" for="thing.field1">field 1</label> <input class="form-control ctrl-md" type="text" id="thing.field1" name="field1" ng-model="thing.field1" ng-maxlength="30" required uib-tooltip="field 1 required" tooltip-placement="right" tooltip-trigger="none" tooltip-is-open="thingform1.field1.$invalid && showvalidationerr('thing1')" ng-blur="fieldblur('thing1')"> </div> i've attempted use directive + template, , works more or less, seems complex , slow. is there way make in

c++ - LLVM: Clang does not run Pass if CallGraphWrapperPass is a requirement -

i wrote following pass llvm. using namespace llvm; namespace { struct skeletonpass : public functionpass { static char id; skeletonpass() : functionpass(id) {} void getanalysisusage(analysisusage &au) const { au.addrequired<callgraphwrapperpass>(); au.setpreservesall(); } virtual bool runonfunction(function &f) { errs() << "function: " << f.getname() << "!\n"; callgraph &cg = getanalysis<callgraphwrapperpass>().getcallgraph(); return false; } }; } char skeletonpass::id = 0; static registerpass<skeletonpass> x("skeleton", "text"); if execute code opt -load ./libskeletonpass.so -skeleton test.bc > /dev/null i correct output. (test.bc can neglected) according great blog , next command clang -xclang -load -xclang ./libskeletonpass.so test.c should work, long r

python - Pandas: how to increment a column's cell value based on a list of ids -

i have list of ids correspond row of data frame. list of ids, want increment value of column intersects id's row. what thinking this: ids = [1,2,3,4] id in ids: my_df.loc[my_df['id']] == id]['other_column'] += 1 but doesn't work. how can mutate original df, my_df ? try this: my_df.loc[my_df['id'].isin(ids), 'other_column'] += 1 demo: in [233]: ids=[0,2] in [234]: df = pd.dataframe(np.random.randint(0,3, (5, 3)), columns=list('abc')) in [235]: df out[235]: b c 0 2 2 1 1 1 0 2 2 2 2 0 3 0 2 1 4 0 1 2 in [236]: df.loc[df.a.isin(ids), 'c'] += 100 in [237]: df out[237]: b c 0 2 2 101 1 1 0 2 2 2 2 100 3 0 2 101 4 0 1 102

c# - Where should be custom EventLog created? -

i have windows service. i'm struggling eventlog working properly. in windows service's constructor do: public myservice() { initializecomponent(); autolog = false; if (!eventlog.sourceexists(servicename)) { eventsourcecreationdata creationdata = new eventsourcecreationdata(servicename, servicename); eventlog.createeventsource(creationdata); } } after run service, no exceptions, can't see under application , services logs in event viewer ! (even after computer reset). i checked registry , service appears in hkey_local_machine\system\currentcontrolset\services\myservice not here: hkey_local_machine\system\currentcontrolset\services\eventlog\myservice i install windows service via visual studio's developer command prompt vs2015 opened administrator. why there? why not in eventlog? why can't see in event viewer? thanks! use following code, check source

Kafka & Flink duplicate messages on restart -

first of all, similar kafka consuming latest message again when rerun flink consumer , it's not same. answer question not appear solve problem. if missed in answer, please rephrase answer, missed something. the problem exact same, though -- flink (the kafka connector) re-runs last 3-9 messages saw before shut down. my versions flink 1.1.2 kafka 0.9.0.1 scala 2.11.7 java 1.8.0_91 my code import java.util.properties import org.apache.flink.streaming.api.windowing.time.time import org.apache.flink.streaming.api.scala._ import org.apache.flink.streaming.api.checkpointingmode import org.apache.flink.streaming.connectors.kafka._ import org.apache.flink.streaming.util.serialization._ import org.apache.flink.runtime.state.filesystem._ object runner { def main(args: array[string]): unit = { val env = streamexecutionenvironment.getexecutionenvironment env.enablecheckpointing(500) env.setstatebackend(new fsstatebackend("file:///tmp/checkpoints")) env

printf - Why is F# printfn not implemented in terms of Console.WriteLine? -

i noticed unexpected behavior when using f# printfn. seems break format string chunks , call console.write multiple times each call printfn. expect format entire string , call console.writeline once. i noticed because intercepting standard console output using console.setout call own textwriter tries prefix every line of output time stamp , additional custom text. what gives? here's guess, it's worth: compiler magic at runtime, implementer knew write go buffered stream, performance won't drastically different using stringbuilder object , tostring() override. maybe performance better, since avoided object allocation.

java - Does Spring Data MongoDb support $filter array aggregations operator? -

i'm trying implement in spring data using mongotemplate following working mongodb query: db.answers.aggregate([ { "$match" : { "object_id" : "1" } }, { "$project": { 'answer_list': 1, 'profile': { $filter : { input: '$answer_list', as: 'answer', cond: { $eq: [ '$$answer.question', 2 ] } } } } }, { "$unwind" : "$profile"}, { "$unwind" : "$answer_list"}, { "$group" : { "_id" : { "question" : "$answer_list.question", "answer" : "$answer_list.answer", "criteria" : "$profile.answer"}, "count" : { "$sum" : 1 } } }, { "$sort" : { "_id.question" : 1, "_id.answer" : 1 } } ]); the collection has structure: { "_id" : objectid("..."), "object_id" : objectid(&quo

php - iOS push not going to multiple device IDs -

i fetching array of device_ids using php, , sending ios pushes each of them code - question - devices received pushes when array of device_ids ( devicetokens ) 2-3 device_ids . deviecs did not receive push notifications when devicetokens array ~300 device_id long. issue? new php (this question has been asked few times answers did not reflect problem facing) $customers_ios = "select * `gcm_user` `gcmregios` <> '0' , `preference` = '1'"; $c_ios = mysql_query($customers_ios); while($bd = mysql_fetch_array($c_ios)) { $devicetokens[]= $bd['gcmregios']; } $arrlength = count($devicetokens); //echo $arrlength; // put private key's passphrase here: $passphrase = 'mypassphrase';//'pushnotification'; //adhoc_id setup above $message = $adhoc_desc;

Use python list IN postgresql query -

my question similar this have strings instead of integers in list. my python list : list = ['a', 'b'] #number of items varies 1 6 i want use list in postgres query this select * sample sub in ('a', 'b'); i can use tuple(list) ('a', 'b') , not useful when length of list became one. struggling find way convert ['a'] ('a') ['a', 'b'] ('a', 'b') tried in[91]: myquery = "select * sample sub in (%s)" % ",".join(map(str,list)) in[92]: myquery out[92]: 'select * sample sub in (a,b,c)' but postgres expects select * sample sub in ('a', 'b'); use psycopg2 , handle correctly sorts of edge cases haven't thought of yet. specific problem see http://initd.org/psycopg/docs/usage.html#adapt-tuple

html - how to blur background image and display text over it on hover -

this question has answer here: how apply css 3 blur filter background image 10 answers the effect trying create when hover on image blur image , display text on it. far able blur image , display text on it, problem text blurred. how prevent text being blurred out? suggestions appreciated html <div class="row3"> <div class="six left"> <p class = "imgdescription">description yo</p> </div><!--closing column 6--> <div class="three middle"> </div><!--closing column 3--> <div class="three right"> </div><!--closing column 3--> </div> css .row3 .left{ background: url('zombiegame.jpg') no-repeat center center; -webkit-background-size:

Generic Exception Handler Orchestration in BizTalk -

hi biztalk developers, i need input , guidance on how design orchestration can take few parameters input , log them in sql server table (tbltrackingdata) i want start orchestration @ various points, example when calling webservice want log request in db , when response want log response xml in same table. in case of exception want log error message , other details in same table tracking purpose. can 1 guide me, direct me existing blogs/posts on how handle generic tracking / exceptions etc starting new orchestration. the purpose of new orchestration call anywhere, please suggest if handled in better way also. thanks. the best advice, don't this. the reason? everything describe done biztalk server automatically biztalk tracking , event log . i can tell experience, not need else beyond tracking , event log. i recommend implement proper exception handling within app , log custom events, written windows event log only well.

function - Understadning C# delegate Func<...> operators -

i having trouble on understanding c# func<...> operators, example, have following snippet: func<int, bool> = n => n <= 1; func<int, int> b = n => 10; func<int, int> c = n => { return n; }; func<int, int> d = n => a(n)? b(n): n*c(n-1); console.writeline("{0} {1} {2}", d(1), d(2), d(3)); what meaing of ? , : stand ? a(n)? b(n) stand condition ? (e.g. if a(n) false , b(n) has value, calculate c(n) , return d .) not sure if understand correctly or assumption totally wrong. to make more clear, can interpret n => a(n)? b(n): n*c(n-1); as (given definitions provided @ question): if (n<=1) return 10; //b(n) else return n*n-1; //n*c(n-1)=n*n notice returns there because of d=...

Why does express-ejs-layout fails to render layout.ejs? -

in configuration below, contents of home.ejs not appear plugged <%- body %> of layout.ejs page. hitting default route / returns contents of home.ejs none of structure or styling in layout.ejs . i couldn't find useful information troubleshoot how express-ejs-layouts work. thoughts on why might be? app structure: . ├── app ├── main.js ├── node_modules ├── package.json └── public ├── css │   └── style.css ├── js │   └── app.js └── views ├── layout.ejs └── pages ├── events.ejs ├── home.ejs └── test.ejs configuration snippet: // file: app/server.js // template engine app.set('view engine', 'ejs'); app.use(expresslayouts); // set views directory app.set('views', __dirname + '/../public/views'); app.use(express.static(__dirname + '/../public')); route: //file: app/controllers/maincontroller.js exports.home = function(req,res){ res.render(

amazon web services - Boto3 SNS Publish to a wildcard Topic ARN -

background aws services regional (e.g. us-west-2 , us-east-1 ) , boto3 library requires set default region before accessing client or resources. however, documentation here shows can have sns topic arn wildcard substituted region. documentation says: documentation: amazon simple notification service (amazon sns) syntax: arn:aws:sns:region:account-id:topicname arn:aws:sns:region:account-id:topicname:subscriptionid examples: arn:aws:sns:*:123456789012:my_corporate_topic arn:aws:sns:us-east-1:123456789012:my_corporate_topic:02034b43-fefa-4e07-a5eb-3be56f8c54ce code when use boto3's sns resource/client publish topic arn (that has wildcard region), below error. when don't have wildcard region (e.g. specify us-west-2 ), works. looked boto3 library , seems replace values in json mapping (e.g. inserts topic string) don't understand why invalid parameter if documentation above shows it's valid. import boto3 client = boto3.client('sns', region_nam

python - how to add object in database with sqlalchemy (doesn't insert) -

i'm trying add object in database function insert_data_into_the_picture_table when query database realize no object inserted. class picture(timestampmixin, base): __tablename__ = 'picture' id = column(integer, primary_key=true) created_at = column(datetime) original_image_profile_hash = column(string(60)) normal_image_profile_hash = column(string(60)) profile_image_url = column(text) user_id_str = column(string(30)) user_id = column(integer, foreignkey('user.id')) user = relationship(user) def insert_data_into_the_picture_table(): beginning = datetime.now() compte = 0 open('user_pictures.json', encoding='utf-8') data_file: data = json.load(data_file) information in data[:10]: = datetime.now() twitter_user_id = information.get('twitter_user_id') user = session.query(user).filter(user.id_str == twitter_user_id).first() if user: print

html - how to hide the overflow coming from my corner ribbon div? -

on line 11 of codepen (link) have following body{overflow:hidden;} that last attempt hide overflow of content right side of body... a div called ".talk" positioned absolute corner ribbon & "call action" .talk{height:50px; width:370px; position:absolute; right:0; top:0; transform:rotate(40deg); margin-right:-100px;} however body{overflow:hidden;} hides lot of content below first pink icon ... how can hide ribbons overflow without affecting layout of page? http://codepen.io/gebrutommy/pen/tlhfh?editors=0100 do change in css remove body{overflow:hidden;} add .text{position: relative; overflow: hidden; } then move talk div child of text <div class="text"> <div class="mix-text"> <h1>gitter</h1> <h2>where developers come talk</h2> </div> <div class="talk"><a href="https://gitter.im/tommygebru">let's chat&

reactjs - Typescript React React.createElement: type should not be null, undefined, boolean, or number -

Image
i using typescript(1.8.10) , learning react. using react-bootstrap build simple navigation example , getting following error. error prevents dom getting rendered. totally new react not sure doing wrong here. thank or pointers past error. // '.tsx' file enables jsx support in typescript compiler, // more information see following page on typescript wiki: // https://github.com/microsoft/typescript/wiki/jsx /// <reference path="./../../../typings/index.d.ts" /> import * react 'react'; import * reactbootstrap 'react-bootstrap'; interface inavigationprops { } let navbar = reactbootstrap.navbar; let navitem = reactbootstrap.navitem; let menuitem = reactbootstrap.menuitem; let navbarheader = reactbootstrap.navbarheader; const dropdownitems = [ { href: '#', name: 'overview' }, { href: '#', name: 'setup' }, { href: '#', name: 'usage' }, ]; export default class navigation extends re

ajax - Unexpected token < in JSON at position 2 jquery Autocomplete -

i have ajax request jquery "autocomplete", code bellow: var clienteslist = []; $("#clientes").autocomplete({ source: function (request, callback) { $.ajax({ type: "post", url: "../../../cliente/getclientesbyname", data: "{'nome':'" + request.term + "'}", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (data) { debugger; callback($.map(data.cities, function (obj) { return obj.main })) } }) } }) when event triggered, error showed in jquery.min?? "create:2 uncaught syntaxerror: unexpected token < in json @ position 2" my input html this: <input type="text" id="clie

algorithm - Erlang "case" clause for values in a range -

learning erlang, i'm solving simple problem , came solution: %%%------------------------------------------------------------------ %%% @doc https://leetcode.com/problems/add-two-numbers/ %%% %%% @end %%%------------------------------------------------------------------ -module(add_two_numbers). -define(base10, 10). -export([main/2]). -ifdef(test). -include_lib("eunit/include/eunit.hrl"). -endif. -spec main(l1 :: nonempty_list(non_neg_integer()), l2 :: nonempty_list(non_neg_integer())) -> list(). %%%================================================================== %%% export %%%================================================================== main(l1, l2) -> loop(l1, l2, 0, []). -ifdef(test). main_test() -> ?assertequal([0, 2, 1, 2, 1, 1], add_two_numbers:main([9, 6, 9, 5, 9], [1, 5, 1, 6, 1])), ?assertequal([3, 6, 9, 7, 5], add_two_numbers:main([4, 1, 8, 7, 2], [9, 4, 1, 0, 3])), ?assertequal([6, 7, 9, 0, 1], add_two_numbers:main([2, 2, 3, 3

how to run python files in windows command prompt? -

Image
i want run python file in command prompt nothing. these screen shots of program testing , output command prompt gives me. first set path of python https://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows and run python file python filename.py command line argument python python filename.py command-line argument

ios - ImageView Image doesn't show at first -

i have set image image view in storyboard , in viewwillappear using: imageview.image = uiimage(named: string) but when view controller first appears image doesn't show. image appears when view controller comes second time.

Host or OS dependent settings in Visual Studio Code (VSCode) -

in visual studio code, possible have different settings.json files dependent on host or os on, preferably in layer above user settings? there no current way achieve within product, on backlog. can follow issue , give thumbs show team important you.

javascript - Pie chart with empty middle HTML5 -

Image
i'm working on mvc webpage, i'm using kendo mvc display charts. now, need specific chart (image bellow) don't seem find in kendo. ideas how customize kendo's chart? or there js charts can customized this? for search this. kendo wasn't best solution couldn't add number middle. best solution found library called morris.js http://morrisjs.github.io/morris.js/

java - How to Delete Document Using CMIS -

i have created external web application using servlets connected alfresco repository. i able upload document in repository, download document repository. now requirement is, have delete document based on user role. means want give delete document access site manager. please provide sample code if have. thanks in advance in order delete document first need see if user have role delete why answer split in 2 part part 1 : search authority in part see if user have authority delete session session = getsession(serverurl, username, password); // session object = session.getobjectbypath(idobject); // object if (object.getallowableactions().getallowableactions().contains(action.can_delete_object)) { //// can delete } else { //// can't delete system.out.println("i can't "); } part 2 : delete method for document simple delete session session = getsession(serverurl, username, password); cmisobject object = session

android - can i retrieve sqlite data depending on fragments name? -

Image
hey have 3 fragment (3 tabs ) want column 1 display on text view tab 1 , column 2 on tab 2 column 3 on tab 3 database possible ??? of course fragments name tab 1 2 , 3.. ..! public class databasehelper extends sqliteopenhelper { public static final string database_name = "big.db"; public static final string table_name = "images"; public static final string name = "name"; public static final string place = "place"; **public static final integer flag = 1;** public databasehelper(context context) { super(context, database_name, null, 1); sqlitedatabase db = this.getwritabledatabase(); } @override public void oncreate(sqlitedatabase db) { string create_images_table = "create table images ( " + "id integer primary key autoincrement, " + **"flag integer, " +** "name text, " + "place text )"; db.execsql(create_images_tab