Posts

Showing posts from January, 2010

mysql - sql/php query to set the value of a variable -

i have table called "users" has columns 'username', 'password' , 'permission'. in permission column either 'browse' or 'edit'. have user logged site, want select select permission using username (which have stored in session variable). want set variable equal either 'browse' or 'edit' based on permission, use in further logic. assuming have connected , selected appropriate database pretty sure php code , query should go like: $u = $_session['username'] ; $sql = "select permission users username = '$u' " ; $result = mysqli_query($sql); but im unsure how set variable equal 'browse' or 'edit' accordingly. any ideas? say have connection $con , using session have start session. $u = $_session['username'] ; $sql = "select `permission` `users` username='$u'"; $result = mysqli_query($con, $sql); $rows = mysqli_fetch_object($result); /

javascript - Set interval Slider with Random starting <div>, How to traverse through all <divs>? -

i have jsonp request returning block of html this <div id="slider_wrapper" style=""> <div style="xxx" ><section style="xx">xx</section></div> <div style="xxx" ><section style="xx">xx</section></div> <div style="xxx" ><section style="xx">xx</section></div> <div style="xxx" ><section style="xx">xx</section></div> ... ... </div> here number of inner depends on db rows. after this, sliding content using set interval fallowing note: here want start sliding random position , not 0th position here id = random number setinterval(function() { $('#slider_wrapper > div:eq('+id+')') .fadeout(1000) .next() .fadein(1000) .end()

Windows batch file - automatic answer to all prompts -

i running program generates batch file. batch file has bunch of prompts want answer return: example: type x quit or <return> proceed i have tried: echo. | batchfile.bat this answers first prompt. want answer prompts, , there lot of prompts.

javascript - Jquery show loading div while waiting for script to finish -

i have javascript looks this $("#loading").show(); // script takes time $("#loading").hide(); i want show loading dialog wait script end , close it. doesn't work this. opens loading dialog after script finished , stays open. what's problem? try use toggle $(document).ready(function(){ $("button").click(function(){ $("#loading").toggle(); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <p id="loading">loading</p> <button>show hide loading</button>

spring boot - How to log request and response (headers+body) using Grails 3? -

i looking ways log incoming request , returned response (headers+body) in grails 3 application. grails has notion of interceptors, in these interceptors unable read body body can read once. if in interceptor normal controller logic fails error indicating stream closed. i tried find ways on how can done using springboot grails based on springboot. any hints on how can done in grails 3 application? i suggest following approach (haven't found available spring-boot when needed similar functionality, i've decided roll own): implement httpservletrequestwrapper copy bytes inputstream being consumed can re-read request body multiple times implement , register filter wrap http request on way in , log complete request/response after request consumed , response produced endpoint nice bonus can log both request , response in 1 logging statement, keeping them in logfile.

jquery - onBeforeUnload custom button messages -

i have following beforeunload function have stolen sonewhere else.... $().ready(function() { $("#posmanagerloginform").trigger("submit"); $(window).bind("beforeunload", function(){ window.settimeout(function () { window.location = "home.htm"; }, 0); window.onbeforeunload = null; // necessary prevent infinite loop kills browser return "press 'stay on page' go reporting manager home"; }); }); regardless of option select navigated home.htm. there way can make dialog box ok button instead of default "leave page" or "stay on page" options? or perhaps else make suggestion on hot better handle? thanks you cannot override styling of onbeforeunload dialog. believe me, tried before in earlier projects. reference: http://msdn.microsoft.com/en-us/library/ms536907%28vs.85%29.aspx it built browser object, , have no control on it. yo

javascript - Jquery Dropdown on change not working -

this code below should capture selected value , add div. can't life of me code respond. i've tried different selectors , event listeners still doesn't work. appreciated! $("#mapdatatable select").on("change", function(){ var option = $(this).val(); $("#exbuilder").innerhtml += ' '+option; }); $("#mapdatacolumn select").on("change", function(){ var option = $(this).val(); $("#exbuilder").innerhtml += ' '+option; }); $("#analyzefunction").on("change", function(){ var option = $(this).val(); $("#exbuilder").innerhtml += ' '+option; }); $("#parametervalue select").on("change", function(){ var option = $(this).val(); $("#exbuilder").innerhtml += ' '+option; }); map datatable t_

python - URL encode parameters -

was wondering how url encode parameters, right? params = {'oauth_version': "1.0", 'oauth_nonce': oauth.generate_nonce(), 'oauth_timestamp': int(time.time()), 'oauth_consumer_key': consumer_key, 'oauth_token': access_key, 'oauth_nonce' : nonce, 'oauth_consumer_key': consumer.key, 'oauth_signature': 'el078a5axgi43fbdyfg5ywy', } following guide: to make authorization header, append values starting “oauth”. each value must url encoded. > 1. authorization: oauth oauth_callback="http%3a%2f%2fwww.website-tm-access.co.nz%2ftrademe-callback", > oauth_consumer_key="c74cd73fdbe37d29bdd21bab54bc70e422", > oauth_version="1.0", oauth_timestamp="1285532322", > oauth_nonce="7o3kee", oauth_signature_method="hmac-sha1", &

c++ - Search for first index of 'xy' in string using divide and conquer -

i have find first instance of sub string "xy" in char array, using divide , conquer split array half (so array[0...mid] , array[mid+1...size] mid = size+1/2) , recursively running algorithm on both halves. substring 'xy' in left half, in right half, or between 2 halves. returns index of 'x' if first 'xy' found, otherwise returns -1. method allowed 2 parameters, (pointer to) array , size of array. tried using modified binary search, , code follows: (ps. pseudocode resembles c++, doesn't have proper logic has good) public int xy-search(char* data, int n){ //starts @ l=0 , r == n-1 int l = 0; //left index int r = n-1; // right index if (n==1) return -1; if (l>r) // not found return -1; int mid = l+r/2; //get mid point if (data[mid] == ‘x’ && data[mid+1] == ‘y’) return mid; else if (l==r) // not found return -1; else { int left = xy-search(data, left);

c# - Filter a BindingSource based on the rows of another DataGridView -

i have 2 datagridviews in winforms. datagrid1 connected table contains list of jobs need completed. once completes job, it's entered separate table completed, connected datagrid2. i need filter binding source datagrid1 when job shows completed in datagrid2 it's filtered out of datagrid1. current code i'm using filters binding source last entry in datagrid2 , need filter of entries. how filter bindingsourc e datagrid1 based on values of column of datagrid2? foreach (datagridviewrow row in datagrid2.rows) { datagrid1bindingsource.filter = string.format("columnname <> '{0}'", row.cells[1].value); } here example of jobs in data table, first grid contains incomplete jobs , second grid contains completed jobs. jobs should shown in incomplete grid, jobs not in completed jobs grid: __________ ____________ ___________ | jobs | | incomplete | | completed | |――――――――――| |――――――――――――| |―――――――――――

php - disable a submit button after clicking on it in codeigniter -

i'm new php , codeigniter. have task i'm working on right hostel management system. student has ability choose meal want eat selecting on it, im trying disable select button after click on it, in other words student can choose specific meal once. here's code: <td><div><?php echo $row['type'];?></div></td <td><div><?php echo $row['content'];?></div></td> <td><div><?php echo $row['date'];?></div></td> <td align="center"> <?php $is_selected=$this->db->get_where('selected_meal', array( 'meal_id' => $row['meal_id'],'student_id'=>$this->session->userdata('student_id')))->row()->delivered; <a data-toggle="modal" href="#modal-form" onclick="modal('order_meal',<?php echo $row['meal_id'];?>)" class="btn btn-gray btn-sma

Ruby on rails. Ransack search on money-rails Monetize attribute -

i having problems searching money-rails/monetized attribute using ransack. able search in cents. have model (gig) money attribute salary . can create model no problem with: <%= form.input :salary %> which saves value in salary_cents column expected in gig model have: monetize :salary_cents i can show salary in view with: <%= @gig.salary %> the problem having searching field ransack. salary attribute null, , salary_cents attribute populated should be, means can search in cents. for search using: <%= f.search_field :salary_cents_gteq %> <%= f.search_field :salary_cents_lteq %> but search $30 , have input 3000 . there way of manipulating inputted data, multiplying 100, before sending search request? there easier ways missing? i have searched , cannot find information on searching money fields ransack. thanks in advance. ransack's custom predicates saves day! # config/initializers/ransack.rb ransack.configure |config|

javascript - Confused with Viewer API vs example, passing options to extensions -

i confused examples on how use viewer don't seem match documentation of api, functions not in docs or signature different. base on examples code, how pass options extensions instantiate? pass extension callback. thanks! we need fix doc not rely anymore on undocumented a360 viewer additional code, supposed internal. sorry incovenience, asap... for time being, can use code viewer boilerplate sample : function initializeviewer(containerid, urn) { autodesk.viewing.document.load(urn, function (model) { var rootitem = model.getrootitem(); // grab 3d items var geometryitems3d = autodesk.viewing.document.getsubitemswithproperties( rootitem, { 'type': 'geometry', 'role': '3d' }, true); // grab 2d items var geometryitems2d = autodesk.viewing.document.getsubitemswithproperties( rootitem, { 'type': 'geometry', 'role': '2d' },

c - How can i run the command emerge in git? -

this 1st question here! on site: is there kdevelop version can install on windows? @ 1 of answers required "run emerge qt, emerge kdelibs, emerge kde-baseapps, emerge kdevelop , emerge kdevelop-pg-qt". however, when make tells in cmd.exe: "the command 'emerge' either misspelled or not found." how can fix problem? so, emerge installable on windows if follow guide on https://community.kde.org/guidelines_and_howtos/build_from_source/windows#installing_emerge for info: emerge command of portage package manager (program install software in os). portage official package manager of gentoo linux os. other examples: ubuntu , debian linux use apt package manager, fedora linux uses fpm, archlinux uses pacman, etc...

email - Send Mail using cron job and shell script -

This summary is not available. Please click here to view the post.

HTML/PHP Require Error -

i working on personal project able write web page uses 1 page. running error in 1 directory of web page same code works in other places. errors: warning: require(mainclass.php): failed open stream: no such file or directory in c:\xampp\htdocs\testproj\cssfiles\index.html on line 3 fatal error: require(): failed opening required 'mainclass.php' (include_path='../testproj/phpclasses') in c:\xampp\htdocs\testproj\cssfiles\index.html on line 3 code: <?php set_include_path("../testproj/phpclasses"); require "mainclass.php"; $controller = new mainclass(); ?> can assist me this? i assume, not need 'testproj' in include path should ..\phpclasses however, not recommend overwrite include path calling set_include_path , because in example exclude standard libraries path. use require "../phpclasses/mainclass.php"; without set_include_path(...)

javascript - ModalPopupExtender not show after a few click -

Image
i have 2 modalpopupextender in page, first modalpopupextender use popup message, second 1 use let user make choose. when running, fine, after open , close on first or second modalpopupextender, not show on top of screen, can't see it. mean is, not show on screen, if use developer tool check it, can see show under front page, can't click button on it, , make whole page hanged. my code below: <asp:updatepanel runat="server" id="modalpanel1" rendermode="inline" updatemode="conditional"> <contenttemplate> <asp:button id="btnhidden" runat="server" text="" style="display: none" onclick="btnhidden_click" /> <asp:panel id="pndialog" runat="server" bordercolor="#003399" borderstyle="solid" borderwidth="3px"> <asp:panel id="pntitle" runat="se

javascript - Rails form does POST instead of DELETE after adding in Bootstrap? -

i added functionality sort table columns following lines of code: <table data-toggle="table" class= "table"> . . . <th data-sortable = "true"> header column </th> . . <%= form_tag(sccm_destroy_multiple, method: :delete) %> . . . <%end%> so after added in data-toggle="table" , data-sortable="true" lines (was working fine before added those), form started making post requests instead of delete, ideas how fix this? also: application.js : //= require bootstrap-table can post html generated form page? according the docs , should have following hidden field. see field? <form accept-charset="utf-8" action="/sccm_destroy_multiple" method="post"> <input name="_method" type="hidden" value="delete" /> the rails framework encourages restful design of applications, means you'll making lot of "patch&

how to display files of a folder in listbox by browsing the folder using asp.net -

string path = textbox1.text; directoryinfo dtr = new directoryinfo(path); if (dtr.exists) { fileinfo[] files = dtr.getfiles("*.txt"); foreach (fileinfo file in files) { listbox1.items.add(file.name); } label1.text = "entered listbox"; } else { label1.text = "directory doesnt exit"; } i using asp.net, have textbox,a button , listbox, copying path of folder in textbox , on button click display text file in listbox..... but, dont want copy folder path textbox rather want browse folder on button click , display path in textbox , on button click display files inside particular folder replace listbox1.items.add(file.name); with listbox1.items.add(file.name.substring(file.name.lastindexof('\\')));

jquery plugins - Parallel uploads for multiple images using DropzoneJS -

at present have working dropzonejs implementation user can select multiple images , upload them. there parameter paralleluploads seems in practice determine how many images can uploaded @ once, example when select files dialog opened if user selects 10 files, paralleluploads:5 first 5 images upload , remaining 5 ignored, , 5 images sent via single http post request. what able configure there no limit how many images uploaded, uploaded in batches. example, if user selects 30 images, them uploaded successfully, either 1 image per http post request or defined number per http post such 5. if set paralleluploads:30 server requires vast amount of memory try , server-side processing on 30 images in 1 go , doesn't seem great solution. how can configure launch separate http post request per image or defined number of images @ once without capping number of images being uploaded in 1 action user? <link rel="stylesheet" type="text/css" href="dropzone.

sql server - Dates and Dynamic SQL error message -

using ms sql 2012. i trying query set of tables using dynamic sql , passing through tablename, start date in format of dd/mm/yyyy , end date in format of dd/mm/yyyy. my code follows. @tablename nvarchar(50), @startdate date, @enddate date begin set nocount on; declare @query varchar(max) set @query = 'select * ''' + @tablename + ''' convert(date, docdate, 103) >= ''' + cast(@startdate varchar(50)) + ''' , convert(date, docdate, 103) <= ''' + cast(@enddate varchar(50)) + '' exec @query end the docdate field has data type of date , in format of yyyy-mm-dd. i following error when run stored procedure. incorrect syntax near '/'. what missing? update i testing query following entries variables , still same error. use [testdbs] go declare @return_value int exec @return_value = [dbo].[getresultset] @tablename = prices, @startdate = 01/02/2016, @e

hadoop - Create var in hive query running in Ozzie -

how create variable in hive query running in oozie(hue) , pass variable in next step of oozie job example email job or shell? i try : set q1=select sum(br) auth; accessing q1 in email job :${hiveconf:q1} throw error : el_error encountered ": q1 }", expected 1 of ["}", ".", ">", "gt", "<", "lt", "==", "eq", "<=", "le", ">=", "ge", "!=", "ne", "[", "+", "-", "*", "/", "div", "%", "mod", "and", "&&", "or", "||", ":", <identifier>, "(", "?"] maybe wrong , there different solution? or maybe itss hue error?

java - Having trouble making a Android.os.Handler continue running -

so, have service need keep running in order send ayt device , report on connection (basically whether it's or down) @ regular intervals. have setup right now, works, after 10 or 15 minutes, ceases run. it's using handlerthread, handler , runnable start service, work, stops itself. mainactivity.java snippets: private handlerthread hthread = new handlerthread("maintainconnection"); private handler h; private runnable htask = new runnable() { @override public void run() { startservice(new intent(getapplicationcontext(), maintainconnectionservice.class)); h.postdelayed(this, 2000); } }; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); hthread.start(); h = new handler(hthread.getlooper()); /* other code goes here */ } @override protected void onpause() { super.onpause(); log.v(tag, "i in onpause"); h.removecallbacks(htask); } @override protected void onresum

javascript - Inject an object into a service function -

i have been struggling few hours without getting solution. how can inject object function, can use in there? example: angular.module(modulename).service('myservice', myservice, myobject); here, myobject defined, ok. then, inside function, undefined. how can pass object function , use in there? camundaservice.$inject = ['$http']; function camundaservice($http, myobject) {...} injecting second parameter in array did not work , error: angular.js:13708 error: [$injector:unpr] unknown provider any appreciated :) you can use angular constant : var app = angular.module('myapp', []); app.constant('myobject', { message: 'hello world' }); now can inject myobject .

How to split a character column into multiple columns in R -

i have dataframe x : dput(x) structure(list(district = structure(c(6l, 6l, 6l, 6l, 6l, 6l), .label = c("district - central (06)", "district - east (04)", "district - new delhi (05)", "district - north (02)", "district - north east (03)", "district - north west (01)", "district - south (09)", "district - south west (08)", "district - west (07)"), class = "factor"), age = structure(c(103l, 1l, 2l, 14l, 25l, 36l), .label = c("0", "1", "10", "100+", "11", "12", "13", "14", "15", "16", "17", "18", "19", "2", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "3", "30", "31", "32",

java - Issues with update method in Android Studio LibGDX -

i'm trying call update method every time amount of time passes, destroys , adds new obstacle, game loop. however, when it, series of errors: error:(146, 8) gradle: error: illegal start of expression error:(146, 16) gradle: error: illegal start of expression error:(146, 32) gradle: error: ';' expected error:(149, 23) gradle: error: ';' expected error:(151, 31) gradle: error: '.class' expected error:(151, 40) gradle: error: illegal start of expression error:(151, 41) gradle: error: ';' expected here's code seems causing problem: public void update(float deltatime) { texture playertexture = game.getmanager().get("player.png"); texture floortexture = game.getmanager().get("floor.png"); texture overfloortexture = game.getmanager().get("overfloor.png"); texture overfloor2texture = game.getmanager().get("overfloor2.png"); texture obstacletexture = game.getma

bootloader - How to use the fatls command in uboot sandbox? -

i working uboot sandbox. here how see fatls in sandbox. => fatls fatls - list files in directory (default /) usage: fatls <interface> [<dev[:part]>] [directory] - list files 'dev' on 'interface' in 'directory' here interface , dev in system. trying, => fatls sda 0 ** bad device sda 0 ** you have bit more work. assuming have built sandbox already: $ dd if=/dev/zero of=fat.img bs=1k count=2048 $ mkfs.vfat ./fat.img $ ./u-boot ... => host bind 0 fat.img => fatls host 0:0 0 file(s), 0 dir(s) =>

javascript - issue with my game of life logic? -

i have coded conway's game of life in javascript, seems producing screen, doens't seem following same logic or running in same way @ conways game of life. don't know wrong , why running this, code seems me should following correct rules. can spot why not running correctly? here link jsfiddle https://jsfiddle.net/nw4lw7z9/1/ //object constructor function cell(){ this.alive = math.random() >0.8; this.neighbours = 0; //number of live neighbours this.checkneighbours = [[-1,-1],[-1,0],[0,-1],[-1,1],[1,-1],[1,0],[0,1],[1,1]]; } function gol(size){ this.size = size; this.grid = this.makegrid(size); }; gol.prototype.makegrid = function(size){ var grid = []; for(var i=0; i<size; i++){ var row=[]; for(var j =0; j<size; j++){ row.push(new cell()); } grid.push(row); } return grid; }; gol.prototype.drawgrid = function(){

php - Show only the last result from mysql row -

i have table id | field1 | field2 | ... | field[x-1] | field[x] 1 | val1 | val2 | ... | val[x-1] | val[x] and i'm doing search for($i = 1; $i <= $x; $i++){ $getvalue = mysql_query("select * table id='1' , field".$i." 'some_value%'")or die(mysql_error()); while($row = mysql_fetch_array($getvalue)){ $j=$i+1; $val = $row['field'.$j.'']; } } some values in table (val[1-x]) same need last value. limit 1 doesn't seem work. update. unfortunately david suggested, can't change database. has is. have text file (a settings dump sensor) insert line line db , check see if there errors. check run ok have few lines in need choose last 1 check. have 10 lines this d? string r? string ... d? string r? string i'm interested in last string after r?. use explode () , each value checked in limits. using order id desc limit 1 : to last row (with highest = last = newest id ), shou

javascript - rootScope gets undifined when changing route -

so, when user logs in have code var promise = userfactory.dologin(usercredentials); promise.success(function (data, status) { //set localstorage vars //only on login's success additional data var anotherpromise = userdatafactory.getuserdata(); anotherpromise.success(function (data, status){ if(data.code == 2){ $rootscope.userhead = true; } }); $rootscope.userhead = true; show/hide sub-menu according value (true/false). sub-menu's html is <div class="panel panel-default text-center" style="text-align: center;" ng-hide="userheader"> the page includes menu, included in pages <div id="submenu" ng-include="'submenu.html'" ></div> . pages in routes so .when('/user', {

php - Comma separate custom taxonomies (no links) -

here's simple little question can't seem figure out. have 1 custom taxonomy has multiple options. want show taxonomies without links. use code: <li> <?php $terms_as_text = get_the_term_list($post->id, 'opties'); if (!empty($terms_as_text)) echo '', strip_tags($terms_as_text) , ''; ?> </li> this display's selected custom taxonomies of opties . because taxonomy has multiple options comma separate them. won't let me. normally use: <?php echo get_the_term_list( $post->id, 'opties', '<ul><li>', '</li><li>', '</li></ul>' ); ?> the first part = before. the middle part = separate. the last part = after. but makes links of custom taxonomy terms, , don't want happen. but because of strip_tags($terms_as_text) can't comma separate them. how can them separate comma? you can try following: g

Android video displayed wrong in specific portrait rotation -

Image
i using geniatech atv1220 running android 4.2.2 display video in simple videoview . connected monitor via hdmi port. setup need display content in different orientations. works fine in 3 of 4 orientations (landscape, landscape flipped, portrait flipped). in portrait video displayed wrong though. i created basic application reproduce behaviour. ( https://github.com/ingoalbers/simplevideoview ) the relevant parts: videoviewactivity public class videoviewactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_video_view); final videoview videoview = (videoview) findviewbyid(com.ingoalbers.simplevideoview.r.id.videoview); assert videoview != null; videoview.setvideopath("http://clips.vorwaerts-gmbh.de/vfe_html5.mp4"); videoview.start(); } } androidmanifest.xml <?xml version="1.0" encoding="utf-

c# - Should I use a collection of Users or user in a certain class inMVC4 -

Image
i have department filled users in eg mark in hr department , james in hr department etc i'm wondering use public virtual icollection users { get; set; } or public virtual user user { get; set; } for department , depot classes same? public class department { public int departmentid { get; set; } [stringlength(50, minimumlength = 3)] public string name { get; set; } [display(name = "administrator")] public int userid { get; set; } public virtual icollection<user> users { get; set; } } can check if did these few lines correctly in user class(you can reference below) public virtual icollection<ticket> tickets { get; set; } <-users can have collection of tickets because can open many tickets want. public virtual administrator administrator { get; set; } <- 1 user can 1 type of admin @ time public virtual department department { get; set; } <- 1 user can @ 1 depar

c++ - Serialize PNG and Send to Rest Client -

iam sending images in png format rest clients. when download file on client side , try open it, errors. believe headers of file missing, how can add them serverresponse? on details of picture can see, size , on missing. ifstream stream; stream.open(fullfilename,std::ios::binary); string content, line; if (stream) { while (getline(stream,line)){ content += line; } } stream.close(); request::request->set_body(content); after searching around found post post on side. and sequenze create that. ifstream *stream = new ifstream(fullfilename, std::ios::in | std::ios::binary); std::ostringstream *oss = new ostringstream(); *oss << stream->rdbuf(); string *content = new string(oss->str()); stream->close(); request::request->set_body(*content);

php - Laravel Migration return Incorrect table definition -

laravel migration return "incorrect table definition; there can 1 auto column , must defined key", why? link of code damn, consider atomizing . the second argument integer values when creating migrations not length of field rather if should or should not autoincrement. https://github.com/laravel/framework/blob/330d11ba8cd3d6c0a54a1125943526b126147b5f/src/illuminate/database/schema/blueprint.php#l443 that's problem lies. for example $table->integer('celular',15)->nullable(); . laravel assume want autoincrement since 15 truthy value , since mysql doesn't allow more 1 column autoincrement got error.

Android Permissions at Run Time with fragments -

i have in project activity has 2 fragments in xml (main): <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.example.fragments.mainactivity"> <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.mapfragment" /> <fragment android:i

playframework 2.0 - Mapping many to one with Scala and Slick -

i have user can have 1 more more logininfos. wish find user id , pack each of associated logininfos user object. my expectation number of rows equal number of logininfos each same user. first map user object , each of logininfos. there better way? here's have: def find(userid: uuid) = { val query = { dbuser <- slickusers.filter(_.id === userid.tostring) dbuserlogininfo <- slickuserlogininfos.filter(_.userid === dbuser.id) dblogininfo <- slicklogininfos.filter(_.id === dbuserlogininfo.logininfoid) } yield (dbuser, dblogininfo) db.run(query.result).map { results => var loginlist = list[logininfo]() results.foreach { case (user, logininfo) => loginlist = logininfo(logininfo.providerid, logininfo.providerkey) :: loginlist } results.headoption.map { case (user, logininfo) => user( uuid.fromstring(user.userid), loginlist, user.firstname, user.lastname, user.fullname, user.email, user.avatarurl)

c++ - Eigen with EIGEN_USE_MKL_ALL -

i compiled c++ project(using eigen 3.2.8) eigen_use_blas option , link against mkl-blas, every thing works fine , indeed speeds program substantially(perhaps due lot of complex-valued matrix-vector multiplication) then tried eigen_use_mkl_all, however, similar errors prompt up: /eigen3/eigen/src/qr/colpivhouseholderqr_mkl.h:94:1 error: cannot convert "eigen::plainobjectbase<eigen::matrix<int,-1,1>>::scalar* {aka int*}" "long long int*" in initialization eigen_mkl_or_colpiv(...) two questions here: eigen_use_blas enables 4x speed though didn't expect much, possible reason? eigen_use_mkl_all seems have type conflict lapack stuff, how fix compiling error? mkl utilizes new avx/avx2 instruction set (8 32-bit float operations per clock fma , 3-operand instructions), while eigen 3.2.8 supports sse4 (4 32-bit float operations per clock). indicated ggael, update 3.3beta1 achieve better performance. you try eigen 3.3-beta1. canno

windows installer - Install shield 2011 installscript functions -

how disable of existing functions under install script. install script having many functions that, don't want minor upgrade. at high level, can find function calls it, , replace function. use dropdown @ top select function, , insert current code, allowing modify it. approach, other dropdown part, includes top-level program / endprogram block in theory. (i not suggest replacing that, in installscript msi.) i believe entry points want examine altering behavior of minor upgrade onresumeuibefore , onresumeuiafter .

If IDs in HTML should be unique, why sometimes I see in Css see something like div#nav-blue? -

since id should unique in html, why see in css selectors formatted (div#nav-blue), since it's obvious there no other element having id exccept div, aint writting #nav-blue makes more sense? it no change or little. you can reason : more visibility when maintain code. easier find, , remember each kind of element style. the second reason priority of selector. there different order of priority : !important > #id > .class > element you can consider element = 1 .class = 10 #id = 100 !important= 1000 and div#id = 101 > #id = 100 div#myid{ color:red; } #myid{ color:blue; } .myclass{ color:yellow; } div{ color:green; } <div class="myclass" id="myid"> text </div>

node.js - loopback set scope by name in JSON relation -

i'm defining relation between loopback models , want filter using scope. define custom scope in related model json definition this "scopes":{ "blogid":{"where":{"originaltype":"blog"}} }, and want address in master model name, like "oldid":{ "type": "hasone", "model": "originalids", "foreignkey": "iid", "scope": "blogid" <------ }, this not work, have explicitly set scope structure there like "scope": {"where":{"originaltype":"blog"}} which leads code duplication. possible address scope name somehow? i believe (and down vote me if i'm wrong), want here file er against loopback project add feature. me, makes perfect sense. issues may reported here: https://github.com/strongloop/loopback/issues

oracle - ORA-03111: Break received on communication channel -

i consistently getting error when connecting oracle db server - don't know version - using odp.net connector (v.4.121.2.0). have idea why? thanks oracle.manageddataaccess.client.oracleexception (0x80004005): ora-03111: break received on communication channel ---> oracleinternal.network.networkexception (0x00000c27): ora-03111: break received on communication channel @ oracleinternal.network.readerstream.read(orabuf ob) @ oracleinternal.ttc.orabufreader.getdatafromnetwork() @ oracleinternal.ttc.orabufreader.read(boolean bignoredata) @ oracleinternal.ttc.ttcdatatypenegotiation.readresponse() @ oracleinternal.serviceobjects.oracleconnectionimpl.dodatatypenegotiation() @ oracleinternal.connectionpool.poolmanager`3.get(connectionstring cswithdiffornewpwd, boolean bgetforapp, string affinityinstancename, boolean bforcematch) @ oracleinternal.connectionpool.oraclepoolmanager.get(connectionstring cswithnewpassword, boolean bgetforapp, string affinityinstance

Calling Twilio API from R using RCurl -

i trying send sms through twilio using r. following code works after sending sms, tries keep connection option. library(rcurl) twilio_account_sid <- "yourkey" twilio_account_token <- "yourtoken" number_from <- "+44*********" number_to <- "+44*********" the_url <- paste("https://api.twilio.com/2010-04-01/accounts/", twilio_account_sid,"/messages.xml",sep="") output <- postform(the_url, .opts = list( userpwd = paste(twilio_account_sid,":",twilio_account_token,sep=""), useragent = "rcurl", verbose = true ), .params = c(from = number_from, = number_to, body = "i sending test message" ) ) then message: < connection: keep-alive < *

android - Volley priority doesn't work properly -

i have make 2 calls volley. problem need done first call , second. calls on loop. put on first call priority.immediate , on second priority.low . second call done before first , doesn't have data need first call. missing? (int = 0; < sitedata.getsites().size(); i++) { firstcall(); secondcall(); } the firstcall method private void firstcall(){ jsonobjectrequest sitedatarequest = new jsonobjectrequest(request.method.get, url, null, new response.listener<jsonobject>() { @override public void onresponse(jsonobject response) { // json } }, new response.errorlistener() { @override public void onerrorresponse(volleyerror error) { volleylog.d(membership_id_tag, error.getmessage()); } }) { @override public priority getpriority() { return priority.immediate; } }; appcontroller.getinstance().addtorequestqueue(siteda

linux - Import .t3d file -

Image
i try import .t3d file seems there no default upload folder specified. i did research not able find out can specify path, don't understand why such folder necessary? can tell me how can fix can import t3d files? try create new folder under: fileadmin/user_upload/_temp_/importexport/ this export tool exporting .t3d files

asp.net - Blank pages from logged in views -

i have mvc application displays login page , reset password page fine, , when fill in reset password form, email gets correctly sent me. know database connection fine , web.config being read correctly. however, when log in application, blank page back. once have logged in, login & logout pages subsequently return blank. can open incognito tab , login & logout pages again, seems issue cookie/authentication - i.e. once logged in, it's sending cookie, somewhere in pipeline failing when validating(?) cookie. i should add website works fine on laptop when publish host, has behavior. i wanted make sure correct route/controller being used, created simple "test" controller & view. if navigate url http://www.example.com/test error: http error 500.19 - internal server error requested page cannot accessed because related configuration data page invalid. however, works correctly on localhost - i.e. when published have error. on localhost see correct view co

python - Retrieving the value of specific attribute using E Tree -

i have xml document through want ti retrieve value of specific attribute using e tree. below document-snippet have: -<orcid-message> <message-version>1.2</message-version> -<orcid-profile type="user"> -<orcid-identifier> <uri>http://orcid.org/0000-0001-5105-9000</uri> <path>0000-0001-5105-9000</path> i want retrieve value of 'path' have tried far: tree = et.parse(file) root = tree.getroot() element in root: all_tags in element.findall('.//'): if all_tags.text: print all_tags.text, '|', all_tags.tail what should value of 'path' you can use element class' find method path element wish pick out, example: import xml.etree.elementtree et tree = et.parse("filename") root = tree.getroot() path = root.find("orcid-profile/orcid-identifier/path") print(path.text)

Error in cloudwatch logs while attempting to indexing data in an Amazon ES cluster -

i'm following this tutorial automatically index dynamodb streams amazon elasticsearch service cluster created . i followed step step , created permissions policies. however, when testing, nothing indexed in amazon es cluster. when check cloudwatch, see log: ('error: ', 'traceback (most recent call last): file "/var/task/lambda_function.py", line 123, in lambda_handler return _lambda_handler(event, context) file "/var/task/lambda_function.py", line 219, in _lambda_handler post_to_es(es_payload) # post es exponential backoff file "/var/task/lambda_function.py", line 86, in post_to_es es_ret_str = post_data_to_es(payload, es_region, creds, es_endpoint, \'/_bulk\') file "/var/task/lambda_function.py", line 53, in post_data_to_es req = botocore.awsrequest.create_request_object(params) file "/var/runtime/botocore/awsrequest.py", line 314, in create_request_object request_object.context.update(r[\&#

Get image from Google Cloud Storage in App Engine -

i trying image in app engine backend , every time try get following error com.google.api.client.googleapis.json.googlejsonresponseexception: 503 service unavailable { "code": 503, "errors": [ { "domain": "global", "message": "java.io.ioexception: application default credentials not available. available if running in google compute engine. otherwise, environment variable google_application_credentials must defined pointing file defining credentials. see https://developers.google.com/accounts/docs/application-default-credentials more information.", "reason": "backenderror" } ], "message": "java.io.ioexception: application default credentials not available. available if running in google compute engine. otherwise, environment variable google_application_credentials must defined pointing file defining credentials. see https://developers.google.co