Posts

Showing posts from May, 2011

android - Title is not showing in the ActionBar only the logo is showing (Have tried many solutions) -

in app, changed styles , actionbar got disappeared. have used these lines brought actionbar , icon : getsupportactionbar().setdisplayshowhomeenabled(true); getsupportactionbar().setlogo(r.drawable.ic_launcher); getsupportactionbar().setdisplayuselogoenabled(true); but still title of app not shown actionbar. hare style.xml file : <style name="theme.brintin" parent="@style/theme.appcompat.light.darkactionbar"> <item name="actionbaritembackground">@drawable/selectable_background_brintin</item> <item name="popupmenustyle">@style/popupmenu.brintin</item> <item name="dropdownlistviewstyle">@style/dropdownlistview.brintin</item> <item name="actionbartabstyle">@style/actionbartabstyle.brintin</item> <item name="actiondropdownstyle">@style/dropdownnav.brintin</item> <item name="actionbarstyle">@sty

Issues installing SCIP for Python -

i trying install scip optimization suite python 2.7 ( http://scip.zib.de/#download ) on windows machine. when run setup_win.py , link error: fatal error lnk1181: cannot open input file 'spx.lib'. not, sure have make work. it looks might missing scip binaries, distributed separately source package in python binding (with setup_win.py) live. should too. reading setup_win.py should give insight spx.lib supposed be.

angularjs - How can I tell whether a web app was built using Angular? -

Image
how can tell whether (drupal 7) web app built using angular, e.g., looking @ page source, , not asking developers? the best way check write "angular" on browser console. if object [with child objects "bind","bootstrap","callbacks","module" etc.] angular web app.

html - Sticking two div simultaneously to window top using jquery -

i know topic has been discussed here before facing difficulties 1 of problems solved. want stick 2 div(s) top @ same time. (e.g: when layer2 sticks top, want layer 2 stick top different height , width) trying stick 1 div not working. html <div id="layer1"></div> <div id="sticky-anchor"></div> <div id="layer2"></div> <div id="layer3"></div> js jquery(document).ready(function($){ $(window).scroll(sticky_relocate); sticky_relocate(); }); function sticky_relocate(){ var s=$('#layer2'); var pos = s.position(); var window_top = $(window).scrolltop(); var div_top = $('#sticky-anchor').offset().top; s.html("distance top:" + pos.top + "<br />scroll position: " + window_top); if(window_top>div_top){ s.addclass('stick'); } else{ s.removeclass(); } } css #la

xcode - How to Fix Error: Incompatible Pointer Types Assigning to -

let me preface saying i'm new might not best @ asking questions here goes. getting error when hit build in xcode code. -(ibaction)unwindtorecipedetails:(uistoryboardsegue*)segue { changerecipedetailviewcontroller *source = [segue sourceviewcontroller]; recipelabel = source.textview; // error: incompatible pointer types assigning uilabel uitextfield } here's i'm trying do. based code off of snippet works... -(ibaction)unwindtorecipebook:(uistoryboardsegue *)segue; { addrecipeviewcontroller *source = [segue sourceviewcontroller]; recipeitem *item = source.recipeitem; } this supposed make addrecipeviewcontroller data source initial recipebook page when user navigates backward. i'm trying implement same thing when user navigates backward changerecipe page recipedetails page. apparently mixed 2 different types of code in error, uilabel , uitextfield. incompatible change either 1 in order make work. little different basing code off of in don&

jquery - Bootstrap Data Attributes with Bootstrap Tour Plugin -

i'm newer bootstrap , i've started using plugin called bootstrap tour. http://bootstraptour.com/ i started learning data-attributes today, , i'm wondering if can/should use them bootstrap tour. bootstrap tour combo of included popover , tooltip plugins. for instance, tours have steps, , steps have attributes can set when initiating tour. i'm trying able set placement, title, , content html element. var tour = new tour(); tour.addsteps([ { element: ".completed-range", title: "", content: "" }, { element: ".fph-row h1", placement: 100, title: "welcome <b>" + sectiontitle +"</b> tour!" , content: "proceed discover section's features." } ]); the above code creates tour 2 steps. first step targets element class "completed-range." html, i'd set placement, title, , content appears in step's popover/tooltip. this: <div c

label - Vaadin layout break line without panel -

Image
i know possible labels automatically break lines when in panel. there way have labels break lines when text on layouts width? update ok tried "800px" width instead of "100%" , labels having line breaks. whats reason behaviour? , how can workaround percentual sizing of layouts important page? it looks in image below, text cut off. extracted code showing setup: verticallayout labellayout= new verticallayout(); labellayout.setwidth("100%"); labellayout.addcomponent(usernamelabel); labellayout.addcomponent(postlabel); labellayout.addcomponent(ratiolabel); labellayout.addcomponent(lowestratedpost); labellayout.addcomponent(highestratedpost); detailslayer.addcomponent(labellayout); wrappercontent.addcomponent(detailslayer); wrapper.addcomponent(wrappercontent); i had problem, , managed solve using css. vaadin labels have css attribure white-space: nowrap stoping text wrapping expect to. .v-la

scala - Using Macro to Make Case Class -

given following macro (thanks @travisbrown help ): jetdim.scala case class jetdim(dimension: int) { require(dimension > 0) } object jetdim { def validate(dimension: int): int = macro jetdimmacro.apply def build(dimension: int): jetdim = jetdim(validate(dimension)) } jetdimmacro.scala import reflect.macros.context object jetdimmacro { sealed trait posintcheckresult case class lteqzero(x: int) extends posintcheckresult case object notconstant extends posintcheckresult def apply(c: context)(dimension: c.expr[int]): c.expr[int] = { import c.universe._ getint(c)(dimension) match { case right(_) => reify { dimension.splice } case left(lteqzero(x)) => c.abort(c.enclosingposition, s"$x must > 0.") case left(notconstant) => reify { dimension.splice } } } def getint(c: context)(dimension: c.expr[int]): either[posintcheckresult, int] = { import

performance - Does Sencha Touch include a fix for the 300ms delay? -

i curious know if 300ms delay tap events has been fixed or configurable in sencha touch 2.4.1. sencha touch has own implementation , has 300ms delay because of doubletap. in defined in maxduration also check out https://www.sencha.com/forum/showthread.php?282102-tap-vs-click-300ms-delay disable doubletap delay: ext.define("nodelay", { override : "ext.event.recognizer.doubletap", config: { maxduration: 0 } });

Rails environment variables failing to load in model -

i have environment variable i'm using in 2 places, 1 in rake task, other in model method. when call rake task, fine , variable loads, when call model doesn't find anything. it's not nil error or other error, returns empty string. is there reason environment variables overridden or inaccessible model? it's being used build url: http://#{appenv['env_var_1']}/this/is/#{appenv['env_var_2']}/a/path --one more thing, myabe it's relevant, model method called after_create edit: thanks responses, question isn't how access or use env vars, can see i'm using them above. question why not loading in model. edit 2: i have 4 relevant appenv variables, , [this weird bear me] when check them on running rake task ( puts 4 of them log), expected. when run exact same class method, called after_create in model, 3 of variables empty, , 1 of them holds value of different variable. is: appenvvar1 empty appenvvar2 has value of appenvvar4 a

linux - Is it possible to force a range of virtual addresses? -

i have ada program written specific (embedded, multi-processor, 32-bit) architecture. i'm attempting use same code in simulation on 64-bit rhel shared object (since there multiple versions , have requirement choose version @ runtime). the problem i'm having there several places in code people wrote (not me...) have used unchecked_conversions convert system.addresses 32-bit integers. not that, there multiple routines hard-coded memory addresses. can make minor changes code, porting x86_64 isn't option. there routines handle interrupts, cpu task scheduling, etc. this code has run fine in past when statically-linked previous version of simulation (consisting of fortran/c/c++). now, however, main executable starts, loads shared object based on inputs. shared object checks other inputs , loads appropriate ada shared object. looking through code, it's apparent should work fine if can keep logical memory addresses between 0 , 2,147,483,647 (32-bit signed int). there

linux - How can i uninstall Spagobi 4.2 and install SpagoBI 5.1 -

i working spagobi 4.2 , decided pass on spagobi 5.1 without knowing process. installed both version 4.2 , 5.1 of spagobi , both don't working. please assist me kind regards. 1.first delete old version of spagobi sever 4.2 system. 2.then, install spagobi server 5.1 tool , set 2.1 environment path catalina home path like:- "c:\program files (x86)\all-in-one-spagobi-5.1-21012015" 2.2 tomcat_home path:- c:\program files (x86)\all-in-one-spagobi-5.1-21012015\lib 3.in cmd command execute command spagobistartup.bat. 4.and log in browser.

javascript - Using $(this) when selecting a div -

i have series of divs of same class no ids. want change background of div when clicked. tested function , works fine. when access element this , not working. question how buttonpressed() work div clicked on? html <div id="navbar"> <div class="navitem" onclick="buttonpressed()"><p>membership</p></div> <div class="navitem" onclick="buttonpressed()"><p>certification</p></div> <div class="navitem" onclick="buttonpressed()"><p>foundation</p></div> <div class="navitem" onclick="buttonpressed()"><p>seminars</p></div> <div class="navitem" onclick="buttonpressed()"><p>councils</p></div> </div> javascript function buttonpressed() { var bgstring = "url('navbuttonpressed.png')"; $(this).css('bac

mysql - Reorder / reset auto increment primary key -

i have mysql table auto increment primary key. deleted rows in middle of table. have, example, in id column: 12, 13, 14, 19, 20. deleted 15, 16, 17 , 18 rows. i want reassign / reset / reorder primary key have continuity, i.e. make 19 15, 20 16, , on. how can it? you drop primary key column , re-create it. ids should reassigned in order. however bad idea in situations. if have other tables have foreign keys table not work.

database - codeigniter model does not return results as defined on limt -

this model function get_one_news($limit = 2, $offset = null) { if ($limit) { $this->db->limit($limit, $offset); } $this->db->order_by('news.added_on', 'desc'); return $this->db->get('news'); } and in controller had assign $data['news'] = $this->news_model->get_one_news(); in view had implement <div class="col-md-8 col-lg-8"> <!-- artigo em destaque --> <?php if ($news->num_rows()):?> <?php foreach ($news->result() $n):?> <?php if ($n->cat_id == 17):?> <div class="featured-article"> <a href="#"> <?php if ($n->image != ''): ?> <img src="<?php echo base_url('uploads/'.$n->image);?>" alt="" class=&q

Opposite of set.intersection in python? -

in python can use a.intersection(b) find items common both sets. is there way disjoint opposite version of this? items not common both a , b ; unique items in a unioned unique items in b ? you looking symmetric difference ; elements appear in set or in set b, not both: a.symmetric_difference(b) from set.symmetric_difference() method documentation : return new set elements in either set or other not both. you can use ^ operator too, if both a , b sets: a ^ b while set.symmetric_difference() takes iterable other argument. the output equivalent of (a | b) - (a & b) , union of both sets minus intersection of both sets.

css - Is there a way to make italic text within italic text non-italic? -

typically, way emphasize text within italic text make non-italic. example: the publication of james joyce's ulysses was met great controversy. i know can this: em em { font-style: normal; } but won't work if parent italicized phrase doesn't use <em> . instance, won't work if have <p class="photo-caption">the publication of james joyce's <em>ulysses</em> met great controversy.</p> of course, can this: .photo-caption em { font-style: normal; } but has potential maintainability problems, since every change parent element requires change child element. is there way tell css globally unitalicize nested italics? the capabilities of css limited browsers can process rules quickly. i think original approach correct, can address concerns maintainability css preprocessor, less . these tools support more advanced logic while still compiling down lean , mean css. with less, specifically, create

sql server - SQL Synonym for cross database stored procedure using UDT table type -

we have stored procedure on 1 database using udt(table) input parameter. our requirement create synonym stored procedure on different database. tried creating synonym isn't working... other synonyms stored procedures not involving udt's working fine. can please suggest solution issue? thanks

java - How to modify a single list item after Asynctask is done in a BaseAdapter to -

in main activity display listview uses custom baseadapter (thoughtlistadapter). listview = (listview) findviewbyid(r.id.list); adapter = new thoughtlistadapter(this, resultingthoughts); listview.setadapter(adapter); every item in listview has custom layout containing textview , 2 button . if (convertview == null) { convertview = layoutinflater.inflate(r.layout.list_item_thought, null); } thoughttext = (textview) convertview.findviewbyid(r.id.thought_text_view); likebutton = (button) convertview.findviewbyid(r.id.thought_like_button); dislikebutton = (button) convertview.findviewbyid(r.id.thought_dislike_button); when button clicked asynctask (asyncpost) called connects database , makes changes. likebutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { system.out.println("like clicked"); thought t = thoughtitems.get(position); thoughtid = t.getid();

c# - How to group items in a list with the same max date and filter them -

i have list<takenbmi> these 4 columns , data: takendate uerid takenitem takenvalue aug-10-2014 34 weight 140 aug-10-2014 34 height 5.5 mar-15-2015 34 weight 141 mar-15-2015 34 height 5.5 i want group them in separate lists based on takendate , find out list should use has details latest taken date. here have tried: var q = n in takenbmi group n n.takendate g select g.orderbydescending(t=>t.takendate ) .firstordefault(); var m = n in takenbmi group n n.takendate g select new { takendate = convert.todatetime(q) }; also, if can suggest after getting list max date one, how 2nd latest date ones if possible? thank replied i'd approach finding latest date: var latestdate = items.select(i => i.takendate).max(); then filtering items date: var itemswithlatestdate = items.where(i => i.takendate == latestdate).tolist(); if require

jquery - What is preventing my JavaScript from modifying the iframe? -

there example here inserts iframe height of iframe changed height of inserted content. explains trick here . however when try , bootstrap example, preventing javascript modifying iframe. height never added iframe. question can see why height isn't added iframe, done in original example? i using iframe content wget http://www.456bereastreet.com/lab/iframe-height/iframe-content.html and html is <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://max

Java generics work one time, does not compile second time -

this accessor method collection in class abstractnode: public list<polygonalchain> getoutedges() { return collections.unmodifiablelist(outedges); } but following not work, compilation error message is: incompatible types: java.lang.object cannot converted .....formulaelements.polygonalchain abstractnode anodeexample = getconnectingshape(); for(polygonalchain outedge: anodeexample.getoutedges()){ //do stuff } what more confusing me, can use following code in descendants of abstractnode without error: for(polygonalchain outedge: getoutedges()){ outedge.delete(); } here minimal code, causes problem: package brokengenerics; import java.math.biginteger; import java.util.list; public class brokengenerics { public static abstract class aclass <e extends number> { private list<b> bs; public list<b> getbs(){ return bs; } } public static class b extends aclass<biginteger>{ } public static aclass getsomething(

html - Bootstrap affix overlaps footer -

i'm facing problem bootstrap 3 affix. when scroll down page, affix overlaps footer. i've tried adding "data-offset-bottom" seems affix jumps top and, after that, doesn't scroll anymore. i put code here: http://www.bootply.com/jywv1zg0mw

python - Can't install package inside virtualenv -

i have following environment: linux mint17.1 comes pre-installed python 2.7.6. i setup altinstall python 3.3.5 using python 3.3 created virtualenv i trying install ta-lib in virtual env not having success. if try install with: ./easy_install ta-lib i following error: searching ta-lib reading https://pypi.python.org/simple/ta-lib/ reading http://github.com/mrjbq7/ta-lib reading https://github.com/mrjbq7/ta-lib/releases best match: ta-lib 0.4.8 downloading https://github.com/mrjbq7/ta-lib/archive/ta_lib-0.4.8.zip processing ta_lib-0.4.8.zip writing /tmp/easy_install-67a3vk/ta-lib-ta_lib-0.4.8/setup.cfg running ta-lib-ta_lib-0.4.8/setup.py -q bdist_egg --dist-dir/tmp/easy_install-67a3vk/ta-lib-ta_lib-0.4.8/egg-dist-tmp-w24p9n /tmp/easy_install-67a3vk/ta-lib-ta_lib-0.4.8/setup.py:49: userwarning: cannot find ta-lib library, installation may fail. warnings.warn('cannot find ta-lib library, installation may fail.') talib/common.c:314:28: fatal error: ta-lib/ta_d

android - Get friendsrequests with the Facebook Graph API 2.3 -

i have updated android facebook sdk 2.3 , can't use fql requests anymore. how can have "friendsrequests" through facebook graph api request ? what solutions have ? thanks help updated answer this **deprecated** , cant anymore the documentation says /me/friendrequests removed after graph api 1.0 this document refers feature removed after graph api v1.0. /* make api call */ new request( session, "/me/friendrequests", null, httpmethod.get, new request.callback() { public void oncompleted(response response) { /* handle result */ } } ).executeasync(); permissions a user access token read_requests permission required view current person's received friend requests. graph explorer says { "error": { "message": "(#12) friend requests deprecated versions v2.0 , higher", "ty

php - Insert values from database to xml table and output them with ajax in html -

i have search box user can type in name , display "firstname", "username", "lastname", "email", "accountnumber" . far have been able data database, make xml structure of (it 1 of requirements in school). question how can echo values come search box xml table , output result html table? code database (file called ajax-search.php): (i know using mysql , fix later) <?php header("content-type: text/xml"); //create database connection $db = mysql_connect("127.0.0.1","root",""); if (!$db) { die('could not connect db: ' . mysql_error()); } //select database mysql_select_db("bank",$db); $ssearchfor = $_get['ssearchfor']; $sql = "select * customers name '%$ssearchfor%'"; $result = mysql_query($sql, $db) or die(mysql_error()); //create simplexmlelement object $xml = new simplexmlelement('<xml/>'); //add each column value node of

c# - SharePoint - Reference file in item properties -

(disclaimer: first time deal sharepoint) i trying add file in sharepoint , reference in property of list item. property type 'sparqube lookup classic' (i had no idea quick search led me this: http://www.sparqube.com/sharepoint-lookup-column/ ). what ever try seem fail. have searched on-line, no relevant results came (wrong search terms probably?). here half-functioning code. item has no file attached in ( _x03a8__x03b7__x03c6__x03b9__x03 ) property when code finishes. public void publishdoctosp() { var clientcontext = getclient(); sp.client.file file; var foldername = "doclib"; // upload file - works ok. { var filename = @"c:\users\user\desktop\file.pdf"; var folder = clientcontext.web.folders.getbyurl(clientcontext.url + '/' + foldername); var info = new filecreationinformation { contentstream = new filestream(filename, filem

c++11 - Can I create a new syntax in C++? -

i quite fond of python generator expression , (ab)use lot in python. (up no good) working on implementing generator expression on c++ 11, using macros embedded in macros, lambdas , more obscure things. aim copy abilities of operator close possible. there implementations already, lack multi-variable support. python complex syntax looks like generator = i*j i,j in zip(arr1,arr2) if i>0 , j>0 # python this line produces functor returns on every successfull call multiplication of repective values 2 arrays. , in realization syntax looks auto generator = brf_genexpr(i*j,(i,j),zip(arr1, arr2),i>0 && j>0); //c++11 my question is: know way, exotic, rid of lots of commas , allow me write auto generator = brf_genexpr(i*j i,j in zip(arr1,arr2) if (i>0 && j>0)); i understand can write preprocessor script change syntax me, love in-code solution. updates: my question call syntax, implementation working already. no, impossible use langua

javascript - MeteorJs - Error in an http call -

this first meteor program , i'm trying make http call github. i'm facing error goes this: exception in delivering result of invoking 'getuserinfo': ["click button"]/<@ http://localhost:3000/hellometeor.js?823f404b37c246a7d23ae50a10c37969e426b2b8:18:17 meteor.bindenvironment/<@ http://localhost:3000/packages/meteor.js?43b7958c1598803e94014f27f5f622b0bddc0aaf:983:17 ._maybeinvokecallback@ http://localhost:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:3860:7 .receiveresult@ http://localhost:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:3880:5 ._livedata_result@ http://localhost:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:4964:7 connection/onmessage@ http://localhost:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:3725:7 ._launchconnection/self.socket.onmessage/<@ http://localhost:3000/packages/ddp.js?d1840d3ba04c65ffade261f362e26699b7509706:2717:11 _.foreach@ ht

How to set up Google Maps Utility Api in Android Studio? -

i don't know why couldn't figure out. trying add android_maps-utils library in android studio.i have seen link suggested google developers blog .but couldn't understand way suggested. can give me step step instruction use android-maps-utils library in android studio?? have been stuck 2 days. in advance. have fixed more 1 package name problem? if yes, omitted followings. saw in "dependencies" element, have compile project(':library') , compile('com.google.maps.android:android-maps-utils:0.3.4') . :library google maps utility library? if yes, add google maps utility dependency twice leads problem.

graph theory - Matlab Network Average path length -

i've created erdős random graph of format n n symmetric matrix attribute sparse. i'm trying work out average path length using following code: % compute average path length network - average shortest path % inputs: adjl - matrix of weights/distances between nodes % outputs: average path length: average of shortest paths between every 2 edges % note: works directed/undirected networks % gb, december 8, 2005 function l = ave_path_length(adj) n=size(adj,1); dij = []; i=1:n; dij=[dij; simple_dijkstra(adj,i) ]; end l = sum(sum(dij))/(n^2-n); % sum , average across diagonal it uses dijkstra algorithm in following link: http://strategic.mit.edu/docs/matlab_networks/simple_dijkstra.m however, matlab becomes busy , don't result. tips appreciated. you growing matrix, in dij starts off empty , appended each loop, size changing. in matlab, can result in significant slowdowns in running time , in worst cases, matlab hang. presuming know final size of dij (fr

javascript - AngularJS convert Date to getTime() before sending to server -

i have form uses <input type="datetime-local" ng-bind="course.enddate".. , sets variable of model. before sending date server i've convert date 2015-04-04t22:00:00.000z integer given gettime() . in controller added this: course.enddate = course.enddate.gettime(); works server side angular complains in console this error . ( as said, works, avoid errors ) error: [ngmodel:datefmt] expected `1325458800000` date http://errors.angularjs.org/1.3.15/ngmodel/datefmt?p0=1325458800000 @ regex_string_regexp (angular.js:63) @ array.<anonymous> (angular.js:19938) @ object.ngmodelwatch (angular.js:23419) @ scope.$get.scope.$digest (angular.js:14300) @ scope.$get.scope.$apply (angular.js:14571) @ done (angular.js:9698) @ completerequest (angular.js:9888) @ xmlhttprequest.requestloaded (angular.js:9829) how can then? i had idea of adding fields used in form ( formenddate ) , convert 1 ( enddate = formenddate.gettime() )

html - CSS - create a dynamic "tag" shape facing to the right -

i'm trying create "price tag" shape using css, sharper edge facing right. when edge of tag facing left, there's no problem adding text (be short or long), since triangle static , rectangle stretching. i need create same thing "elastic" right facing triangle, keep using 1 class , not dedicated class each text length. for both examples please see fiddle . .pricetag { position: relative; margin: 0 5px 0 10px; display: inline-block; height: 46px; padding: 0 35px 0 15px; background: #e8edf0; font-size: 20px; line-height: 41px; } .pricetag:after {} .pricetag:before { position: absolute; content: ""; left: -15px; width: 1px; height: 0px; border-right: 14px solid #e8edf0; border-top: 23px solid transparent; border-bottom: 23px solid transparent; } /**********/ .pricetag-right { position: relative; margin: 0 5px 0 10px; display: inline-block; height: 46px; padding: 0 35px 0

c++ - UnitTest failing only when all tests get executed at once -

i'm facing odd problem when running microsoft c++ unittest within vs2013. the test failing each time execute run all tests in ide, when use run selected tests on specific one, succeeds. what i'm testing usage of own binarysearchtree class. in case of failure, exception code c0000005 gets returned (this may due wrong internal linkage of pointers). so can reason this? additional the test failing on last piece of code, generate random id strings, add them individually bst , remove them randomly till whole bst empty again. binarysearchtree clientlist; client client; // test random adding & deletion std::vector<std::string> idaddlist; (unsigned int = 0; < 100; i++) idaddlist.push_back(randomid(20)); std::vector<std::string> idremovelist; unsigned int id; while (idaddlist.size() > 0) { // pick random id list , delete id = rand() % idaddlist.size(); client.uniqueid = idaddlist.at(id); clientlist.add(client); if (cl

javascript - Carousel padding on first item -

Image
i'm working owl carousel using stage padding: http://www.owlcarousel.owlgraphic.com/demos/stagepadding.html i'm using carousel loop:false . i'm trying first item without padding on left , after slide keeps same padding both items on left , right. so @ page load should this: and on slide: using stage-padding gives padding both left , right. giving space on first item shown in test: http://pixelbypixel.comli.com/owl/ the problem if remove padding-left (to first item attached on left without margin) result on slide: any idea how can solve this? this markup: <div class="owl-carousel"> <div class="item"><h4>1</h4></div> <div class="item"><h4>2</h4></div> <div class="item"><h4>3</h4></div> <div class="item"><h4>4</h4></div> <div class="item"><h4>5</h4></div&g

sql - JoinAlias vs. Joinquery over differences toward Rowcount -

from understand, joinalias supposed functionally similar joinquery in ways return object. ie joinalias returns outer iqueryover , joinqueryover returns 1 join object. in following example: query.left.joinalias(() => eventalias.children, () => childalias); query.where(() => childalias.name.isin(searchcriteria.selectednames.toarray())); the rowcount 29. but here: query.left.joinqueryover(s => s.children).where(restrictions.in(projections.property<child>(x => x.name), searchcriteria.selectednames.toarray())); query.rowcount(); returns 18. the 18 want. there 18 entries on db. i did research on distinctrootentityresulttransformer() brings count 14 after alias, still not correct. on high level i'd gain better understanding happening, on immediate level i'd know if need use alias. thanks --- edit --- should left join, becuase count can 0, , want parent items. noted in answer, when run exact same filter same

javascript - Design a Rest API -

firstly, new web frameworks. using meteor. have students collection: students = new mongo.collection('students'); currently, defining rest api as: // maps to: /api/getallstudents restivus.addroute('getallstudents', {authrequired: false}, { get: function () { var students = students.find().fetch(); if (students.length > 0) { return {status: 'success',count:students.length,data: students}; } else { return { statuscode: 404, body: {status: 'fail', message: 'students not found'} }; }} }); }; now, there can api getstudentbyname as // maps to: /api/getstudentbyname name restivus.addroute('getstudentbyname', {authrequired: false}, { get: function () { var obj = {}; for(var key in this.queryparams){ var val = this.queryparams[key]; obj[key] = val; } var students = students.find(o

c++ - Establishing shared memory between different proccesses with limited resources? -

after painful debugging, realized trying use mmap store class in shared memory horrendously stupid. so, have class 5 variables (strings , ints) accessible running processes. how go coding if not use non standard libraries boost? one idea comes mind, , it's pretty bad, make variables global , use mmap few times. @ first, tried variables declared in class , mmap'd in constructor, understanding not work either. i add i'm forced use version not support map_anonymous , map_anon. hold phone. i, in morning haze, have forgotten tested object mmap'ing , managed update member of object 2 different processes in shared manner. believe problem lies entirely in construct initialization , way declare object. yet similar access in current code causes process abruptly end... this code: hangman * h; // i've tried , without using new here // , talk of placement new may show illumination h =(hangman*) mmap(null, sizeof *h, prot_read | prot_write,

android - How to set listview to its original position? -

Image
i have spent enough time make work listview setproperty " above " of layout align_parentbottom=true. seems easy right? no not. please see image can visualize problem , have idea it. when user scrolls listview , home button @bottom hides. and default, home button stays if list scrolling in idle state. needs done. so problem after home button visibility goes gone listview fills whole space towards bottom means match_parent , thats fine. but when scroll reaches idle state & visibility set visible last item of listview goes/hides behind home button. it means listview not getting original place image shows. tried making programmatically set "above" property of list home button align_parentbottom=true . also tried changing whole layout linear layout , giving weight=1 . but didn't succeed. appreciated. thanks. layout file fragement: <linearlayout android:id="@+id/llmain" android:visibility="visible&