Posts

Showing posts from January, 2014

python - How can I close a DatagramTransport as soon one datagram is sent? -

i'm trying close transport right after sending udp packet , i'm getting exception in callback _selectordatagramtransport._read_ready() import asyncio class myprotocol: def __init__(self, message, loop): self.message = message self.loop = loop self.transport = none def connection_made(self, transport): self.transport = transport print("send:", self.message) self.transport.sendto(self.message.encode()) self.transport.close() # <---------- def error_received(self, exc): print('error received', exc) def connection_lost(self, exc): print("socket closed, stop event loop") self.loop.stop() loop = asyncio.get_event_loop() message = "hello" connect = loop.create_datagram_endpoint(lambda: myprotocol(message, loop), remote_addr=('127.0.0.1', 2222)) transport, protocol = loop.run_until_complete(connect) loop.run_forever() the full

How to sort a list of enums by the enum indexes in C#? -

i have enum : public enum group { administration = 1, lawyers, propertymanagement bookkeeping, secretariat } i have list of group also: list<group> . need simple way sort values of list enum index. so, example, list: { group.bookkeeping, group.administration, group.secretariat, group.administration } will become: { group.administration, group.administration, group.bookkeeping, group.secretariat } (administration first, bookkeeping second, secretariat last, in definition of enum). looking simple way (maybe using linq ), without manually looping or so. array.sort() uses underlying type default compare elements: list<group> groups = new list<group>() { group.bookkeeping, group.administration, group.secretariat, group.administration }; groups.sort();

jquery - Remove div inline style on device rotation -

i working on search form shows expanded on desktop , collapsed on mobile devices. ok except 1 issue noticed. to see issue, please replicate these steps in https://jsfiddle.net/jrnvbvb5/ open firebug in firefox, change window size 1685px width (or close) , if rotate window, extended search bar replaced search icon. no matter how many times change device orientation, works ok. now, change view portrait , click on search button (to expand bellow search form). click again close dropdown , hide search bar , next, rotate landscape , extended search not show anymore. when inspect firebug see prevents search form appear. so, how can lose style="display: none; when change view portrait? $(".dropdown").click(function(event) { event.stoppropagation(); $(this).parent().find(".dropdown").not(this).find(".dropdown-values").fadeout(500); $(this).parent().find(".dropdown").not(this).find(".dropdown-title").removeclass("ac

php - Hiding/displaying button based on conditions and issues with basic queries -

i in mid development of social networking site. trying hide , display buttons based on conditions set coming across difficulties before that. @ moment, mind cannot process how specify code. i have add favourites visible on pages besides profile page of user logged in. let's assume logged in freddy, , go alice's profile page, button visible, , actions specified button work, data sent database. however, trying specify once user in logged in users favourites, add favourites button replaced remove favourites . i unable first of all, specify user can favourite user once, @ moment, when add favourites clicked on profile, database update many rows, when freddy should allowed favourite alice once. this have tried @ moment allow user favourited once: <?php // code process favourite request if (isset($_post['addfriend'])) { $fav_request = $_post['addfriend']; $favourited_who = $user; // u variable $favourited_by = $username; // logged i

javascript - AngularJs: uncheck checkbox after item is removed -

after spending lot of time on simple issue , having made lot of research, wondering if give me help. i have data generated inside of table so: <tbody> <tr class="odd gradex" ng-repeat="user in ctrl.datas | orderby:ctrl.sorttype:ctrl.sorttypereverse"> <td> <input type="checkbox" class="checkboxes" value="{{user.id}}" ng-click="ctrl.additem(user)"/> </td> <td> {{user.given_name}} </td> <td> {{user.family_name}} </td> <td> <a href="mailto:{{user.emai}}"> {{user.email}}</a> </td> <td class="center" ng-bind-html="ctrl.converttodate(user.created_at) | date: 'dd-mmmm-yyyy hh:mm'"></td> <td> <span class="btn blue-hoki"> details </span> </td> </tr> </tbody>

php - Where to add external library in bonfire..? -

if want use third party/external library in code add library in bonfire. for example : want add coinbase php library in mode should put library provided in below link : https://github.com/coinbase/coinbase-php without composer directly want add coinbase library website. have idea please let me know..? if want use third party library project use have put libraries folder. path is:- application\libraries[your_libraries_folder_or_file]; then load library in helper or in constructor in controller file. if face problem please let me know.

sockets - C++ , sending structs via tcp -

i try send , receive data via tcp. problem want send 2 structs in 1 tcp message, there way link struct together. like: send(connected, struct1 + struct2, sizeof(struct1 + struct2), 0); recv_data = recv(connected, struct1 + struct2,sizeof( struct1 + struct2),0); if not possible add signal byte @ beginning of message like: send(connected, "0x01" + struct1, sizeof(struct1 + 1), 0); recv_data = recv(connected, struct1,sizeof(struct1),0); you writev , readv functions, allow sending/receiving data multiple non-contiguous memory locations. struct iovec data[2]; data[0].iov_base = vector1.data(); data[0].iov_len = vector1.length() * sizeof(vector1[0]); data[1].iov_base = vector2.data(); data[1].iov_len = vector2.length() * sizeof(vector2[0]); writev(socket, data, 2); however @ receiving side need way know number of incoming elements can reserve enough space read into. this work vectors of trivially-copyable objects, not std::vector<std::string> .

reactjs - react-highcharts alignThreshold -

i turned app react frontend , have graphing component. need alignthresholds set true , used experimental script of torstein hønsi far. http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/studies/alignthresholds/ is there easy way integrate script? import react 'react' import reacthighcharts 'react-highcharts/bundle/reacthighcharts'; class graphing extends react.component { constructor(props) { super(props) this.graphconfig = this.graphconfig.bind(this); } render(){ console.log(this.props); if(this.props.active){ return (<reacthighcharts config = {this.graphconfig()}></reacthighcharts>) }else{ return (<div>click row graph</div>) } } graphconfig(){ return { title:{ text:'' }, subtitle:{ text:'' }, chart: { alignthresholds: true,

Mongodb can't find object with too long _id -

Image
i have little bit strange situation. i persist objects in collection "refs" explicitly setting _id. have objects big id's. db.refs.find().sort({_id: -1}); // {_id: 9200000000165761625} // ... but when try find object biggest id in mongo shell returns nothing: db.refs.find({_id: 9200000000165761625}); // nothing but! db.refs.find({_id: 9200000000165761625}).count(); // return 1 how happen? i not reproduce problem. able query on _id value specified. ensure when querying passing correct collection name

whether a shell script can be executed if another instance of the same script is already running -

i have shell script runs 10 mins single run,but need know if request running script comes while instance of script running already, whether new request need wait existing instance compplete or new instance started. i need new instance must started whenever request available same script. how it... the shell script polling script looks file in directory , execute file.the execution of file takes 10 min or more.but during execution if new file arrives, has executed simultaneously. the shell script below, , how modify execute multiple requests.. #!/bin/bash while [ 1 ]; newfiles=`find /afs/rch/usr8/fsptools/www/cgi-bin/upload/ -newer /afs/rch/usr$ touch /afs/rch/usr8/fsptools/www/cgi-bin/upload/.my_marker if [ -n "$newfiles" ]; echo "found files $newfiles" name2=`ls /afs/rch/usr8/fsptools/www/cgi-bin/upload/ -art |tail -n 2 |head $ echo " $name2 " mkdir -p -m 0755 /afs/rch/usr8/fsptools/www/dumpspace/$name2 name1="/

android - com.firebase.client.FirebaseException: Failed to bounce to type JSON -

Image
i have code here.. main_menu.java @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main_menu); getdata(); } private void getdata(){ string url = config.data_url+a_username; requestqueue requestqueue = volley.newrequestqueue(this); log.d(tag,"merging url , name success"); stringrequest stringrequest = new stringrequest(request.method.get, url, new response.listener<string>() { @override public void onresponse(string response) { showjson(response); log.d(tag,"show json success"); } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { } }); requestqueue.add(stringrequest); } private void showjson(

version control - Get latest transaction ID for AccuRev stream -

i want find out id of latest transaction changed stream. figured use accurev hist -s nameofstream -t -fx , not sure if show changes upstream. let's assume have following tree in accurev: mydepot streama streama1 streama2 streamb in case promote change streamb mydepot, affects streama , children, want see transaction when calling accurev hist -s streama1 -t -fx . happen or need different command? update : checked , hist command shows transactions occured in specific stream mentioned , not upstream changes. how can detect change in stream single command, without having local workspace? you can't accurev alone wrote python script can. part of accurev git conversion tool can find here: https://github.com/navicoos/ac2git if clone repository need accurev.py script , deep-hist sub-command. use ./accurev.py -h , ./accurev.py deep-hist -h see usage. example use: ./accurev.py deep-hist -p mydepot -s mystream -t 20-highest this recursively run

ios - use activity indicator in many VC without duplicating code swift -

i have 2 viewcontrollers (a , b) in swift ios. both , b loads data internet (separately). want display activityindicator while loading. know can bad way declaring once in each vc follows viewcontroller a var activityindicator: uiactivityindicatorview = uiactivityindicatorview() func activityindicatorbegin() { activityindicator = uiactivityindicatorview(frame: cgrectmake(0,0,50,50)) activityindicator.center = self.view.center activityindicator.hideswhenstopped = true activityindicator.activityindicatorviewstyle = uiactivityindicatorviewstyle.gray view.addsubview(activityindicator) activityindicator.startanimating() disableuserinteraction() greyview = uiview() greyview.frame = cgrectmake(0, 0, self.view.bounds.width, self.view.bounds.height) greyview.backgroundcolor = uicolor.blackcolor() greyview.alpha = 0.5 self.view.addsubview(greyview) } func activityindicatorend() { self.activityindicator.stopanimating() enableuser

ios - WKWebView does not process "Set-Cookie" header correctly -

i use wkwebview in project implement web-based authorisation ui. use [nshttpcookiestorage sharedhttpcookiestorage] keep user session cookies of whole app , keep user authenticated in case of wkwebview redirects our backend pages. the problem looks wkwebview ignores "set-cookie" header other domains in case. example: initial request setup authentication process: get /api2/providers/misfit/start/ http/1.1 host: api.welltory.com accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 accept-encoding: gzip, deflate connection: keep-alive proxy-connection: keep-alive cookie: csrftoken=haf3px9l6vb9drtjtneqvsjsaimztync;sessionid=txo4fhez18vl6mvjuwlelph1uyn1pkau user-agent: mozilla/5.0 (macintosh; intel mac os x 10_11_5) applewebkit/601.6.17 (khtml, gecko) version/9.1.1 safari/601.6.17 x-csrftoken: haf3px9l6vb9drtjtneqvsjsaimztync referer: https://api.welltory.com/api2/api/version/ accept-language: ru the result of request redirect target service login pag

html - Selecting Multiple div Nodes with diffrent class with xpath in C# -

i want select div nodes different class xpath.what should do? wrote code, returns error. htmlweb w = new htmlweb(); string searchresults = "http://www.ask.com/web?q=" + query.querytxt; var hd = w.load(searchresults); var titles = hd.documentnode.selectnodes("//div[contains(@class='web-result ur tsrc')] && //div[contains(@class='web-result ur tsrc_wiki-sa '] && //div[contains(@class='web-result ur tsrc_tube youtube-result ']"); i need these divs //div[contains(@class='web-result ur tsrc')] //div[contains(@class='web-result ur tsrc_wiki-sa ')] //div[contains(@class='web-result ur tsrc_tube youtube-result '] this error: function 'contains' in '//div[contains(@class='web-result ur tsrc')] && //div[contains(@class='web-result ur tsrc_wiki-sa '] && //div[contains(@class='web-result ur tsrc_tube youtube-result ']' has invalid numbe

javascript - Replace an element in an array at a specified index -

i have array: var left=[323,345,654,123]; how can replace 345 ? have tried : left[2]=456 but didn't work. (i can use jquery if that's relevant.) the index in array ( in every programming language ) starts zero! if want replace second value of array, need index of 1 . // index: 0 1 2 3 var left = [323, 345, 654, 123]; left[1] = 456; for further example, array accessible like: left[0]; // 323 left[1]; // 456 left[2]; // 654 left[3]; // 123 and don't need jquery @ this. is plain, basic javascript.

sql - Laravel Eloquent to join table and count related -

how use join eloquent taking in consideration following table structure: i have properies table --------------------- id | name --------------------- 1 | property name than have rooms ---------------------- roomid | property ---------------------- a-212 | 1 ---------------------- f-1231 | 1 here property foreign key want properties , count how many rooms have each the query retrives looks like class propertiesrepository extends eloquentbaserepository implements propertiesinterface { use taggablerepository; /** * construct * @param properties $properties */ public function __construct( properties $properties ) { $this->model = $properties; } /** * properties joining rooms * @return properties */ public function getall() { return $this->model->get(); } } how extend query desired result? $this->model->leftjoin('rooms', 'properties.id&#

python - How to release GIL in subprocess.Popen.communicate() -

i have 2 threading.thread s, , each calls: p = subprocess.popen(...) o,e = p.communicate() it seems gil not released when calling p.communicate() . in above code, threads become pipelined, when first thread finishes, second can start , that's not desired behavior. is there way wait on popen in way releases gil ? use multiprocessing module instead of threading . look @ first sentence in introduction of https://docs.python.org/2/library/multiprocessing.html . or, if still want use threads, not call communicate() , use stdin , stdout pipes. still have careful, because may inadvertly lock process way. happens, example, if try read process's stdout when there no data available. have know when data available, , how many bytes of available (this not polling). p = subprocess.popen( ..., stdin=subprocess.pipe, stdout=subprocess.pipe ) p.stdin.write( ... ) n = 1 x = p.stdout.read(n) # lock if less n bytes available

python - AssertionError: View function mapping is overwriting an existing endpoint function: EMPTY? -

any suggestion toward clean solution appreciated. i trying add static files existing app, static folder other files set. define several routes based on list, goal able add files. the problem receive instead of working program, "endpoint function" isn't detected. output: {'/file1.js': <function func @ 0x10aedfed8>, '/file2.js': <function func @ 0x10aeea050>} {'/file1.js': <function func @ 0x10aedfed8>, '/file2.js': <function func @ 0x10aeea050>} traceback (most recent call last): file "flaskweird.py", line 29, in <module> app.add_url_rule(d, '', app.serv_deps[d]) file "/library/python/2.7/site-packages/flask/app.py", line 62, in wrapper_func return f(self, *args, **kwargs) file "/library/python/2.7/site-packages/flask/app.py", line 984, in add_url_rule 'existing endpoint function: %s' % endpoint) assertionerror: view function mappin

post increment - 'In any case, follow the guideline "prefer ++i over i++" and you won't go wrong.' What is the reason behind this in C? -

i had come across this answer this question. in 1 of line, author mention's: in case, follow guideline "prefer ++i on i++ " , won't go wrong. i know ++i faster i++ , thought there no reason them go wrong. searched while, , closest this . explained why preferred use ++i , not still how go wrong using i++ . so can tell me how can i++ go wrong? note: question isn't dupe, not asking performance. have seen question. asking how can i++ wrong mentioned in answer have mentioned above. in case of for (i=start; i<end; i++) vs for (i=start; i<end; ++i) their meanings completely identical , because value of expressions i++ , ++i not used. (they evaluated side effects only.) compiler produces different code 2 pathologically bad , should chucked in garbage. here, use whichever form prefer, i++ idiomatic among c programmers. in other contexts, use form yields value want. if want value before increment, use i++ . makes sense thi

php - Magento 1.9.0.1: 404 error with $product->getProductUrl after entering a new product -

i have existing magento project , has strange problem: after entering new product in magento backend, url_key direct link not work. example: created new product called "some testarticle". field url_key in backend filled "some-testarticle". when try calling www.domain.com/some-testarticle.html 404 error. on category page link specific product looks this: www.domain.com/catalog/product/view/id/12345/s/some-testarticle.html only after while (don't know how long takes or needs happen), short link work , domain.com/some-testarticle.html work. do guys know is? there magento cronjob works magic or how , when short urls generated? thanks in advance! it might need reindex after adding new products, catalog url rewrites category products this can done in admin panel, system -> index management or command line in /magento_root/shell php indexer.php --reindex catalog_url php indexer.php --reindex catalog_category_product

c - Why doesn't valgrind complain when copying uninitialized data? -

according manual doesn't: it important understand program can copy around junk (uninitialised) data as likes. memcheck observes , keeps track of data, not complain. complaint issued when program attempts make use of uninitialised data in way might affect program's externally-visible behaviour. the question if there's important reason behave way? there (commonly) used construct that's copies uninitialized data trigger false positives? or there way make valgrind complain this? my concern in c use of uninitialized variables have undefined behavior (iirc), example following functions emit nasal daemons: int fubar(void) { int a; return a; } now recalled incorrectly, it's in situations it's undefined, example if you're doing arithmetics uninitialized variables: int fubar(void) { int a; -= a; return a; } so same question arises here. there important reason valgrind allow arithmetics uninitialized data? etc. note if floa

c - Alternative way to pass a char pointer to a function -

given source code strcpy() char * strcpy(char *s1, const char *s2) { char *s = s1; while ((*s++ = *s2++) != 0); return (s1); } why handing on second argument work , how in memory since not pass pointer function char dest[100]; strcpy(dest, "helloworld"); in c string literals have types of character arrays. c standard (6.4.5 string literals) 6 in translation phase 7, byte or code of value 0 appended each multibyte character sequence results string literal or literals.78) the multibyte character sequence used initialize array of static storage duration , length sufficient contain sequence. character string literals, array elements have type char, , initialized individual bytes of multibyte character sequence. also arrays rare exceptions converted pointers in expressions. c standard, 6.3.2.1 lvalues, arrays, , function designators 3 except when operand of sizeof operator or unary & operator, or string literal used in

python - Django. I need variables from my own context processor only when user is authenticated -

i have django 1.8.13. need variables own context processor when user authenticated. context processor: def comment_rew(request): context_dict = {} if request.user.is_authenticated(): user = request.user user_rew = user.review_set.all().count() context_dict['user_rew'] = user_rew return(context_dict) when user not authenticated returns empty dictionary , causes error(because context processor can't returns empty dict). possible use context processor if user authenticated? context processors can't enabled/disabled based on authentication status of users. you can instead set value of context variable user_rew none when users not authenticated: def comment_rew(request): context_dict = {'user_rew': none} if request.user.is_authenticated(): user = request.user user_rew = user.review_set.all().count() context_dict['user_rew'] = user_rew return context_dict

ios - LDAP authentication over the web using Swift 2 -

i'm working on ios app , need implement user authentication on internet. running ldap service on ibm domino backend. using swift app. have looked many tutorials, examples, etc. using openldap libraries, problem lies in fact in objective-c. question is: there anyway implement ldap user authentication on internet in ios app written in swift? apple library, openldap or similar. at time of writing question, couldn't find online or in apple documentation. thank you

javascript - convert decimal to hex in table -

Image
i trying create table similar one: i uploaded site can viewed here: http://alainwebdesign.ca/cis245/rgb.html in script file, trying populate " red hex " column modifying generaterandomreds() function so: function generaterandomreds(){ for(var i=0; i<11; i++){ var randred = math.random(); randred = randred.tofixed(2); var sel = document.getelementbyid('genrandomreds'); var opt = document.createelement('option'); opt.innerhtml = randred; opt.value = randred; sel.appendchild(opt); //trying convert decimal hex , populate "red hex" //column in generate random colors table //but reason adding code makes 1 random //red decimal value created , that's it: var selhex = document.getelementbyid('genredhex'); var opthex = document.createelement('option'); opthex.innerhtml = randred(parseint( number , 10)).tostring(16); opthex.value =

bytearray - Loading custom class loader to load a transferred byte[] in java -

i transfer whole .class file (and it's declared , anonymous classes) byte[] , want able define using class loader on computer receives byte[]. i have found solution @ java: how load class stored byte[] jvm? , however, don't understand how use byteclassloader purpose. post code here again: public class byteclassloader extends urlclassloader { private final map<string, byte[]> extraclassdefs; public byteclassloader(url[] urls, classloader parent, map<string, byte[]> extraclassdefs) { super(urls, parent); this.extraclassdefs = new hashmap<string, byte[]>(extraclassdefs); } @override protected class<?> findclass(final string name) throws classnotfoundexception { byte[] classbytes = this.extraclassdefs.remove(name); if (classbytes != null) { return defineclass(name, classbytes, 0, classbytes.length); } return super.findclass(name); } } the question is: how have instantiate it? i tried use instantiating byteclass

jsp - foreach loop variable accessing from outside -

how access variable in foreach loop outside ? when try it, takes last value. have click on button open wind , need use value of row clicked, takes last value. i use loop <c:set var="q" value="${p.getiduser()}" /> and outside loop <a href='deleteuser?id=${q}'> but takes last row. yo can put row row no c:set var identify uniquely each c set variable q+row_number q${foreach_varstatus_variable.count} like <c:set var="q${foreach_varstatus_variable.count}" value="${p.getiduser()}"/> outside foreach: <a href='deleteuser?id=${q1}'> <a href='deleteuser?id=${q2}'> or access c set q+row_number.

c++ - class with float variable -

i have simple class here variable. why not return value of variable 10.5 ? output test! -1.09356e+09 code #include "iostream" using namespace std; class txtbin{ protected: float area; public: txtbin(); float get_area(); }; txtbin::txtbin(){ float area = 10.5; } float txtbin::get_area(){ return area; } int main(int argc, char* argv[]){ txtbin a; cout << "test! " << a.get_area() << endl; return 0; } this creating local variable, not initializing member: txtbin::txtbin(){ float area = 10.5; // creates variable called area isn't used. } you should initialize member this txtbin::txtbin() : area(10.5) { } or perhaps directly in class if using c++11 or newer: class txtbin{ protected: float area = 10.5; public: txtbin(); float get_area(); };

php - Laravel and images dsiplay -

i'm using laravel 5.2, in moment i'm testing views builtin php server. display images in views, used code <img src="{{asset('images/logo.png')}}" alt="logo"> when load page browse don't see images, if try inspect code see <img src="http://localhost:8010/images/logo.png" alt="logo"> then, if try follow link of image, don't see image it's code: http://p4c.it/test.jpg it's clear i'm doing wrong, issue related definition of mime types? see {{asset('my_file_here')}} works fine css files , jvascript. at first create virtual host , check image folder permission .

elasticsearch - How to enable sort on a field in kibana? -

in logstash parsing out microseconds apache logs, how sort on field in kibana? here filter logs : if [type] == "apachelogs" { grok { break_on_match => false match => { "message" => "\[%{httpdate:apachetime}\]%{space}%{notspace:verb}%{space}/%{notspace:apacherequested}" } match=> { "message" => "\*\*%{number:seconds}/%{number:microseconds}" } add_tag => "%{apachetime}" add_tag => "%{verb}" add_tag => "%{apacherequested}" add_tag => "%{seconds}" add_tag => "%{microseconds}" } } as long logstash parsing field want sort on, is, has no impact on ability sort in kibana. to sort in kibana, in discovery view, add field microseconds (or field want sort on). can sort on field, using arrow near field name.

osx - Mysql 5.6 is not working in Mac OS -

mysql 5.6 creating problem in mac osx. its disconnecting server. and throwing errors /tmp/mysql.sock doesn't exist the same mysql 5.6.14 installed via dmg: $ mysql error 2013 (hy000): lost connection mysql server @ 'sending authentication information', system error: 32 and authentication packet lost errors. i have kill process id every time , had run mysql -u root -p on again. but same thing happens again , again. don't worry if none of online answers in website doesn't work. try this, worked me , team mates charm. 1). install atom in mac. 2). run sudo atom /library/launchdaemons/com.oracle.oss.mysql.mysqld.plist you might see code <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>disabled</key> <false/>

javascript - How to stay at the same place of the page after you send post comment using Django-comments -

now use next code <input type="hidden" name="next" value="{{ request.get_full_path }}" /> in comments/form.html , after post new comment page content , comments list refreshes , should scroll down see post. it's not want. i want stay @ same page after send post, without refreshing. it's possible? there 2 principle ways of doing want: give unique id each comment , pass url create so-called bookmark. you'll smth http://the/url/you/want#desired-post-id , automatically jump post want. use ajax refresh part of page changing. in case you'll stay there are.

html - Removing white line from bootstrap 3 navbar-inverse dropdown menu -

Image
i'm making clean possible menu , have managed rid of unwanted styling. 1 little white line remains however, , i'm demanding 0 or none borders on css, trying gone. it can seen in these images above music icon , below dropdown icon: it in "small screen mode" , dropdown active shows up. custom navbar css .navbar { background-color: transparent; background: transparent; border: 0; } .navbar li { color: white; font-size: 14px; } .collapse { border: 0; } #mynavbar { border: 0; } .navbar .dropdown-menu::after{ border:0; } .navbar-header .navbar-collapse { border: 0; } .navbar.navbar-default { padding: 10px 0; background: rgba(0, 0, 0, .1); border: none; } .navbar.navbar-default .navbar-nav > li > a, .navbar.navbar-default .navbar-brand { color: white; } .navbar.navbar-default .navbar-collapse { border: none; box-shadow: none; } the menu markup: <nav class="navbar navbar-inverse"> <div class="containe

Best Way to Reduce Overloading when Casting is Sufficient in C++ -

the avr-gcc compiler offers f() macro way define strings in statements , place strings in program memory. strings end being of type __flashstringhelper, however, , error if try pass them functions expect "const char *". i can cast each 1 , code function. example code work: int16_t lt_printf(const char *format, ...); lt_printf((const char *)f("testing!\r\n")); i can define overload function nothing receive __flashstringhelper , turn (const char *). works: int16_t lt_printf(const __flashstringhelper *format, ...); lt_printf(f("testing!\r\n")); the second solution executes less efficiently first, @ least don't have hundreds of casts in code more. is there way eliminate casts inside every function call, still not need overload function? edited add more examples build (not of examples i'd do...i'm interested in pointer const __flashstringhelper): typedef struct { char test_string[20]; } test_struct_type; const test_struct_ty

javascript - Add dummy parameter to Custom function for Google sheets -

i have custom function below; moves columns 1 sheet different sheet in google sheets i got here non-contiguous column copy 1 spreadsheet in google apps i need add dummy parameter can refresh data pulls i tried doing this: function copycolumns(sourcerange,start,sheetkey, dummy) (which has worked other custom functions) but keep getting error: problem getting sheet1 - exception: not have permission perform action. (line 31). which is: throw "problem getting sheet" + sheetkey + " - " + err; i know vba new google script writing, have tried have not worked out how this thanks /* =copycolumns("mydatasheet!c,a,w",8) */ function copycolumns(sourcerange,start,sheetkey) { // initialize optional parameter if(!sheetkey && typeof start!== "number") { sheetkey = start; start = 1; } else { start = start || 1; } // check sourcerange input var inputre = /^((.*?!)(?=[a-z],?|[a-i][a-z]))?[a-i]?[a-z](,[a-i]?[

css3 - Confusion with a CSS transform having multiple translate properties -

in the following demo (webkit only), not understand why there double translates , rotates 1 transform property in css part. transform: translate(100px, 100px) rotate(45deg) translate(-100px, -100px) rotate(-45deg); this weird example. , why circle move that? full demo: // note: change red signifies start of // animation // allows elements accessed in clean way var circle = document.getelementbyid('circle'), button = document.getelementbyid('button'); // gets element show current percentage var result = document.getelementbyid('result'), // current position of circle around path // in percent in reference original totalcurrentpercent = 0, // percent of circle around path in // percent in reference latest origin currentpercent = 0; // updates percent change latest origin var showpercent = window.setinterval(function() { if(currentpercent < 100) { currentpercent += 1; } els