Posts

Showing posts from June, 2010

php - Mailer Error: Message body empty -

this question has answer here: php mailer class issue :message body empty 3 answers i can't, life of me, figure out why i'm receiving error. code below: require_once('lib/phpmailer/phpmailerautoload.php'); $mail = new phpmailer(); $mail->issmtp(); $mail->smtpauth = true; $mail->host = "smtp.gmail.com"; $mail->port = 26; $mail->username = "email@email.com"; $mail->password = "scrambled"; $mail->setfrom('email@email.com', 'web app'); $mail->subject = "a transactional email web app"; $mail->ishtml(false); $mail->msghtml($body); $mail->addaddress('email@email.com', 'nomination'); if($mail->send()) { echo "message sent!"; } else { echo ...

Pass jQuery variable to PHP Symfony2 -

i'm trying star rating tutorial symfony2 in rating.css : fieldset, label { margin: 0; padding: 0; } body{ margin: 20px; } h1 { font-size: 1.5em; margin: 10px; } .rating { border: none; float: left; } .rating > input { display: none; } .rating > label:before { margin: 5px; font-size: 1.25em; font-family: fontawesome; display: inline-block; content: "\f005"; } .rating > .half:before { content: "\f089"; position: absolute; } .rating > label { color: #ddd; float: right; } .rating > input:checked ~ label, .rating:not(:checked) > label:hover, .rating:not(:checked) > label:hover ~ label { color: #ffd700; } .rating > input:checked + label:hover, .rating > input:checked ~ label:hover, .rating > label:hover ~ input:checked ~ label, .rating > input:checked ~ label:hover ~ label { color: #ffed85; } in view test.html.twig : <html> <head> <link rel="stylesh...

Python - TypeError: not all arguments converted during string formatting -

i have written following code, reason giving error when code applied, not sure issue is. import datetime = datetime.datetime.now() eventrootoids = ('1.3.6.1.4.1.11.2.17.19.2.2.%s') event_trap_varbinds = { 'applicationid' : tuple(['applicationid'] + [oid % 1 oid in eventrootoids]), console' : tuple(['console'] + [oid% 2 oid in eventrootoids]), } my root oid supposed 1.3.61.4.1.44.2.17.19.2.2.1/2/3 on..) typeerror: not arguments converted during string formatting 'applicationid' : tuple(['applicationid'] + [oid % 1 oid in eventrootoids]), you missing comma in eventrootoids = ('1.3.6.1.4.1.11.2.17.19.2.2.%s') ; way wrote it not tuple. import datetime = datetime.datetime.now() eventrootoids = ('1.3.6.1.4.1.11.2.17.19.2.2.%s', ) event_trap_varbinds = { 'applicationid' : tuple(['applicationid...

react native - Animate opacity based on view's position in scrollview -

i'm using react-native-swiper component allow user swipe horizontally between different listviews. animate opacity of these listviews @ full opacity when centered on screen , fade out when swiped left or right. have tried use onscroll event of parent scrollview (the swiper component) , using rctuimanager on listview components current position on screen: var handle = react.findnodehandle(this.refs['list']); rctuimanager.measure(handle, (x, y, width, height, pagex, pagey) but resulting animation really choppy , i'm guessing because uses onscroll event update opacity value. what best way achieve this? probably not relevant anymore since old question can use usenativedriver: true on scrollview , animate opacity based on scroll event performance. this blog post explains well

php - How do I use multiple versions of Laravel on the same machine? -

after had contribute 1 of laravel 4 projects, cloned , ran blindly composer install , dependencies of 4... however when came projects of laravel 5, had re-run command continue working on them too.. so instead of re-running composer time, there neater alternative have multiple versions of laravel on same machine on same user? i using ubuntu 14.04 lts you seem have laravel installed globally, , if should install per project won't conflict staying in each project's vendor/ folder instead.

excel - Connecting to Redshift SQL Server with VBA -

i'm having trouble connecting redshift sql server (postgres) vba macro. edit: here's error i'm getting: -2147467259 microsoft ole db provider odbc drivers [microsoft][odbc driver manager] data source name not found , no default driver specified c:\progra~1\common~1\micros~1\vba\vba7.1\1033\vblr6.chm 1000440 also, commented out of code while trouble shooting. public conn1 adodb.connection public conn2 adodb.connection public function openconnection1() boolean dim boolstate boolean dim servername string, databasename string, _ username string, password string on error goto errorhandler if conn1 nothing set conn1 = new adodb.connection end if if conn1.state = adstateopen boolstate = true goto exithere else ' put text box values connection variables. servername = "asdf" databasename = "asdf" ' s...

Couchdb startkey and endkey does not work when using POST method -

when using method startkey , endkey, works fine , gives list of "datestamp" falls in startkey-endkey range: http://localhost:5984/reservations/_design/default/_view/by_datestamp?startkey=1438704000002&endkey=1438704000005 but when use post method json payload, gives records has "datestamp" field regardless of value: http://localhost:5984/reservations/_design/default/_view/by_datestamp payload: {"startkey":"1438704000004","endkey":"1438704000005"} my view looks this: { "by_id": { "map": "function(doc) { if(doc.id) { emit(doc.id, doc); } }" }, "by_datestamp": { "map": "function(doc) { if(doc.datestamp) { emit(doc.datestamp, doc); } }" } } according docs argument can send in post body keys ....

wix - What will happen if I have two msi's creating same folder? -

if folder structure x/y/a created 32 bit msi first , x/y/b created 64 bit msi. happen x , y ? msi id have? the uninstall order 1 matters. empty folders correctly removed if uninstall them backwards compared how installed, i.e. lifo . when install second msi, find x , y folders on machine. if gets uninstalled last 1 leave folders on machine if empty, because installation did not created them. (the installation of first msi created. when uninstall first msi before second 1 leave folders there because not empty, i.e. containing files installed second msi) you try using removefolders action .

java - SimpleCursorAdapter doesn't return any object in listview -

i use simplecursoradapter in app rows db , not receive error, tryed put values in db can't see filled listview. post code below better explanation. fragmenttab2.java @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.fragmenttab2, container, false); d= new database(getactivity()); cursor c = d.getbarcode(); cursorloader(c); string from[] = {codice.dati_id, codice.dati_barcode}; int to[] = {r.id.record_id, r.id.record_barcode}; @suppresswarnings("deprecation") simplecursoradapter sca = new simplecursoradapter(view.getcontext(), r.layout.singolo_elemento_card, c, from, to); cardbarcode = (listview) view.findviewbyid(r.id.barcode_list); cardbarcode.setadapter(sca); cardbarcode.setclickable(true); cardbarcode.setonitemclicklistener(new adapterview.onitemclicklist...

java - Vaadin MenuBar Acting Strangely with IE -

Image
good evening everyone! i have deployed application made vaadin7 , , during testing, encountered weird when running app on ie. the menu bar shows three(3) items , rest viewed via triangular button. happens on ie (we have ie11 on office btw, if helps).. on firefox , chrome, works perfectly, shown in picture below: this code used header: import java.io.file; import java.util.arraylist; import java.util.list; import no.solarsoft.studentweb.listener.menuitemselectionlistener; import no.solarsoft.studentweb.manager.resourcemanager; import no.solarsoft.studentweb.manager.sessionhelper; import no.solarsoft.studentweb.theme.studentwebtheme; import org.apache.logging.log4j.logmanager; import org.apache.logging.log4j.logger; import com.vaadin.server.fileresource; import com.vaadin.server.page; import com.vaadin.server.themeresource; import com.vaadin.server.vaadinservice; import com.vaadin.ui.menubar.menuitem; import com.vaadin.ui.customcomponent; import com.vaadin.ui.image; imp...

Algorithm to find optimised resource allocation -

i doing project named 'resource gathering , project allocation'. in project, admin has first register project. after registering divides project various modules. once work division completed, needs gather resources project. resources means developers, testers, analysts etc. later when resources obtained, work assigned them.so same, need algorithm give optimised allocation of work employees considering inputs like:-type of project, skills needed, budget estimated etc. i think use genetic algorithm this. example - find way encode resource allocation combinations in sequence of bits. after should create fitness function evaluate efficiency of each generated sequence of bits in meaning of resource allocation represented combination of bits. you can find practical example of implementation of approach figure out of ann structure , weights particular recognition tasks here .

php - PHPStorm is not recognizing methods of my Model class in Laravel 5.0 -

failed insert data database, , query class , model class's method not found show in ide (phpstrom) how can solve it? here extended class (post.php) here show error in latest , method: <?php namespace app; use carbon\carbon; use illuminate\database\eloquent\model; class post extends model { protected $fillable=[ 'title', 'description', 'location', 'contact', 'type', 'published_at' ]; protected $date=['published_at']; public function setpublishedatattribute($date) { $this->attributes['published_at'] = carbon::createfromformat('y-m-d', $date); } /** * @param $query */ public function scopepublished($query) { $query->where('published_at', '<=', carbon::now()); } public function scopeunpublished($query) { $query->where('published_at', ...

laravel 5 - Eloquent/Laravel5 linking distant relations ("hasOneThrough") -

the question in short: "pages" , "tasks" have many-to-many relationship linked pivot table "page_tasks". table "responses" linked pivot table foreign key "page_task_id". now want able access page , task response belongs directly eloquent. hasmanythrough function not work, exspects foreign_keys @ different places: public function task(){ return $this->hasmanythrough('pagetask', 'task', 'page_task_id', 'task_id'); } unknown column 'tasks.page_task_id' in 'field list' this means eloquent exspects task table having foreign key page_task_id pointing page_tasks. in model page_tasks table has foreign key task_id pointing tasks. how tell eloquent fact? an other approach tried use existing relations defined: public function task(){ return $this->page_task->task(); } this tells me there no methoid called "task". what recommended way achi...

reporting services - Any suggestion as to how group the data in SSRS -

i have date shown below; p.no first name last name desc sdate activity c date 2 barack hotel lung 7/6/2015 cre 6/30/2015 2 barack hotel lung 7/6/2015 com 6/30/2015 2 barack hotel lung 7/6/2015 com 6/30/2015 2 barack hotel lung 7/6/2015 cre 6/30/2015 5 patrick dirt brain 7/27/2015 cre 7/21/2015 5 patrick dirt brain 7/27/2015 com 7/21/2015 5 patrick dirt brain 7/27/2015 com 7/21/2015 5 patrick dirt brain 7/27/2015 cre 7/21/2015 6 ann hathway lung 6/27/2016 cre 6/27/2015 6 ann hathway lung 6/27/2016 cre 6/27/2015 6 ann hathway lung 6/27/2016 can 6/29/2015 10 travis eye 8/27/2018 cre 6/29/2015 10 travis eye 8/27/2018 cre 6/29/2015 10 travis eye 8/27/2018 cre 7/1/2015 10 travis eye 8/27/2018 cre 6/29/2015 i want group them , should display 1 below; p.no first name last name desc sdate activity c date 2 barack hotel lung 7/...

javascript - Promises and pagination in AngularJS -

i have list of events i'm trying ng-repeat over. i'm using ui-bootstrap create pagination off of events. when hard code event data controller, able display , flip through them no problem. however, when try grab data service using promises, code breaks. have feeling it's because i'm not writing promise correctly (i'm new @ them) when page loads data hasn't yet been returned yet. here controller: app.controller("eventscontroller", ['$scope', 'eventsservice', function($scope, eventsservice) { $scope.events = []; $scope.itemsperpage = 5; //items show per page $scope.currentpage = 1; //what page start on eventsservice.getevents() .then(function(data) { $scope.events = data; }, function(error) { console.log(error); }); $scope.totalitems = $scope.events.length; //determines total # of pages $scope.pagecount = function () { return math.ceil($scope.events.length / $scope.itemsperpage); }; $s...

ios - Podspec subspec where the module name is not the same as the podspec name? -

so have project in swift (xcode 7) has bunch of framework targets, want have 1 podspec includes, subspecs, of these frameworks. when create podspec , add bunch of subspecs sample project sample project doesn't compile because module names have changed. for example have podspec named "frameworks" subspecs "datamodel" , "common". i create sample project podfile has references both 'frameworks/datamodel' , 'frameworks/common'. datamodel framework has dependencies on common , inside datamodel code common framework imported with import common but in sample project of subspecs getting inserted new framework cocoapods generates called frameworks import common throws error saying can't find common module. have change to import framework to work, not acceptable solution. how can resolve this?? or can't do? i think you're looking module_name attribute. can add podspec change how cocoapods generates framew...

java - org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [MyXYZ.class] -

i implementing restful web application jersey+spring+mongo+solr. after adding solr dependency, application not working on production environment. however, it's works when run in eclipse (by using run >> run on server). below pom.xml <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test</scope> </dependency> <!-- jersey --> <dependency> <groupid>com.sun.jersey</groupid> <artifactid>jersey-server</artifactid> <version>1.8</version> </dependency> <dependency> <groupid>com.sun.jersey.contribs</groupid> <artifactid>jersey-multipart</artifactid> <version>1.8</version> </dependency> <dependency> <groupid>com.s...

Calling PHP Function through JavaScript with Parameter -

mysqli_query($con, $sql) mysqli_close($con); } how use ajax php here answer example. jquery ajax post example php also might want learn more basics before going further. try google ajax , php ajax mysql , find tutorials.

excel - Max IF While Filtering dates? -

Image
how can find max date less today in range mixed both actual , projected dates: as see here have row of dates. dates actual, others projected. want open spreadsheet , "what latest projected date less today?" if want in single formula, need use array formula. array formulas calculate multiple times, once each cell in range, , provide array of responses. solve part 1 of you're asking, array formula (assuming columns end @ h, , on row 2 only): =max(if(a1:h1="projected",a2:h2,"")) when typed formula bar, confirm ctrl + shift + enter, instead of enter. afterwards (do not type {} yourself): {=max(if(a1:h1="projected",a2:h2,""))} this looks @ each cell a1:h1. says "projected", gives value in a2:h2 column [otherwise gives ""]. find date highest, wrap in max function. but we're not done, because have other criteria. use , function this, , functions take array results , collapse them single valu...

matlab - Best way to flatten a 2D matrix to 1D when sliced from a 3D matrix variable -

i have 3d matrix in matlab store sequence of 2d arrays. i'm having find maximal value , row , column indices, pretty straightforward single variable holds 2d array in a = rand(10,10); [m,i] = max(a(:)); [i,j] = ind2sub( size(a) , ) the trouble cannot use syntax 3d matrix a = rand(10,10,3); [m,i] = max( a(:,:,1)(:) ); [i,j] = ind2sub(size( a(:,:,1) ), ) error: ()-indexing must appear last in index expression. i create temporary variable store 2d slice, i'd thought i'd see if there's better means of doing this, maybe making call reshape? there way use simple linearizing/flattening operator (:) in context? here's i'd do: [b i]=max(reshape(a,[],size(a,3))); [ii,jj]=ind2sub(size(a),i ); the limitation wont treat cases there more 1 max per 2d slice.

spring - Update one column does not works -

i want update 1 column of database. column name status , type enum('waiting' , 'accepted' , 'rejected') want update column when click on link: <a href="requests/action?id=${vac.id}&a=accepted">accept</a> <a href="requests/action?id=${vac.id}&a=rejected">reject</a> vacation.hbm.xml <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-mapping public "-//hibernate/hibernate mapping dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <hibernate-mapping package="com.terafast.tem.model"> <class name="vacation" table="vacations" dynamic-update="true"> <id name="id" column="request_id"> <generator class="native" /> </id> <property name="user" column="user_id...

c# - Windows Store App URLs at ms-windows-store:// - Broken Now? -

recently windows store , windows phone store have merged might have seen on developer portal, user-facing windows store website, etc. since has happened, few links have been using in our apps have stopped working. such as: link our publisher page - ms-windows-store:search?publisher=ourpublishername link rate/review our app - ms-windows-store:reviewapp?appid=ourappid documentation on these here . else having trouble? i able solve these issues urls of format: publisher page - ms-windows-store:publisher?name=ourpublishername review page - ms-windows-store:review?pfn=ourpackagefamilyname to find these values on account, login new windows dev center | select app | app overview | scroll down app identity. package/properties/publisherdisplayname display publisher name. sure replace spaces %20 . package family name (pfn) pfn app.

Zebra Android Printing with v2.8.2148 images print as string instead of pixels -

in our android app, can print images p4t printer. use pcx cpcl command print image inline other receipt text. prior printing receipt upload image printer memory using zebra sdk. have zebra first convert our bitmap zebraimage , upload it. on p4t results in .pcx file reference in our cpcl label. example: printer config: e:signature.pcx in android app: static private void sendimagestoprinter(deviceprinter deviceprinter, list<string> imagestosend, string rootpath) throws ioexception, connectionexception, zebraprinterlanguageunknownexception, zebraillegalargumentexception { for(string image:imagestosend) { //[0] -> image path, <[1]> -> image scale factor string[] imageparams = image.split("\\|"); double scalefactor = imageparams.length > 1 ? parseimagescale(imageparams[1]) : 1.0d; file file = new file(stringutils.pathcombine(rootpath,imageparams[0])); if(!file.exists()) throw new filenotfound...

Checkbox grid alignment inside well for bootstrap -

i can't seem checkboxes align labels , select options inside using bootstrap 3.3.5. code is: <div class="well"> <div class="row"> <div class="col-md-6"> <label class="control-label">checkboxes</label> </div> </div> <div class="row"> <div class="col-md-6"> <div class="checkbox"> <input type="checkbox" id="1">1 </div> <div class="checkbox"> <input type="checkbox" id="2">2 </div> </div> </div> <div class="row"> <div class="col-md-6"> <label class="control-label">select</label> </div> </div> <div class="row"...

Range operator in C# for arrays -

i have 3d array int array arr1 = new int[2,2,2]; i'd create array, time 2d, part of arr1 . sudo code: arr2 = arr1[..,..,2] .. means elements (create 2d array arr1 trird dimension (rank) index equals 2) but looks there no range operator arrays in c#. right, or overlooked something? in other languages thre range operators marking elements, example: .. or : i'd avoid iterate on arr1 array. you can write own extension public static void getrange(this int[] array, int start, int end) { //your loop } then use arr1.getrange(1,2) but there no builtin operator.

android - What does google-services.json really do? -

i work on adding google analytics , gcm services current app. on guide both services implementation, google asks developer generate json file: google-services.json , put under root directory of app. i found if delete json file app, services still works. just want know sure, file for? usage , how work? i investigated bit regarding google-services plugin , json , found sources plugin. first things first the gradle-plugin google-services referenced classpath , apply build-time plugin only! influences build-process of app, not runtime-process! this plugin meant quickstart-helper integrating google-services in app. obviously, process convoluted , not documented, google should have made clear process does. in fact, found source code plugin version com.google.gms:google-services:1.4.0-beta3 , didnt find specific reference in regarding appinvites nor did find google api app invites! (but maybe uses generic api project project id, didnt try this) what does the goog...

c++ - forward declaration of 'const class LHContactInfo' error when try to access it property -

i have 2 c++ class bellow. want lhcontactinfo property lhscenesubclass can nothing.so how can this? #ifndef __levelhelper_api_contact_info_h__ #define __levelhelper_api_contact_info_h__ #include "lhconfig.h" #if lh_use_box2d #include "cocos2d.h" class b2contact; using namespace cocos2d; class lhcontactinfo { public: lhcontactinfo(); virtual ~lhcontactinfo(); node* nodea; node* nodeb; std::string nodeashapename; std::string nodebshapename; int nodeashapeid; int nodebshapeid; point contactpoint; float impulse; b2contact* box2dcontact; }; #endif #endif //__levelhelper_api_contact_info_h__ #include "lhcontactinfo.h" #if lh_use_box2d #include "box2d/box2d.h" lhcontactinfo::lhcontactinfo(){ nodea = null; nodeb = null; box2dcontact = null; } lhcontactinfo::~lhcontactinf...

Running Apache and Tomcat on guest VM, Tomcat redirects to host -

i'm trying deploy webapp on vagrant vm , having issues tomcat redirects , ports. here's configuration: guest os cent os 6.3 running on virtualbox. apache 2.4 installed , running on guest host port 4000 being forwarded guest port 80. tomcat 7 installed , running on guest host port 4040 being forwarded guest port 8000 (for jpda debugger). mod_jk installed forward requests apache tomcat. for part, works. have 1 webapp deployed @ /mywebapp, can access entering http://localhost:4000/mywebapp host browser. problem occurs when mywebapp application credentials check, , issues redirect if there no logged in user. what happens @ point host browser url changed https://localhost /mywebapp/login.jsp instead of https://localhost:4000 /mywebapp/login.jsp, causes me error since don't have apache running on host machine. i know mod_jk working, because can debug mywebapp application , follow point forward happens, know request being forwarded to tomcat. because of beli...

Check Jenkins Status Get Email When Service Goes Down -

i know if there way periodically check status of jenkins service , email when service goes down? on linux: can use ps -ef | grep -v grep | grep jenkins | wc -l find if jenkins running or not , if not try invoke email script or restart , put in crontab. #!/bin/bash if (($(ps - ef | grep - v grep | grep $service | wc - l) > 0)) echo "$service running!!!" else echo "do stuff!!" fi source / example : link on localhost, can check http code url assuming jenkins running on 8080 #!/bin/bash response=$(curl --write-out %{http_code} --silent --output /dev/null http://localhost:8080) if [ $response == 200 ] echo "site up" else echo "site down" echo "do stuff!!" fi on windows: you can simillar form batch script using: sc query service | findstr /i running | if "%errorlevel%"=="0" (sc stop service) else (sc start service) more links read on stop , start service via batch or ...

How to change options in select tag in javascript using console? -

this question has answer here: how set selectedindex of select element using display text? 6 answers <select name="ethinicity" > <option value="type1">asian</option> <option value="type2">african</option> <option value="type3">caucasion</option> <option value="type4">hispanics</option> <option value="type5">other populated groups</option> </select> i using document.getelementsbyname("ethinicity").value="type2" to change value,but donot work in way,why can't this? , give me other way donot want put in form , changing like document.formname.ethinicity.value="type2" thanks in advance! you can this: document.getelementsbyname(...

arrays - The fastest way to set up sparse matrix in matlab -

i working iterative methods, , large sparse matrices. instance, want set matrix this: 1 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 0 0 1 0 0 1 1 1 0 0 1 so diagonals non-zero. in programming, working larger matrix sizes, idea same: few diagonals non-zero, other entries zeros. i know, how in loop, seems not effective, if matrix size large. work symmetric matrices. appreciate, if provide me code sample matrix along description. you want spdiags : m = 6; %// number of rows n = 10; %// number of columns diags = [-4 -1 0 1 4]; %// diagonals filled = spdiags(ones(min(m,n), numel(diags)), diags, m, n); this gives: >> full(a) ans = 1 1 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 ...

How to send to only one client and not all clients using Go and gorilla websocket -

i trying learn websockets go. have been looking @ examples gorilla websocket. i have checked out these 2 examples show how use gorilla websocket: https://github.com/gorilla/websocket/tree/master/examples https://www.youtube.com/watch?v=ysaz_oqpoo0 all of these examples show how connect websocket server, send , receive texts. don't understand how can send 1 client. because in real world application have users, , don't want users receive same message , same data. there way me unique id of connection can save in database redis , link user id in same database, , use websocket id send specific client if user id received message or notification? how 1 go , achieve this? if case, how that? is there way me unique id of connection can save in database redis , link user id in same database, , use websocket id send specific client if user id received message or notification? sure! can generate id while user registering. add userid field in connection stru...

ios - Device Orientation results in flipped node location -

my code simple. want change positioning of skspritenode remain in bottom right corner of device screen. call uideviceorientationdidchangenotification method "rotated" on device rotation , should move node, reason flips desired location landscape position portrait should , vice-versa. my code follows: ui - (void)rotated:(nsnotification *)notification { deviceorientation deviceorientation = [uidevice currentdevice].orientation; if (uideviceorientationislandscape(deviceorientation) && !_isshowinglandscapeview) [self.node setposition:bottom_right]; _isshowinglandscapeview = yes; } else if (uideviceorientationisportrait(deviceorientation) && _isshowinglandscapeview) { [self.node setposition:bottom_right]; _isshowinglandscapeview = no; } } ok i'm doing simple. use uibuttons on skscene. go uiview...

java - Some equal condition didn't work -

this question has answer here: what difference between == vs equals() in java? 22 answers why equal operator dosn't work in case : integer act0 = integer.valueof(ac.split("-")[0]); if (activite_alerte.getactivite().getidactivite() == act0)) { add_notif(profil, ao); added = true; break; } activite_alerte.getactivite().getidactivite() , act0 equals 439 didn't work other value work. you're using boxed integral type integer . java permits equality using == values in range -128 +127 since these "canned" boxed values, reference comparison work numbers in range. number - 439 - big. you should use .equals() instead boxed types. personally find 1 of pernicious aspects of java.

database - Filtering queryset with objects -

currently have foreach($this->friends $friend) { $user_ids[] = $friend->id; } $posts = post::wherein("user_id", $user_ids)->orderby("date_published", "desc")->paginate(15); seems okay , works fine, creation of array little weird. there way filter user objects themselves? example post::wherein("user", $this->friends) where $this->friends public function friends() { return $this->belongstomany("app\user", "friends_users", "user_id", "friend_id"); } $this->friends collection object has lists method creates array column, or associative array 2 columns. here's how use it. $posts = post::wherein("user_id", $this->friends->lists('id'))->orderby("date_published", "desc")->paginate(15);

html - Background attachment fixed to the wrapper div -

i have such situation: http://jsfiddle.net/5axmtw9g/3/ <div class="content inner clearfix1 has-left-sidebar"> <div class="sidebar-left-menu prepended"></div> <div class="content-middle"> <section id="about-stat" class="clearfix1 about-stat-section"> <h1>some title</h1> </section> </div> </div> .inner { margin: 0 auto; width: 600px; } .content.inner { position: relative; } .content .sidebar-left-menu { height: 100%; left: 0; overflow-x: hidden; overflow-y: auto; position: absolute; top: 0; float: left; width: 160px; } .sidebar-left-menu { background: #3b86c4 none repeat scroll 0 0; color: #fff; } .content-middle { margin: 0 0 10px 170px; } #about-stat { background: rgba(0, 0, 0, 0) url("http://quotesnhumor.com/wp-content/uploads/2014/12/funny-minions-pictures-and-quotes.jpg") no-repeat fixed 0 ...

c++ - How to speed std::vector access time -

how improve std::vector time? hi making software multivariable fuzzy k means cluster. work on big matrix´s 50.000 observations 10 variables. matrix not need grow o shrink or bounds check. make resize needed size, load items , make lot of access. first use: `std::vector< std::vector<double> > matrix(numclusters, std::vector<double>(numobs,0.0));` to element do: double a=matrix[i][j]; procces time of 20 minutes. then make: std::vector<double> u(numclusters *numobs,0.0); to element do: double a=u[i*numobs+j]; , time better. now want make question: more faster access: iterator+int std::vector<double>::const_iterator uit = u.begin(); double a= *(uit+index) pointer[int] std::vector<double>::const_pointer upt = u.data(); double a= upt[index]; or normal index access[int] double a= u[index]; greetings one thing try switch rows , columns. if have 10 × 50,000 matrix , lay down 1 row after another, operations on ro...