Posts

Showing posts from July, 2010

java - TextWatcher keep looping after enter the keys -

https://gist.github.com/tigers2020/e10b6981acfbceb06a673db00f3d8f5f so, try make edittextview convert string pattern this 700 -> 7:00 570 -> 6:10 43 -> 0:43 it works problem keep looping 1 after added. mean, when insert number runs 1 time , inserts number runs 2 times 4 times 8 times... , crashed. do guys have idea? you need set proxy pass. in apache virtual host file,make these changes <virtualhost *:80> servername mydomain proxyrequests off <proxy *> order allow,deny allow </proxy> proxypass / http://localhost:4004/ proxypassreverse / http://localhost:4004/ proxypreservehost on </virtualhost>

Python--Initializing variables using a variable in the current parameter -

i find myself assigning variable none in variable assignment, , wondering if there more efficient , less ugly way. def stringlength(string = "hello", slength = none): if slength == none: slength = len(string) here example. want assign slength length of string . how can in more efficient way? i doing because using permutation code, recall using same method, please don't comment saying write variable later on :d the possible improvement have replace slength == none slength none . latter more accurate, , perhaps more efficient.

html - Backface-visibility not working in IE10? -

so i'm working on project of mine , i'm trying set 3d css effects - tried on chrome , works great, firefox looks awesome ie making me cry. the problem can't see backside in ie10 when hover on it. can see on chrome live @ this place - that's want in ie - how d:! tried setting perspective on child elements, transformations nothing d:! anyone have ideas? i tried this it's still not working, unless read wrong of course. here of css .panel { position: relative; -webkit-perspective: 800px; -ms-perspective: 800px; -moz-perspective: 800px; } #card { width: 100%; height: 100%; position: absolute; -webkit-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -webkit-transition: transform 1s; -ms-transition: transform 1s; -moz-transition: transform 1s; } #card figure { display: block; position: relative; width: 100%; height: 100%; -webkit-backface-visibility: hidden; -ms-backface-visibility: hidden; -moz-backface-vis

Modify Modulo in SQL -

i have following sql generates insert statements shown below. i have total of 6854 rows in #order_ids table, cannot find way include of them insert statements below. the inserts give me total of 6355 total ids. modulo in batches of 500, since have lot of rows, , insert statement huge if insert each id individually. it doesn't have in batches of 500 though can more or less, long not inserting table 1 one. sql query declare @total int, @current int, @print varchar(max) select @total = count(*) #order_ids set @current = 1 while @current <= @total begin if @current % 500 = 0 begin print @print print 'insert #orders_table values' select @print = value #order_ids roworder = @current end else begin set @print = @print + (select ', ' + value #order_ids roworder = @current) end set @current = @current + 1 end print @print desired result set insert #order_ids values ('asc'), ('

dimple.js - modify shape to be unfilled bubble depending on value of 'Channel' -

looking suggestions on how can modify example dimple.js code in link below output filled/unfilled circle depending on value of 'channel' variable? http://dimplejs.org/examples_viewer.html?id=bubbles_vertical_grouped picture below example of result looking achieve. result looking for you can do: chart.assigncolor("supermarkets", "transparent", "blue"); where third parameter whatever want outline colour be. if want thicker borders picture can after drawing with: svg.selectall("circle").style("stroke-width", 5); to bit more specific can assign series variable , access them way: var series = mychart.addseries("channel", dimple.plot.bubble); mychart.draw(); series.shapes.style("stroke-width", 5); or can set stroke-width in css.

How to find the largest difference in change in an array? - java -

suppose declare array: int[] arr = {10,2,7,11,3}; the largest (positive) change in array 9 11 - 2 = 9. how write method find largest change in code smaller integer occurring earlier? thank you, i rewrote answer since misunderstood question. the simplest not efficient way check every change , comparing previous one. if bigger, discard previous 1 , remember 1 instead. int change = arr[1] - arr[0]; //give initial value, if find bigger change replace for(int = 0; < arr.length - 1; i++) { for(int j = + 1; < arr.length; j++) { if(arr[j]-arr[i] > change) { change = arr[j]-arr[i]; } } } this still give answer if there no positive changes. if not want that, can modify it. trivial. keep in mind arr.length - 1 important in outer loop.

winapi - Windows app access to textboxes in other applications ? -

i have idea text formatting tool useful within number applications. is possible create application popup when triggered hot key or icon click (trigger method not important) , give user options reformat text in active text box of whatever application active. i suspect there might standard winapi way work on many applications not work on apps using proprietary text box widgets. case ?

perl - Printing the search path taken to find item during BFS -

i trying solve doublets puzzle problem using perl. 1 of first times using perl please excuse messy code. i have working, believe, having issue printing shortest path. using queue , bfs able find target word not actual path taken. does have suggestions? have been told keep track of parents of each element not working. #!/usr/bin/perl use strict; $file = 'test'; #my $file = 'wordlist'; open(my $fh, $file); $len = length($argv[0]); $source = $argv[0]; $target = $argv[1]; @words; # creates new array of correct length words while (my $row = <$fh>) { chomp $row; $rowlen = length($row); if ($rowlen == $len) { push @words, $row; } } %wordhash; # creates graph word variations using dictionary foreach $word (@words) { $wordarr = []; (my $i = 0; $i < $len; $i++) { $begin = substr($word, 0, $i); $end = substr($word, $i+1, $len); $key = "$begin" . "_" . "$end";

python - How do I create a variable number of variables? -

how accomplish variable variables in python? here elaborative manual entry, instance: variable variables i have heard bad idea in general though, , security hole in python. true? you can use dictionaries accomplish this. dictionaries stores of keys , values. >>> dct = {'x': 1, 'y': 2, 'z': 3} >>> dct {'y': 2, 'x': 1, 'z': 3} >>> dct["y"] 2 you can use variable key names achieve effect of variable variables without security risk. >>> x = "spam" >>> z = {x: "eggs"} >>> z["spam"] 'eggs' for cases you're thinking of doing like var1 = 'foo' var2 = 'bar' var3 = 'baz' ... a list may more appropriate dict. list represents ordered sequence of objects, integer indices: l = ['foo', 'bar', 'baz'] print(l[1]) # prints bar, because indices start @ 0 l.append(&#

python - flask cache: list keys based on a pattern? -

i'm using flask cache plugin redis backend cache api response. have apis users , create user this: /api/users?page=1 /api/users post the result cached full url key. when new user created, i'd delete keys start /api/users - i'm doing cache.clear() hardly seems necessary. however, can't seem find api list of keys. redis-py , there keys(*pattern) api purpose. there similar api flask cache? flask cache plugin not provide access point raw redis commands. can use redis-py connect same redis instance , database delete keys pattern.

ecmascript 6 - Import into object? -

let's start example: import renewcreeplife '../tasks/renew_creep_life'; import harvestenergy '../tasks/harvest_energy'; import pickupenergy '../tasks/pickup_energy'; import storeenergy '../tasks/store_energy'; import upgradecontroller '../tasks/upgrade_controller'; const taskfuncs = { [tasks.renew]: renewcreeplife, [tasks.pickup_energy]: pickupenergy, [tasks.harvesting]: harvestenergy, [tasks.storing]: storeenergy, [tasks.upgrading]: upgradecontroller, }; is there way simplify i'm not creating these pointless temporary variable names? like: // incorrect desired syntax const taskfuncs = { [tasks.renew]: import '../tasks/renew_creep_life', }; n.b. each of files using export default function() no. import statement not have return value, can never used assign directly variable that. additionally, import , export must declared @ top level. this not possible es6 , stay way foreseeable

c# - Asp.Net Web API to get getails of a particular item -

hi every 1 new asp.net-web-api , want details of particular item item_code has passed in header of postman or in json format. i did follows public list<product> getbycode(string itemcode) { using (var context = new dbcontext()) { var getitem = (from s in context.objproduct (s.itemcode == itemcode) select s).tolist(); if (getitem!=null ) { return getitem; } else { return null; } } } if doing through query string localhost:50787/api/product/getbycode?itemcod=3f-47-ab-84-9f-eb-d6-6b-9c-62-cc-85-98-4d-28-6b as working fine. want has passed through json or header key , values. please me. first need post request end point. need edit action [httppost] attribute. [httppost] public list<product> getbycode(string itemcode) {...} i suggest changing name of action posting getbycode can cause confusion name. with done, lets focus on how send data endpoint. se

javascript - JS GST calculation form total is multiplying more then it should -

my total * 10 reason, have made stupid mistake somewhere. working out calculation method form building stuck on last element. the gst input has no decimal place not overly bothered @ point can added later see should + both elements , output. <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <body> <script type="text/javascript"> function updateprice() { // ex-gst price form element var exprice = document.getelementbyid("ex-gst").value; var tprice = document.getelementbyid("gst").value; // gst price gstprice = exprice * 0.1; tprice = gstprice + exprice; // set gst price in form element document.getelement

Cordova CLI, Admob and Google Maps plugins conflict -

i have trouble admob , google maps plugins. when ads appear, maps blank. think both conflict. dont know how solve it? anyone? nothings conflicting believe using google-phonegap-maps plugin , admob-pro. google-phonegap-map plugins needs tweaked when working other framework. running on native view. if put background color dom element may reflect on map. admob banner guess applies background (i couldn't fetch out in manner), does. work around have came overlap banner , solved. admob.createbanner({ /*parameter stuff, set 1 more parameter*/ overlap : true, }) and done. guess have acknowledged on facebook.

build.gradle - Gradle issue, Converting Application from eclipse to studio -

error : error:execution failed task ':app:dexdebug'. com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished non-zero exit value 2 my gradle : apply plugin: 'com.android.application' android { packagingoptions { exclude 'meta-inf/dependencies.txt' exclude 'meta-inf/dependencies' exclude 'meta-inf/dependencies.txt' exclude 'meta-inf/license.txt' exclude 'meta-inf/license' exclude 'meta-inf/license.txt' exclude 'meta-inf/lgpl2.1' exclude 'meta-inf/notice.txt' exclude 'meta-inf/notice' exclude 'meta-inf/notice.txt' } compilesdkversion 22 buildtoolsversion "23.0.2" defaultconfig { applicationid "com.abcd" minsdkversion 16

database - data storage in android - combining SQlite with myPHP -

i trying develop application in have data base on server in phpmyadmin i'm taking data parsing json objects, of course different users have different data , users share same data. problem when im taking data server taking long , if store on device more efficient users share same data (they can delete , add data). problem - how can combine sqlite myphp in first time user sign in data wil taken server , inserted device data base , next time user sign in data taken device data base. , if make changes update both data bases you'll have replicate database schema on both server client. fetch results first time server. , store in local sqilite. , then, store flag in sharedpreferences know in future have fetch results local db. after that, if change in made in local db, you'll have update @ server also. that, depends on use case how fast want update on server. if don't want right away, can wait , batch several calls , post server using job scheduler api .

How to configure openfire to connect mysql cluster -

i want high availability of database openfire server. hence, have created mysql cluster. not able configure openfire use mysql cluster. have searched not able find except using following connection string : "jdbc:mysql:loadbalance://" + hosts + "/test" . not seems work. please me configure openfire server use mysql cluster. kind of or suggestions appreciated. in advance.

machine learning - Why is my Spark Mlib ALS collaborative filtering training model so slow? -

i use als collaborative filtering method content recommendation system in app. seems work fine , prediction part quick training model part takes on 20 seconds. need @ least 1 second or less, since need real time recommendations. use spark cluster 3 machines, each nodes has 17gb. use datastax shouldn't have influence. i don't know why , how improve this? happy suggestions, thanks. here basic spark code: from pyspark.mllib.recommendation import als, matrixfactorizationmodel, rating # load , parse data data = sc.textfile("data/mllib/als/test.data") ratings = data.map(lambda l: l.split(','))\ .map(lambda l: rating(int(l[0]), int(l[1]), float(l[2]))) this part takes on 20 seconds should take less 1. # build recommendation model using alternating least squares rank = 10 numiterations = 10 model = als.train(ratings, rank, numiterations) # evaluate model on training data testdata = ratings.map(lambda p: (p[0], p[1])) predictions = model.predictall(

java - How to set the DB Credentials of log4j at runtime -

this log4j properties file. i'm writing logs db. want set db credentials @ run time log4j.appender.db=org.apache.log4j.jdbc.jdbcappender log4j.appender.db.url=jdbc:sqlserver://172.16.0.201:1433;databasename=databaseone;autoreconnect=true log4j.appender.db.driver=com.microsoft.sqlserver.jdbc.sqlserverdriver log4j.appender.db.user=username log4j.appender.db.password=password$123 log4j.appender.db.sql=insert usage_fact(accessed_date,accessed_item_id,user_id,tenant_id,log_level) values('%d{yyyy-mm-dd hh:mm:ss}','%x{accessed_item_id}','%x{user_id}','%x{tenant_id}','%p') log4j.appender.db.layout=org.apache.log4j.patternlayout and how catch sql exception arises while log4j connecting db or writing table. exception stack trace printing on console don't want print on console. you can initialize logging framework through java code this: public class corelogger { public static logger getlogger(final class modulename) {

Android Studio Build Error : This version of Android Studio is incompatible with the Gradle Plugin used. Try disabling Instant Run -

i upgraded android studio version 1.5 2.0 today , has gone wrong. first got gradle version error, updated gradle version 2.10 2.12. # previous # distributionurl=https\://services.gradle.org/distributions/gradle-2.10-all.zip # current distributionurl=https\://services.gradle.org/distributions/gradle-2.12-all.zip gradle version error has disappeared. have error when try run project: error running app: version of android studio incompatible gradle plugin used. try disabling instant run (or updating either ide or gradle plugin latest version) project gradle.build: // top-level build file can add configuration options common sub-projects/modules. buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.0.0' classpath 'com.google.gms:google-services:2.1.0-alpha1' classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' // note: not place application depe

xcode - My Bundle ID is now invalid -

Image
the bundle id use on itunes connect existing app invalid. when first opened xcode 7.3 asked "fix" below team button when clicked it, said "reset" , did it. now when try "fix" again pops though bundle id already. need relink can update app. thank you!

Loss turns to be NAN at the first round step in my tensorflow CNN -

loss turns nan @ first round step in tensorflow cnn. 1 .network : 3 hidden layyer ( 2 convolutional layer +1 hidden fullconnect layyer ) + readout layyer. 2. 3 hidden layyer : a) weights : w = tf.variable( tf.truncated_normal(wt,stddev=0.1,name='wights' )) b) bias : b = tf.variable( tf.fill([w.get_shape().as_list()[-1] ],0.9),name = 'biases' ) c) activition: relu d) dropout 0.6 . **loss trun nan if dropout 0.0 readout layyer softmax 4: loss function: tf.reduce_mean(-tf.reduce_sum(_lables * tf.log(_logist), reduction_indices=[1])) 5.optimizer: tf.train.adamoptimizer learning_rate:0.0005 **loss truns nan if learning_rate = 0 since don't have entire source code, it's hard see problem. however, may try use 'tf.nn.softmax_cross_entropy_with_logits' in cost function. example: cost = tf.reduce_mean(tf.nn.softmax_cross_entropy_with_logits(predictions, la

android - org.testng.TestNGException: org.xml.sax.SAXParseException -

i following error while executing testng org.testng.testngexception: org.xml.sax.saxparseexception; linenumber: 3; columnnumber: 44; attribute "parallel" value "none" must have value list "false methods tests classes instances ". @ org.testng.testng.initializesuitesandjarfile(testng.java:325) @ org.testng.remote.remotetestng.run(remotetestng.java:90) @ org.testng.remote.remotetestng.initandrun(remotetestng.java:206) @ org.testng.remote.remotetestng.main(remotetestng.java:177) @ org.testng.remotetestngstarter.main(remotetestngstarter.java:125) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:62) @ sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:43) @ java.lang.reflect.method.invoke(method.java:497) @ com.intellij.rt.execution.application.appmain.main(appmain.java:140) caused by: org.xml.sax.

php - How can I use <tables> like HTML in CActiveForm classin Yii to align my lables and textboxes? -

here sample code have made dropdown, 2 textboxes , button.now how can align them using tables use in html. <div class="row"> <?php echo $form->labelex($model,'user_id');?> <?php echo $form->dropdownlist($model,'user_id',array('all'=>'all','members'=>'members','businessusers'=>'businessusers','selectedusers'=>'selectedusers'));?> <?php echo $form->error($model,'user_id'); ?> </div> <div class="row"> <?php echo $form->labelex($model,'title'); ?> <?php echo $form->textfield($model,'title'); ?> <?php echo $form->error($model,'title'); ?> </div> <div class="row"> <?php echo $form->labelex($model,'message'); ?> <?php echo $form->textfield($model,'message'); ?> <?php echo $form-

amazon web services - How to manage ansible inventory with multiple environments in a scalable and flexible way? -

it seems in ansible world there bit many ways deal inventory , faced hard questions. we have 4 official target environments: production, staging, testing , local (localhost). groups of hosts inside single inventory.ini located in root. almost entire infrastructure running on aws, exception developers running local environment on localhost or local vm. still, other non-personal environments on aws. some staff split different inventories each environment in order avoid accidental execution against @ once. bit concerned increase maintenance costs , make harder work tools ansible tower, semamphore or rundeck. want switch ec2 dynamic inventory makes split less intersting. here few questions have addresed optimal setup: how deploy specific component towards specific environment? how test playbook without affecting production or staging? what default value should keep "hosts: value" inside our playbooks what should default inventory if use multiple files how can d

express - stormpath logout URL route not working -

i see error message "cannot /logout" /logout url, docs seems link should automatically registered route. code basic @ moment, looks like: var express = require("express"); var stormpath = require('express-stormpath'); var app = express(); var port = 1337; app.use(stormpath.init(app, { apikey: { id: '<>', secret: '<>' }, application: { href: "<>" }, website: true })); app.get("/", stormpath.loginrequired, function(req, res) { res.send("hello node.js , express."); }); app.on('stormpath.ready', function() { console.log('stormpath ready!'); }); console.log("web application opened."); app.listen(port); any appreciated. the logout route express-stormpath requires post request. prevent omnibar accidentally logging out application.

c# - Selenium - PhantomJS TypeError - undefined is not a constructor (evaluating '_getTagName(currWindow).toLowerCase()') string -

i create auto application testing website in csharp using selenium , phantomjs. i have problem when try sendkeys("values") website. <section id="login"> <form class="login"> <input type="text" id="login-username"> </form> </section> it throws exception: message "unexpected error. typeerror - undefined not constructor (evaluating '_gettagname(currwindow).tolowercase()')" string my code like: element.findelementbyid("login-username").sendkeys("user1"); i updated phantomjs latest version. solved: you should download phantomjs 1.9.8 @ this link . work in case. phantom 2.1.1 or 2.0 don't work.

c - PIC12F675 set timer function . What exactly it does -

please explain set timer function in code. , number 60535 used set timer function. case 0: if (int_innercount == 0) { output_low(pin_b5); output_low(pin_b6); output_low(pin_b1); int_innercount = 1+int_innercount; set_timer1(60535); } else if (int_innercount == 1) { output_high(pin_b1); int_innercount = 1+int_innercount; set_timer1(65035); } else { output_low(pin_b1); int_count = 1+int_count; int_innercount = 0; set_timer1(65035); } break; it loads 16 bit unsigned value timer1 register. because pic 8-bit machine, loading 16 bit timer take 2 8 bit assignments. function provided convenience. the manual says nothing atomicity. it's best assume assignment non-atomic.

ruby on rails - can caching information attached to image file names cause a 404 error? -

i deployed rails app successfully, however, images not displaying. 404 error that's showing in console get http://mydomain.com/assets/myimage.png 404 (not found) inside application directory on server, there's 3 subdirectories current releases shared which setup created deployment script borrowed ryan bates. i can see images in images directory of assets folder in current current/app/assets/images$ ls glyphicons-halflings.png glyphicons-halflings-white.png qb.png however, in assets folder of shared directory (which i'm guessing they're being put after everything's compiled production), same images have (i'm assuming) cache information attached them, such image want isn't myimage.png but rather myimage-0bb3f134943971c95b2abdfd30f932c7.png i'm wondering if what's causing 404 error, (i'm assuming) code's looking myimage.png in shared/assets directory. do know how can deal problem? contents of /shared/assets

Mapping XML child elements to a Kendo UI DataSource -

i'm struggling mapping , displaying list of child elements on xml datasource, using kendo ui mobile. consider following straightforward xml structure: <?xml version="1.0" encoding="utf-8" standalone="yes"?> <topics> <topic id="1" title="weather"> <header>great weather today!</header> <smallicon>foo_bar.png</smallicon> <items> <item>it's great weather</item> <item>sunny feeling</item> <item>raining dog</item> </items> </topic> <topic id="2" title="politics"> <header>left or right, take pick!</header> <smallicon>whatever.png</smallicon> <items> <item>making budget cuts</item> <item>how important healthcare?</item> &

multithreading - Django rest framework request handling -

how django rest framework handles request ? process based or thread model. each request 1 process start new thread or 1 process takes care of request (like happens in nodejs) based on context. your question django , not drf. said, believe django single-threaded, thread-safe. might want have celery if interested in deferred tasks.

android - The "CheckDuplicateJavaLibraries" task failed unexpectedly -

i'm trying build app, following error pops up. couple of days ago, had no problems building it. error "checkduplicatejavalibraries" task failed unexpectedly. system.io.filenotfoundexception: not find file 'obj\debug\__library_projects__\vectorcompat\library_project_imports\bin\classes.jar'. file name: 'obj\debug\__library_projects__\vectorcompat\library_project_imports\bin\classes.jar' @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.fileinfo.get_length() @ xamarin.android.tasks.monoandroidhelper.sizeandcontentfilecomparer.gethashcode(fileinfo obj) @ system.linq.set`1.internalgethashcode(telement value) @ system.linq.set`1.find(telement value, boolean add) @ system.linq.enumerable.<distinctiterator>d__63`1.movenext() @ system.linq.enumerable.whereselectenumerableiterator`2.movenext() @ system.linq.buffer`1..ctor(ienumerable`1 source) @ system.linq.enumerable.toarray[tsource](ienumerable`1 source) @ xamarin

retrofit2 abstraction network android -

i use retrofit2 handle network of android app. want abstract network, networkmanager.getsearch() , async request , ui update. tutoriels i've seen have, code update ui in callback on @override onresponse in code of activity update ui (and want handle in networkmanager). wanted pass function or method handle return of callback research think it's not impossible. missing on use of retrofit2 ? did have ideas solve problem or how abstraction of network in android ? it's not impossible, although differs depending on whether use synchronous ( execute() ) or asynchronous ( enqueue() ) call. as know here , how handle them: call<list<car>> carscall = carinterface.loadcars(); try { response<list<car>> carsresponse = carscall.execute(); } catch (ioexception e) { e.printstacktrace(); //network exception thrown here } if(carsresponse != null && !carsresponse.issuccess() && carsreponse.errorb

javascript - Series for tooltip only in highcharts -

i need use several series in tooltip in highchart chart. these series should invisible except tooltip. 've tried setting visible false. in case, legends series still visible though faded. if state "ignorehiddenseries: true", hidden series not there @ , cannot use them @ tooltip. there way type of usage? keeping series in global javascript arrays outside highchart's scope , using them in tooltip formatter. prefer keep data in highchart well. by way setting showinlegend: false, visible: false makes series unusable in tooltip. each invisible serie should have 2 params: visible: false, showinlegend: false, you need use tooltip formatter , use loop on each serie / each point print values. tooltip: { formatter: function() { var series = this.series.chart.series, x = this.x, each = highcharts.each, txt = '<span style="font-size: 10px">' + this.key + '</span><br/>'; each(series, fu

PHP - Codeigniter - Connecting to a PostgreSQL error -

i new on codeigniter , connect postgres. when filling data in login page , press submit button show error. error number: error: column "id" not exist line 1: select "id", "user_name", "user_pass" ^ select "id", "user_name", "user_pass" "admin" "user_name" = 'aziz' , "user_pass" = 'aziz12' limit 1 filename: c:\wamp\www\ci_login\system\database\db_driver.php line number: 331 in codeigniter config->database.php file configuration is $active_group = 'default'; $active_record = true; $db['default']['hostname'] = 'localhost'; $db['default']['username'] = 'postgres'; $db['default']['password'] = 'postgres'; $db['default']['database'] = 'login'; $db['default']['dbdriver'] = 'postgre'; $db['default']['dbprefix'] = '

Android adapter item change after click -

i have custom adapter holds humans. these humans have features. want when click 1 of these human , features changed. (like new message in whatsapp). custom adapter class : public class gecmisinsanadapter extends arrayadapter<insan> { arraylist<insan> objects; arraylist<insan> kokobjects; int resource; context context; layoutinflater lala; private displayimageoptions options; filter insanfilter = new filter() { @override protected filterresults performfiltering(charsequence constraint) { filterresults results = new filterresults(); if (constraint == null || constraint.length() == 0) { results.values = objects; results.count = objects.size(); } else { arraylist<insan> sonuclistesi = new arraylist<>(); (insan : kokobjects) { if (i.getname().contains(constraint.tostring())) {

c# - saveFileDialog How to save to user input? -

i have added class file if (savefiledialog1.showdialog() == dialogresult.ok) { process.start(url); } but when process starts, automatically downloads file , puts on desktop. how can make downloads user input in savefiledialog1? use this: if (savefiledialog1.showdialog() == dialogresult.ok) { system.net.webclient web = new webclient(); web.downloadfile(url, savefiledialog1.filename); web.dispose(); }

java - How to read the same xml tag using Stax parser -

<product> <supplydetail> <price> <pricetypecode>01</pricetypecode> <discountcoded> <discountcodetype>02</discountcodetype> <discountcodetypename>lsi</discountcodetypename> <discountcode>25</discountcode></discountcoded> <priceamount>29.95</priceamount> <currencycode>inr</currencycode> </price> </supplydetail> <supplydetail> <price> <pricetypecode>08</pricetypecode> <priceamount>14.32</priceamount> <currencycode>inr</currencycode> </price> </supplydetail> </product> i want output pricetypecode : 01 priceamount : 29.95 currencycode : inr pricetypecode : 08 price amount : 14.32 currencycode : inr bulkfilexmlreader2.java import com.main.query.query; import com.main.bean.pricedetail; import com.main.bean.specificationbook; import java.io.fileinputstream; impo

php - WordPress Error after update -

after updating wordpress website received following error message whenever attempt login admin area. fatal error: cannot redeclare add_object_page() (previously declared in /home/nichea5/mausmedia.net/mm1/wp-admin/includes/plugin.php:1101) in /home/nichea5/mausmedia.net/mm1/wp-admin/includes/deprecated.php on line 1342 any appreciated.

html - Why isnt my link yellow -

so have navigation reason link not yellow if selected. <div class="link-selected" id="navbutton"><a href="index.html">home</a></div> <div id="navbutton"><a href="expertise.html">expertise</a></div> <div id="navbutton"><a href="doctors.html">doctors</a></div> <div id="navbutton"><a href="facility.html">facility</a></div> <div id="navbutton"><a href="contacts.html">contacts</a></div> #nav #navbutton{ width: 180px; height: 30px; float:left; font-family: "trebuchet ms", arial, helvetica, sans-serif; font-size: 14pt; color:#fff; text-align:center; margin-top: 1px; } #nav #navbutton a{ width: 180px; height: 30px; float:left; font-family: "trebuchet ms", arial, helvetica, sans-serif;

oop - Python: accessing attributes and methods of one class in another -

let's have 2 classes , b: class a: # a's attributes , methods here class b: # b's attributes , methods here now can assess a's properties in object of b class follows: a_obj = a() b_obj = b(a_obj) what need 2 way access. how access a's properties in b , b's properties in ? you need create pointers either way: class a(object): parent = none class b(object): def __init__(self, child): self.child = child child.parent = self now a can refer self.parent (provided not none ), , b can refer self.child . if try make instance of a child of more 1 b , last 'parent' wins.

java - Automatic redirection to a servlet from a JSP page -

is there way auto redirect servlet jsp page? i know it's possible jsp this: <% response.addheader("refresh","4;./nexpage.jsp"); %> this code redirect nexpage.jsp after 4 seconds. but want redirect given servlet instead. can please check this. <meta http-equiv="refresh" content="5;url=/servleturl"> this redirect given servlet url after 5 seconds. place tag between head tag. think not seo friendly.

java - Spring + Hibernate: How do I efficiently chain two link tables and include resulting data in single entity? (user-role-right) -

Image
short version i have basic setup user table linked role table , role table linked right. these both many-to-many relations. roles dynamic entity , not of interest application (only visual aspects). when fetch user want return data in user table including list of names of rights. to clarify, want solution do: i managed rights in user object , return them, it's inefficient due query calls hibernate makes after original query called. detailed version let me first give information on how entities linked , code looks like. (simplified) database table structure looks this: user.java @entity @table(name = "user") public class user { @id @column(name = "user_id", columndefinition = "user_id") private long userid; @transient private list<string> rights @manytomany @jointable( name = "user_role", joincolumns = @joincolumn(name = "user_id", referencedcolumnname = "user_id"), in