Posts

Showing posts from February, 2012

python - pyparsing to parse a string made of boolean -

i use package pyparsing parse following kind of strings. atomname * , atomindex 1,2,3 atomname xxx,yyy or atomtype rrr,sss thiol not atomindex 1,2,3 not (atomindex 4,5,6) or atomname * based on parsing, link matches specific function calls perform selection of atoms. all selection keywords (atomname,atomindex,thiol ...) stored in list (i.e. selkwds ). i tried failed: keyword = oneof(selkwds,caseless=true).setparseaction(self.__parse_keyword) func_call = forward() func_call << (keyword + commaseparatedlist).setparseaction(self.__parse_expression) func_call = operatorprecedence(func_call, [(not, 1, opassoc.right, self.__not), (and, 2, opassoc.left , self.__and), (or , 2, opassoc.left , self.__or)]) where self._and, self._or, self._not, self._parse_keyword, self._parse_expression method modify token future eval of transformed string. would have ide...

c# - SQLBulkCopy slower than expected -

it's taking around 5 minutes per million records, wondering if expected speed. i wondering if batch size small i.e. 500 ? my current code looks this... using (var destinationconnection = new sqlconnection(settings.default.batchoutputconnectionstring)) { var tablename = mergedfilename.substring(0, mergedfilename.indexof('.')); destinationconnection.open(); try { using (var createanddroptablecommand = new sqlcommand("sp_dropandcreatetable", destinationconnection)) { createanddroptablecommand.commandtype = commandtype.storedprocedure; createanddroptablecommand.parameters.add("@tabletocreate", sqldbtype.varchar).value = tablename; createanddroptablecommand.executenonquery(); } foreach (var file in txtfiles) { using (var lineiterator = file.readlines(file).getenumerator()) { while (lineiterator.movenext()) ...

html - create a pie chart using php -

i saw tutorial online claim code below makes pie chart. yet when run exact code have error fatal error: call undefined function imagecolorsallocate() in / **/** / * /piechart.php on line 7 (i've used asterix cover folders names). suggestions? or there other way create 1 preferably without using third party material. <?php //create image $image = imagecreatetruecolor(100,100); //allocate colour $white = imagecolorsallocate($image, 0xff , 0xff, 0xff); $gray = imagecolorsallocate($image, 0xc0 , 0xc0, 0xc0); $darkgray = imagecolorsallocate($image, 0x90 , 0x90, 0x90); $navy = imagecolorsallocate($image, 0x00 , 0x00, 0x80); $darknavy = imagecolorsallocate($image, 0x00 , 0x00, 0x05); $red = imagecolorsallocate($image, 0xff , 0x00, 0x00); $darkred = imagecolorsallocate($image, 0x90, 0x00, 0x00); //make 3d effect for($i = 60; $i >50; $i--){ imagefilledarc($image, 50, $i, 100, 50, 0, 45, $darknavy, img_arc_pie); imagefilledarc($image, 50, $i, 100, 50, 45, 75, $darkgray, img_ar...

Android: Clear keyboard input when edittext is cleared -

Image
i want set automatic thousand separator edittext. did textwatcher. in public void aftertextchanged(editable s) i save current value of edittext, format with @override public void aftertextchanged(editable s) { inputfield.this.removetextchangedlistener(this); double tmp = getdoublevalue(); s.clear(); s.append(decimalformat.getinstance(locale.german).format(tmp)); inputfield.this.addtextchangedlistener(this); } }); but keyboard galaxy tab doesn't care if clear editable. keeps current input , fills edittext complete number. short example: i type "1", keyboard inserts "1", edittext shows "1". type "2", keyboard inserts "12", edittext shows "112" type "3", keyboard inserts "123", edittext shows "112.123" press delete button, keyboard inserts "12", edittext shows "11.212.312" press delete b...

Laravel ReflectionException error : Repository doesn't exist -

i know question lil bit old, still can't find right solution. i've been search internet days, , try several solutions, check files path, update composer.json , and dump-autoload it, still no luck. still following error : reflectionexception class cribbb\storage\user\euserrepository not exist here's code. the controller (app/controllers/userscontrollers.php) : <?php use cribbb\storage\user\iuserrepository user; class userscontroller extends \basecontroller { /** * display listing of resource. * * @return response */ public function __construct(user $user) { $this->user = $user; } ?> the interface (lib/cribbb/storage/user/iuserrepository.php) : <?php namespace cribbb\storage\user; interface iuserrepository{ public function all(); public function find($id); public function create($input); } ?> the repository (lib/cribbb/storage/user/euserrepository.php) : <?php namepsace cr...

angularjs - Unknown provider's error throw when injecting constant -

i having issues running karma tests. i have service works well, in inject constant csrf_token : 'use strict'; angular.module('app').factory("authenticationservice", function($http, $sanitize, sessionservice, flashservice, csrf_token) { var sanitizecredentials = function(credentials) { return { email: $sanitize(credentials.email), password: $sanitize(credentials.password), csrf_token: csrf_token }; }; ... but when running grunt test command, karma's error : error: [$injector:unpr] unknown provider: csrf_tokenprovider <- csrf_token <- authenticationservice update karma.conf : // karma configuration // http://karma-runner.github.io/0.10/config/configuration-file.html module.exports = function(config) { config.set({ // base path, used resolve files , exclude basepath: '', // testing framework use (jasmine/mocha/qunit/...) frameworks: ['jasmine...

symfony - Symfony2 - Custom arguments to postFlush method using annotations -

i want use current user in postflush method of proposals service, i've added securitycontextinterface $securitycontext parameter of __construct method , property of proposals service class: use symfony\component\security\core\securitycontextinterface; /** * @di\service("pro.proposals") * @di\tag("doctrine.event_listener", attributes = {"event": "onflush", "lazy": true}) * @di\tag("doctrine.event_listener", attributes = {"event": "postflush", "lazy": true}) */ class proposals { private $doctrine; private $translator; private $templating; private $notifications; private $proposalswithtypechanged; private $securitycontext; /** * @di\injectparams({"notifications" = @di\inject("pro.notifications")}) */ function __construct(registry $doctrine, translatorinterface $translator, notifications $notifications, templating $tem...

html - Spinning circles css3 transition -

Image
i want make 3 spinning circles can`t find examples. how need work: there 3 circles (big,medium,small) want rotate them on hover (small , medium change position on big circuit) img: https://dl.dropboxusercontent.com/u/64675374/circle/circle1.png single img: https://dl.dropboxusercontent.com/u/64675374/circle/small.png https://dl.dropboxusercontent.com/u/64675374/circle/medium.png https://dl.dropboxusercontent.com/u/64675374/circle/big.png here code 1 circle. how make big circle background of , add medium circle http://jsfiddle.net/aqkyc/293/ css: .dot{ position:absolute; top:0; left:0; width:300px; height:100%; background: url('https://dl.dropboxusercontent.com/u/64675374/circle/small.png') no-repeat 50% 50%; } .sun{ width:200px; height:200px; position:absolute; -webkit-animation-iteration-count:infinite; -webkit-animation-timing-function:linear; -webkit-animation-name:orbit; -webkit-animation-duration:5s...

jquery - How to remove Firefox's enter-key with Javascript -

Image
how can remove firefox's enter-key image below javascript? i add more "(" , ")" code , works in ie, yet seems not work in firefox or chrome browsers. moreover, please tell me differences between ie , firefox affect code. here code: javasript: // extract labels adding "(" , ")" labels[i] = txt1 + "(" + txt + ")"; ... var str = document.getelementbyid("demo").innerhtml; alert(str); var res = str.replace(/(<br>)/g, ''); alert(res); jsfiddle : http://jsfiddle.net/huydq91/l7vxl/ i think looking remove line break. do this: // extract labels adding "(" , ")" labels[i] = txt1 + "(" + txt + ")"; ... var str = document.getelementbyid("demo").innerhtml; alert(str); var res = str.replace(/\n/g, ''); alert(res); \n used match line breaks. demo

c# - Local fixed disk cannot be accessed from service -

i'm experiencing following strange behaviour: a c# service fails operations on local disk d: (e.g. check if directory exists), while console version wrapping same assembly, has no problem whatsoever. both running under same user account, member of local administrators group. when loggon on interactively, same user has no problems accessing drive d:\ using windows explorer. inserting following diagnostic code: driveinfo[] drives = driveinfo.getdrives(); foreach (driveinfo drive in drives) { string label = drive.isready ? string.format(" - {0}", drive.volumelabel) : " - drive not ready"; string drivemessage = string.format("drive {0} - {1}{2}", drive.name, drive.drivetype, label); eventlog.writeentry("nxg siteservice", drivemessage, eventlogentrytype.information); } shows drive d: fixed disk, "not ready"? can please explain me why fixed disk can "no...

MongoDB - Pull from array of objects -

i have collection { "_id" : objectid("534bae30bf5049a522e502fe"), "data" : [ { "0" : { "content" : "1", "type" : "text", "ident" : true }, "1" : { "content" : "", "type" : "text", "ident" : false } }, { "0" : { "content" : "2", "type" : "text", "ident" : true }, "1" : { "content" : "", ...

c# - Do not pass data to OS in observer mode in Wacom Feel Multi Touch API -

i making little application lets me use intuos pro keyboard because touch enabled. wacom has released an api allows access of touch data getting core functionality has not been problem. have hit bit of snag, though. api allows listen data in 2 modes: consumer mode means application not pass touch information onto other applications or driver gesture recognition. listen if window has keyboard focus. observer mode means application pass touch information onto other applications , listen data regardless of focus. here's problem. keyboard needs running time, when i'm typing on touchpad, don't want 2 finger scrolls or tap clicking or happen. if i'm typing something, thing i'm typing has have keyboard focus - not application. i can't see point of observer mode if there's no way destroy data gesture recognition doesn't in way. , in faq , wacome hinted @ possibility of being able destroy data in observer mode. if application chooses pass tou...

java - How to write tests for API based on Google Cloud Endpoints? -

is there way test api written using google cloud endpoint using junit or other framework? in documentation there example using curl commands , perhaps logic behind test api on client side only. when tried find approaches how test api server-side, came across possibility of writing junit tests , invoking httpurlconnection 's localhost, there problems approach. example, instance of app engine should running before testing, deploy locally maven , testing prior deploying, if have broken tests doesn't deploy dev server , not feel that right way rewrite maven steps. edit 1: found similar python: how unit test google cloud endpoints with objectify can this. example, let's declare our booksendpoint follows: @api( name = "books", version = "v1", namespace = @apinamespace(ownerdomain = "backend.example.com", ownername = "backend.example.com", packagepath = "") ) public class booksendpoint { @ap...

c# - Storage to store vectors of int(On disk matrix storage) -

i have int vectors of same length(or matrix) , need store them in kind of db, because store them in .txt file. i need ability extend matrix appending rows end of matrix , need const time operation(not depending on size of matrix). it wiil if can handle large data , don't load whole dataset in memory.

Replace the text in sed -

i have <funcprototype> <funcdef>void <function>foo</function></funcdef> <paramdef>int <parameter>target</parameter></paramdef> <paramdef>char <parameter>name</parameter></paramdef> </funcprototype> <funcprototype> <funcdef>void <function>foo2</function></funcdef> <paramdef>int <parameter>target2</parameter></paramdef> <paramdef>char <parameter>name2</parameter></paramdef> </funcprototype> i need : void foo( int tagret char name) void foo2( int tagre2 char name2) using sed can void foo( int target char name ) void foo2( int target2 char name2 ) i using command awk "/\<funcprototype\>/,/\<\/funcprototype\>/ { print }" foo.xml | sed 's/^[ ^t]*//;s/[ ^]*$//'|sed -e '/^$/...

C# wpf calculator -

i'm making calculator exception when try make calculation decimal number. there wrong with sum1 += double.parse(nument.text); i'm bit lost now:p public partial class mainwindow : window { double sum1 = 0; double sum2 = 0; string dotsign = ""; bool plusbuttonclicked = false; bool subbuttonclicked = false; bool multbuttonclicked = false; bool divbuttonclicked = false; public mainwindow() { initializecomponent(); } private void numbervalidationtextbox(object sender, textcompositioneventargs e) { regex regex = new regex("[^0-9]+"); e.handled = regex.ismatch(e.text); } private void one_click(object sender, routedeventargs e) { nument.text += one.content; } private void two_click(object sender, routedeventargs e) { nument.text += two.content; } private void three_click(object sender, routedeventargs e) { nument.text +...

windows phone 8 - NullReferenceException thrown when app is updated and new UI added - WP8 -

this strange , happening first time. i have 1 version of app in store. next version has few ui changes. lot of re arrangements made. now happens is, textblock written in xaml nullreferenceexception when try assign text. initilizecomponent called before assign value, how textblock remain null! <grid x:name="adsdialog" grid.row="2"> <grid.rowdefinitions> <rowdefinition height="*"/> <rowdefinition height="auto"/> <rowdefinition height="30"/> </grid.rowdefinitions> <stackpanel horizontalalignment="center" verticalalignment="center"> <textblock name="statuspreview1" text=" " width="240" textalignment="center" foreground="#ff121212" fontfamily="{...

c# - TabPages in accordance to CheckedListBox -

i have tabcontrol 4 tabpages.i have checked list box 8 items.i want open tabpages checked in checkedlistbox.i tried this. private void clbscenario_itemcheck(object sender, itemcheckeventargs e) { if (clbscenario.selectedindex == 0 || clbscenario.selectedindex == 1 || clbscenario.selectedindex == 2 || clbscenario.selectedindex == 3 || clbscenario.selectedindex == 4) { tabcontrol1.tabpages.add(tp1); } else hidetabpage(tp1); if (clbscenario.selectedindex == 5 || clbscenario.selectedindex == 8) { tabcontrol1.tabpages.add(tp2); //showtabpage(tp2); } else hidetabpage(tp2); if (clbscenario.selectedindex == 6) { tabcontrol1.tabpages.add(tp3); } else hidetabpage(tp3); if (clbscenario.selectedindex == 7) { tabcontrol1.tabpages.add(tp4); } else h...

java - Multicast packets come in dirty -

i'm making simple multicast application controller locks , unlocks station via simple messages. controller , station both have receiver threads. reason, when first message sent, received well, when second message sent, received incorrectly, of first message attached it. for example, station 1 sends "locked: 1001" message. controller receives message correctly. controller sends "unlock: 1001" message. station 1 receives "unlock: 1ocked: 1001" here's station's receiver: public class votingstationreceiver implements runnable{ private dummyvotingstation votingstation; private multicastsocket s; private thread listener = new thread(this); public votingstationreceiver(multicastsocket s, dummyvotingstation votingstation){ this.s = s; this.votingstation = votingstation; listener.start(); } public void run() { byte[] buf = new byte[1024]; while(true) try { ...

How to append a character in Crystal Report? -

i using cr version 13.0.2.000.i want display following record 1,2,5,10,50,100 in following way $1 $2 $5 $10 $50 $100 i have tried replace method , show data columnwise dont know how append $ sign before starting of each element the formula tried given below replace({table7.value},",",chrw(10)) keep in mind won't able use formula 'manufacture' rows; need done @ database. if want change display, try: // {@display} local stringvar crlf := chr(10)+chr(13); // convert values array; 1,2,5,10,50,100 stringvar array tokens := split({table7.value}, ","); // join array "$" + join( tokens, crlf + "$"); if need tally array, try: // {@aggregate} local numbervar i; local numbervar x; // tally := 1 ubound(tokens) ( x := x + tonumber(tokens[i]); ); // display x

java - How is Backtracking done using recusrion in Binary Tree -

Image
i'm trying insert binary node. code convoluted , there's no hope of rescuing plan rewrite (basically didn't account backtracking , didn't think algorithm closely). i'm trying insert binary node using in order traversal, don't understand how i'm supposed backtrack. d / \ b e / \ / \ c f how search through left subtree of root d , go , search through right one? might stupid question, i'm stumped. best can come this: if (!root.hasleftchild) { root = root.getleftchild(); recurse(root); } but when reach bottom, can't go root. also, doesn't solve problem if reach bottom left node have fill both children of node before starting backtrack. i think i'm thinking wrong way. tree : d / \ b e / \ / \ c f for recurse : using inorder traverse if (root == null) return; recurse(root.getleftchild()); int rootdata = root.getdata(); recurse(root.g...

c# - Does ReflectionOnlyLoad initialize or otherwise run any code? -

for project i'm working on have analyze several dozen assemblies. it important none of code contained within these assemblies being run, therefore looked @ assembly.reflectiononlyload , the documentation on msdn mentions: loads assembly reflection-only context, can examined not executed. member overloaded. complete information member, including syntax, usage, , examples, click name in overload list. now know regular assembly.load runs either initializers or constructors of objects loads, right in assumption not case reflectiononlyload , or should looking other ways of achieving want? reflectiononlyload indeed forbid code assembly executing. has own issues - notably, it's not cabaple of loading dependencies. can tricky, since reflecting on class deriving type defined in different assembly fail. as far i'm aware, assembly.load will not run in assembly default ( edit : except module initializers, abused; if you're not concerned "hac...

video - YouTube api URL to get Shares count -

can please give me exact youtube api url example can find share count of video. example: following url works find comments of youtube video. https://gdata.youtube.com/feeds/api/videos/5jetoum8_z8/comments in same way can please give proper url example shares count of video. thank in advance. regards, ritesh. you can use youtube analytics metrics data own videos, channels, etc. https://developers.google.com/youtube/analytics/v1/dimsmets/mets

c - Arduino Serial.readBytes() Incompatible Types -

when on arduino: const unsigned long baudrate = 57600; const int tledpin = 13; //--------------------------------------------------------------- void setup() { //serial.begin(baudrate); // identifies vcp module serial2.begin(baudrate); // identifies uart2 snap module serial3.begin(baudrate); // identifies uart3 rn42 modem pinmode(tledpin, output); pinmode(shdn_pwr, output); digitalwrite(shdn_pwr, high); // turn wireless board regulator on } //----------------------------------------------------------------------- void loop() { char rxdata[14]; if (serial2.available() > 0){ // read snap write rn42 serial2.readbytes(rxdata, 14); serial3.write(rxdata); //serial3.write(serial2.read()); } } i following errors: bt_snap_softconnectv2.ino: in function 'void loop()': bt_snap_softconnectv2:47: error: 'rxdata' not declared in scope bt_snap_softconnectv2:55: err...

github - Jekyll-bootstrap how does mark down for external links work? -

i writing in post.md intro [links](http://jekyllrb.com/docs/permalinks/) then when clicking link once post has been published link sent is: http://example.github.io/post-name/jekyllrb.com/docs/permalinks/ can help? this gotcha. had migrated from maruku kramdown , handles urls differently . need define [setid]: http://www.example.com (don't forget http:// ) then use [setid] in place of link.

php - Laravel 4 - Route to the controller with an optional parameter -

how can make routing optional parameter not raise error if there no parameter provided ? my app/routes.php looks this: route::get('/{slug}', 'pagecontroller@page'); and app/controllers/pagecontroller.php : class pagecontroller extends basecontroller { public $layout = 'templates.default.tpl'; public function page( $slug = 'front' ) { return view::make('pages.'.$slug); } } so if go www.websiteurl.com/ , without parameter, should arrive default front page. instead i'am getting error symfony \ component \ httpkernel \ exception \ notfoundhttpexception how can tell laravel4, make routing 2nd variable optional ? you should define route like: route::get('/{slug?}', 'pagecontroller@page'); questionmark tells laravel parameter optional. more on docs

html - Some selectors doesn't work for me -

i writing selectors didn't work me. html code : <h2 rel="singer-connector-cricketer">shoaib chikate</h2> <h2 rel="dancer-build-tester">ashok dongare</h2> css code: h2[rel|="connector"]{ color:blue; } css tricks attribute similarly :matches() selector not working although i'm using higher version of chrome (version 32.0.1700.77). html code: <div id="matcher"> <p>matched</p> <h1>not</h1> <h2>matched</h2> <h3>not</h3> </div> css code: #matcher :matches(p,h2){ color:purple; } how selectors work? css tricks selectors- :matches() jsfiddle h2[rel|="connector"] looks attribute value starts "connector" followed hyphen. not attribute value has word "connector" anywhere among set of hyphenated words — value must start given string. since 2 elements given ...

Why does JavaScript consider "," to be smaller than "."? -

this question has answer here: javascript - alert(“zoo”>“house”) returns true 2 answers alert("," < ".") returns true in javascript. so why "," smaller "."? as mdn because: strings compared based on standard lexicographical ordering, using unicode values. which internally means ( ord(',') < ord('.') ) == ( 44 < 46 ) .

sql - Insert query in C# for GETDATE() -

may know how access getdate() value using insert query in c# (db connection), singe cell in row.. every time login page..instead update, use insert query display time in gridview column .. if use update query cant list of search values filtered using date i have 4 columns(one primary too) in want change fourth cell getdate(). value using insert query challenging tried more cant result primarycol. col1 col2 col3 date(col4) 12345 aaa 4000.00 a121 2014-04-14 17:08:16.437 67890 bbb 3500.00 @121 2014-04-14 17:08:22.873 112233 ccc 2000.00 12345 2014-04-14 17:07:23.700 445566 ddd 6000.00 6789 2014-04-14 15:25:29.857 sqlcommand cmd = new sqlcommand(("insert tablename (date) values(getdate())"), con); init want insert again n again same datas ,rather date column getdate() sql server function , msut call directly because query wll executed on server. sqlcommand cmd = new sq...

android - self.socket.recv() wrong reading in adbclient.py while trying to run it on Python 3 -

i'm trying run androidviewclient example file (dump-simple.py) python 3.3 i fixed essential syntax issues in viewclient.py , adbclient.py files convert them run on python 3. i have android tablet usb connected pc, see via cmd adb commands. working on windows7 os. currently facing following problem: in places self.socket.recv() function used in adbclient.py file returns b'' string i tried 4 different andoid devices 4 different vendors , b'' returned self.socket.recv() of them. what doing wrong, did still not converted work python 3?

mysql - Secondary developer access to phpMyAdmin with 1&1 -

i have managed hosting 1&1. know 1&1 mysql server administration isn't accessible outside own phpmyadmin, due databases sitting behind pretty locked-down firewall, need give external developer access import data mysql database without: giving administrative username/password. giving access of files stored on server (or risk breaking privacy laws) giving access of other databases on server (again - risk breaking privacy laws) so, question is: possible 1&1 managed server? i'm of opinion isn't, i'd love proved wrong. best option if there way add new sub-account has limited access. install phpmyadmin here: http://www.phpmyadmin.net/home_page/index.php set user access database want give access to give phpmyadmin install link other developer , give him user/pass access database need give access to.

security - VB.NET executeScalar IF conditional -

call con_getsetting() if con_open() = true dim pass string using cmd new sqlcommand("select pass_key m_user user_id='" + textbox1.text.replace("'", "").replace("--", "") + "'", con) pass = cmd.executescalar if pass <> nothing if pass = textbox2.text messagebox.show("login success!!, go main menu!", "djiesoft", messageboxbuttons.ok, messageboxicon.information) me.close() else counter += 1 if counter <> 3 messagebox.show("invalid password") else messagebox.show("invalid password" & vbnewline & "anda sudah 3x gagal melakukan login!") me.close() end if end if ...

java - Where does this.getClass().getResource() look? -

this question has answer here: getresourceasstream() hell 3 answers say call this.getclass().getresource() in class in order obtain url of file. where getresource() start looking? in main src folder of project? in main package folder? 'root folder' getresource() method? i confused method, great if explained this. class.getresource() finds resource given name. rules searching resources associated given class implemented defining class loader of class. before delegation, absolute resource name constructed given resource name using algorithm: if name begins '/' ('\u002f') , absolute name of resource portion of name following '/'. otherwise, absolute name of following form: modified_package_name/name where modified_package_name package name of object '/' substituted '.' ('\u002e') . the...

c# - Simple data collection application using JSON and .NET -

i'm building web application consists of 1 page (literally 1 page, no html generation). whole purpose of application collect data users , save sql server database. i want use javascript validate , collect data html form, put in json object, , use c# , .net insert data sql server. i have no clear idea on how achieve this, , honestly, i'm not sure if valid model or not! any pointers or ideas on , start? , how can achieve in simplest way possible? i suggest using jquery , asp.net mvc. here example: posting simple json mvc action controller method jquery or one: send data mvc controller using json

javascript - How to name a jQuery function to make a browser's back button work? -

i'm trying write function ajaxyfy web site, works perfect, except function button. that's have now: function loading() { if (typeof history.pushstate !== "undefined") { var historycount = 0; $('.menu-item, .logo').on('click','a',function(e){ e.preventdefault(); $(this).data('clicked', true); if ($(this).is('.logo a')) { var homepage = $(this).attr('href'); function1(homepage); history.pushstate(null, null, homepage); } else if ($(this).is('.projects a')) { var projects = $(this).attr('href'); function2(projects); history.pushstate(null, null, projects); } else { var pages = $(this).attr('href'); function3(pages); history.pushstate(null, null, pages); ...

html - css border is not show although I make it -

this html code <div id="vertical-chart-total-calls-statuses" class="chart-holder" style="border:10px #000"> <canvas class="overlay" width="478" height="265"></canvas> </div> i draw canvas using library. my problem div vertical-chart-total-calls-statuses doesn't have border. why please? thanks try add solid border:10px solid #000 border-style reference here

c# - Listview template with link -

i have listview: <listview verticalalignment="top" width="210" height="150" selectedvaluepath="selectedfile" selectionmode="single" selectedindex="0" behaviour:commandsbehaviour.selectionchanged = "{binding selectionfilechange}" itemssource="{binding files}" issynchronizedwithcurrentitem="true" atachedproperties:gridviewsort.autosort="true" atachedproperties:gridviewsort.showsortglyph="true"> <listview.view> <gridview> <gridview.columns> <gridviewcolumn header="file name" width="100" displaymemberbinding="{binding name}"/> ...

c++ - Copying a text file into debug directory -

working c++ fstream in visual studio, , i'm wondering if there's simple way include specific files in debug folder (or build folder really). know in c# there's option "always copy path" or along lines, can use relative path (ex: "filename.txt") easily. i'm wondering if there's equivalent in c++, or if i'm stuck building full path , using that?

extjs - Javascript: undefined is not a function -

this code controller: ext.define(controller.details.studentcontrolller', { extend: 'ext.app.controller', requires: [ ], config: { }, init: function(){ "use strict"; var me = this; this.app = this.getapplication(); this.createstudenttables(); } createstudenttables: function () { var finalstudent=[], view=this.getstudentstableview(); arrreqtpltest = ['<div class="stureq"><table><tr><th class=" stureq ">' + 'name ' + '<img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="this.sortstore();"/>' + '</th><th class=" stureq ">category ' + ' <img src="resources/images/arrow-bottom-1-512.png" width="10px" height="10px" onclick="sortstore();"/>...

php - Move a project to Bitbucket -

i looking few hours find solution problem.so have project(my blog),create in code igniter,i have mini server , where.i created account on bit bucket.org,i installed mingw , want work git improve project.what steps need follow,help me please create repository -> create project -> setup git on local machine -> push project git repository -> push/pull further changes

c++ - Using std::search to find multiple occurrence of pattern -

i want use function search or other similar function find multiple occurrence of given pattern. this code: #include <cstring> #include <iostream> #include <iomanip> #include <set> #include <list> #include <vector> #include <map> #include <algorithm> #include <functional> using namespace std; int main () { std::vector<int> haystack; string = "abcabcabc"; string b = "abc"; string::iterator it; = search(a.begin(),a.end(),b.begin(),b.end()); if(it!=a.end()){ cout << it-a.begin()<<endl; } return 0; } this code return 0 first occurrence of pattern "abc" , return 0, 3, 6. of indexes in original string pattern begins. thank help. for(size_t pos=a.find(b,0); pos!=std::string::npos; pos=a.find(b,pos+1)) { std::cout << pos << std::endl; } this uses std::basic_string::find ( ref ) directly find starting position of subst...

mysql - Optimal way to fill in missing values after a LEFT JOIN? -

i simplify problem make core issue clear: have query tablea inner join tableb left join tablec . the result of left join in result set, 2 of columns might have null values in rows. fill in missing values have loop on result set , query database has data (so not possible join in first place). my question is: there standard/optimised approach when need fill nulls of result set after left join? you can use coalesce(...) ( msdn - coalesce ) instead. you query like: select a, b, coalesce(tableb.c, 'replacement value') tablea inner join tableb left join tablec ... add join replacement table , put column want replace null values in coalesce function in don't want use static value.

AngularJS: Determining Template based on Select Control -

i thrown loop scope creep/change on project. initially there 6 buttons on page (with other stuff) triggering routes 6 different add new ... forms. had buttons wired routes , working. on friday, uix leader decided landing page complex , convinced stakeholders single "add new request" button needed leading drop down wherein user choose correct form. so template looks this: <form> <div class="row"> <div class="form-group col-lg-12"> <label for="requesttype">what type of request create? <span class="required">*</span> </label> <select class="form-control" name="requesttype" ng-model="requesttype" ng-change="new_form_select()"> <option value="0">please select ...</option> <option value="1">it web task</option...

broadcastreceiver - LocalBroadcast Receiver in Android -

i noob in android. noticed first time term localbroadcastreceiver in android. know localbroadcastreceiver can used in android ?? localbroadcastreceiver used receive application level broadcasts , using u have use localbroadcastmanager , used if dont want leak data outside app. for details refer :- http://developer.android.com/reference/android/support/v4/content/localbroadcastmanager.html consider scenario in downloading file, when download complete want notify application , , in case dont need send system level broadcast. you send broadcast in way :- localbroadcastmanager.getinstance(this).sendbroadcast("downloadcomplete"); and receive in way :- localbroadcastmanager.getinstance(this).registerreceiver( mmessagereceiver, new intentfilter("downloadcomplete")); where mmessagereceiver receiver defined dynamically

html - How can I put multiple classes in a <li> element? -

i working navigation menu, , wondering how put multiple classes in li tag: this li tag <li class='pil' class='dropdown'> and want in li tag: class='{{ ($aktiv == 'dagvakt') ? 'active' : '' }}' i tried , didn't work: <li class='pil' class='dropdown' class='{{ ($aktiv == 'dagvakt') ? 'active' : '' }}'> you can add multiple classes element putting them in same class attribute , separating them space. example: <li class='pil dropdown {{ ($aktiv == 'dagvakt') ? 'active' : '' }}'> as far know, spec allows class declared once, trying <li class='ex' class='am' class='ple'> won't work.

javascript - Randomised variable grid -

i'm working on website needs have variable grid. it's based on tumblr unfortunately can't use php solve our problem. want make posts wider other, should done randomly , photo posts should excluded this. the current markup each of text blocks is: <article class="post text cf post-3"> <a href="#"> <div class="post-overview-header" style="background-image: url(https://31.media.tumblr.com/d4134dd4d2c48674e311ca0bb411d5cc/tumblr_inline_n3v11hgji61s3vyc9.jpg); background-size: cover; background-position: 50% 0%; background-repeat: no-repeat no-repeat;"> <div class="hoveroverlay"></div> <div class="post-overview-title"> <span class="post-title">posts adden</span> <span class="post-date"> april 11, 2014 </span> <span class="post-readingti...

Taking Over An Existing Web Project: How to Access the Yii WebApp? -

i'm new , took on management of website runs on yii framework. i have access cpanel, ftp , web server. can see /var/www/yii/framework/ folder , inside- including yiic.php & yiic.bat files on ftp & public server via filezilla. i told source codes hosted on private git server. read yii documentation there webapp can access can make core changes site. how can access yii webapp make changes site? (all see .php files on filezilla) you need create application outside framework folder, use framework in application. this article overview.

sql - How to Remove duplicate values from join query -

hi ever 1 how can remove duplicate records join statement. select std_info.reg_no, std_info.std_name, tut_fee.fee_month, class.class_name std_info inner join tut_fee on std_info.reg_no=tut_fee.reg_no inner join promot on std_info.reg_no=promot.reg_no inner join class on class.class_id=promot.class_id std_info.reg_no not in (select reg_no tut_fee tut_fee.fee_month=3 , tut_fee.fee_year=2014) it give result reg_no std_name fee_month class_name 1. a01 name1 1 2nd 2. a01 name1 2 2nd 3. a02 name2 1 3rd 4. a02 name2 2 3rd thanks all. the dublicat come column "tut_fee.fee_month,"

grails - Unidirectional Many To One mapping with cascade -

is possible map following gorm? i want rid off associated events when delete person. person object should not have link events.( want avoid using hasmany on person domain) class person { string username } class event { string description static belongsto = [person:person] } i'm getting 'referential integrity constraint violation' when doing person.delete() because events not removed before deleting person. i don't think possible without using hasmany (speaking of which, why want avoid anyway?) this question states: hibernate cascades along defined associations. if knows nothing bs, nothing affect bs. use static hasmany , bam, problem fixed. edit: the way think achieve using beforedelete on person class delete associated event s, i.e. class person { def beforedelete() { def events = event.findallbyperson(this) (e in events) { e.delete() } } } see the documentation on ...

java - Jackson custom type info not working -

i've got classes use @jsontypeidresolver add custom type field output. code working expected. i've added propertyfilter mapper object. @jsontypeidresolver stopped working. factory not being called anymore. working code: objectmapper mapper = new objectmapper(); mapper.writevalue(outputstream,myobject); not working code: objectmapper mapper = new objectmapper(); propertyfilter myfilter=new simplebeanfilter() { protected boolean include(beanpropertywriter writer) { return true; } protected boolean include(propertywriter writer) { return true; } } filterprovider filters=new simplefilterprovider().addfilter("myfilter",myfilter); mapper.writer(filter).writevalue(outputstream,myobject); as filter useless (accepts anything) output should same. why type field not serialized anymore? seems jackson doesn't deal inheritance right way. test setup like @jsontypeinfo( use = jsontypeinfo.id.class, include = as.property, proper...