Posts

Showing posts from January, 2014

(C++) Cannot refer to an enum class inside a namespace -

hello met problem during project, have this: types.h namespace machine { enum class size{ tiny, small, medium } //other stuff..... and in file: test.h: #include "types.h" class sample{ public: void some_function(); machine::size s; //this declaration correct } test.cpp: #include "test.h" void some_function(){ s = machine::size::tiny;//line aaaa; line error } at line aaaa kept getting error message: error: 'machine::size' not class or namespace anyone have idea why? or not put enum class inside namespace? thanks! edit: fixed machine spell problem in first file, sorry that machine::size s place hold attribute (the size of machine), don't think it's special. in test.cpp replace definition starting with void some_function() by void sample::some_function() as otherwise defining free standing function no relation whatsoever class sample (in...

python - Access google docs using gspread -

i trying access google docs using gspread utility , successful when tried below code on google doc import gspread g = gspread.login('gmailid', 'password') worksheet = g.open('googlesheetname').get_worksheet(0) val = worksheet.cell(2, 1).value print val but when tried same code corporate account uses google server, getting below error: raise authenticationerror("unable authenticate. %s code" % ex.code) gspread.exceptions.authenticationerror: unable authenticate. 500 code can please me on this? see author of gspread says here : two factor authorization in case google account protected 2 factor authorization, have create application-specific password , use email login usual. otherwise authenticationerror: unable authenticate. 403 code when trying login.

javascript - onClick="" don't appear at the actual element made with react. -

i'm making elements react this: var addnewtask = react.createclass({ handleclick: function() { console.log('pressed!'); }, render: function() { return ( <div classname="addnewtask" onclick={this.handleclick}> <i classname="material-icons">add</i> </div> ); } }); but on actual rendered html page div not contain onclick property. looks this. <div class="addnewtask" data-reactid=".0.2"> <i class="material-icons" data-reactid=".0.2.0">add</i> </div> how make appear? it won't appear in rendered html, handler attached dom element itself. react normalizes event system across browsers behaves consistently. suggest reading on how works @ official docs: https://facebook.github.io/react/docs/events.html

Which type of data structure is a stack? -

i got 1 simple question: kind of data structure stack? static or dynamic data structure? looking answer , couldn't find it, therefore got own "explanation" - guess, when can implement either using array or linked list, can be... both?, depending on implementation? reasoning make sense? by definition, static data structure has fixed size. if can limit size of stack pre-determined number, stack becomes static data structure. size size of storage, plus size of stack pointer or stack index indicating current location. a stack of unlimited capacity dynamic data structure, regardless of implementation. implemented linked list or array re-allocate upon reaching capacity, size of such stack changes add or remove data.

java - Asynchronous handling of messages - which concurrency primitives to use? -

i building simple implementation of postgresql wire protocol, , want client send messages service, , process them asynchronously in background. having little trouble understanding when use executorservice versus using raw threads. using 2 blockingqueue s - 1 put messages on , have them sent server, , 1 receive messages into, code far below. what want know is, make sense use executorservice here or should create , start receivethread , sendthread standalone threads (i.e. new thread(new receivethread()).start(); )? import java.io.*; import java.net.socket; import java.nio.bytebuffer; import java.util.arraylist; import java.util.list; import java.util.concurrent.*; public class connection { private messagebuilder builder; private messagereader reader; private blockingqueue<byte[]> sendqueue; private blockingqueue<byte[]> receivequeue; private executorservice exec = executors.newfixedthreadpool(2); private socket socket; public conn...

javascript - Onsen 2.0 v 1.x - pure JS -

sorry if basic question, documentation seems conflicting regarding onsen monaca. using monaca cloud , want use pure js - no angular or react. frameworks add overhead trying accomplish basic app. question is, appears onsen 2.0 divests frameworks yet sample template in cloud ide indicates need use angular flat ios design. if want use non-framework integrated js, onsen should using 1.x or 2.0? if want use pure javascript, should choose onsen ui 2.0 @ moment, it's agnostic mobile hybrid app framework on market. onsen ui 1.x based on angularjs 1.x, not suitable purpose. take @ following link if want learn more onsen ui 2.0 https://onsen.io/2/

Getting undefined method `setTimeout' with selenium webdriver using with ruby -

getting error below : c:\ruby\scripts>w9_file_delete_v1.rb c:/ruby193/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.30.0/lib/selenium/webdr iver/common/timeouts.rb:33:in `page_load=': undefined method `settimeout' #< selenium::webdriver::driver:0xa3263e4 browser=:firefox> (nomethoderror) c:/documents , settings/rakshiar/my documents/userdata/ruby/scrip ts/w9_file_delete_v1.rb:19:in `<main>' with below code : #-------------------------------------------------------------- #creating here firefox browser agent #file deletion process #-------------------------------------------------------------- driver = selenium::webdriver.for :firefox driver.get "https://demo.com/" #driver.manage.timeouts.implicit_wait = 200 # seconds pgload = selenium::webdriver::timeouts.new(driver) pgload.page_load=(300) can have on that. you should not need create selenium::webdriver::timeouts object directly. instead, use appropriate method driver ...

Which things need to care with Rails application cluster? -

if plan create rails application cluster , think session share problem, , can save session memcache or database. want know there else need cared ? thanks! this question vague, should load balancing (haproxy good), in-memory data store such memcached , database mysql. web tier scales out horizontally it's easy increase processing power needed. please clarify question more answers.

qtgui - How can I change background color for child windows in Qt MDI project? -

Image
how can change background color child windows in qt mdi project? if mdisubwindow pointer child window use code like mdisubwindow->setstylesheet("background-color:<color like>;"); can (well known) name (e.g. white) or numeric value (e.g. #ff00dc).

html - How to vertically align text with center of image when using Bootstrap. -

i trying create header website. want have logo @ top left corner , nav bar @ top right corner of window. issue nav bar not aligned flush center of logo. here's goods: #logoheader { float: left; vertical-align: middle; } ul { list-style: none; display: inline block; vertical-align: middle; } li { float: right; padding: 10px; font-size: 22pt; display: inline-block; } .header .navcontainer { height: 131px; vertical-align: middle; } <!doctype html> <html> <head> <meta charset = "utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmkzs7" crossorigin="anonymous"> <link type= "text/css" rel="stylesheet...

python - Use colormaps along with matplotlib cycler -

Image
i use matplotlib cycler colors palettable. cycler looks this: from cycler import cycler plt.rc('axes', prop_cycle=(cycler('color', ['r', 'g', 'b', 'y']) + cycler('linestyle', ['-', '--', ':', '-.']))) how replace color list above color map obtain palettable? import palettable cmap = palettable.colorbrewer.diverging.prgn_11.mpl_colormap for answer, not critical use palettable, important know how use colormap. cycler needs iterable assigned 'colors' . here way generate one: [plt.get_cmap('jet')(1. * i/n) in range(n)] so original example: plt.rc('axes', prop_cycle=(cycler('color', ['r', 'g', 'b', 'y']) + cycler('linestyle', ['-', '--', ':', '-.']))) x = [1,2,3,4] in range(4): plt.plot([_ + _ in x]) to modif...

PHP access level system using session array -

i have login , register system working fine, although want add user access levels users admin access can go on page regular users can't. have code echoing know if work @ moment. this code i'm using: echo("hello $_session[user]"); if ($_session['user']==1) { echo "you have admin access"; } else { echo "you're regular user"; } so basically, if user have level 1 in database, admin , below regular user. the problem never works, displays "you're regular user" and code: echo("hello $_session[user]"); echo's out "hello arrayyou're regular user" i know login system has session set user, says array. here login page, didn't make since i'm new php: http://pastebin.com/h0zqnnse and curious, know level row in database working because have echoed out fine using script, can see here $_session['user'] associative array, containing various attributes o...

regex - MySQL - efficient regexp (or like) query -

i have 2 tables, performer table , redirect table. performer table has column called slug . redirect table has column called source . both source , slug columns have unique key indexes. an example of slug column data like: this-is-a-slug an example of source column data like: this-is-a-slug.s12345 i want efficient query gives me rows in redirect have source column starts slug , ".s" characters, followed number digits. i tried this: select source redirect join performer on source regexp concat('^', slug, '.s[0-9]+$'); it extremely slow. decided less restrictive , tried this: select source redirect join performer on source concat(slug, ".s%"); it still slow. is there way can efficiently? abandon current plans. add column redirect has slug . one-time change table, plus changing code insert it. if running 5.7 or mariadb, use virtual column, possibly materialized index. btw, here's way split stri...

c# - I want to join two tables and want column of both tables in result using linq -

i want join 2 tables , want column of both tables in result using linq i have like var k = (from t in uow.transactions.getallwithreferences() join q in uow.transactiondetails.getall() on t.transactionid equals q.transactionid select t) instead of t u wabt columns of both t , q using lambda syntax, create anonymous result containing both items: var joinresult = uow.transactions.getallwithreferences() .join(uow.transactiondetails.getall(), transaction => transaction, details => details, (transaction, details) => new { transaction = transaction, details = details });

What's the 'standard' directory location to use when cloning a Git repo onto a LINUX machine -

while spend of career on microsoft stack full-stack web developer - have, on occasion, made way *nix side of things.. built out freebsd web server here, played caldera linux once on there, , doing web deployment using google cloud vm running ubuntu... tl,dr so, if forked repo onto github account- purposes of cloning ubuntu server i'll compile , run web application.. what professionally expected location should put 'cloned' source code? googled around bit better grasp of various linux directories for.. but.. need answer... so... put it? /usr/src/mygitrepos ..that sounded me.. but.. do? what professionally expected location if you're deploying app that's compiled source, there's no such location. in professional environment sources don't go on servers. from professional "it works" solutions: build system packages outside of production environment. means have repository of both deployed versions , have package manife...

javascript - Rails 4 - Sending Google Maps API JSON return val to controller -

i'm using google maps javascript api return distance point point b , i'm able value. i'm able see writing log (using google chrome devtools) using following js: console.log(totaldistance); what i've tried far has not worked far have hidden tag , set value of using js: $('#distance').text(totaldistance); in view form have is: <%= form_tag({ :action => 'fare', :controller=> 'page'}, {:class => 'form-horizontal center'}) %> <%= text_field_tag :origin, '', class: 'form-control', id: 'origin-input' %><br/> <%= text_field_tag :destination, '', class: 'form-control', id: 'destination-input' %> <%= hidden_field_tag :distance, '', id: 'distance' %> <%= submit_tag "submit" , id: 'get-route'%><!-- id needed js --> <% end %> my thought pass value on parameter controller i'm checking...

C# define LET in LINQ -

i have multiple linq queries uses same let variables, predefine these somehow. iqueryable<routequerymodel> query = (from b in db.routes let avg_rating = b.ratings.any() ? b.ratings.select(r => r.rating1).average() : 0 let distance_to_first_from_me = b.coordinates. select(c => c.position). firstordefault(). distance(dbgeography.fromtext(currentlocation, 4326)) let distance_to_last_from_me = b.coordinates. orderbydescending(c => c.sequence). select(d => d.position). firstordefault(). distance(dbgeography.fromtext(currentlocation, 4326)) let distance_to_from_me = distance_to_first_from_me < distance_to_last_from_me ? distance_to_first_from_me : distance_to_last_from_me b.endpoints.any(e => values.any(t => t == e.town.town_id)) select new routequerymodel { b = b, distance_to_from_me = distance_to_...

Google Calendar API: Calendar usage limits exceeded -

we have application migrations between google apps domains. calendar migrations using import api( https://developers.google.com/google-apps/calendar/v3/reference/events/import ). last 6 months did lot of calendar migrations. week ago faced new api error import: "error"=> {"errors"=>[ {"domain"=>"usagelimits", "reason"=>"quotaexceeded", "message"=>"calendar usage limits exceeded."}], "code"=>403, "message"=>"calendar usage limits exceeded." last week got lot of "calendar usage limits exceeded." errors users different domains. accordingly google api console didn't reach daily quota limit. our app using 2legged authorization. please understand "calendar usage limits exceeded." mean? how can prevent error? can find information calendar usage limits? having same issue. i using version 3 code, t...

asp.net - How do I do a custom modelbinder when binding from body? -

i've been trying experiment model binding make our api easier use. when using api can't model binding bind when data in body, when part of query. the code have is: public class funkymodelbinder : imodelbinder { public bool bindmodel(httpactioncontext actioncontext, modelbindingcontext bindingcontext) { var model = (funky) bindingcontext.model ?? new funky(); var hasprefix = bindingcontext.valueprovider .containsprefix(bindingcontext.modelname); var searchprefix = (hasprefix) ? bindingcontext.modelname + "." : ""; model.funk = getvalue(bindingcontext, searchprefix, "funk"); bindingcontext.model = model; return true; } private string getvalue(modelbindingcontext context, string prefix, string key) { var result = context.valueprovider.getvalue(prefix + key); return result == null ? null : result.attemptedvalue; } } ...

python - How to use restful upload multiple files with array? -

my schema: test_multivalues = { 'name': {'type':'string'}, 'multi': {'type': 'list', 'schema': {'type': 'media'}}, 'arr': {'type': 'list'}, } i use post data follow: content-type: multipart/form-data name: multivalue multi: ....file1... multi: ....file2.... arr: [arr_value1, arr_value2] in eve,parameter arr list, multi first value. expect multi list [file1, file2]. when read code, eve use werkzeug's multidict.to_dict() in payload() method return first value same key. how can key multiple values list ? updated: eve raise exception above schema , post data: multi:must of list type updated: yes, test curl. curl -f "image=@text.txt" -f "image=@test.txt" http://localhost/eve/api when changed code in payload() to: v = lambda l: l if len(l) > 1 else l[0] return dict([(k, v(request.form.getlist(k))) k in request.form] + ...

ios - Update/change array value from another view controller -

data model class dataimage { var userid: string var value: double var photo: uiimage? var croppedphoto: uiimage? init(userid:string, value: double, photo: uiimage?, croppedphoto: uiimage?){ self.userid = userid self.value = value self.photo = photo self.photo = croppedphoto } } viewcontroller(tableview) var photos = [dkasset]() //image source var datas = [dataimage]() override func viewdidload() { super.viewdidload() self.loaddataphoto() } func loaddataphoto(){ var counter = 0 asset in photos{ asset.fetchoriginalimagewithcompleteblock({ image, info in // move image photos datas let images = image let data1 = dataimage(userid: "img\(counter+1)", value: 1.0, photo: images, croppedphoto: images) self.datas += [data1] counter++ }) } } from code, let's have 5 datas: dataimage(userid: "img1", value: 1.0, photo: images, croppedpho...

In Android Studio, Create AVD at New Path (As my C drive is full) -

i dont have space in c drive, hence want create avd in android studio in drive. how can change setting of avd manager, new avds created @ new path-directory this has been answered before, according @wloescher : add new user environment variable (windows 7): start menu > control panel > system > advanced system settings (on left) > environment variables add new user variable (at top) points home user directory: variable name: android_sdk_home variable value: path directory of choice avd manager use directory save .android directory it. original post. if on linux system: how set environment variables on linux. if on mac: how set environment variables on mac.

c# - Pass properties of parent control to children controls -

i developing set of custom controls specific application. want define properties universal on set of controls appearance purposes, argument's sake let's make customctrl.accentcolor i want define same property windows form i.e. form1.accentcolor , when change it, custom controls' accentcolor should change, when change forecolor of form, labels' , buttons' etc forecolor changes it. is @ possible or have settle effort of looping through custom controls , changing one-by-one? short answer since can have common base class controls mentioned in comments, option can create base class , add properties behavior ambient properties (like font ) base control class. detailed answer an ambient property property on control that, if not set, retrieved parent control. in our implementation, value parent form using findform method. in implementation, when getting property value, check if value equals default value , if parent has same property, retur...

Google Sheets App Script - Menu Item Link Purchase Order # to Packing Slip # -

i having trouble wrapping mind around problem. i have sheet customer purchase orders. here dumbed down sheet example here: https://docs.google.com/spreadsheets/d/151h1xjb98nobno0otnaql3asjk84ccczz399dx4bmbm/edit?usp=sharing i need way link packing slip # matching list of customer purchase order #'s on order sheet. using sort of copy cell value "packing slip!g2" "orders!c:c" = "packing slip!g5" "orders!d:d" do think feasible? thank you. been smashing around, trimmed out stuff mussing , leave here morning can make better sense. function linkpacknumtopo() { var activesheet = spreadsheetapp.getactive(); var ps = activesheet.getvalue("g2"); var po = activesheet.getvalue(g5); } so can not figure out way similar operation vlookup using app script. so thinking need write separate sheet single record each purchase order # being linked packing slip # and/or sales order # also. i using following code copy date, ...

android - OutOfMemoryError when doing setImageResource() -

imageview.setimageresource(int id); showing outofmemoryerror . have tablelayout in adding tablerow pragmatically, in each row i'm setting image, in projects resource folder, referencing image withe resource_id . private void additems() { table.removeallviews(); random rand = new random(); (int = 0; < 20; i++) { tablerow row = new tablerow(getactivity()); table.addview(row); relativelayout profile = (relativelayout) getlayoutinflater(null).inflate(r.layout.buddyname, null); textview name = (textview) profile.findviewbyid(r.id.name); name.settext(randomnames[i]); imageview photo = (imageview) profile.findviewbyid(r.id.photo); photo.setimageresource(randomphoto[new random().nextint(randomphoto.length - 1)]); row.addview(profile); } } each time doing table.removeallviews(); not working, can guess because image resource loading again , again on heap , not clearing heap, can reference loa...

java - Creating Guest Session -

is there way create guest session in aem? our project e-commerce website built on aem , need track session of incoming guest , generate token out of it, in case there saving of items on cart. need track guest session/token in case user decides log in our site checkout items, back-end services can map on ownership of cart based on session/token. by default if user not logged in , content viewed, aem internally logs user "anonymous", may consider guest. you can value below: import org.apache.jackrabbit.api.security.user.authorizable; import org.apache.jackrabbit.api.security.user.usermanager; import org.apache.sling.api.resource.resourceresolver; import javax.jcr.session; ... usermanager usermanager = resourceresolver.adaptto(usermanager.class); session session = resourceresolver.adaptto(session.class); // getting current user authorizable auth = usermanager.getauthorizable(session.getuserid()); log.info("\n--- user, p...

ios - Return value in NSURLSession Error -

i below error while trying return responsestring incompatible block pointer types sending 'nsstring *(^)(nsdata *__strong, nsurlresponse *__strong, nserror *__strong)' parameter of type 'void (^)(nsdata *__strong, nsurlresponse *__strong, nserror *__strong)' where call suppose aviewcontroller class nsstring *responsestring=[self callapi]; and below code in bviewmodel class: -(nsstring* )callapi { nsurlsessionconfiguration *configuration = [nsurlsessionconfiguration defaultsessionconfiguration]; nsurlsession *session = [nsurlsession sessionwithconfiguration:configuration delegate:self delegatequeue:nil]; nsurl *url = [nsurl urlwithstring:@"http://appersgroup.com/talkawalk/login.php?email=twalknet@gmail.com&password=123456&latitude=52.486245&longitude=13.327496&device_token=show"]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:url cachepo...

c - How to generate a very large non singular matrix A in Ax = b? -

i solving system of linear algebraic equations ax = b using jacobian method taking manual inputs. want analyze performance of solver large system. there method generate matrix i.e non singular? attaching code here.` #include<stdio.h> #include<stdlib.h> #include<math.h> #define tol = 0.0001 void main() { int size,i,j,k = 0; printf("\n enter number of equations: "); scanf("%d",&size); double reci = 0.0; double *x = (double *)malloc(size*sizeof(double)); double *x_old = (double *)malloc(size*sizeof(double)); double *b = (double *)malloc(size*sizeof(double)); double *coeffmat = (double *)malloc(size*size*sizeof(double)); printf("\n enter coefficient matrix: \n"); for(i = 0; < size; i++) { for(j = 0; j < size; j++) { printf(" coeffmat[%d][%d] = ",i,j); scanf("%lf",&coeffmat[i*size+j]); printf("\n"); //coeffmat[i*size+j] = 1.0; } }...

character - understanding letter or digit function check in C -

what functions check? from understand, supposed check if word contains non-alphanumeric character. don't understand how this. my understanding: the first check length - ok. the second check if character letter: isletter(symbol[0])) evaluates false. logically negated. the third function same above. what didn't understand, fourth one: isletterordigit(*symbol)) . how check if word has non-alphanumeric characters? the code: int issymbolvalid(char* symbol) { int len = strlen(symbol); if ((len == 0) || (len > max_symbol_size)) { strcpy(lastparsingerror, "invalid symbol length"); return 0; } if (!isletter(symbol[0])) { strcpy(lastparsingerror, "symbol name has start letter"); return 0; } while (*symbol != 0) { if (isletterordigit(*symbol)) { strcpy(lastparsingerror, "symbol name can contain letters , digits"); return 0...

debugging - MediaWiki language bug still persists -

Image
this on en.mydomain.org this in logged out state on chrome. log in though, in english, should be. same happens on firefox. anyone got clue stem from? looks set language in user preferences english. to set global language english, change/put in localsettings.php: $wglanguagecode = "en";

python - Stacked bar plot by grouped data with pandas -

Image
let's assume have pandas dataframe has many features , interested in two. i'll call them feature1 , feature2 . feature1 can have 3 possible values. feature2 can have 2 possible values. i need bar plot grouped feature1 , stacked count of rows each value of feature2 . (so there 3 stacks each 2 bars). how achieve this? at moment have import pandas pd df = pd.read_csv('data.csv') df['feature1'][df['feature2'] == 0].value_counts().plot(kind='bar',label='0') df['feature1'][df['feature2'] == 1].value_counts().plot(kind='bar',label='1') but not want because doesn't stack them. im not sure how in matplotlib (pandas default plotting library), if willing try different plotting library, quite easy bokeh. here example import pandas pd bokeh.charts import bar, output_file, show x = pd.dataframe({"gender": ["m","f","m","f","m...

typography - Is there a way to move letters closer to each other for only a certain range of a string using CSS? -

Image
given have string "software", reduce spacing between "f" , "t" , keep rest of string spacing is. plan b me @ point add span around letters f , t ideally not have touch markup. question is: is there way change spacing between letters range of string using css or scss? code example: html <h1>software</h1> css h1{ letter-spacing:-0.13em; //is there way specify range here? } here plan b: h1{ font-size:5rem; font-family: 'comfortaa', cursive; } span{ letter-spacing: -0.13em; } <link href='https://fonts.googleapis.com/css?family=exo+2|michroma|comfortaa' rel='stylesheet' type='text/css'> <h1>so<span>ft</span>ware</h1> what want normal typographical behavior, referred "kerning", adjusts intra-letter spacing in visually pleasing ways. example: kerning function of font. in other words, fonts have kerning data, , don...

selenium - How to Open negative browser url? -

i need verify if opening browser url not landing particular page. code snippet below, open performed , page displays 'couldn't open url' still exception thrown selenium error: "error in invoking selenium commands:timed out after 100000ms". selenium rc command selenium.settimeout("100000"); selenium.open(url); how verify negative url's via selenium to open url in web browser string browser = "firefox"; //string browser = "chrome"; //string browser = "ie"; @test public void googlesearch() { webdriver driver = null; if (browser.equalsignorecase("chrome")) { system.setproperty("webdriver.chrome.driver", "path-to-chromedriver\chromedriver.exe"); driver = new chromedriver(); } else if(browser.equalsignorecase("ie")){ system.setproperty("webdriver.ie.driver","path-to-iedriver\iedriver.exe"); drive...

executorservice - Java ThreadFactory: Why does one use of works but other doesn't? -

in following program code hangs while trying get() on future in method second() ! why that? difference between 2 executor services threadfactory use. doesn't matter if use newsinglethreadexecutor or newfixedthreadpool count of 1. package me.test; import java.util.concurrent.callable; import java.util.concurrent.executionexception; import java.util.concurrent.executorservice; import java.util.concurrent.executors; import java.util.concurrent.future; import java.util.concurrent.threadfactory; public class executorservicetest { threadfactory tf1 = new threadfactory() { @override public thread newthread(runnable r) { thread t = executors.defaultthreadfactory().newthread(r); t.setdaemon(true); t.setname("tf1-thread"); return t; } }; threadfactory tf2 = new threadfactory() { @override public thread newthread(runnable r) { thread t = new thread("tf2...

javascript - Remove CSS properties that were set in a CSS file (not inline CSS) [jQuery] -

i have css property set in stylesheet file: .main-outer-div-filter { max-height: 230px; } i trying remove jquery so: $('.main-outer-div-filter').css('max-height',''); for reason, way doesn't seem have affect, works if set style inline, not when in css file. there way use jquery reset/remove css properties, set in css file? thank you with ('max-height', '') removing inline css. work if set inline before. reset it, use initial value: $(document).ready(function() { $('.special').css({ 'max-height': 'initial' }); }); li { height: 50px; border: 1px solid black; max-height: 20px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <ul> <li>max-height: 20px;</li> <li class="special">max-height: initial;</li> </ul>

java - Is there a way to summarize multiple OnClickListener into one function in AndroidStudio? -

i got multiple onclicklistener 8 imageviews same logic behind. onclick variable-details shown. tried summarize them in method , tried add them in oncreate method loop. did not work. have 8 listeners , 8 addlistener @ oncreatemethod . is there more elegant way? private void addlistenercal1arrow() { ivcalarrow1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (!cal1clicked) { cal1clicked = true; ivcalarrow1.setimageresource(r.drawable.arrow_symbol_up); tvdescription1.setvisibility(view.visible); } else { cal1clicked = false; ivcalarrow1.setimageresource(r.drawable.arrow_symbol_down); tvdescription1.setvisibility(view.gone); } } }); } more explanation: got experiment fragment, can add 8 variables max. each varia...

ruby on rails - ERROR Failed to start Neo Server -

i have use neo4j rails application. started installing neo4j server.i followed steps install here on linux. but when run ./bin/neo4j console it gives error failed start neo server on port [unknown port] bad value 'conf/neo4j-http-logging.xml' setting 'org.neo4j.server.http.log.config': http log directory [/opt/neo4j-community-2.3.2/data/log] not writeable. org.neo4j.graphdb.config.invalidsettingexception: bad value 'conf/neo4j-http-logging.xml' setting 'org.neo4j.server.http.log.config': http log directory [/opt/neo4j-community-2.3.2/data/log] not writeable. i unable start neo4j server.help me how resolve it. in advance. the error message mentions root cause: http log directory [/opt/neo4j-community-2.3.2/data/log] not writeable. so check file permissions , fix them user running neo4j can write directory.

c# - ZipFile Entry FulllName Folder Oblique Line sometimes '\' sometimes '/' direction change -

i use method fullname property in zipfile public static string getallfullname(string zippath) { string s = ""; using (ziparchive archive = zipfile.openread(zippath)) { foreach (ziparchiveentry entry in archive.entries) { s += entry.fullname + "\n"; } } return s; } string s = getallfullname(zippath); //save string savefilepath file(such txt) file.writealltext(savefilepath, s, encoding.default); then can see fullname in zip. and in case, zipfile others , print fullname, result (part of result) telerik.windows.controls.dll telerik.windows.controls.input.dll wms.silverlight.languages.dll zh-hans\system.windows.data.resources.dll assets\appmenu.xml assets\configuration.xml assets\resource.xml image\lock16.png then unzip file in folder, , choose files , right click use winrar zip .zip again. and print zip file get(part of result) telerik.windows.controls.dll telerik.windows.controls.input.dll wms...

Exactness of integer square root in Python -

i understand why happening. needed implement integer square root in python (isqrt(64) = 8 = isqrt(80)). convinced naive approach: def isqrt(n): return int(math.sqrt(n)) was bound fail when n passed square number, assuming python converts floats, performs square root calculation on floats. instance, calling isqrt(13*13) expected after converting floats , calculating sqrt, 12.999999843, after casting integer give 12. but performed large loops testing values, big , small, , correct result. seem there no need implement special square root integers, after all! not understanding bothers me, as when supposed work failing. why happening? there question regarding integer square root in python: integer square root in python in isqrt() defined there, +0.5 added n, guess included precisely fight issue mentioned expecting, cannot find in specific case. edit: forgot specify, using python 2.7 using python 2.7 on machine c type long 64 bit integer , c type double imple...

Find cell in table, add text after font class using jQuery -

i have code... <td valign="top"> <a title="test title" class="class1 class2" href="http://www.test.com/product/test123.htm"> test link text </a> <img width="5" height="5" src="/images/clear1x1.gif"> <br> <font class="text">test text</font> </td> how find particular cell, unique test123.htm, , add text after using jquery? try this: $("td a[href$='test123.htm']").parent().append("your text");

Flyway - Cant run Multiple sql Scripts -

my files - v3.2-alter.sql , v3.2-3insert_fmcc.sql if running flyway - error .. [error] failed execute goal org.flywaydb:flyway-maven-plugin:3.2.1:migrate (default) on project snapdealops: org.flywaydb.core.api.flywayexception: found more 1 migration version 3.2 offenders: [error] -> /home/kartikeya/git/snapdealops/mysqldb/release-v3.2/v3.2-1alter.sql (sql) [error] -> /home/kartikeya/git/snapdealops/mysqldb/release- v3.2/v3.2-3insert_fmcc.sql (sql) cant run multiple sql scripts single version . have put queries in single file . if want 2 files, need give them 2 versions (like 3.2.0.0.1 , 3.2.0.0.2). how order of application defined.

php - Zend data cache TTL not working -

i'm using zend_shm_cache functions fast storage of variables. problem cache doesn't seem cleared after ttl over. example: zend_shm_cache_store( $key = 'test3', 'value', 2 ); foreach( range(1,5) $timer ){ sleep( 1 ); echo $timer.' - ' .zend_shm_cache_fetch( $key ).'<br/>'; } returns: 1 - value 2 - 3 - value 4 - value 5 - value i expect cache empty after second second. can explain what's happening or propose solution? i got answer in documentation of apcu: after ttl has passed, stored variable expunged cache (on next request). as code runs in 1 request cache never deleted when time has expired.

android - 2d ArrayList Using ListView -

Image
i want build program looks this. i'm getting confused how can build this. possibilities in mind using listview. searching in many sites how make looks this, didn't found it. so give mark in picture. data coming database. example in first record contain ship-001 , cdd, indah transport, 5 nov 2015. , second record ship-002, cde, buana karya, 6 nov 2015, , on. could u me provide me ? so listview use data in form of array. every item in array, contain 1 record, example, item 1 contains ("ship-001" , "cdd", "indah transport", "5 nov 2015"). then use list view show items. this great tutorial listview list view tutorial

Node: How to store JSON Array in google datastore -

i'm trying store following object in google datastore using nodejs returning 400 "bad request" error { "_id":{ "$oid":"567e9e80067de880273095e0" }, "name":"windows 10", "desc":"this test", "isselfpaced":true, "credit":[ { "_id":"56640d4926b67c201b861cde", "username":"akash", "displayname":"gupta", "email":"yesitsakash@gmail.com", "role":"author" } ], "video":{ "type":0, "videokey":"khatemotionalfulls_lowb84c0084-836c-008c-a850-328687e23d02.mp4", }, "structure":4, "category":...

Construction of a List of byte[] in a MemoryStream: Wrong number of elements C# -

Image
i'm trying create list of byte[], list of bitmapimage, getting bytes using memorystream. i put image let see debugger, tells me size of array 1,048,576. , want calculations: but, let me show result of console.writeline: there are, @ end, 460 arrays of bytes, , none of them have right number of bytes and later in code, "out of range" exception am doing wrong? why debugger giving me "right" values ("right" because want) seems wrong ?

android - Application crashes when searching data from listview using filterable -

i try write application library. have activity, see books in stock. use listview, , baseadapter. information saved in database. oncreate in activity: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_crown_library_details); // initialization value member = (member) getintent().getserializableextra(intentextra.member.tostring()); book = (book) getintent().getserializableextra(intentextra.book.tostring()); title = (textview) findviewbyid(r.id.title); author = (textview) findviewbyid(r.id.author); title.settext(book.gettitle()); author.settext(book.getauthor()); searchview = (searchview) findviewbyid(r.id.searchview); listview = (listview) findviewbyid(r.id.listview); new asynctask<void, void, void>() { @override protected void onpreexecute() { } @override protected void doinbackground(void... voi...