Posts

Showing posts from March, 2015

c# - Filter linq/entity query results by related data -

i'm using mvc5 ef6 , identity 2.1. i have 2 classes: public class incident { public int incidentid {get; set;} ...//title, description, etc public virtual icollection<followedincident> followedincidents { get; set; } public virtual applicationuser user { get; set; } } public class followedincident { public int followedincidentid { get; set; } public string userid { get; set; } public int incidentid { get; set; } public virtual incident incident { get; set; } public virtual applicationuser user { get; set; } } so, users have ability follow incident. (for starters, i'm not entirely sure if need icollection , public virtual relationship references, added them in case time being.) i'm trying create query show users results of followed incidents. in controller, query starts (i'm using troy goode's paging packa...

jquery - Dropzone Invalid Dropzone Element -

i'm trying setup dropzone on site, using example code given on dropzone website ( http://www.dropzonejs.com/bootstrap.html ). error: invalid dropzone element i can see 3 buttons load , disappear , empty div. <div class="sixteen columns omega"> <div class="page"> <div class="page-inner" id="dropzone"> <div class="table table-striped" class="files" id="previews"> <div id="template" class="file-row"> <!-- used file preview template --> <div> <button class="btn btn-primary start"> <i class="glyphicon glyphicon-upload"></i> <span>start</span> <...

oracle - need to retrieve records for the last 3 years in sub tasks -

i need retrieve records tables following condition between sysdate-1095 , sysdate in ssis package connects oracle database. however, data flow task hanging statement. when tried replacing line between sysdate-50 , sysdate , worked fine. i want break data flow task several tasks , replace above line of code in each of tasks such cover 3 years records. can please assist. these following lines correct if replace them in each of data flow tasks? and lab.detail_svc_date between sysdate-100 , sysdate -- data flow task1 , lab.detail_svc_date between sysdate-200 , sysdate+100 --data flow task2 , lab.detail_svc_date between sysdate-300 , sysdate+200 --etc , lab.detail_svc_date between sysdate-400 , sysdate+300 , lab.detail_svc_date between sysdate-500 , sysdate+400 , lab.detail_svc_date between sysdate-600 , sysdate+500 , lab.detail_svc_date between sysdate-700 , sysdate+600 , lab.detail_svc_date between sysdate-800 , sysdate+700 , lab.detail_svc_date between sysdate-900 , sysdate+800...

php - slow loading content via AJAX -

i have modal box in add content box via ajax ( data database ), here problem. content loaded slowly. happened open modal , after 4 or 5 sec appears content. i set content : $("#someidinmodal").html(""+datafromdatabase); so how think problem ? need buy better server? xd or there faster method this?

android - Retrieve data from database and display them to screen -

i want display data database screen in grip view not working. when ran nothing happens no error or log here code on mainactivity: db db = new db(this); // reading contacts log.d("reading: ", "reading contacts.."); list<contact> contacts = db.getallcontacts(); (contact cn : contacts) { string log = "id: "+cn.getid()+" ,name: " + cn.getname() + " ,time: " + cn.gettime(); // writing contacts log log.d("name: ", log); } db.getallcontacts(); gridview = (gridview) findviewbyid(r.id.gridview1); arrayadapter<string> adapter = new arrayadapter<string>(this, android.r.layout.simple_list_item_1, arrayofname); gridview.setadapter(adapter); gridview.setonitemclicklistener(new adapterview.onitemclicklistener() { public void onitemclick(adapterview<?> parent, view v, int position, long id) ...

c# - Row count of nested GridView is always zero -

parent grid-view gvagreement . child grid-view gvproducts . code used : protected void gvagreement_onrowdatabound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { string agreementid = gvagreement.datakeys[e.row.rowindex].value.tostring(); gridview gvproducts = e.row.findcontrol("gvproducts") gridview; gvproducts.datasource = getdata(string.format("select dbo.agreement.*, dbo.agreementlist.*, dbo.store.*, dbo.agreementlist.agreement_id agreid dbo.agreement inner join dbo.agreementlist on dbo.agreement.agreement_id = dbo.agreementlist.agreement_id inner join dbo.store on dbo.agreementlist.proid = dbo.store.pro_id (dbo.agreementlist.agreement_id = '{0}')", agreementid)); gvproducts.databind(); int count = gvproducts.rows.count; session["countgrid"] = count; } ...

MySQL batch-file call flush tables for export -

i use batch-file copy database server1 server2. step 1: call stored procedure flush tables table1,table2, ..., table1000 export; step 2: copy files .ibd , .cfg temp directory , archive step 3: unlock tables; the problem first step - files .cfg created , removed, unlock tables not called. why? files .cfg created , disappear, not have time copy .bat file command: mysql -u %db_user% -p%db_password% %db_name% --default-character-set=utf8 < stored_proc_flush_tables.sql file stored_proc_flush_tables.sql: drop procedure if exists stored_proc_flush_tables; delimiter // create procedure stored_proc_flush_tables ( ) begin declare t_name blob; declare tmp_query blob; declare done_tables int default 0; declare cursor_tables cursor select table_name information_schema.tables table_schema=db_name; declare continue handler not found set done_tables = 1; set @table_name = ''; set @tmp_query = ''; open cursor_tables; tables_loop: loop fetch c...

android - Left arrow in spinner -

im useing tutorial make custom spinner http://androidopentutorials.com/android-how-to-get-holo-spinner-theme-in-android-2-x/ has 2 issue me first , arrow(triangle) @ right , want bring left second , dropdown list aligned left of spinner , want aligend right of spinner have tryed edit drawable folder bring arrow left , cant tnx every body

mysql - Get rows with condition from 2 tables -

i need top 3 referrers along number of referrals qualified ones (table_2). hope makes sense. far have following query. please help. thank you select count(*) total_referrals, referrer table_1 table_2.qualified = '1' group referrer order total_referrals desc limit 0,3 table_1 referrer referral user1 user89 user1 user54 user1 user23 user1 user56 user2 user89 user2 user23 user2 user45 user3 user78 user3 user14 user4 user10 user5 user98 user5 user56 ... table_2 referral qualified user89 1 user54 0 user23 0 user56 1 user89 1 user23 1 user45 0 user78 1 user14 1 user10 0 user98 1 user56 1 ... you need reference both tables in clause , decide whether field name referrer or username: select count(table_1.referrals) total_referrals, referrer table_1 left join table_2 on table_1.referrals=table_2.referrals table_2.qualified = ...

iOS iPad simulator not working properly -

i have game settings landscape only. when run on iphone simulator in xcode, runs in landscape mode should. when run on ipad simulator, ipad doesn't go landscape mode when opens app. why , how can fix it? have looked answer unable find one. in addition landscape problem frames per second on ipad extremely low, @ 18 whereas iphone 6 30 , 4s 55, there anyway frame rate of bigger devices up? running xcode 6.4

sql - Selected columns that are not in group by -

i quetions sql. example have table name surname price adress john smith 100 adress123 alex martin 200 adress2 john smith 300 adress123 and want group records name same.and records prices must sum() write query this select sum(price),name total_price table1 group a.name but when want select other columns should group ... group a.name,a.surname,a.adress i want select columns without group by. want ask best way selecting other columsn without using group condition? i waiting result 200 alex martin adress2 210 john smith adress123 but don't want group surname , adress column you can arbitrary value rest of columns using min() or max() : select sum(price) total_price, name, max(surname) surname, max(address) address table1 group a.name;

javascript - Infragistics dropdown in row with value selected -

i have datasource contains status column. have array, part_status, contains possible statuses. is possible display dropdown menu in column part_status statuses , have correct option selected? <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="http://www.modernizr.com/downloads/modernizr-latest.js"></script> <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.js"></script> <script src="http://cdn-na.infragistics.com/jquery/20122/latest/js/infragistics.loader.js"></script> <script type="text/javascript...

python - How can i make the ship shoot bullets properly? -

i creating ship game can shoot down enemies , upgrade ship. have not done because have problem bullets. before started point out using python 2.7 , pygame 1.9. aware there later versions of pygame , python started writing before knew there later versions of pygame python 3.4. i point out basic coder , not know of advanced things yet. import pygame import time pygame.init() white = (255,255,255) black = (0,0,0) red = (255,0,0) green = (0,255,0) blue = (0,0,255) display_width = 800 display_height = 600 gamedisplay = pygame.display.set_mode((display_width,display_height)) pygame.display.set_caption('destroyer') clock = pygame.time.clock() fps = 60 font = pygame.font.sysfont(none, 25) shipw = 69 shiph = 88 #~~~~~~~~~~~~~~~~~~~other functions~~~~~~~~~~~~~~~~~# #~~~~~~~~~~~~~~~~~~~~~~the game~~~~~~~~~~~~~~~~~~~~~# def game_loop(): shipimg = pygame.image.load('ship1.png') face = 1 #the direction ship facing. #1 = north, 2 = east, 3 = s...

json - Frontend - Add new use jqGrid? -

i use jqgrid add new record, can't put data grid json string. when run, return code: error status: 'unsupported media type'. error code: 415 and code: $(document).ready(function () { jquery("#jqgriddemo").jqgrid({ url: 'http://192.168.1.59:8080/sunrise/api/v1/warehouse/getbyid/1', mtype: "get", contenttype: "application/json", datatype: "json", colnames: ['warehouseid', 'name' , 'fullname' , 'company', 'address'], colmodel: [ { name: 'warehouseid', index: 'warehouseid', width: 150,editable:false, editoptions:{readonly:true, size:10}, hidden:true}, { name: 'name', index: 'name', width: 150,editable:true, editoptions:{size:30}}, { name: 'fullname', index: 'fullname', width: 150,editable:true,editoptions:{size:30}}, { name: 'company', index: 'company', width: 150,editable:...

c# - Load Remote Authenticated Image in WinRT/UWP -

i trying load remote image in xaml requires authentication header download. currently i'm using own caching service download image using httpclient , store file disk. on subsequent loads, bind image absolute file path of cached file so: <image width="50" height="50" stretch="uniformtofill" horizontalalignment="center" verticalalignment="center" source="{binding cachedimagepath}"/> this works i'm not pleased time takes load image file. seems slower if use xaml caching. so questions are: 1) there way pass authentication header when bind image remote uri? 2) if not, can recommend quicker way load image disk how have it? this possible implementing iwerequestcreate . may need change app.config file adding class details implemented interface. hence whenever webrequest getting created g...

angularjs - Angular $http appears to make two server calls -

i'm using angulars $http make calls backend services. can't figure out why ui appears make 2 calls services. navigate angular partial using ui-router so $stateprovider.state('new/client', { url: '/client/new', templateurl: globalcontextpath + '/javascripts/partials/modals/client/new.html', controller: 'newclientmodalcontroller' }) once in partial , controller initialize bit of data. var vm = this; var retrieveservers = function () { appserverfactory.list() .then(function (success) { $log.debug(success); vm.appserverlist = success.data; (var = 0; < vm.appserverlist.length; i++) { if (vm.appserverlist[i].defaultitem == true) { vm.clientservers.push(vm.appserverlist[i]); } } }); }; retrieveservers(); the factory function itself factory.list = function () { return $http.get(globalco...

null - Android getting JSONObject Exception -

i'm getting jsonobject exception in cases twitter value in json object media null in below code, though check make sure i'm not assigning value if is. way checking correct? or how can avoid code throwing exception , allow me check if twitter value there or not? if(nextactivityobject.getjsonobject("media") != null){ media = nextactivityobject.getjsonobject("media"); log.d("next media object not empty", media.tostring()); if(media.getstring("twitter") != null && media.getstring("facebook") != null){ log.d("both not null", "both not null"); twitter = media.getstring("twitter"); facebook = media.getstring("facebook"); intent.putextra("twitter", twitter); intent.putextra("facebook", facebook); } else if(media.getstring("twitter") != null){ twitter = media.getstrin...

file - gnuplot unable to output images -

i tried following code , expected image sequence produced, when ran it, no files generated. reset set terminal png size 640, 480 set dummy x [i=1:12] { set output sprintf('sumofsinusoids.%03.0f.png', i) plot sin(x) } i suspect plot function creating problem.

java - Libgdx dim screen with glClearColor -

i want draw background, overlay 0.5f transparent black color dim , render on top of pause menu. i have tried: gdx.gl.glclearcolor(0f, 0f, 0f, 0.5f); gdx.gl.glclear(gl20.gl_color_buffer_bit); and nothing working. couldn't find solution online. other option overlay black sprite, don't want that. there anyway paint on gl? well, draw transparent rectangle gdx.gl.glenable(gl20.gl_blend); gdx.gl.glblendfunc(gl20.gl_src_alpha, gl20.gl_one_minus_src_alpha); shaperenderer.begin(shaperenderer.shapetype.filled); shaperenderer.setcolor(new color(0, 0, 0, 0.5f)); shaperenderer.rect(0, 0, screenwidth, screenheight); shaperenderer.end(); gdx.gl.gldisable(gl20.gl_blend); hope helps

Access Clipboard Data programmatically with C on Linux platform -

i have tried looking ways access linux clipboard (access , modify clipboard) there no clear solution problem. have seen these post , 1 , 2 and tried solution, find either windows solution or osx solution problem. there formal way solve problem? thank much. the clipboard in linux not work similar how works under windows , os x. there no separate storage it, rather x selection 1 application "owns" , transfer data when requested. if wanted modify contents need request current selection contents, modify that, , make available in application new clipboard.

java - Accessing Google oAuth giving invalid grant_type (Bad request) -

i searched lot in so, skim through many questions regarding same error, applied whatever suggested, nothing turned out. hence writing here. i learning how make call google api (say google calendar api). going through google developers tutorial https://developers.google.com/identity/protocols/oauth2serviceaccount so have created service account in google, created credentials (i want invoke google api own application). after create jwt, singed jwt private key shared google, , making rest post call oauth. here code public class testgoogleapi { public static void main(string[] args) throws exception{ string header = "{\"alg\":\"rs256\",\"typ\":\"jwt\"}"; long time = calendar.getinstance().gettimeinmillis()/1000; string claimset = "{\"iss\":\"xxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com\"," + "\"scope\":\"https://www.googleapis.com/auth/c...

c# - Save ID instead of Name -

i have stored country name. instead of that, want store country id. here code:- if (!string.isnullorempty(mkey)) { insertupdatequery = "update b_order_new set shipname = :shipname, shipcity = :shipcity, shipaddress = :shipaddress, " + "shipcountry = :shipcountry, orderdate = :orderdate, sent = :sent mkey = :mkey"; } else { insertupdatequery = "insert b_order_new (mkey, shipname, shipcity, shipaddress, shipcountry, orderdate, sent) " + "values(:mkey, :shipname, :shipcity, :shipaddress, :shipcountry, :orderdate, :sent)"; } oraclecommand cmd = new oraclecommand(insertupdatequery, myconn); var orderedon = datetime.parseexact(orderdate, "dd/mm/yyyy", null); cmd.parameters.add("mkey", oracletype.number).value = decimal.parse(mkey).tostring(); cmd.parameters.add(...

magento 1.9 - Category products not found -

whoops, our bad... page requested not found, , have fine guess why. if typed url directly, please make sure spelling correct. if clicked on link here, link outdated. what can do? have no fear, near! there many ways can on track magento store. go previous page. use search bar @ top of page search products. follow these links on track! store home | account. i these errors in magento. how should solve this? check in 'url rewrite' created urls correct, in column 'url requested' because puts extensions 'htm, html ...) or perhaps have special character.

mysql - PHP OOP while loop -

i had problem looping data mysql using oop style. so, here code: class mysql { private $host; private $username; private $password; private $database; public $con; public function connect($sethost, $setusername, $setpassword, $setdatabase) { $this->host = $sethost; $this->username = $setusername; $this->password = $setpassword; $this->database = $setdatabase; $this->con = mysqli_connect($sethost, $setusername, $setpassword, $setdatabase); } public function query($setquery) { $query = mysqli_query($this->con, $setquery); return $query; } public function fetch($setfetch) { $fetch = mysqli_fetch_assoc($this->query($setfetch)); return $fetch; } } $objmysql = new mysql(); $con = $objmysql->connect("localhost" , "root" , "root" , "test"); while ($dataslideshow = $objmysql->fetch("select...

php - How to Call Static Function In Symfony2 Twig Template -

how call static function in twig template without passing through controller? for example: ... {{ mystaticclass::getdata() }} ... my static class: class mystaticclass { const v1 = 'value1'; const v2 = 'value2'; ... public static function getdata() { ... return $data; } } you cannot directly call php in twig template. you'll need create filter or function you're looking. $twig = new twig_environment($loader, $params); $twigfunction = new twig_simplefunction('mystaticclass', function($method) { mystaticclass::$method }); $twig->addfunction($twigfunction); then in twig template do: {{ mystaticclass('getdata') }} of course above example assumes mystaticclass within scope of wherever you're twig. symfony example you must create twig extentions. example below: namespace purpleneve\web\pnwebbundle\extensions; use purpleneve\web\pnwebbundle\dependencyinjection...

how hide/show JRibbonBand of RibbonTask by a JCommandToggleButton of another RibbonTask in flamingo java -

i created 2 ribbontask in jribbonframe , each of them has jribbonband, want hide/show specific jribbonband of ribbontask jcommandtogglebutton of ribbontask. use this.getribbon().gettask(0).getband(1).setvisible() but when click on ribbontask see ribbontask again. please me

php - Script to retrieve position of an element on a web page -

i know there javascript getboundingclientrect() retrieve position of element on web page, need write script (preferably in php) take list of url , retrieves position of specific element on every page (an <a href="specificurl"> ). the position expressed in px, or "it's in header", "it's in footer", "it's in sidebar" (that way it's better purpose). there method in "simple" way? look web scraper such guette , simple html dom or curl / libcurl . not "simple". see related question: screen scraping technique using php .

java for loop sum and average of range -

i have calculated sum of loop range, not know how count , average solution. must done without ifs. loop: //defining variables // constants & variables here int i; int numstart; int numend; double sum = 0; double average=0; double loopcount=0; system.out.print("enter start number: "); // keep print line open numstart = console.nextint(); system.out.print("enter end number: "); numend = console.nextint(); //enter thevalue (i = numstart; <= numend; i++ ) { sum = sum + i; loopcount = numend - numstart; average = sum+1 / i; } system.out.println(); system.out.println( "sum is: " + sum); system.out.println(); system.out.println( "average is: " + average); system.out.println(); (i = numstart; <= numend; i++ ) { sum = sum + i; loopcount++; } average = sum / loopcount;

r - Comparing Linear Models with Multiple Interactions -

for assignment, needing determine linear model interaction terms data set , can manually creating different linear models , performing anova test. what wondering if there function within r check possible combinations of linear model interactions given main effects model? (a function similar same way handles stepwise variable selection) i've had knowledge of r isn't strong , may have browsed past function. first column dependent variable(y)(mainclass) , make possible linear regression models. there 3 independent variables(x,y , z). mainclass ~ x , mainclass ~ x+y , mainclass ~ y+z , other combinations explored. --code description creating data frame first column mainclass , other columns variable finding column names excluding first column(mainclass) having combination of column numbers having combination of formulas used in linear regression building linear regression df<- data.frame(mainclass=1:10,x=rnorm(10,3,1),y=seq(4,40,4),z=seq(100...

javascript - Pass a variable to a service with AngularJS? -

i building app track movies , info, new angular, , cant not sure how pass variable service. want url variable instead of hardcoded. whats best way it? tmdb.service('tmdbservice', function($http, $q){ var deferred = $q.defer(); $http.get('https://api.themoviedb.org/3/movie/popular?api_key=jkhkjhkjhkjh').then(function(data){ deferred.resolve(data); }); this.getmovies = function(){ return deferred.promise; } }); tmdb.controller("tmdbcontroller", function($scope, tmdbservice){ var promise = tmdbservice.getmovies(); promise.then(function(data){ $scope.movies = data; // console.log($scope.movies); }) }); there no need (in case) use $q.defer() because $http returns promise. so, service code can simplified to: tmdb.service('tmdbservice', function($http){ this.getmovies = function(){ return $http.get('https://api.themoviedb.org/3/movie/popular?api_k...

select - R: obtaining subset of a column that matches a certain criteria -

let's have table of data of students in school. want @ family size of students male (1) , @ least considered "tall". how in r? i can seem figure out how column of family size of students, student_data$family_size , can't figure out how narrow down further. family_size ... gender ... height 1 6 1 tall 2 3 0 tall 3 5 1 tall 4 4 1 tall 5 10 0 short 6 2 1 average so want: family_size 1 6 2 5 3 4 i'm not sure how indexing turn out, maybe corresponds original indexing of first table, that's not important. also, i'm not sure if i've uploaded data frame or not, when execute typeof(student_data) , returns "list" we can use subset . has subset , select argument pass logical index subset rows , select columns based on column index or name r...

html - Can I overwrite pre-inserted text etc on a generated page? -

ok here goes; the developer of our hotel booking software has guest registration form pre-formatted our use. i have found can add additional items using css in 1 of custom boxes "guest questions" - has allowed me add custom text areas lined boxes around text. so, has got me thinking - there way remove or obscure pre-formatted text on form, , replace own custom requirements? the form isn't used other printing , guest signing, doesnt have search engine friendly or that. any suggestions please ? ps have asked developer if make changes affect if aren't keen (i that). this code ive used add custom areas - id love control whole registration form layout. <style> * { box-sizing: border-box; } .terms { width: 49%; height: 260px; float: left; padding: 10px; border-style: solid; } .staff { width: 49%; height: 260px; float: right; padding: 10px; border-style: double; } ul.b { list-style-type: square; } ...

css - How I can consider resolution for design -

this question has answer here: media queries: how target desktop, tablet , mobile? 10 answers i want design responsive webview application based on ionic 2. in css use px unit think not consider resolution. anyway design based on this? by using @media queries within css, can find "px" measurement of devices accessing pages. each query, css can modified displayed differently. please see attached w3schools link explanation of uses. https://www.w3schools.com/css/css_rwd_mediaqueries.asp the following github repository provides template of media queries of can used allow many device types , resolutions. https://gist.github.com/marcobarbosa/798569 for example: @media screen , (min-width : 321px) { /* insert styles here */ } if resolution width (in px) @ minimum of 321px, styles within used. click following link , resize result frame. g...

javascript - How to make pass a test case which use enzyme shallow with contains when a React component has an event handler -

i cannot make pass test use .contain when react component has event handler. examples: foo.js const foo = react.createclass({ render () { return ( <p onclick={() => {}}>i not smart component...</p> ) } }) export default foo foo.test.js import react 'react' import { shallow } 'enzyme' import foo './foo' describe('<foo />', () => { it('renders <p> static text', () => { const wrapper = shallow(<foo />) console.log(wrapper.debug()) expect(wrapper.contains(<p>i not smart component...</p>)).tobe(true) }) the console result when using .debug() is <p onclick={[function]}> not smart component... </p> please note onclick={[function]} i tried change test case to: describe('<foo />', () => { it('renders <p> static text', () => { const wrapper = shallow(<foo />)...

python - Prevent buffer from closing -

i'm creating script output information in separate buffer: def create_buffer(): global buffer if not buffer: buffer = weechat.buffer_new( 'vk', 'buffer_input_cb', 'main window %s script' % script_name, 'buffer_close_cb', '' ) def buffer_input_cb(data, buffer, input_data): return weechat.weechat_rc_ok def buffer_close_cb(data, buffer): return weechat.weechat_rc_ok i need buffer openned, user can type /close , not good. can open new buffer in x seconds after buffer_close_cb called or try open when calling weechat.prnt function, cancel buffer closing if it's possible

regex - What is the use of ,/^}/ when searching through Git using regular expression? -

Image
i'm learning git following book "progit 2nd edition". in section discussing "git log -l", author mentioned i understand string between '/ /' treated regular expression, wondering ,/^}/ there for? i had query git log -l '/mymethodname/':myjavafilename , worked expected. why did author included ,/^}/ ? /pattern1/,/pattern2/ defines range of lines between 2 patterns. /^}/ means line starts }

How do you know how to import libraries in aurelia-cli -

how these guy's/gal's figure out how import library blog instructions for? not easy since there many blogs giving examples of importing libraries not how figured out. let's @ few libraries. how figure out how libraries imported in aurelia.json? examples: 1) "bootstrap" understand jquery deps , resources bootstrap.css include in non-module system. how did know export @ less export $ instead of "insert-something"? { "name": "bootstrap", "path": "../node_modules/bootstrap/dist", "main": "js/bootstrap.min", "deps": [ "jquery" ], "exports": "$", "resources": [ "css/bootstrap.css" ] }, 2) "jquery" imported "jquery" in aureia.config. think read importing 1 file do...

Declare env variable which value include space for docker/docker-compose -

i have env variable value this: test_var=the value do knowns whether legal? should place " around value interpreted needed in docker? thanks edit : quotation marks not solution part of val see reference here . lets see result running following compose file: version: "3" services: service: image: alpine command: env env_file: env.conf env.conf: test_var1=the value test_var2="the value2" docker-compose up result: service_1 | path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin service_1 | test_var2="the value2" service_1 | test_var1=the value service_1 | home=/root therefore, legal have spaces in env value.

php - mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 to be resource or mysqli_result, boolean given -

i trying select data mysql table, 1 of following error messages: mysql_fetch_array() expects parameter 1 resource, boolean given or mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given this code: $username = $_post['username']; $password = $_post['password']; $result = mysql_query('select * users username $username'); while($row = mysql_fetch_array($result)) { echo $row['firstname']; } the same applies code $result = mysqli_query($mysqli, 'slect ...'); // mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given while( $row=mysqli_fetch_array($result) ) { ... and $result = $mysqli->query($mysqli, 'selct ...'); // call member function fetch_assoc() on non-object while( $row=$result->fetch_assoc($result) ) { ... and $result = $pdo->query('slect ...', pdo::fetch_assoc); // invalid argument supplied foreach() foreach( $result $row ) { ... and ...

html - Not able to fetch User details in JSP -

i'm fetching details based on email id wrote following code <% string patientid=request.getparameter("patientid"); preparedstatement pst = con.preparestatement("select email,patientname,patientid patient patientid='"+patientid+"'"); resultset rst= pst.executequery(); string email=null; %> <%while(rst.next()){ email = rst.getstring(1); }%> <% preparedstatement ps = conn.preparestatement("select weight, height, bp, sugarb4,sugaraftr,eyelow,eyehigh,chol,time measurements email='"+email+"'" ); resultset rss=ps.executequery(); %> <%while(rss.next()){%> <table> <tr><td>weight</td><td><input type="text" value="<%=rss.getstring(1)%>" disabled/></td> ...

javascript - Notice: Use of undefined constant database_name - assumed 'database_name' in C:\xampp\htdocs\visitor\index.php on line 97 -

this question has answer here: mysqli_fetch_array()/mysqli_fetch_assoc()/mysqli_fetch_row() expects parameter 1 resource or mysqli_result, boolean given 33 answers php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers please assist me; making page able see visitors of website through ip addresses using php, javascripts msql, getting lot of errors when try execute codes below. not know issue here. please help! here errors getting: notice: use of undefined constant database_name - assumed 'database_name' in c:\xampp\htdocs\visitor\index.php on line 97 warning: mysql_num_rows() expects parameter 1 resource, boolean given in c:\xampp\htdocs\visitor\index.php on line 105 warning: ...

angular - Pass md2 datepicker value to api -

basically why i'm making post because want understand better md2 datepicker working principles. didn't see examples previously. task me @ moment make datepicker(time format) user can select time, , should passed afterwards rest api , been stored in database column (format: time -- looks : 00:34:02.000000). datepicker (angular2) code im executing datepicker(which shows time correctly) <md2-datepicker [(ngmodel)]="user.birthday" name="enabled_from_time" [type]="'time'" [format]="'hh:mm'" placeholder="{{ 'extensions.add_new_extension.enabled_from_time' | translate }}" fxflex="49%" ></md2-datepicker> but when i'm trying debug shows message : invalid date also tried add method (event) settime($event){ this.user.birthday = moment($event).format('h:mm'); } ...

c# - Program version -

this question has answer here: best practice: software versioning [closed] 12 answers what i'm asking maybe little weird there rule in changing .net program version when you're adding new features? to more clear: you have initial c# program , add few new features it. your initial version 1.0.0.0, update 1.1.0.0 is how works? or has how bigger change? example: changed whole ui design (v1.0.0.0 updates v1.1.0.0) fixed little bug (v1.0.0.0 updates v1.0.0.1) any answer welcome!! use semantic versioning: given version number major.minor.patch, increment the: major version when make incompatible api changes, minor version when add functionality in backwards-compatible manner, , patch version when make backwards-compatible bug fixes. additional labels pre-release , build metadata available extensions majo...

php - Specifying that parameter is a database in the constructor -

in following code: protected $db; public function __construct(database $db) { $this->db = $db; } what point in specifying parameter $db database if can name whatever want , still work? that's type declaration. manual : type declarations allow functions require parameters of type @ call time. if given value of incorrect type, error generated: in php 5, recoverable fatal error, while php 7 throw typeerror exception. to specify type declaration, type name should added before parameter name. declaration can made accept null values if default value of parameter set null . so, if didn't specify type declaration $db in code, instantiate class null argument, cause object's $db parameter set null : $object = new classname( null ); by specifying single parameter constructor must of type database , php throw error (or exception in php 7) if pass other database object. example: $object = new classname( nul...