Posts

Showing posts from January, 2010

php - MYSQL - FInd last date and group by IDUSER -

this question has answer here: get latest date grouped mysql data 7 answers i have message system on site , see list of users sent me message while displaying last message of each user. same way facebook. so, have table idusersender, iduserreceiver, date , message i tried on several time take query can not have last message of each. idea? ok, again, try please select message my_table iduserreceiver = 'my_id' , date in (select max(date) my_table group idusersender);

java - Exception in Hibernate config file while mapping my bean -

hello not in hibernate. when excecute class test. display in console config file xml of mapping (resource: com.live.hibernate.user.hbm.xm) not found. simple example : user.java : package com.live.beans; public class user { private int id; private string name; private string email; private string password; public int getid() { return id; } public void setid(int id) { this.id = id; } public string getname() { return name; } public void setname(string name) { name = name; } public string getemail() { return email; } public void setemail(string email) { this.email = email; } public string getpassword() { return password; } public void setpassword(string password) { this.password = password; } public user(int id, string name, string email, string password) { super(); this.id = id; name = name;

linux - Debian 8 - Enabled .htaccess -

my server turn on debian 8 (jessie). i try enabled htaccess on apache, edited nano /etc/apache2/apache2.conf and changed <directory /var/www/> options indexes followsymlinks allowoverride none require granted </directory> into <directory /var/www/> options indexes followsymlinks allowoverride #require granted </directory> now .htaccess file working on, when put login/password , submit, got error: 500 erreur interne du serveur (500 internar server error) so right way enabled htaccess files on debian 8 ? thanks help

jquery - How to display retrieved data from JavaScript through html -

i know seems kind of vague, best way put words. below example of code. javascript <script type="text/javascript"> var name = $('#firstname').val(); var email = $('#useremail').val(); var json = { email: email, firstname: name }; var string = json.stringify(json); $.ajax({ url: 'http://ubuildrewards.api/api/users/getinfo', type: 'get', contenttype: 'application/json', datatype: "json", crossdomain: true, data: string }); </script> html <div class="user-logged-in"> <div class="content"> <div class="user-name" id="firstname"> **name here** <span class="text-muted f9">admin</span></div> <div class="user-email" id="useremail"> **email here** </div>

N-Tier Application Authentication (RabbitMQ as Broker and C# as Business Tier) - WIF possible? -

i'm devoloping n-tier application c# business tier. it's kind of erp , need authentication (email/password) app. need permissions based on login (create orders, delete articles) informations should stored in 1 database. as ui clients planned make wpf client, asp.net , maybe in future iphone/android. message broker use rabbitmq (clients talk business layer on amqp. due advanteges have more 1 business layer round robin dispatching). on research authentication in n-tier applications found 1 advise windows identity foundation. wif completly new me. examples found handle asp.net applications. my question is: wif right thing me or should implement session handling on own? if wif can fit needs, best way handle this? have implement custom sts , place within wcf service? as explicitly mentioning rabbitmq, suggesting servicestack service interface. one issue mqs in general decoupled meta information, such http headers, inject authentication. should in contrast prov

ios - Any idea on how to "slow down time" with an NSTimer? -

i created timer, , wondering if @ possible make timer go slower when reaches second: 1..2..3..4..4.1..4.2 . for example, timer increasing 1 second, @ 4 seconds, time slows down showing milliseconds. if(i = 4) { } it depends on want. of course, can't slow down time, can simulate it. example, check how time has passed. if 1, 2, 3 seconds, nslog 1, 2, 3. when 4 seconds has passed, start logging milliseconds. e.g. if (i < 4) { nslog(@"%d", i); } else { nslog(@"4.%d", - 4); } sure, logging can substituted whatever need. p.s. answer in objective-c, changes nothing.

r - Why is theme created returned by a function delayed in its application? -

Image
in following example function returns theme, altered extend (in minimum example extreme ugly modifications...). adding function first time ggplot not anything, adding further plot works intenden. how can make sure, function works alreay in first application, or error in thinking? require(ggplot2) # minimal example: function returning theme modifications mytheme <- function(size = 3) { th.my <- theme_set(theme_bw(base_size=size)) th.my$axis.ticks$size = 1 return (th.my) } # plot something, applying theme function first time fig1 <- ggplot(data = mtcars, aes(x = mpg)) + geom_point(aes(y = hp)) + mytheme() print(fig1) # same, again fig2 <- ggplot(data = mtcars, aes(x = mpg)) + geom_point(aes(y = hp)) + mytheme() print(fig2) as 1 can see in following plots, first time theme not applied, second time worked... this because theme_set changes default future calls ggplot , not change "current" theme. if create o

c# - Trouble writing controller actions that work with JQuery to update database -

i have html table holds categories of things. each row consists of category id , name looped in model. there 2 buttons in each row. 1 want use set state of row enabled , other set disabled: <table id="categorylist" class="table"> <thead> <tr> <th>category id</th> <th>category name</th> </tr> </thead> <tbody> @foreach (var item in model.categories) { <tr> <td>@item.id</td> <td>@item.name</td> <td> <button class="btn btn-success categoryenabled">enabled</button> <button class="btn btn-danger categorydisabled" style="display: none;">disabled</button> </td> </tr> } </tbody> </table> when set enabled or disabled mean change bit value row in sql ta

java - Yet another "multiple target patterns" makefile error -

i tried looking around, of questions saw here high-level me understand. here's makefile: compile: bin src cmp bin: mkdir bin src: find src -name "*.java" > sources.txt cmp: javac -cp biuoop-1.4.jar -d bin @sources.txt run: java -cp biuoop-1.4.jar:bin:src/resources ass6game jar: jar -cmf ass6game.jar manifest.txt -c bin . -c src resources when try run make compile , "multiple target patterns" error. did wrong? your makefile syntax incorrect. the syntax of make rule is in general, rule looks this: targets : prerequisites recipe … or this: targets : prerequisites ; recipe recipe whereas have recipe lines in prerequisite location , : in java command confusing make. your makefile should this compile: bin src cmp bin: ; mkdir bin src: ; find src -name "*.java" > sources.txt cmp: ; javac -cp biuoop-1.4.jar -d bin @sources.txt run: ; java -cp biuoop-1.4.jar:bin:src/resources ass6game jar: ; jar -cmf a

rust - Acessing data from a global struct, gives error "borrowed value does not live long enough" -

as per thread i've had need create global non-mutable singleton store static data. #[derive(clone)] struct refdata { atm_vol : btreemap<string,string>, delta_vol : btreemap<string,string> } impl refdata { fn singleton() -> refdata { static mut g_refdata : *const refdata = 0 *const refdata; static g_once : once = once_init; unsafe { g_once.call_once(|| { let mut ref_data = refdata { atm_vol : (btreemap::new()), delta_vol : (btreemap::new()) }; ref_data.init(); g_refdata = mem::transmute(box::new(ref_data)); }); (*g_refdata).clone() } } fn init(&mut self) { self.atm_vol.insert("xcu".to_string(),"xcu_usd_vol_dt".to_string()); self.delta_vol.insert("xcu".to_string(),"xcu_usd_vol_skew_m".to_string()); } // doesn

c - Undefined reference to `gdk_color_parse' -

i'm using gtk + 3.0 lib, , i'm getting errors: undefined reference `gdk_color_parse' my source code: int connectps3(gtkwidget *button) { hinstance hlib; hlib = loadlibrary("ccapi.dll"); gchar *ip; ip = "192.168.0.40"; __cconnect v_connectps3 = getprocaddress(hlib, "ccapiconnectconsole"); __cnotify v_notifyps3 = getprocaddress(hlib, "ccapivshnotify"); gdkcolor color; if (v_connectps3(ip) == 0) { v_notifyps3(trophy2, "connected ps3"); gtk_button_set_label(gtk_button(button), "connected"); gdk_color_parse("green", &color); gtk_widget_modify_bg(button, gtk_state_normal, &color); } else { gtk_button_set_label(gtk_button(button), "can't connect ip address"); gdk_color_parse("red", &color); gtk_widget_modify_bg(button, gtk_state_normal, &color);

mockito - Is there an equivalent to anyInt(), anyString(), etc. for checking a parameter is of a particular (non-generic) type? -

if mocked method passed generic type parameter, easy generate same response regardless of value using methods such anyint() , anychar() , anystring() , etc. is possible parameter must particular type of object? (for example, anycar() , anyvehicle() , etc.) the matcher isa(class<t> clazz) provides functionality. for example - isa(car.class) , isa(vehicle.class)

c++ - Error when trying to pass '==' overload to std::map comparator -

i'm trying pass overload of custom class comparator of std::map . here's code , error me : here position.hpp #ifndef position_hpp_ # define position_hpp_ class position { public: int _x; int _y; position(){} position(int x, int y) { _x = x; _y = y; } void setposition(position &newpos) { _x = newpos._x; _y = newpos._y; } int getx() { return _x; } int gety() return _y; } void setx(int x) { _x = x; } void sety(int y) { _y = y; } struct cmpissame{ inline bool operator==(const position& pos) { if (pos._x == _x && pos._y == _y) return true; return false; } }; inline position& operator=(const position& pos) { _x = pos._x; _y = pos._y; return *this; } }; #endif and here map declaration in gameengine.hh private: std::map<position, case, position::cmpissame> _cases; and here error: posit

java - Error while producing XML from REST using Jersey and embedded jetty -

i attempting return simple xml output rest service 500 internal server error , following error in jetty console: org.glassfish.jersey.message.internal.writerinterceptorexecutor$terminalwriterinterceptor aroundwriteto severe: messagebodywriter not found media type=application/xml, type=class com.example.dbrest.model.saying, generictype=class com.example.dbrest.model.saying. i have tried few tricks problem remains. however, if change @produces application_json, works expected: {"name":"hello jersey!"} maven pom.xml has right dependencies jersey, jetty, jackson don't believe specific needed xml? code looks following. missing - perhaps need register in main function? in advance! model: package com.example.dbrest.model @xmlrootelement( name = "saying" ) public class saying { public string name; public saying() { } public saying(string name) { this.name = name; } } resource: package com.example.dbrest.resour

Apache CXF 2.3 to 3.0 migration ... where is ServletTransportFactory? -

i'm trying migrate cxf 2.3 cxf 3.0.3, , found this 2.3 class no longer in 3.0.3's cxf-rt-transports-http project: org.apache.cxf.transport.servlet.servlettransportfactory question : class (or alternative) in 3.0.3? the xml snippet is: <bean class="org.apache.cxf.transport.servlet.servlettransportfactory" id="org.apache.cxf.transport.servlet.servlettransportfactory"> <property name="bus" ref="cxf"/> <property name="transportids"> <list> <value>http://cxf.apache.org/bindings/xformat</value> <value>http://schemas.xmlsoap.org/soap/http</value> <value>http://schemas.xmlsoap.org/wsdl/http/</value> <value>http://schemas.xmlsoap.org/wsdl/soap/http</value> <value>http://www.w3.org/2003/05/soap/bindings/http/</value> <value>http://cxf.apache.org/tran

Copy array into another array many times in java -

i wanted copy array 1 integer array array many times. int a[6]={1,2,3}; int b[]=new int[12]; for(int i=0;i<12;i++) { b[i]=a[i]; system.out.println(b[i]); } i wanted output this: 1,2,3,1,2,3,1,2,3,1,2,3 how should copy element a[] b[] many times want. you can use modulus operator : for(int i=0;i<12;i++) { b[i]=a[i%a.length]; system.out.println(b[i]); } i%a.length iterate repeatedly 0 a.length-1.

java - How to add the items in listview Dynamically in android? -

i adding items in listview, it's working fine listview not expanding. this code: private arraylist<namedetails> namedetails = null; inside oncreate() code is namedetails = new arraylist<namedetails>(); case r.id.tvaddmore: final dialog dialog = new dialog(this); dialog.requestwindowfeature(window.feature_no_title); dialog.setcontentview(r.layout.location_name_details_dialog); final edittext etname = (edittext) dialog.findviewbyid(r.id.etname); final edittext etphone = (edittext) dialog.findviewbyid(r.id.etphone); button btnok = (button) dialog.findviewbyid(r.id.btnok); button btncancel = (button) dialog.findviewbyid(r.id.btncancel); btnok.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { string name= et

java - HTTP Status 500 -

here ajax request: $.getjson(..... + '/dashboard/searchdocumentsandcompanies.do', {q: ul.item.reqquery, resulttype: ul.item.resulttype}, function (data) { if (data.length == 0) { data = [ {name: 'no matches found', resulttype: 'document', noresults: true} ]; } $.each(data, function (index, document) { $(".textbox.ui-front li:eq(1)").after(function () { return $("<li></li>").data("ui-autocomplete-item", ul.item).append(document.name).addclass('ui-menu-item'); }); }); }); this co

When using sheets as floating- tooltip is getting hidden tableau -

Image
i creating dashboard multiple sheets, of same size. sheets added 1 one floating. issue: top sheet tooltip getting shown. below sheets, tooltip doesn't shown. this happens when sheet on top has no data, still acts empty container. due this, can through transparent container , seems second sheet on top. however, still have top empty container on top, , sheet beneath it, visible intangible. i have stumbled upon issue in past, , this tutorial helpful in creating visualization plan to. basically, can drag vertical layout container dashboard. then, drag each sheet dashboard. put sheets, 1 atop other vertically.

c# - Exit code from ClickOnce application installation -

i found couple ways of running .application clickonce file. 1 can run file executable (and let explorer rest) or run explorer using rundll32.exe . the thing want wait until clickonce application finished installation. waiting exit code start-process \path\to\file.application -wait doesn't make sense because clickonce app runs different process named dfsvc.exe . thing process runs in background , not exit after installation complete can't wait until appears , wait until exits. how can programmatically check clickonce app finished installing? mike, if understand situation, have several applications, 1 of clickonce application, , these applications install synchronously, each application installing before proceeding next one. i've run similar situation on few occasions clickonce , have verified installation completes below: i select files installed part of clickonce installation process, , check existence before continuing next application in synchron

javascript - Routing using $stateProvider in angular js , the page is not getting load when tried to route using states -

i want load page on click of menu item of menu state gets reflected url of browser , content of page doesn't gets loaded, far have studied tutorial states declared , code not showing me error also. here route.js file app.config(function config($stateprovider) { $stateprovider.state("index",{ url:"", controller:"mainctrl", templateurl:"templates/home/home.html" }), $stateprovider.state("development",{ controller:"employeectrl", templateurl:"templates/employee/employee.html" }); }) this list in home page on href have declared states index state working fine. <ul class="nav navbar-nav"> <li class="active"><a href="#/development">development</a></li> <li><a href="#/design">design</a></li> <

c# - TabControl - Autoscroll doesnt work proper -

i have following problem, i'm creating tabcontrol few tabpages, content within tabpages dynamic generated, decided make autoscroll = true. when change on tab, first have press on textbox or checkbox, can scroll, thats annoying. better, when scrollfunction instantly active, when change tab. tried few things, focus, doesnt changed anything. tabcontrol tc = new tabcontrol(); tc.tabpages.addrange(new tabpage[] { new tabpage("noten 2015"), new tabpage("noten 2014"), new tabpage("history 2013-2010"), new tabpage("sonstiges")}); } (int = 0; <= 3; i++) { tc.tabpages[i].autoscroll = true; } the complaint vague, won't have trouble operating scrollbars. have guess real problem related mouse wheel. mouse wheel messages sent control has focus. tabcontrol when click tab.

java - Exception in thread "main" com.datastax.driver.core.exceptions.InvalidQueryException: Unknown definition referenced in PRIMARY KEY -

i trying create tables in cassandra using java api. this query works , creates table. string query = "create table if not exists topquery1(term text , " +"year text , " +"month text , " +"day text , " +"hour text , " +"count counter," +"primary key (\"term\", \"year\", \"month\", \"day\", \"hour\" ));"; but when execute following query throws error. string query = "create table if not exists topquery2(term text , " +"year text , " +"month text , " +"day text , " +"hour text , " +"dayofyear int , " +"weekofyear int , " +"productcount int , " +"count counter," +"primary key (\"term\&

Ruby loop - determining value -

i looping through items, names should self explanatory: <% [@in_force_item, @draft_item, @historical_items].compact.flatten.each |item| %> <tr> <td> <label><input class="select" type="checkbox" /></label> </td> <td> <% if item == @draft_item %> <div> <%= link_to('', edit_account_item_path(@account, @draft_loa_item), class: 'black-icon-color') %></div> <% else %> <i class="lock"></i> <span class='black-icon-color'></span> <% end %> </td> <td> <% updated_at = datetime_to_string item.updated_at %> <%= link_to(updated_at, account_item_path(@account, item)) %> </td> <td><%= lifecycle_label(item) %></td> <

c - Is vectorization profitable in this case? -

i broke kernel down several loops, in order vectorize each 1 of them afterwards. 1 of loops looks like: int *array1; //its size "size+1"; int *array2; //its size "size+1"; //all positions of array1 , array2 set 0 here; int *sarray1 = array1+1; //shift 1 position start writing on pos 1 int *sarray2 = array2+1; //shift 1 position start writing on pos 1 int bb = 0; for(int i=0; i<size; i++){ if(a[i] + bb > b[i]){ bb = 1; sarray1[i] = s; sarray2[i] = 1; } else bb = 0; } please note loop-carried dependency, in bb - each comparison depends upon bb 's value, modified on previous iteration. what thought about: i can absolutely of cases. example, when a[i] greater b[i] , not need know value bb carries previous iteration; when a[i] equals b[i] , need know value bb carries previous iteration. however, need account case when happens in 2 consecutive positions; when started shape these cases, seemed these become

sql - How to maintain a running balance in a month wise report -

select * (select year (dateoftransaction) year, left(datename(month, dateoftransaction), 3) month, sum(case when transtypename 'credit%' amount else 0 end) - sum(case when transtypename 'debit%' amount else 0 end) balance .............) t pivot (sum(balance) month in (jan, feb, march, ...., dec)) pvt this query returns month-wise report account balance. want result running balance. example: january month credit 5000, february month credit 2000 my query result year jan feb march...dec 2014 5000 2000 null ..null i want result this: year jan feb march...dec 2014 5000 7000 null ..null (5000+2000) try this select year,jan = jan, feb = isnull(jan,0)+isnull(feb,0),.... (select year (dateoftransaction) year, left(datename(month, dateoftransaction), 3) month, sum(case when transtypename 'credit%' amount else 0 end) -

php - Get two types of number of rows with minimum lines -

i have following query. $sql = "select customer furniture id = :id , category = :cat"; $stmt = $connectdb->prepare($sql); $stmt->execute(array(':id'=>$id, ':cat'=>"1")); $resulta = $stmt->fetchall(pdo::fetch_assoc); $rowcount = count($result); this works perfectly. have requirement number of rows where id = :id , category = :cat number of rows where category = :cat . possible both of them without having write select query lines twice? you can use conditional sum 2 different counts as select sum(id = :id , category = :cat) count1, sum(category = :cat) count2 furniture; later fetch records , values of count1 , count2 note : if row count return 1 since using aggregate function

objective c - Speech Recognition for iOS that doesn't need predefined vocabulary -

is aware of speechrecognition framework ios allows using without predefined vocabulary? app i'm making right navigation app, , want let users speak desired location , destination. in case, making vocabulary consisting of names of cities, towns, villages , streets in entire tricky 1 :) i made research , of best rated frameworks not support feature (openears, ceed vocal) does knows might missed?

how to check if username exists in angularjs -

all username , password details present in oracle db. using servlets , jsp backend. when user name registered through java servlet, sits in oracle db. now want check if existing username available. know making ajax call fetch info pass url? shall pass url pattern of servlet (example: url:'./getrecords' ) ? or there other way of doing it? also using end servlet , jsp idea? wonder why people use node js , mondo db angular js. my problem solved this: using php mvc framework angularjs . i have written directive validating unique field (checking db). script: app.js var base_url="http://localhost/mysystem/"; var angularapp = angular.module('angularapp', ['ngroute','angularcontrollers','uniquefield']); angularapp.config(['$routeprovider', function($routeprovider){ $routeprovider .when('/add_user', { controller : 'adduserctrl', template

Building authentication with Microservices Architecture -

i'm developing app microservices , don't know how distribute microservices allow auth. i've read each microservice should have own database avoid coupling. the problem authentication (via jwt) , users microservices must have access same database , table (users). suppose problem has been solved before due similar applications having deal same issue. how can solve this? jws (the signed version of jwt) perfect example thought similar scnearios: you have authentication app: every login goes through ( signin.domain.com ), , once verify credentials of user issue token, generated through private keys each service ( service1.domain.com , service2.domain.com ) can implement middleware instead authorization : services receive public key , able verify authenticity of token through key. don't need db since need verify token valid, not user exists etc etc. to clarify last statement: should issue short-lived tokens. @ point, that: user x logs in his t

android - Sharing Pictures and Text with Facebook SDK 4.2 -

i'm trying share pictures , text facebook sdk 4.2, when call share function (via sdk or intent) image without text. here's code intent shareintent = new intent(android.content.intent.action_send); shareintent.settype("image/*"); shareintent.putextra(intent.extra_stream, uri.parse("file://" + mfilepath)); shareintent.putextra(intent.extra_text,"example"); shareintent.setpackage("com.facebook.katana"); startactivity(shareintent); facebook not allow pre-filling messages. see this discussion details.

ruby on rails - how to use capybara-webkit to get a message send to external network -

assume user updating password, , click submit, system send email include confirmation link mailbox. question is: how can email , click confirmation link when use rspec+capybara-webkit test system, hope want test email of actionmailer opening it. please use capybara-email gem https://github.com/dockyard/capybara-email you can below stuff scenario: email sent winning user given "me@example.com" playing game when user picks winning piece "me@example.com" receives email "you've won!" subject /^"([^"]*)" receives email "([^"]*)" subject$/ |email_address, subject| open_email(email_address) expect(current_email.subject).to eq subject end

sql - How to change my Query to a single command in MySql? -

my order has 2 fields called buyerid , sellerid. want both id according same condition, can use 2 search statements union them, have search them 2 times. how search them 1 time in 1 select statement? statement is: select sellerid order status=2 , createtime>'2015-05-25 8:00:00' union select buyerid order status=2 , createtime>'2015-05-25 8:00:00' how change them 1 statement? -- try change equal above,but wrong. select (buyerid+sellerid) order status=2 , createtime>'2015-05-25 8:00:00' this you're looking for, if understood right: select q.id (select sellerid id, status, createtime order union select buyerid id, status, createtime order) q status=2 , createtime>'2015-05-25 8:00:00' i'd still go first attempt, not sure wether solution more efficient.

parse.com - The method setDefaultPushCallback from the type PushService is deprecated using android -

i newbie in android. have been dealing problem of deprecated method @ push service using parse services. have followed similar question similar problem here can't solution. in main application class dealing problem, code given below one. public class mapplication extends application { private static mapplication minstance; @override public void oncreate() { super.oncreate(); minstance = this; parse.initialize(this, jni.stringfromjni001(), jni.stringfromjni010()); // specify activity handle pushes default. pushservice.setdefaultpushcallback(this, mainlandingactivity.class); // setdefaultpushcallback shows deprecated method here.. parseacl defaultacl = new parseacl(); // optionally enable public read access. defaultacl.setpublicreadaccess(true); defaultacl.setpublicwriteaccess(true); parseacl.setdefaultacl(defaultacl, true); } public static mapplication getinstance() {

mysql - Select from a table where a condition is fulfilled and another is not -

i have 3 tables: students (student_id, name, group, year, specialization) scolarships (scolarship_id, name, description, duration) applicants (student_id, scolarship_id) i need select students have applied scolarship id=2 , have not applied scolarship id=4 so far have query: select students.name, students.group, students.specialization applicants ap inner join students on students.id = ap.student_id inner join scolarships on scolarships.scolarship_id = ap.scolarship_id ap.scolarship_id = 2; this selects students have applied scolarship id=2. how can add condition have applied scolarship 2 haven't applied scolarship 4? you can use not exists as select students.name, students.group, students.specialization applicants ap inner join students on students.id = ap.student_id inner join scolarships on scolarships.scolarship_id = ap.scolarship_id ap.scolarship_id = 2 , not exists( select 1 applicants ap1 ap.student_id = ap1.student_id , ap1.scolarship_id

java - How to use symmetric key to encrypt and sign SOAP using WSS4J -

i need build web-service client application using axis 1.4 access third party system (web service producer). in order send valid request third party system need encrypt , sign soap request before sending them. i make use of wss4j 1.5 task follow steps in link: calling owsm protected service axis 1.4 , wss4j what understand that: 1- encrypt soap need use third party public key , decrypt using own private key. 2- sign soap need use own private key , should verify signature using public key need share them. i did receiving error faultstring: did not understand "mustunderstand" header(s) from third party end. after checking third party team said: " we use “username authentication symmetric key”, not maintain client certificates @ our trust store. there single shared key used both signing , encryption. hence need signing , encryption using our certificate. " this response not make sense me. understand need use third party certificate (

java - How to check duplicate from Strings given by user -

i writing code checking duplicate typed user. when user type second duplicate, program stop , warn user of duplication. logic put given words arraylist , check next given word in current arraylist if there or not. public class recurringword { public static void main(string[] args) { scanner reader = new scanner(system.in); arraylist<string> words = new arraylist<string>(); while (true) { system.out.println("type word: "); string word = reader.nextline(); words.add(word); int = 0; if (words.contains(words.get(i+1))) { system.out.println("you gave word " + words.get(i+1) + " twice"); } i++; break; } } } you need little reorganizing , logic check. if want stop when user tries add same word twice, stop , don't add @ list, won't have keep index @ all. while (true) { sy

android - My activity is unable to connect to website and display JSON data using volley -

i have been trying use volley connect , parse json data in activity posted below each time application forces close. value of urljsonobj correct since displays data when call browser. doing wrong? package gsie.bizlink; import android.content.intent; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.arrayadapter; import android.widget.button; import android.widget.gridview; import android.widget.listview; import android.widget.textview; import android.widget.toast; import com.android.volley.defaultretrypolicy; import com.android.volley.request; import com.android.volley.requestqueue; import com.android.volley.response; import com.android.volley.volleyerror; import com.android.volley.volleylog; import com.android.volley.toolbox.jsonobjectrequest;