Posts

Showing posts from September, 2011

python - importing array into pandas but losing a column -

python - importing array into pandas but losing a column - import numpy np import pandas pd import sklearn sklearn.datasets import load_boston boston1 = load_boston() boston2 = pd.dataframe(boston.data, columns = boston.feature_names[0:13]) boston2.keys() the medv column disappears? please help driving me crazy , don't know doing wrong import numpy np import pandas pd import sklearn import sklearn.datasets ds boston1 = ds.load_boston() boston2 = pd.dataframe( np.column_stack([boston1.data, boston1.target]), columns = boston1.feature_names) print(boston2.keys()) yields index([u'crim', u'zn', u'indus', u'chas', u'nox', u'rm', u'age', u'dis', u'rad', u'tax', u'ptratio', u'b', u'lstat', u'medv'], dtype='object') print(boston1.descr) gives mysterious comment, "median value (attribute 14) target". not mention how

android - Access Java anonymous object properties -

android - Access Java anonymous object properties - i relatively new java programming, trying access anonymous objects properties, object: object tomorowweekday = convertedtimeforandroid(openhours, tomorrow); inspected via debugger, looks this: i need access key value pair "to" , "from", there no method such tomorrowweekday.get("from") . how access these values in anonymous object? change to jsonobject tomorowweekday = convertedtimeforandroid(openhours, tomorrow); you're setting declared type object . means can't see methods other ones exposed object , though actual type jsonobject . create declared type same actual type , you'll able see methods need. because jsonobject subclass of object (as indeed every class is), current code legal, means abstract away functionality isn't nowadays in object . useful trick, not 1 employ unless know why you're doing it. (as side note, word anonymous not quite approp

c# - Detect and install framework 4.5 when program execute -

c# - Detect and install framework 4.5 when program execute - i have vs2013 ee winforms application target .net 4.5. when seek execute app under win7 without 4.5 framework installed exception window appears (0xc000007b). should set in app settings showing info window download framework option? don't want publish installation file, want exe dll-s publish not target. try: http://thecodeventures.blogspot.com/2012/12/c-how-to-check-if-specific-version-of.html reffers msdn http://msdn.microsoft.com/en-us/library/hh925568.aspx private static void get45or451fromregistry() { using (registrykey ndpkey = registrykey.openbasekey(registryhive.localmachine, registryview.registry32).opensubkey("software\\microsoft\\net framework setup\\ndp\\v4\\full\\")) { int releasekey = convert.toint32(ndpkey.getvalue("release")); if (true) { console.writeline("version: " + checkfor45dotversion(releasekey)); } } } // checking version u

c++ - SeekToBegin fails when running as LocalSystem -

c++ - SeekToBegin fails when running as LocalSystem - the snippet of code below used download file remote server. works fine when run user or administrator returns error when run localsystem (the requested operation invalid). when comment out line fsourcefile->seektobegin(); programs runs fine localsystem. any insights why getting error? should worry removing statement: fsourcefile->seektobegin(); alternate approaches? fsourcefile = (chttpfile*)netsession.openurl(pwnd->m_strsource,1, internet_flag_transfer_binary | internet_flag_reload); // starting time of download(kb/sec calculation) coledatetime dlstart = coledatetime::getcurrenttime(); fsourcefile->seektobegin(); // move cursor top reading*/ c++ windows

Pretty print json but keep inner arrays on one line python -

Pretty print json but keep inner arrays on one line python - i pretty printing json in python using code: json.dumps(json_output, indent=2, separators=(',', ': ') this prints json like: { "rows_parsed": [ [ "a", "b", "c", "d" ], [ "e", "f", "g", "i" ], ] } however, want print like: { "rows_parsed": [ ["a","b","c","d"], ["e","f","g","i"], ] } how can maintain arrays in arrays on 1 line above? python arrays json dictionary pretty-print

sql - Conditional clause to DROP Table -

sql - Conditional clause to DROP Table - i trying write sql procedure drop table have pattern in names. below code : declare @temp table ( id bigint identity(1,1), tabname sysname not null ) insert @temp select table_name information_schema.tables table_name '%:%' declare @processedid bigint = 0 declare @tablename sysname select @processedid = id, @tablename = tabname @temp id > @processedid order id desc while(@processedid not null) begin drop table dbo.[@tablename] select @processedid = id, @tablename = tabname @temp id > @processedid order id desc end but @tablename not replaced right table name. can 1 point me in right direction. you need dynamically when want utilize variable name argument, need wrap in string , execute string , little changes while status fit. i'd this: declare @temp table ( id bigint identity(1,1), tabname sysname not null ): insert @temp select table_name information_schema.tables table_name '%:

mysql - can't resize innodb_log_file_size in my.cnf -

mysql - can't resize innodb_log_file_size in my.cnf - i have mysql 5.0 sonar database bloated (360gb instead of on average 30gb) this link said in order prepare need export db, install mysql 5.6, import , export, , should go original size..: sonarqube : how cut down size of measures_data.ibd? so got virtual machine test, installed centos 5.6 , , mysql 5.6, , started import... unfortunately errors in of imports... [error] innodb: total blob info length (39220742) greater 10% of redo log file size (3072). please increment innodb_log_file_size. which brought me many links of innodb_log_file_size one: issue changing innodb_log_file_size i shut downwards mysql without errors. modify my.cnf innodb_log_file_size=64m (for illustration purposes although tried much higher values seek 600m 6g etc..) i deleted ib_logfile0 , ib_logfile1 logs in /var/lib/mysql restarted service , nil changes.. (even though read shouldnt matter in 5.6) 2014-10-

javascript - Authenticate before serving up directory in Express -

javascript - Authenticate before serving up directory in Express - i having problem trying authenticate users before view express directory file tree. can authenticate on other pages not on "/dat/:file(*)" when pass authentication route before downloading file. when user goes '/', express redirect them if not logged in. but, if user goes '/dat', express not authenticate , allow them browse file tree. i'm using express@3.4.8 , help great. thanks! app.configure( function() { app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use('/', express.static(__dirname + '/public')); app.use('/dat', express.directory(__dirname + '/public/dat', {hidden: true, icons: true})); app.use(express.json()); app.use(express.urlencoded()); app.use(express.methodoverride()); app.use(express.cookieparser('secret')); app.use(express.sess

PHP sorting a multidimensional array by key and non-zero values -

PHP sorting a multidimensional array by key and non-zero values - [a, 1, 3, 9, 0, 13] [b, 5, 6, 0, 0, 11] [j, 0, 6, 2, 1, 9] [c, 1, 0, 8, 5, 14] [d, 0, 0, 0, 17, 17] [e, 0, 5, 0, 0, 5] [h, 0, 0, 3, 3, 6] the array needs sorted on ascending order of number of zeroes. ascending order of lastly element value. so above array after sorting should like, [j, 0, 6, 2, 1, 9] [a, 1, 3, 9, 0, 13] [c, 1, 0, 8, 5, 14] [h, 0, 0, 3, 3, 6] [b, 5, 6, 0, 0, 11] [d, 0, 5, 0, 0, 5] [d, 0, 0, 0, 17, 17] i sorting multidimensional array against lastly value via code function multiarraysorter($arr, $index) { $b = array(); $c = array(); foreach ($arr $key => $value) { $b[$key] = $value[$index]; } asort($b); foreach ($b $key => $value) { $c[] = $arr[$key]; } homecoming $c; } any ideas how accomplish first sort based on number of zeroes of values? you can utilize usort tasks this: $arr=[['a', 1, 3, 9

jquery - Variable loses value on if statement in javascript -

jquery - Variable loses value on if statement in javascript - i have simple html layout test page: <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"> </script> <script>var user = 'test';</script> <script> $(document).ready(function () { if(!user) { var user = '0'; } alert(user); }); </script> </head> </html> for reason when checking value of !user using if condition, status successful , variable user gets new value of 0 although defined previously. has been driving me crazy sometime now. there wrong above code? you've redeclared "user" local variable in function. variable definitions in functions treated if occur @ start of function, meaning code equivalent to $(document).ready(function () { var user; if(!user) { user = '0';

.net - How to check is a user is in a Domain group? -

.net - How to check is a user is in a Domain group? - i want check grouping membership of user. grouping taken ldap , inserted domain. moment tried this... #powershell.ps1 $currentuser = [system.security.principal.windowsidentity]::getcurrent() $wp = new-object system.security.principal.windowsprincipal($currentuser) # have in domain grouping called 'dom_group' if ( $wp.isinrole('dom_group') ) { "expected true" } else { "unexpected false" } #unexpected false unfortunately, works local groups. how can check grouping membership of current utilize against domain grouping 'dom_group'? your code work, must qualify grouping name name of domain: $wp.isinrole('mydomain\dom_group') or $wp.isinrole('dom_group@mydomain') . .net windows security powershell

python - Redirecting stdout, stderror to file while stderr still prints to screen -

python - Redirecting stdout, stderror to file while stderr still prints to screen - i stdout , stderr redirected same file, while stderr still writes screen. what's pythonic way this? i'm assuming want redirect current script's stdout , stderr, not subprocess you're running. this doesn't sound pythonic thing in first place, if need to, pythonic solution be: redirect stdout file. redirect stderr custom file-like object writes file , writes real stderr . something this: class tee(object): def __init__(self, f1, f2): self.f1, self.f2 = f1, f2 def write(self, msg): self.f1.write(msg) self.f2.write(msg) outfile = open('outfile', 'w') sys.stdout = outfile sys.stderr = tee(sys.stderr, outfile) python redirect stderr

maven - Is there anyway to specify project-specific coding style that will get loaded in IntelliJ from a pom.xml? -

maven - Is there anyway to specify project-specific coding style that will get loaded in IntelliJ from a pom.xml? - if have maven project, , going load project opening pom.xml file in intellij, there can set in file or elsewhere in project load project-specific coding styles ide? not importing pom only. can add together intellij files source code management tool. thought saves project specific code styles /.idea/codestylesettings.xml - may picks after imported project via maven/pom.xml. think not wound add together few other files too. here .gitignore intellij 13.1.5: target/ # intellij settings files: .idea/artifacts/ .idea/dictionaries/ .idea/copyright/ .idea/inspectionprofiles .idea/libraries/ .idea/scopes/ .idea/compiler.xml .idea/uidesigner.xml .idea/vcs.xml .idea/rebel_project.xml .idea/datasources.ids .idea/workspace.xml everything else under version control. (some developers dont - know - wanted mention it) maven intellij-idea coding-style pom.xml

ruby on rails - I want to use Devise a user table with association another table -

ruby on rails - I want to use Devise a user table with association another table - i want generate 'profile' info @ time of user preservation @ time of next constitution how something? users table data +-------+-------------------+----------+-----+--------------------+ | id | email | nickname | sex | encrypted_password | +-------+-------------------+----------+-----+--------------------+ | 95425 | example@gmail.com | citrus | 1 | | +-------+-------------------+----------+-----+--------------------+ profiles table data +---------+------------+-------------+ | user_id | birth_year | birth_month | +---------+------------+-------------+ | 95425 | 1982 | 12 | +---------+------------+-------------+ signup.html.slim = f.label :sex, 'mens', :value => 0 = f.radio_button :sex, true, :checked => true = f.label :sex, 'women', :value => 1 = f.radio_button :sex, false = f.text_field :em

javascript - ExtJS store add calls both create and destroy -

javascript - ExtJS store add calls both create and destroy - this.store = ext.create('ext.data.store', { fields: [ 'id', 'name', 'address', 'status', ], autoload: auto, autosync: auto, remotesort: true, proxy: { type: 'ajax', api: { create: '../../create.php', read: '../../read.php', destroy: '../../destroy.php', update: '../../update.php' }, reader: { type: 'json', root: '__data', totalproperty: 'grandtotal' },

c - When using strtol and input 2 zeros (00), then it only output one zero back? -

c - When using strtol and input 2 zeros (00), then it only output one zero back? - the code below asks age , outputs simple printf. im trying input 000 , have homecoming 000 , not 0. do? #include <stdio.h> #include <stdlib.h> #include <string.h> #define line_len 80 #define extra_spaces 2 int main(void) { char line[line_len + extra_spaces]; char * end; int input_num; /* user input */ printf("please come in age: "); fgets(line, line_len+extra_spaces, stdin); /* check buffer overflow */ if(line[strlen(line)-1]!='\n') { printf("error: buffer overflow\n\n"); homecoming exit_failure; } /* remove newline */ line[strlen(line)-1]=0; /* retrieve number */ input_num = strtol(line, &end, 0); if(*end) { printf("error: info entered not numeric.\n\n"); homecoming exit_failure; } printf("you %d years old.\n\n", input_num); homecoming exit_success; } if understood question correctly, nee

multithreading - If I have 1 thread writing and 1 thread reading an int32, is it threadsafe? -

multithreading - If I have 1 thread writing and 1 thread reading an int32, is it threadsafe? - i using c#, , need know if having 1 thread reading, , 1 thread writing safe without using volatiles or locks. reading/writing 32 bit ints , booleans. this pretty much definition of thread-unsafe code. if analyze need lock in threaded code pattern. if don't lock thread reads observe random changes variable, out of sync execution , @ random times. the guarantee c# memory model int , bool update atomic. expensive word means not accidentally read value of bytes in value have new value , have old value. produce random number. not every value update atomic, long, double , construction types (including nullable<> , decimal) not atomic. not locking necessary produces extremely hard debug problems. depend on timing , programs tend settle execution patterns timing doesn't vary much. can change, when machine occupied task example. programme running fine week, fai

C# json serialization and deserialization without attributes -

C# json serialization and deserialization without attributes - is possible serialize , deserialize class , inheritance without specifying datamember attribute every needed property? yes. can either utilize .net javascriptserializer class or utilize third-party library such json.net. here illustration using javascriptserializer: using system; using system.web.script.serialization; class programme { static void main(string[] args) { derivedclass dc = new derivedclass { id = 1, name = "foo", size = 10.5 }; javascriptserializer ser = new javascriptserializer(); string json = ser.serialize(dc); console.writeline(json); console.writeline(); derivedclass dc2 = ser.deserialize<derivedclass>(json); console.writeline("id: " + dc2.id); console.writeline("name: " + dc2.name); console.writeline("size: &

methods - fix java logical error, user money does not deduct or add whether it lose or win -

methods - fix java logical error, user money does not deduct or add whether it lose or win - i want create java dice game utilize branching (if-else), nested while loops, , method (simple function , procedures). the code run fine when comes result determine how much money user have, not show anything, show default money 100 how prepare it? give thanks much, beginner please not mine me question. here code: public static void main(string[] args) { scanner in = new scanner(system.in); int umoney= 100; int lw; int roll1; int roll2; int bet ; system.out.println("you have "+ umoney+" dollars"); while (umoney!=0) { bet = getbet(in, umoney); char user=gethighlow(in); roll1=getroll(); system.out.println("die 1 rolls: "+roll1); roll2=getroll(); system.out.println("die 2 rolls: &quo

swapping 2 registers in 8086 assembly language(16 bits) -

swapping 2 registers in 8086 assembly language(16 bits) - does know how swap values of 2 registers without using variable, register, stack, or other storage location? thanks! like swapping ax, bx. you can using mathematical operation. can give idea. hope helps! i have followed c code: int i=10; j=20 i=i+j; j=i-j; i=i-j; mov ax,10 mov bx,20 add together ax,bx //mov command re-create info accumulator ax, forgot statement, ax=30 sub bx,ax //accumulator vil b 10 //mov command re-create info accumulator bx, forgot statement sub ax,bx //accumulator vil b 20 //mov command re-create info accumulator ax, forgot statement assembly cpu-registers 8086 16-bit

objective c - How to get DNS TXT Record in iOS app -

objective c - How to get DNS TXT Record in iOS app - i want inspect txt records server own app. is possible? if yes, how can done? thanks! here's threw quickly. i'm not familiar txt records, might want test few different scenarios, demonstrates basic concept. can modify homecoming ttl values if need well. you'll want add together -lresolv linker flags, , import resolv.h headers. #include <resolv.h> static nsarray *fetchtxtrecords(nsstring *domain) { // declare buffers / homecoming array nsmutablearray *answers = [nsmutablearray new]; u_char answer[1024]; ns_msg msg; ns_rr rr; // initialize resolver res_init(); // send query. res_query returns length of answer, or -1 if query failed int rlen = res_query([domain cstringusingencoding:nsutf8stringencoding], ns_c_in, ns_t_txt, answer, sizeof(answer)); if(rlen == -1) { homecoming nil; } // parse entire message if(ns_initparse(answe

angularjs - what browsers version support GAE Channel Java API -

angularjs - what browsers version support GAE Channel Java API - i want utilize gae channel java api angular i know version of pc browsers, mobile browsers back upwards channel java api on official website nil written if have working examples angular channel api grateful thanks help angularjs google-app-engine channel-api

Tumblr share url -

Tumblr share url - i've came across page https://www.tumblr.com/examples/share/sharing-links-to-articles.html shows possible way customly create share url tumblr. simplified version of have: <a href="http://www.tumblr.com/share/link?url=http%3a%2f%2fwww.google.com" target="blank_">click share</a> http://jsfiddle.net/m5ow6bhs/2/ this take log in page or straight share page if you're logged in. however, if alter http%3a%2f%2f part simple http:// load "not found page". http://jsfiddle.net/m5ow6bhs/3/ hell tumblr? do guys have thought what's going on or what's right code share tumblr? cheers. as share services, url should passed encoded string. supports ops comments http%3a%2f%2f (encoded) , http:// (raw). tumblr provides variable transformations in theme operators handle encoding, sadly doesn't work custom variables. one quick solution drop http:// part. example: http://jsfiddle.net/l9jd8dh

android - Up navigation animation -

android - Up navigation animation - so have followed docs providing navigation however, if want customize animation transitions in xml, trying this https://gist.github.com/lawloretienne/b8b4f68a779b9f97241f the come in animations work well, exit animations seem not triggered. when button clicked, navigate logical parent activity. instead of exit animations showing, come in animations showing. am missing here? your launchmode must have been set singleinstance . overrides transition animation. should set singletop . android animation up-navigation

plot - Can't integrate the subtraction of two Gaussian CDFs [Wolfram Mathematica] [SOLVED] -

plot - Can't integrate the subtraction of two Gaussian CDFs [Wolfram Mathematica] [SOLVED] - i have function product composed 3 (k) factors . each factor subtraction of 2 gaussian cdf random variables r , l. these random variables defined according 4 parameters. the code below shows how plot main function (according 2 independent variables d , e) , how random variables calculated sigma = 1; k = 3; priors = {}; appendto[priors, 1/k + e]; do[appendto[priors, 1/k - e/(k - 1)], {c, 2, k}]; l[priors_, sigma_, d_, i_] := do[ maxval = -infinity; do[ val = (2*sigma^2*log[priors[[i]]/priors[[j]]] + d^2 (j^2 - i^2 + 2 (i - j)))/(2 (j - i) d); if[val > maxval, maxval = val, null]; , {j, 1, - 1}]; return[maxval]; , {1}]; r[priors_, sigma_, d_, i_] := do[ minval = infinity; do[ val = (2*sigma^2*log[priors[[j]]/priors[[i]]] + d^2 (i^2 - j^2 + 2 (j - i)))/(2 (i - j) d); if[val < minval, minval = val, null]; , {j, + 1, k}]; return[minval]; , {1}]; print[ plot3d[

forms - Temperature Conversion PHP -

forms - Temperature Conversion PHP - i have been working on next simple temperature conversion using html , php. first effort @ using php , can't seem right. i sure there lots of errors in code please patient! here have: <!doctype html> <html> <head> <title>temp conversion</title> <meta charset="utf-8"> <body> <form name="tempconvert" method="post" action="<?php echo $_server["php_self"]; ?>"> <table> <tr> <td>enter value convert</td> <td><input type="text" name="valueconvert" id="valueconvert" size="15"></td> </tr> <tr> <td>convert to:</td> <td><select name="converttype" id="converttype" size="1"> <option disabled> select measurement type</option>

javascript - Node.js: How to detect html embedded request vs XMLHttpRequest? -

javascript - Node.js: How to detect html embedded request vs XMLHttpRequest? - in node.js (or in web server matter), somehow possible able determine whether resource request came embedded element in html document, opposed scripted request? for instance, if have in .html file: <script src="/testroute.js"></script> and in javascript: var xhr = new xmlhttprequest(); xhr.open("get", '/testroute.js', true); xhr.send(); is there way server can distinguish between these 2 requests? the same origin policy applies differently in each case, there apparently differentiation going on (at to the lowest degree under surface). there way server developer can see difference? just personal experiment, using diff tool, compared express req object received each , saw 2 slight differences: the socket , connection , , client properties in <script> originating req object had [function] s error property, whereas these [object] re

MySQL Stored Procedure with Prepared Statement does not work -

MySQL Stored Procedure with Prepared Statement does not work - i have next stored procedure: create procedure getlastvalueautomaticshelter(in fieldname varchar(30), position_number int) begin set @query = concat('select * automatic_changes where',fieldname,'is not null , p_id=?'); prepare stmt @query; set @position_number=position_number; execute stmt using @position_number; deallocate prepare stmt; end then running it: mysql> phone call getlastvalueautomaticshelter('current_level', 500)// and getting next error: error 1064 (42000): have error in sql syntax; check manual corresponds mysql server version right syntax utilize near 'not n ull , p_id=?' @ line 1 any ideas? thanks. you need add together spaces in there: set @query = concat('select * automatic_changes ',fieldname,' not null , p_id=?'); /* right ^ here....and ^ here*/ otherwise final que

.net - I want to show any selected item from CheckedListBox in a ListBox in C# -

.net - I want to show any selected item from CheckedListBox in a ListBox in C# - i have windows form application contains 1 "checkedlistbox" named "chkbox1" , contains items (blue, red, green, yellow). the form contains empty "listbox" named "lstbox1". i want when check item "chkbox1" add together "lstbox1" , when unchecked "chkbox1" removed "lstbox1". i think should utilize "itemchecked" event don't know how can observe if item checked or not , add together list. this try: private void chkbox1_itemcheck(object sender, itemcheckeventargs e) { if (chkbox1.checkeditems.count > 0) listbox1.items.add(chkbox1.items[e.index]); else if (chkbox1.checkeditems.count == 0) listbox1.items.remove(chkbox1.items[e.index]); } but add together item when unchecked not when check it. and try: private void chkbox1_ite

aem - CQ5 prevent deleting of a page -

aem - CQ5 prevent deleting of a page - i'm guessing if there's way grab event fired after delete of page before resource no longer available. my problem if click delete button, page on local 4502/siteadmin console, delete event but, during catch, resource no more available can't no longer properties. any advice solution? unless it's kind of processing when want decide whether given user should or shouldn't able remove page recommend using acls defining such constraints. refer official docs: users , groups, acls, useradmin in cq on other way, if need processing might want prevent action including request request filter or overriding wcmcommand . more details take @ developer console in browser , investigate request send on delete button click. cq5 aem

android - AlertDialog is not showing in other activity -

android - AlertDialog is not showing in other activity - function: alert dialog method created notify user on status of account, hence, dialog pop-up when user has been logged out remotely. furthermore, there 4 activities within app; hence, when business relationship logged, dialog pop-up when user decides navigate next activity. dialog pop-up navigate user login page when has been acknowledged. issue: alert dialog doesn't pop when user business relationship has been logged out, logout bttn has been changed login , sharedpreference credentials have been cleared. still allows user navigate around app, app displayed after delayed period. what has gone wrong codes , suggestions? code //build alertdialog notify user on session logout status static builder alertdialog(final activity act,final intent yourintent){ log.i("rootactivity:alertdialog","******session logout info******"); alertdialog.builder alertdialog = new alertdialog.builder(ac

How to convert Decimal to binary C# (4 bits) -

How to convert Decimal to binary C# (4 bits) - this question has reply here: byte binary string c# - display 8 digits 3 answers i want convert decimal numbers binary, i'm using way private string strtobin(string input) { int number = convert.toint32(input) ; string res = convert.tostring(number, 2); homecoming res; } it's working when i'm having illustration "6" i'm getting 110 instead of 0110? tips?! simple string modification: string res = convert.tostring(number, 2); res = new string('0', 8 - res.length) + res; c# binary decimal

java - How to know if the user has scrolled to the end in an SWT Scrolled Bar? -

java - How to know if the user has scrolled to the end in an SWT Scrolled Bar? - we have case need fire server phone call fetch next 100 records user scrolls downwards see lastly element in scroll bar. please share pointers. thanks, pavan. the scrollbar fires selectionevent when changed. listening event , comparing scrollbar position + thumb size maximum size should able tell when scrolled end. final scrollbar scrollbar = scrolledcomposite.gethorizontalbar(); scrollbar.addselectionlistener( new selectionadapter() { public void widgetselected( selectionevent event ) { if( scrollbar.getselection() + scrollbar.getthumb() == scrollbar.getmaximum() ) { // spawn thread fetch farther info } } } ); you want refine status new info fetched before end of scrollbar reached, e.g. if( scrollbar.getselection() + scrollbar.getthumb() > scrollbar.getmaximum() - scrolledcomposite.getclientarea().y ) { ... } java swt

In Oracle/SQL how to select rows where the value of the columns remained the same -

In Oracle/SQL how to select rows where the value of the columns remained the same - in oracle/sql how select rows value of columns remained same i have list of budget, each budget spread on 12 months, fixed salary each month. homecoming list of budgets value of salary remained same on 12 months. budget month salary 5468 1 1500 5468 2 1500 5468 3 1500 5468 4 1500 5468 5 1500 5468 6 1500 5468 7 1500 5468 8 1500 5468 9 1500 5468 10 1500 5468 11 1500 5468 12 1500 3456 1 1675 3456 2 1675 3456 3 1675 3456 4 1675 3456 5 1500 3456 6 1500 3456 7 1500 3456 8 1500 3456 9 1675 3456 10 1675 3456 11 1675 3456 12 1675 3948 1 2900 3948 2 2900 3948 3

objective c - How to set Muc Room Image Using XMPP in iOS -

objective c - How to set Muc Room Image Using XMPP in iOS - i using xep-0045 room implementation in xmpp ios not give functionality regarding adding room image. can 1 suggest protocol supports setting room image. xep-0045 not back upwards avatar or image default. you need customization. if have provision alter server can follow user avatar xep-0153. if not there work around (which not good). can utilize description field (muc#roomconfig_roomdesc) store image info (should utilize base-64 encoded) along actual room description. there limitation of description size @ server beingness used. ios objective-c xmpp livechat

oracle - ORA-28000: the account is locked error getting frequently -

oracle - ORA-28000: the account is locked error getting frequently - i getting error ora-28000: business relationship locked frequently. is db issue? when unlock user business relationship command alter user username business relationship unlock temporarly ok. after time same business relationship lock happen. is got same issue? database using oracle xe one of reason of problem password policy using. and if there no such policy of yours check settings password properties in default profile next query: select resource_name, limit dba_profiles <br/> profile = 'default' , resource_type = 'password'; and if required, need alter password_life_time unlimited next query: alter profile default limit password_life_time unlimited; and link might helpful problem. oracle oracle11g oracle10g

python - Saving current URL on Android Kivy Application -

python - Saving current URL on Android Kivy Application - my code: import kivy kivy.app import app kivy.lang import builder kivy.utils import platform kivy.uix.widget import widget kivy.clock import clock jnius import autoclass android.runnable import run_on_ui_thread webview = autoclass('android.webkit.webview') webviewclient = autoclass('android.webkit.webviewclient')

C++ : Unit testing using Google Mock with Code::Blocks, MinGW and C++11 -

C++ : Unit testing using Google Mock with Code::Blocks, MinGW and C++11 - i've been trying larn unit testing on own next along book. code in book utilize c++11 standard , have line this: auto variable = function(parameter); when first compiled got warning: warning: 'auto' changes meaning in c++11; please remove [-wc++0x-compat] no biggie, prepare checking next box in project->build options... menu: [ ] have g++ follow c++ 11 iso c++ language standard [-std=c++11] now, however, new errors related google mock in gtest-port.h : | | in function 'int testing::internal::posix::strcasecmp(const char*, const char*)': |1719| error: '_stricmp' not declared in scope | | in function 'char* testing::internal::posix::strdup(const char*)': |1721| error: '_strdup' not declared in scope | | in function 'file* testing::internal::posix::fdopen(int, const char*)':| |1779| er

database - Search engine with ability to search for exact match over multiple views? -

database - Search engine with ability to search for exact match over multiple views? - suppose have bunch of raw text, on want perform search. example: "* escaped", or "president of united states". as have searched there many tools can (e.g. lucene) indexing many possible n-grams. suppose in add-on raw text (view 1) somehow create view assigning each word lebel = {a, b} view of raw text (view 2). example, if there document containing: view1 = "jack killed john because doesn't know how code" we have view 2, each word: view2 = "a b b b b" (in general might have more views, let's have 2 view) given sec view, want able search combination of 2 views. for example: "a of united states" "president of b" or perhaps explicitly specified: "v2={a} v1={of united states" "v1={president of the} v2={b}" are there similar capabilit

c++ - Variable or field declared as void -

c++ - Variable or field declared as void - i have read posts same problem, haven't found problem in solutions. i want wirte simple linked list generic content: but written error "variable or field >>insert<< void declared" , each method except main. i hope can help me, thanks #include<iostream> #include<string> //edit:#include"liste.t" waste former test using namespace std; template <typename t> struct element{ t value; element *next; element(t v, element *n) : value(v), next(n) { } }; template <typename t> void insert(element, t, int (*eq)(t,t)); template <typename t> void remove(element, t, int (*eq)(t,t)); void print(element); template <> int equal<string>(t, t); template <typename t> int equal(t, t); int main(){ int (*eq)(int,int) = equal; element* head=null; insert(head, 2, eq); insert(head, 5, eq); insert(head, 1, eq); print(head);

android - Launching a camera in onCreate causing an intermittent issue -

android - Launching a camera in onCreate causing an intermittent issue - i trying find best way implement button in mainactivity launches photographic camera activity , returns image activity. returns image activity add together description image... thought thought start single photo view activity when photographic camera button pressed , new activity start photographic camera activity result before doing else; have intermittent issue photographic camera gets stuck in loop. maybe there improve approach? should launch photographic camera activity result first , pass image intent? here have now: @override public boolean onoptionsitemselected(menuitem item) { int id = item.getitemid(); if (id == r.id.action_settings) { homecoming true; }else if ( id == r.id.menu_rules ){ intent rulesintent = new intent(this, rulesactivity.class); startactivity(rulesintent); homecoming true; }else if ( id == r.id.menu_import_photo ){

c++ - Undefined references linking sqlite3pp -

c++ - Undefined references linking sqlite3pp - i'm trying compile sqlite3pp. source http://code.google.com/p/sqlite3pp 1) g++ ../src/*.cpp -c -> produces 3 .o file sqlite3pp.o, sqlite3ppext.o , testaggregate.o 2) ar crf libsqlite3pp.a *.o -> generate new file called libsqlite3pp.a 3) g++ -shared *.o -o sqlite3pp.dll -> multiple undefined reference sqlite3_* 4) g++ -shared *.o -lsqlite3pp -o sqlite3pp.dll -> same errors previous 5) g++ -shared *.o -lsqlite3 -o sqlite.dll -> undefined reference sqlite3_open_v2 why lastly error occur? c++ sqlite

css - Sticky HTML footer not working -

css - Sticky HTML footer not working - so have looked @ these posts sticky footers on here...and tried every "fix" can find, still can't create footer show , stick bottom of page. not sure if has responsive iframe have in page or not - seems wipe out footer. closest have gotten footer float above content towards bottom, can't stick bottom content stopping above footer. help can give appreciated! class="snippet-code-css lang-css prettyprint-override"> html { position: relative; min-height: 100%; } body { font-family: 'pt_sansregular'; background-image: url(images/body_bg.jpg); background-repeat: repeat; } body, td, th { font-family: "pt_sansregular"; color: #ffffff; } a:link { color: #ff0004; text-decoration: none; } a:visited { text-decoration: none; color: #dc7f81; } a:hover { text-decoration: none; color: #fd5f61; } a:active { text-decoration: none; } body {

handlebars.js - Interleaved closing tag error in Handlebars (Ember.js) -

handlebars.js - Interleaved closing tag error in Handlebars (Ember.js) - i decided seek ember.js. i set little application, can't work. i have file app.html <!doctype> <html> <head> ... </head> <body> <script type="text/x-handlebars"> ... </script> </body> </html> now, of course, doesn't render anything. include handlebars.js, ember.js, , app.js , renders properly. the problem when seek add together curly braces, output blank. example, if set variables in js files , want display in app, <h1>{{title}}</h1> , <h1></h1> . when seek set {{input value="username"}} , nil gets displayed. i no error messages, except when utilize closing tags. example, this {{#link-to "http://google.ca"}}link{{/link-to}} will create whole web page display line 117: interleaved closing tag: link-to i have no

How to verify existence of elements in page using Selenium/Java -

How to verify existence of elements in page using Selenium/Java - i'm trying figure out way see if element existing/not existing on page. this have far. however, if element not existing, exception thrown, , script stop. could help me find improve way this? //checking navbar links system.out.println("======================="); system.out.println("navbar link checks"); //checking web link element in nav bar if(driver.findelement(by.xpath("/html/body/div[2]/div[1]/div[1]/ul/li[1]/a"))!= null){ system.out.println("web link in navbar present"); }else{ system.out.println("web link in navbar absent"); } //checking images link element in nav bar if(driver.findelement(by.xpath("/html/body/div[2]/div[1]/div[1]/ul/li[2]/a"))!= null){ system.out.println("images link in navbar present"); }else{

haskell - Is name reuse the only advantage of type classes? -

haskell - Is name reuse the only advantage of type classes? - i trying understand type classes in haskell. i pose question using simple example: lets consider 2 datatypes, a , b . lets assume a1 , a2 of type a , b1 , b2 of type b . now let's assume want define functions check if a1 equals a2 , whether b1 same b2 . for have 2 options: option 1: define 2 equality functions using separate names : eqa :: -> -> bool eqa = ... eqb :: b -> b -> bool eqb = ... now if want check if a1 equals a2 write : eqa a1 a2 , b : eqb b1 b2 . option 2: we create a , b instances of eq typeclass. in case can utilize == sign checking equality follows. a1==a2 b1==b2 so, question : far understand sole purpose of existence of type classes can reuse function name == equivalence checking function, shown in alternative 2. if utilize type classes not have utilize different function names same purpose ( i.e. checking equality). is correct? n

oracle - SQL*Net configuration - spurious IP -

oracle - SQL*Net configuration - spurious IP - i can't connect oracle 12 database through sql*net tracing backwards tnsping result follows: tnsping devpdb tns ping utility linux: version 12.1.0.2.0 - production on 08-oct-2014 05:28:55 copyright (c) 1997, 2014, oracle. rights reserved. used parameter files: used hostname adapter resolve alias attempting contact (description=(connect_data=(service_name=))(address=(protocol=tcp)(host=xx.xxx.xxx.xx)(port=1521))) the host ip unresolvable computer. don't know getting it's not nat address of host or of router, it's @ to the lowest degree 30 hops away per ping. tnsnames.ora: # generated oracle configuration tools. devdb = (description = (address = (protocol = tcp)(host = tts-poweredge-t105)(port = 1521)) (connect_data = (server = dedicated) (service_name = devdb) ) ) devpdb = (description = (address = (protocol = tcp)(host = tts-poweredge-t105)(port = 1521)) (conn