Posts

Showing posts from May, 2015

xslt 1.0 - Unable to Successfully Pass Parameters to xsl:call-template -

i have generic template i've designed 2 params title , category . <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fo="http://www.w3.org/1999/xsl/format"> <xsl:param name="category" /> <xsl:param name="title" /> <xsl:template name="test-group"> <fo:block> <xsl:value=of select="$title" /> </fo:block> <fo:block> <xsl:value-of select="$category" /> </fo:block> </xsl:template> </xsl:stylesheet> in parent template have following: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fo="http://www.w

android studio - Trying to convert projects that werent built using Gradle -

Image
i have tried clone following repository on github using android studio, https://github.com/alexkang/favr.git , have error: before selected build project using gradle , accepted wanted install. having similar problems with, https://github.com/mb16/remindem.git , that each time selected "create project existing sources" , accepted suggested. what doing wrong? the projects have eclipse .classpath files in folder. i'm guessing should able import project eclipse. as alternative using eclipse might want try using feature of intellij idea (android studio's parent project). file > new > project existing sources... select .project file import

visual studio 2013 - Remote debugging Ax 2012 IL code -

i'm trying remote debugging working aos. breakpoints never hit due symbols not being loaded. 'ax32serv.exe' (clr v4.0.30319: x++ il app domain): loaded 'd:\program files\microsoft dynamics ax\60\server\myaos\bin\xppil\dynamics.ax.application.dll423.netmodule'. cannot find or open pdb file. i have debugging symbols setup to: \server\d$\program files\microsoft dynamics ax\60\server\myaos\bin\xppil but visual studio never loads symbols cache. i'm running visual studio administrator my client configuration settings linked correct aos i'm connecting aos aos-account i'm local administrator on aos server debugging options checked on server configuration any idea i'm missing or not doing correctly? procmon telling me devenv.exe process can't access below path (path_not_found). i'm clueless on why it's trying access path. \server\d$\program files\microsoft dynamics ax\60\server\myaos\bin\xppil\dynamic

html - Dropdown default values return null? -

i have html in jsp ask simple questions, having drop-down boxes users select responses. set default responses incase decide hit next null returned. jsp: <div id="startqrtquestion" align="left">1) when did first arrive here?</div> <div id="startqrtresponse" align="left"> <select name="quarterstart"> <option value="summer">summer quarter</option> <option value="fall" selected="selected">fall quarter</option> </select> </div> <div id="programquestion" align="left">2) program taking?</div> <div id="programresponse" align="left"> <select name="programselect"> <option value="bscs" selected="selected">bscs</option>

.net - import wpf to IronPython app -

i'd making ironpython wpf app' vs says: importerror: no module named 'wpf' i tried this link doesn't work. not sure doing this: import clr clr.addreference('ironpython.wpf') import wpf when write says importerror: no module named 'clr' first might not want have import , else on same line. put imports before whatever calls function making! import clr import wpf clr.addreference('ironpython.wpf') and believe file should in same directory .addreference() locate it. far know, latest ironpython 2.7 should come prepackaged wpf, again version might differ. recommend update latest, or download modules missing , drop them in ironpython repository @ appropriate location! hope helps!

jquery - Display text on button and change color of the button Kendo UI -

i want display text on button based on value database. so, button text varies in each row(ex: in service, expired, 30 days expire). 1) how can display text in button in kendo row ? 2) want change color of button based on above 3 values. (ex: in service - green, expired - red, 30 day expire - yellow) i want display button in custom command button in below code how can ? @(html.kendo().grid(model) .name("grid") .columns(columns => { columns.bound(c => c.username).title("user").filterable(false); columns.bound(c => c.role).title("role"); //columns.command(command => command.custom().click("showdetails")); }) .htmlattributes(new { style = "height: 500px;" }) .sortable() .scrollable(x => x.height(400)) .filterable() .pageable(x => x.enabled(true).previousnext(false).pagesizes(true))

javascript - protractor 3.0.0 and cucumber automated testing -

i using protractor, cucumber , chai/chai-as-promised automated tests. current code using protractor 1.8.0 , update recent version. problem recent version of protractor doesn't support cucumber. to use cucumber framework, protractor ( http://angular.github.io/protractor/#/frameworks ) points using protractor-cucumber-framework ( https://github.com/mattfritz/protractor-cucumber-framework ). have tried integrating current code , smaller example projects no luck @ getting them working. main error is: error: step timed out after 5000 milliseconds @ timer.listontimeout (timers.js:92:15) i have tried changing default timeout globally cucumber suggests by:// features/support/env.js var configure = function () { this.setdefaulttimeout(60 * 1000); }; module.exports = configure; but seem missing setup. so, know of example can show me proper setup new protractor/cucumber framework? if not, know of example shows how change default timeout globally? you should a

c++ - Clicking in ALSA tone generator -

Image
i'm learning use alsa on raspberry pi 2. i've written small test program in c++ generate 440 hz test tone. makes tone, there clicking sound twice per second in tone. does have idea why might happening? code below. #include <cmath> #include <climits> #include <iostream> #include <alsa/asoundlib.h> #include "definitions.hpp" using namespace std; int main() { int ret; snd_pcm_t* pcm_handle; // device handle snd_pcm_stream_t stream = snd_pcm_stream_playback; snd_pcm_hw_params_t* hwparams; // hardware information char* pcm_name = strdup("plughw:0,0"); // on-board audio jack int rate = 48000; const uint16 freq = 440; long unsigned int buffersize = 8192*4; const uint32 len = buffersize*100; const float32 arg = 2 * 3.141592 * freq / rate; sint16 vals[len]; for(int = 0; < len; = + 2) { vals[i] = shrt_max * cos(arg * / 2); } snd_pcm_hw_params_alloca(&hwpara

ios - How do I resolve linker warning "ignoring linker optimzation hint at" in XCode? -

a google search "ignoring linker optimzation hint" practically turns nothing. note: "optimzation" exact spelling :) i'm using 3rd party webrtc library (libjingle_peerconnection) pristine in 1 of apps , warnings when build iphone 6. i'm not sure if warning pop other devices, however, not appear when build simulator. i have 68 of these bad boys in build output: ld: warning: ignoring linker optimzation hint @ _cftmdl_128_neon+0xf0 because ldrinfoc.offset == 0 i'm not sure if should notify maintainers or if can resolve myself. if you're compiling webrtc library using build scripts, warnings generated because of missing parameter in gyp_defines . in order fix warnings, webrtc library needs compiled again parameter clang_xcode=1 in gyp_defines setting, below (only example): export gyp_defines="$gyp_defines os=ios target_arch=arm64 clang_xcode=1" more issue can found here, on chromium forums: https://bugs.chromium.

c++ - Implementation of map - how to differ two ends of the map in iterator -

iterator implementation: class iterator { private: node<pair>* _ptr = nullptr; public: iterator(node<pair>* ptr = nullptr) : _ptr(ptr) { } iterator(const iterator& itr) = default; ~iterator() = default; iterator& operator=(const iterator&) = default; iterator operator++(int) { node<pair> *cur = this->_ptr; if (this->_ptr) { this->_ptr = _ptr->next(); } return cur; } iterator& operator++() { if (this->_ptr) { this->_ptr = _ptr->next(); } return *this; } pair& operator*() { if (!this->_ptr) { throw mapelementnotfoundexception(); } return this->_ptr->data();

Matlab Scatter Plot Color Scheme -

good evening, i'm still new matlab (and stack overflow) i've got set of data want plot "plot" command. have 9 days of data plot. preferably each day having it's own color. after looking online, matlab has 8 pre-built colors, 2 of them being white , yellow. (and yellow doesn't show on white background) i've looked online , tried passing "color" command rgb combo, breaks well. i've had resort changing first , last day different shape, works now, isn't presentation worthy. first data point , last data point need own color. +,x,* represent number of launch occurred day. attached script. many in advance. reid %-------------------------------------------------------- % define model_point array %-------------------------------------------------------- point_model = [0.0112, 0.2147, 0.295, 0.0356, 0.0912, 0, 0, 0.0738, 0.2143, 0.0798, 0.0169, 0.089, 0, 0, 0.1644, 0.065, 0.2271, 0.0727]; %---------------------------

Python Variable Division -

i've been making python program suppose counts how many seconds takes python 2 make 100 cycles, , i've decided @ end convert hz. requires me change second count 1, i've decided easiest dividing itself. note time equates end - start: time / time pretty simple. problem is, doesn't seem work: time variable remains same. i've tried using 2 slashes, putting 'float' in front , surrounding 2 variables, , have future import division in, none seem work. suggestions? thanks, oisin note: time variable not integer, , i'd rather not have truncated. if solution, tell me anyway, i'm thankful help. you need time , define time. work: time = 1 print time/time #output 1 if have statement variables aren't defined , don't use in someway, nothing happen. division can performed / long don it. time/time #nothing time/time + 1 #nothing var = time/time #var becomes result print time/time #prints result also, don't name variable

httpserver - How to serve a folder at a specific context using Python's SimpleHTTPServer -

i want serve contents of folder on different context. example: have folder called "original" index.html in on windows box. if cd folder type in this, python -m simplehttpserver now can access index.html http://127.0.0.1:8000/index.html how can write custom python script can serve same index.html file @ http://127.0.0.1:8000/context/index.html sth this, need parse request path parts if need more refined approach (adapted test python server, use needed): # simple custom http server class testhandler(http.server.simplehttprequesthandler): def do_get(self): # if main path requested # load template , output if self.path == "/" or self.path == "": out = contemplate.tpl('main', main_template_data) self.send_response(200) self.send_header("content-type", "text/html") self.send_header("content-length", str(len(out)))

r - Comparative Histograms Separated by Factor -

have assignment need provide one-dimensional graphs eda sample code given answers of requirements (simple scatter , box plots , histogram) trying "spice up" little creating more interesting graphs. need couple. the data set twin iq data across several studies/authors , wanting back-to-back histogram of twins separated author. far can overlay of authors or back of twins using ggplot stuck when trying separate in either 4 graphs or overlaid back-to-backs. the code using overlay ggplot either geom_density or geom_histogram , code back-to-back came r-bloggers , used first snippet: ggplot(df, aes(iq)) + geom_histogram(aes(x = x1, y = ..density..), fill = "blue") + geom_histogram( aes(x = x2, y = -..density..), fill = "green") what looking way combine these 2 techniques or how ggplot split graphs factor in same plot/lattice when do, example: bwplot(y~x1.x2|author, data=df) the snippet using achieve separate plots includes facet_grid() s

Set php variable to string -

i have this: $rm = json_decode($room_list[0]['room']); and want set variable $string include result of echo of above variable. example, if: echo json_decode($room_list[0]['room']; echos: lorem ipsum <a href="www.google.com>gg</a>. i want string be: $string = 'lorem ipsum <a href="www.google.com>gg</a>.' how can that? it looks you're trying this: how use json.stringify , json_decode() properly so basically, take stripslashes(htmlspecialchars(json_data)) answer , put $rm = in front :)

php - Adding ACF field to post meta -

i found code controlling posts need edit: $img = ( $mode == 'top' ) ? get_the_post_thumbnail( null, 'large' ) : get_the_post_thumbnail( null, 'medium' ); $the_image = sprintf( '<span class="c_img">%s</span>', $img ); $thumb_link = sprintf( '<a class="%s" href="%s" rel="bookmark" title="%s %s" style="%s">%s</a>', $classes, get_permalink( $post ), __( 'link to', 'pagelines' ), the_title_attribute( array( 'echo' => false ) ), $style, $the_image ); $output = ( 'top' == $mode ) ? sprintf( '<div class="full_img fix">%s</div>', $thumb_link ) : $thumb_link; return apply_filters( 'pagelines_thumb_markup', $output, $mode, $format ); } that outputs this: <span class="c_img"><img src="example image"></span> i need insert custom acf (a

python - Scrape data from reduced table -

using beautiful soup , isolating web source data inside 'p' tag, managed retrieve data need. now, i'd iterate on remaining data inside variable 'table' (over each row , each cell) scrape data list. can me how achieve this? i've read several other posts not able apply specific issue... thanks. from bs4 import beautifulsoup import urllib2 url = "http://www.gks.ru/bgd/free/b00_25/isswww.exe/stg/d000/000715.htm" page = urllib2.urlopen(url) soup = beautifulsoup(page.read(), 'html.parser') table=soup.findall('p',text=true) print(table) assuming want per-month price data, need find tr elements inside table , skip first 3 (header rows). note that, html.parser did not work me, lxml did (see differences between parsers ): soup = beautifulsoup(page, 'lxml') # requires 'lxml' installed table = soup.find("center").find("table") row in table.find_all("tr")[3:]: cells = [cell.get

python - Joining strings. Generator or list comprehension? -

consider problem of extracting alphabets huge string. one way is ''.join([c c in hugestring if c.isalpha()]) the mechanism clear: list comprehension generates list of characters. join method knows how many characters needs join accessing length of list. other way is ''.join(c c in hugestring if c.isalpha()) here generator comprehension results in generator. join method not know how many characters going join because generator not possess len attribute. way of joining should slower list comprehension method. but testing in python shows not slower. why so? can explain how join works on generator. to clear: sum(j j in range(100)) doesn't need have knowledge of 100 because can keep track of cumulative sum. can access next element using next method on generator , add cumulative sum. however, since strings immutable, joining strings cumulatively create new string in each iteration. take lot of time. when call str.join(gen) gen generator

glsl - Issues when simulating directional light in OpenGL -

Image
i'm working on opengl application using qt5 gui framework, however, i'm not expert in opengl , i'm facing couple of issues when trying simulate directional light. i'm using 'almost' same algorithm used in webgl application works fine. the application used render multiple adjacent cells of large gridblock (each of represented 8 independent vertices) meaning vertices of whole gridblock duplicated in vbo. normals calculated per face in geometry shader shown below in code. qopenglwidget paintgl() body. void openglwidget::paintgl() { glclear(gl_color_buffer_bit | gl_depth_buffer_bit); glenable(gl_depth_test); glenable(gl_cull_face); m_camera = camera.tomatrix(); m_world.settoidentity(); m_program->bind(); m_program->setuniformvalue(m_projmatrixloc, m_proj); m_program->setuniformvalue(m_mvmatrixloc, m_camera * m_world); qmatrix3x3 normalmatrix = (m_camera * m_world).normalmatrix(); m_program->

Invalid Syntax When Creating Python Dictionary -

this part of project class on python scripting in arcgis. i have created dictionary in python script according data structure . here code have written. id = { 'name': { 'first', 'middle', 'last' }, 'age': { '22' }, 'oit': { 'title', 'address': ['strnum','street'], 'email', 'phone': ['area code', 'exchange', 'number'] }, 'home': { 'title', 'address': ['strnum', 'street'], 'email', 'phone': ['area code', 'exchange', 'number'] } } when run code says "failed run script - syntax error - invalid syntax". doens't tell me , can't seem find it. , won't let me debug either throws same error. syntax error? your dictionary riddled synta

python - Cannot import NavigationToolbar from matplotlib.backends.backend_gtk -

i'm running program received friend i'm not able solve error. initial part of code is: import matplotlib matplotlib.use('gtk') matplotlib.figure import figure matplotlib.axes import subplot matplotlib.backends.backend_gtk import figurecanvasgtk, navigationtoolbar, navigationtoolbar2gtk numpy import zeros import gtk import gtk.glade import scipy import scipy.interpolate import scipy.io when try run code, receive error: file "analeem.py", line 11, in <module> matplotlib.backends.backend_gtk import figurecanvasgtk, navigationtoolbar, navigationtoolbar2gtk importerror: cannot import name navigationtoolbar i'm running code under ubuntu, matplotlib installed. thanks in advance, matteo

save - Compiled Matlab mat file corruption -

i have compiled application cannot save user defined objects. when try load mat file in program crashes access violation error. mat file cannot loaded in matlab either (appears corrupt). however, application runs smoothly before compilation. possible causes this? classdef audio < handle properties ... end methods function self = audio() ... end end end = audio(); b = audio(); c = audio(); audiovector = [a,b,c] save(somefullpath, 'audiovector')

Getting error saying that my program has crashed in C even though it show no issue with the syntax -

i confused why program keeps on crashing. using code blocks , open source ide. here code: int main() { int age; char gender; printf("what age?\n"); scanf(" %d", age); printf("what gender? \(m/f)\n"); scanf(" %c", gender); if (age>=18){ printf("access granted! please proceed\n"); if (gender == 'm'){ printf("what's dude?"); }; if (gender == 'f'){ printf("how's going dudette?"); }; }; if (age<18){ printf("access denied. please on life.\n"); }; return 0; } scanf requires pointer variable you're setting. so, need do: scanf(" %d", &age); and similar gender

osx - password-store with git submodules -

git submodules in pass work quite using different sets of passwords. issue cannot issue git submodule commands through pass . for example, pass git submodule foreach git pull returns: fatal: /usr/local/cellar/git/2.6.4/libexec/git-core/git-submodule cannot used without working tree. as workaround, within ~/.password-store , git submodule commands work expected

mail is not sending using codeigniter php -

i want send email users when registered. have used email api send mail user. my controller code: $this->load->model('user_model'); $verify = $this->user_model->insertuser(); $this->verifymail($username,$verify); $user_data = array( 'email' => $email, 'username' => $username, 'logged_in' => true ); $this->sendmail(); $this->session->set_userdata($user_data); redirect('user/about_me'); my mail code : function sendmail() { //***************email api *********************************************************** $headers = "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; $headers .= "from: hp <crm@example.com>\r\n"; $headers .= "cc: hp@example.com\r\n"; $mailbox= "<pre style=\"font-family:verdana, geneva, sans-serif;\"> test </pre

linux - Why is my bash script that executes another script not exiting? -

i'm calling script bash script -- ampersand. otherscriptthatdoesnotexit & echo "done" i see getting "done" still see original script running ps. idea why be? (note, i'm running on puppy linux) the script still waiting on subprocess spawned. use nohup , disown or screen leave long running task in background , shell.

c++ - Dynamic Allocation not creating array -

i'm doing assignment school , we're doing memory management. far we're tasked create list of students + id's , we're dynamically. i'm supposed overload delete/new operators, i've done. when testing out program crash, possibly not creating array allocate information. namespace { char buffer[1024]; int allocated = 0; } struct student { int size; char *firstname; char lastname; int studentid; int occupied; student::student() : size(0) { } student::student(int s) : size(s) { std::cout << "constructor" << std::endl; std::cout << "allocated: " << allocated << std::endl; int currentloc = allocated; allocated += s; firstname = new (&buffer[currentloc]) char[s]; } void *student::operator new(size_t s) { std::cout << "operator new allocated: " << allocated << std::endl; int currentloc = allocated; allocated += s; return &buffer[currentloc]; } v

Java Play 2.4 and IDEA - Views not resolving -

Image
i doing pretty standard. trying use play-authenticate plugin, references several views won't resolve. the import there, grayed out, showing unused. build.sbt looks like: name := """webapp""" version := "1.0-snapshot" lazy val root = (project in file(".")).enableplugins(playjava, playebean) scalaversion := "2.11.6" librarydependencies ++= seq( javajdbc, cache, javaws, "com.feth" % "play-authenticate_2.11" % "0.7.1", "org.postgresql" % "postgresql" % "9.4-1206-jdbc42", "org.webjars" % "bootstrap" % "3.2.0", "be.objectify" % "deadbolt-java_2.11" % "2.4.4" ) // play provides 2 styles of routers, 1 expects actions injected, // other, legacy style, accesses actions statically. routesgenerator := injectedroutesgenerator fork in run := true i have tried restarting intellij, running

java - Algorithm to find the narrowest intervals, m of which will cover a set of numbers -

let's have list of n numbers. allowed choose m integers (lets call integer a ). each integer a , delete every number within inclusive range [ a - x, + x ], x number. minimum value of x can list cleared? for example, if list of numbers 1 3 8 10 18 20 25 and m = 2, answer x = 5. you pick 2 integers 5 , 20. clear list because deletes every number in between [5-5, 5+5] , [20-5, 20+5]. how solve this? think solution may related dynamic programming. not want brute force method solution. code helpful, preferably in java or c++ or c. a recursive solution: first, need estimation, can split in m groups, estimated(x) must ~ (greather - lower element) / 2*m. estimated(x) solution. if there better solution, has lower x extimated(x) in groups! , can check first group , repeat recursively. problem decreasing until have group: last one, know if new solution better or not, if there'is better, can use discard worse solution. private static int estimate(int[] n,

mysql - How can I get my database to update more than once in this "foreach" loop, using PHP? -

this in php web page. i have link user lands on example: www.example.com/update?attend=1&code[]=4321&code[]=5642&code[]=1842 need update: foreach code attend=1 . my code far: ...database connect information... $codes = $_get['code']; $invitecode = $_get['invitecode']; foreach ($codes $code) { print $code; ?><br><?php $sql = "update guests set attend='$isattend' invitecode=$code"; } ...database close , result... renders as: 4321 5642 1842 record updated when check database last value 1842 set attend=1 . prints correct updates one? does understand doing wrong here? you can execute each sql in foreach better use in clause.so code hit database 1 time.

html - Put divs or spans in td's -

Image
i have basic table td 's. i want able put coming sign on top of td . have got coming sign done both divs , spans , need both in make coming sign. but can't put coming on text in td . current result end on different lines . how can put text , coming on top of each other using css? the wanted result similar minecraft home page: note: coming sign rotated can told apart. table{ width: 100%; background: lightblue; } .header{ text-align: center; background: lightblue; padding: 30px; margin: 0; } table, th, td, .header { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; text-align: left; } <table> <h2 class="header">comming soon</h2> <tr> <td>jill</td> <td>smith</td> <td>50</td> </tr> <tr> <td>eve</td> <td>jackson</td> <td>94&

combinations - Given a sorted array find number of all unique pairs which sum is greater than X -

is there solution can achieved complexity better o(n^2)? linear complexity best o(nlogn) great. i've tried use binary search each element o(nlogn) im missing something. for example, given sorted array: 2 8 8 9 10 20 21 , number x=18 [2,20][2,21][8,20][8,21][8,20][8,21][9,10][9,20][9,21][10,20][10,21][20,21] function should return 12. help! for problem, given set of numbers, there may which, included other number, guaranteed solution because in greater target amount summing. identify those. combination of solution. example-data, 21 , 20 satisfy this, combinations of 21, six, , remaining combinations of 20, five, satisfy requirement (11 results far). treat sorted array subset, excludes above set (if non-empty). from new subset, find numbers can included number in subset satisfy requirement. starting highest (for "complexity" may not matter, ease of coding, knowing have none helps) number in subset, identify any, remembering there need @ least 2 such

php - Current time when MySQL record is saved to database -

i'm working zend framework 1.12 , mysql. want add column in database, save currenct datetime when record inserted table. anyone knows how can defined column? function must working on mysql site, not php. you must change column type timestamp , , in default field set current_timestamp

WebStorm FTP deployment: 'could not put ftp file' -

i added ftp deployment server "passive mode" on in webstorm. it runs when downloading files server fails error when uploading files: [16.01.16, 13:02] failed transfer file '/users/vic/sites/gulpfile.js': not put ftp file "ftp://ver.blabla.ru/www/gulpfile.js". does know can problem? you can : change mode ftp 'active' 'passive' inspect right of directory ftp use sftp otherwise ftp

R, class() returns different results for data frame columns -

> bb = data.frame(x = c( 11:13), y = c(1:3), z = c("a", "a", "b")) > bb x y z 1 11 1 2 12 2 3 13 3 b > > apply( bb, 2, class) x y z "character" "character" "character" > > apply( bb[,1:2], 2, class) x y "integer" "integer" > > apply( bb[,2:3], 2, class) y z "character" "character" > > class(bb$z) [1] "factor" > i quite surprised find class() behavior illustrated above.could please give rationale above inconsistencies. many thanks. the reason apply converts character class converts matrix , matrix can hold single class i.e. if there @ least 1 column non-numeric, entire dataset gets changed character . instead, use, lapply(bb, class) #$x #[1] "integer" #$y #[1] "integer" #$z #[1] "factor" the above returns out

PHP trying to work with classes, but class can't be accessed -

i'm trying create class function in 1 php file, , access another. can't work. fatal error: class 'databaseconnect' not found . the code: <?php $conn = new mysqli("localhost", "root", "usbw", "beoordelingen") or die(mysql_error()); class database { public function getdatabase($thevar, $theselector, $thelocator) { $thevar = $conn->query("select $theselector beoordeling $thelocator"); } } ?> then trying call in file: <?php include("myclassfile.php"); $index = new database(); $index->getdatabase($result, "distinct `category`"); ?> does have scope or namespace? or doing wrong here. (1) check whether file exists. you'd better use absolute path well. (2) whether there namespace scope. try new \databaseconnect(); append back-slash

Does an Android SQLite database persist after switching the device off? -

i want develop android app. input user , store in phone's database. my data should retained in phone if phone gets switched off. possible using sqlite database? android provides several options save persistent application data. solution choose depends on specific needs, such whether data should private application or accessible other applications (and user) , how space data requires your data storage options following: shared preferences store private primitive data in key-value pairs. internal storage store private data on device memory. external storage store public data on shared external storage. sqlite databases store structured data in private database.

java - Constructor method must contain all instance variables -

many times i'm faced class constructor method must contain list of arguments identical list of class instance variables. as see in example there "some" code make hapend. i'm wondering how can make process less painful? example: public class vimeouser extends schema { @getter @setter private string uri; @getter @setter private string name; @getter @setter private string link; @getter @setter private string location; @getter @setter private string bio; @getter @setter private string createdtime; @getter @setter private string account; @getter @setter private map<string,integer> statistics = new hashmap<>(); @getter @setter private list<website> websites = new arraylist<>(); @getter @setter private list<portrait> portraits = new arraylist<>(); public vimeouser( string uri, string name, string link, string location, stri

scala - Restricting generic type to an enumeration type -

say want define generic type , have guarantee instantiated when generic parameter 1 of known list of types. 1 way that, using typeclasses, is sealed trait allowed[a] object allowed { implicit object string extends allowed[string] implicit object int extends allowed[int] } case class player[a: allowed](id: a, name: string, score: double) in case, know player can have id string or int , nothing else. can leverage information in functions such following def retrieveplayerbyid[a: allowed](p: player[a]) = implicitly[allowed[a]] match { case allowed.string => val id = p.id.asinstanceof[string] ... case allowed.int => val id = p.id.asinstanceof[int] ... } now, problem following. same, allowing generic parameter either string , or enumeration type. i not care if enumerations encoded this: object weekday extends enumeration { type weekday = value val mon, tue, wed, thu, fri, sat, sun = value } or this trait weekday case obj

c# - How to optimize SQL query generated by Entity Framework in SQL Server Management Studio? -

i create query in linq returns table of active salesmen in shop: projectdb3context db = new projectdb3context(); db.database.log = message => trace.writeline(message); var result = db.tblusers.join(db.tblsales, u => u.id, sl => sl.tbluserid, (u, sl) => new { u, sl }) .select(o => new { userid = o.u.id, login = o.u.userlogin, fullname = o.u.name + " " + o.u.surname, itemstosell = db.tblsales.where(x => x.tbluserid == o.u.id).count() }) .distinct() .orderbydescending(x => x.itemstosell) .tolist(); the henerated sql query looks like: select [distinct1].[c1] [c1], [distinct1].[id] [id], [distinct1].[userl

Android support lib v4 or v13 -

i have developed android application build using api 13 , min-sdk api 13. want incorporate swiping across tabs, , purpose using v4 support library . i have following questions, which support library should use v4 or v13? should change target api 14? more importantly how decide, should targeted api compile against? for question 1: @stinepike said, depending on use minimum, should use v4 min-sdk = 4-12 if min sdk >=13 ok use v13. for question 2: best target depends on plan do, if want provide features introduced in higher sdk level, have use higher target-sdk make sure check android version not use android apis introduced in higer sdk version on device older android version if(build.version.sdk_int >= build.version_codes.honeycomb) { // safe use api 11 / android 3.0 stuf } else { // use api level <= 10 stuff } for min-sdk same. if require stuff of api level >= 10 have use min-sdk 10 my opinion: don't use api level < 10, not worth it.

perl - Unable to generate ExpatXS.dll from XML-SAX-ExpatXS-1.31 package for Windows -

i encountered error when running app on windows. after r&d, discovered needed expatxs.dll missing component here(loadable object module) can't locate loadable object module xml::sax::expatxs in @inc (@inc contains : c:/perl/site/lib c:/perl/lib .) @ (eval 63) line 1 compilation failed in require @ (eval 63) line 1. so, have strawberry perl installed on x86 machine , have xml-sax-expatxs-1.31 package contains makefile.pl , header file encoding.h , expatxs.pm file guess perl module required generate expatxs.dll(am right ?) can please let me know how should compile package expatxs.dll windows. main aim generate expatxs.dll windows. is related using cpan? don't know it. so, please explain in layman's terms. thanks in advance. just cpan xml::sax::expatxs

c++ - How to make CLion insert generated code.... in .cpp files -

generating code in clion result in having methods implemented in header files, i've been taught should go in .cpp files, how can change behavior , possible ? example : in project containing main.cpp , test class (test.hpp, , test.cpp). the cmake file follow: cmake_minimum_required(version 3.3) project(testclion) set(cmake_cxx_flags "${cmake_cxx_flags} -std=c++11") set(source_files main.cpp test.cpp test.hpp) add_executable(testclion ${source_files}) (note default file provided clion, haven't changed anything) test.hpp #ifndef testclion_test_hpp #define testclion_test_hpp class test { protected: int test; }; #endif //testclion_test_hpp test.cpp #include "test.hpp" pressing alt + insert , generating getters/setters while being in test.hpp or test.cpp changes test.hpp: test.hpp #ifndef testclion_test_hpp #define testclion_test_hpp class test { public: int gettest() const { return te

apache - Can't Access to my Amazon Instance with public Ip -

i have new amazon instance ec2, , want build web server did : install apache2 install libapache2-mod-php5 a2enmod rewrite add http rule in default group allow ip add directory allowoverride in /etc/apache2/sites-availables/ default-conf but when want check if apache running typing public ip of instance in browser, dont have basic index.html "it's works". got nothing. what missed ? thanks you. if apache running fine, might firewall. in aws console, make sure have unblocked port 80 in "security groups" under "network & security".

Love2D, LUA Tween resetting -

i have problem tweening. using tween.lua move character left or right when button held. on release player returns middle. tweening works when character goes either left or right but, reason when has go middle character warps there , not tween. suspect either base x overriding or not resseting @ right moment. here code: --local variables local lg = love.graphics local lk = love.keyboard function player:load(arg) --player load function. called when loaded. self.img = lg.newimage(currentpimg) playerwidth = player.img:getwidth() --gets player image width , sets variable self.mid = width/2 - playerwidth/2 self.left = 100 - playerwidth/2 self.right = width - 100 - playerwidth/2 self.x = player.mid self.y = height-150 self.speed = 0.04 gomid = tween.new(player.speed , player, {x=player.mid}, 'linear') goleft = tween.new(player.speed , player, {x=player.left}, 'linear') goright = tween.new(player.speed , player, {x=player.ri

not assignable to 'android.app.activity' extends application -

i implementing adobe creative sdk. getting following error in in my manifest file: 'com.example.nick.avierytest2.mainactivity not assignable android.app.activity' this xml file: <?xml version="1.0" encoding="utf-8"?> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" android:theme="@style/apptheme.noactionbar" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> this main activity class:

ruby - Rails not finding rake-10.5.0 -

i trying install rake gem in rails 4.2. th gem seems install fine, rails fails when tries run, saying cannot see rake-10.5.0 . developing in rubymine , error getting below, gemfile. have tried deleting gemfile.lock suggested other posts, no avail. console: ~/development/rubymineprojects/revenant.tech  ls gemfile rakefile config lib test gemfile.lock app config.ru log tmp readme.rdoc bin db public vendor ~/development/rubymineprojects/revenant.tech  gem install rack installed rack-1.6.4 parsing documentation rack-1.6.4 done installing documentation rack after 2 seconds 1 gem installed ~/development/rubymineprojects/revenant.tech  bundle update rake fetching gem metadata https://rubygems.org/........... fetching version metadata https://rubygems.org/... fetching dependency metadata https://rubygems.org/.. resolving dependencies... using rake 10.5.0 using i18n 0.7.0 using json 1.8.3 using minitest 5.8.3 using thread_safe