Posts

Showing posts from March, 2015

dialog - Android Calendar View for Date Picker with api level above 11 -

i wanted write application has button , when click on button want display calender in dialog box datepicker in dialog box. i try constructor likes new datepickerdialog.ondatesetlistener() calender. not possible this? after api level 11 supports calender view. //this code shows calendar in dialog, hope helps layoutinflater inflater =(layoutinflater)getapplicationcontext().getsystemservice(context.layout_inflater_service); linearlayout ll = (linearlayout)inflater.inflate(r.layout.calendar, null, false); calendarview cv = (calendarview) ll.findviewbyid(r.id.calendarview); cv.setbackgroundcolor(color.black); cv.setondatechangelistener(new calendarview.ondatechangelistener() { @override public void onselecteddaychange(calendarview view, int year, int month, int dayofmonth) { // todo auto-generated method stub log.d("date selected", "date selected " + year + " " + month + " &quo

JPA OneToOne not working -

i followed tutorial : http://www.codejava.net/frameworks/hibernate/hibernate-one-to-one-mapping-with-foreign-key-annotations-example i have following code: @entity @table(name = domainconstant.table_user) public class user{ @id @column(name = domainconstant.domain_user_id) @generatedvalue private long userid; private useractivationcode useractivationcode; ///////////////////// constructor.... /// standard , set.... @onetoone(cascade = cascadetype.all) @joincolumn(name = domainconstant.domain_activation_link_id) public useractivationcode getuseractivationcode() { return useractivationcode; } } @entity @table(name = domainconstant.table_user_activaton_link) public class useractivationcode { @id @column(name = domainconstant.domain_activation_link_id) @generatedvalue private long useractivationcodeid; @column(name = domainconstant.domain_activation_date) @temporal(javax.persistence.temporaltype.da

javascript - Creating bootstrap buttons dynamically -

Image
is possible create bootstrap button dynamically? have textfile have list of items make use of javascript create array with. create bootstrap buttons dynamically items being text within each button. if there 10 items in textfile, there 10 buttons created. can tell me how can done or point me tutorial it. edit(creation possible not code checking if buttons created): createbuttons(): $(function() { $.ajax({ url : 'http://localhost:8080/ssad/type.txt', datatype : "text", success : function (filecontent) { var lines=filecontent.split('\n'); $.each(lines, function() { if (this!='') { var word = this; word = word.tolowercase().replace(/(?:_| |\b)(\w)/g, function(str, p1) { return p1.touppercase();}); if ($('button:contains("'+word+'")').length==0) { var button='<button type="button" class="btn btn-block btn-inverse ac

c# - Download All Blobs from single Azure Container -

i'm trying download blobs single azure container using code. when download each blob want new file names consecutive numbers 2.jpg upwards through 3.jpg, 4.jpg 5.jpg etc. not name of blobs in azure container, dont know name of each blob when code runs. i seem falling @ last hurdle, cant figure out put foreach block files \home\pi\pictures\ directory on local hard drive. urls.downloadtostream(filestream); throwing error list string not contain definition downloadtostream and filestream type not valid in given context. using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; using system.collections; using microsoft.windowsazure; using microsoft.windowsazure.storage; using microsoft.windowsazure.storage.auth; using microsoft.windowsazure.storage.blob; using system.configuration; using system.io; using system.data; using system.data.sqlclient; using system.threading; namespace cpgetadverts { cla

jquery - Why do we write .attr('selected','selected') with select tag -

why write .attr('selected','selected') select tag for ex: $('#countrylist option').filter(function () { return ($(this).text() == findtext); }).attr('selected','selected'); }); what means? explanation of .attr('selected','selected') . first argument inside .attr represent attribute want pointing @ while second argument set value of attribute passed first argument. if have .attr('selected') return value of selected attribute.

angularjs - Download only new files on an Ionic app? -

i want download file server if file new. example, checking file modified date. using below code download file, stuck need compare files before downloading. can please give me solution this. .factory('filedownloadservice',['$cordovafiletransfer', function($cordovafiletransfer){ return{ filedownload:function(){ // file download var url = "http://www.xxxxx/file-to-download.json"; // file name var filename = url.split("/").pop(); // save location var targetpath = cordova.file.externalrootdirectory + filename; $cordovafiletransfer.download(url, targetpath, {}, true).then(function (result) { console.log('download successful'); }, function (error) { console.log('download error'); }, function (progress) { // progress handling }); } }}]) appreciate help. thank you

ios - Prevent keyboard from scrolling UITextField underneath headerview in UITableView? -

i have tableview header , under header i've couple of uitextfields inside uitableviewcell. problem when press top uitextfield, uitextfield scrolls underneath headerview. how prevent happening? i've disabled scrolling in tableview. thanks i needed split uitableviewcell containing 2 uitextfields 2 uitableviewcells (each containing uitextfield).

Customize the bar colors in Google Gantt Charts -

this should simple. how can assign own colors bars in google gantt charts ? gantt ignoring colors , automatically assigning blue, red , yellow colors (in order) bars , can't seem figure out problem. can please point out if missing here or not supported @ @ time? here have: function drawchart() { var data = new google.visualization.datatable(); data.addcolumn({ type: 'string', id: 'task_id' }, 'task id'); data.addcolumn({ type: 'string', id: 'task_name' }, 'task name'); data.addcolumn({ type: 'string', id: 'resource' }, 'resource'); data.addcolumn({ type: 'date', id: 'start_date' }, 'start date'); data.addcolumn({ type: 'date', id: 'end_date' }, 'end date'); data.addcolumn({ type: 'number', id: 'duration' }, 'duration'); data.addcolumn({ type: 'number', id: 'percent_complet

asp.net mvc 3 - 64 bits alternatives to linq to excel -

i have asp.net mvc 3 application in want import excel files. i managed using linq-to-excel library. when deployed application on iis got error turned out caused iis being running on 64bits system. this can solved enabling 32-bits applications option pool in iis. will affect performance of application? if yes, there alternative linq-to-excel works on 64-bits. https://code.google.com/p/linqtoexcel/wiki/usinglinqtoexcel x64 support if want linqtoexcel run in 64 bit application, make sure use 64 bit version of library. you need make sure have 64 bit version of access database engine installed on computer. and make sure manually set databaseengine property databaseengine.ace var excel = new excelqueryfactory("excelfilename"); excel.databaseengine = databaseengine.ace;

apache - docker: Says connection refused when attempting to connect to a published port -

i'm newbie @ docker. i'm creating hello, world example. i'm trying bring apache in docker , view default website host machine. dockerfile from centos:latest run yum install epel-release -y run yum install wget -y run yum install httpd -y expose 80 entrypoint ["/usr/sbin/httpd", "-d", "foreground"] and build it: > docker build . and tag it: docker tag 17283f566320 my:apache and run it: > docker run -p 80:9191 my:apache ah00558: httpd: not reliably determine server's qualified domain name, using 172.17.0.2. set 'servername' directive globally suppress message it runs.... in terminal window, attempt issue curl command view default web site. > curl -xget http://0.0.0.0:9191 curl: (7) failed connect 0.0.0.0 port 9191: connection refused > curl -xget http://localhost:9191 curl: (7) failed connect localhost port 9191: connection refused > curl -xget http://127.0.0.1:9191 curl: (7) failed con

php - magento phtml content does not show in product page view.phtml -

i creating custom block inside product page view.phtml . block created because can see block when turn on path hint. using plain html content template below: <div> new block </div> but if change template phtml content, returns message calling non-object function. below: template <?php $_helper = $this->helper('catalog/output'); ?> <?php $_product = $this->getproduct(); ?> <?php $productname = $_helper->productattribute($_product, $_product->getname(), 'name'); ?> <?php $producturl = $_helper->productattribute($_product, $_product->getproducturl(), 'product_url'); ?> <?php $productimage = $_product->getimageurl() ?> <div class="socialshare clearfix"> <ul> <li><a class="fa fa-facebook" href="javascript:popwin('https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($producturl); ?>&t=<?php echo urlencod

ios - uigesturerecognizer double click on tableviewcell + segue swift -

override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "editinfo"{ let selecteditem: nsmanagedobject = items[self.tableview.indexpathforselectedrow!.row] as! nsmanagedobject let viewcon: addviewcontroller = segue.destinationviewcontroller as! addviewcontroller viewcon.usernameupdate = selecteditem.valueforkey("username") as! string viewcon.emailupdate = selecteditem.valueforkey("email") as! string viewcon.existeditem = selecteditem } i tried following segue trigered on single tap let doubletap = uitapgesturerecognizer(target: self, action: nil) doubletap.numberoftapsrequired = 2 doubletap.numberoftouchesrequired = 1 cell.addgesturerecognizer(doubletap) check code double tap, simple. you can put in sample project, debug, maybe else blocking code work properly. override func viewdidload() { super.viewdidload()

java - Does it save more memory and is it more efficient to reuse recyclerviews? -

i have total of 4 recyclerviews, each has own xml recyclerview, better on memory usage have 4 fragments use 1 xml recyclerview or each have own recyclerview? if change have substantial effect on amount of allocated files in heap? a few things point out here: every fragment has unique view hierarchy. if want 4 fragments have recycler view, should declare in each fragment. if reuse save xml defined view between fragments, different instance of recycler view still created each fragment. there no such thing xml recycler view. xml used markup language specify view hierarchy. in end, views java objects. files not allocated on heap. objects are.

mongodb - Mongo 2.4 Text Command/ full text search using mongo-ruby-driver -

i want perform full text search on collection. since using mongo 2.4 mongodb's text command the way in mongo's console (as per mongo's official docs.) db.collection.runcommand( "text", { search: <string> }) it returns expected results. now, want achieve same in ruby/rails. using mongo gem version 1.8.4 as per change log/history there support new mongodb 2.4 index types but how can run text command on collection ruby. i went through blog post . did'nt update: i tried, command = bson::orderedhash.new command['find'] = collection command['text'] = {'search' => 'string'} result = @db.command(command) but gives database command 'find' failed: (ok: '0.0'; errmsg: 'no such cmd: find'; bad cmd: '{"find"=>"project", "text"=>{"search"=>"string"}}'). update 2: similar exists php . looking ruby's

How to use memset_s in Android NDK? -

android.ndk { modulename = "hello-jni" stl = "stlport_static" cflags.add("-std=iso9899:2011") // have used "-std=c11" ldlibs.addall(["android", "log"]) } i still cannot see memset_s in jni c code. says undefined reference. in c code have included string.h, stdlib.h, , stdio.h , #define stdc_want_lib_ext1 1 still cannot rid of error undefined reference error. if add flag allow_undefined_symbols compiles when ever call function memset_s crashes. the questions ask follows : 1) in of android ndk tool chains can c11 memset_s api? 2) other question have how can change default tool chain android in latest android studio experimental gradle alpha5? this functionally of "annex k" in c11 standard optional. not implemented in many c libraries. you can test conformance annex k means of macro __stdc_lib_ext1__ .

Creating a MySQL instance on Cloudbees Jenkins for running tests -

we using jenkins hosted on cloudbees building our github hosted code base. run integration test pipeline each build. that, need create mysql db before running integration tests on jenkins. there easy way create mysql db part of job in jenkins, on cloudbees? please @ cloudbees dev@cloud mysql guide . it covers configuring , starting mysql server runs inside build process. a persistent mysql server typically more troublesome need clear out tables prior each test run.

java - HorizontalGridView/ RecyclerView scroll position resets once Picasso image loads -

i have horizontalgridview , working well, loading images picasso , whenever image loads, horizontalgridview snaps first item/starting scroll position. have map fragment on activity , notice when map interacted with, horizontalgridview displays the same behavior. below adapter code. please help, have been stuck on 1 couple of days now... public class gridelementadapter extends recyclerview.adapter<gridelementadapter.simpleviewholder>{ private context context; private deal[] mdeals; public gridelementadapter(context context, deal[] deals){ this.context = context; this.mdeals = deals; } public static class simpleviewholder extends recyclerview.viewholder { public final imageview dealimage; public final textview dealtitle; public final textview dealsubtitle; public final textview dealprice; public final textview dealtime; public final textview dealdays; public simpleviewholder(view view) { super(view); dealimage = (im

ios - How do I set a different UITabBar.tintColor for every icon when selected? -

i have 4 icons. want them have different "highlight" color when selected. how can achieve this? in viewwillappear in presentedvc: override func viewwillappear(animated: bool) { self.tabbarcontroller.tabbar.tintcolor = uicolor.redcolor() super.viewwillappear(animated) } in other ones, different color.

java - Android Database isn't inserting data -

so have following piece of code, code trys add data database , if can't closes app. no matter app closes, advice package net.connormccarthy.walkingdeadcharacterprofiles; import java.util.arraylist; import android.app.activity; import android.database.cursor; import android.database.sqlite.sqlitedatabase; import android.graphics.color; import android.graphics.typeface; import android.os.bundle; import android.util.log; import android.view.view; import android.view.view.onclicklistener; import android.widget.button; import android.widget.edittext; import android.widget.tablelayout; import android.widget.tablerow; import android.widget.textview; public class rickaddnotes extends activity { sqlitedatabase db; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { // try catch block returns better error reporting log // android specific calls super.oncreate(savedinstancestate);

ios - Strange black border when using SKCropNode -

Image
i'm working on game spritekit , have square skspritenode corners want make round. can't use skshapenode because want add gradient it. decided use skcropnode crop it, when so, weird black border appears: if don't try crop it, looks this: this code using create , crop it: spritenode = skspritenode(color: color.skcolor, size: cgsize(width: tilesize, height: tilesize)) let borderradius: cgfloat = 2 let roundpath = cgpathcreatewithroundedrect(cgrect(x: -tilesize / 2, y: -tilesize / 2, width: tilesize, height: tilesize), borderradius, borderradius, nil) let mask = skshapenode() mask.path = roundpath mask.fillcolor = skcolor.whitecolor() mask.strokecolor = skcolor.whitecolor() let cropnode = skcropnode() cropnode.masknode = mask let shadow = skspritenode(color: skcolor.blackcolor(), size: cgsize(width: tilesize, height: tilesize)) shadow.colorblendfactor = 1 shadow.alpha = 0.25 let radius: cgfloat = 3.5 sha

Unable to store terminal output of subprocess with python -

my code has 2 potential outcomes in terminal: can't connect rfcomm socket: permission denied , can't connect rfcomm socket: host down . need store either result string in variable, i've tried has failed. code thought it: from subprocess import check_output out = check_output(["sudo", "rfcomm", "connect", "0", "aa:bb:cc:dd:ee:ff", "10"]) print "output: %s" % out instead nothing: user:~/home $./foo.py can't connect rfcomm socket: permission denied output: another attempt: proc = subprocess.popen(["sudo rfcom connect 0 aa:bb:cc:dd:ee:ff 10"], stdout=subprocess.pipe, shell=true) (out, err) = proc.communicate() print "output: %s" % out, err this @ least gives me when print. unfortunately it's "none" telling me there no error , not actual output: user:~/home $./foo.py can't connect rfcomm socket: permission denied output: none i've tried this

spring - CloudFoundry MySQL Java configuration -

i have spring mvc app running fine on local tomcat etc. spring 3.1 mvc/hibernate app. i using (where possible) pure java @configuration app - , trying deploy app cloudfoundry (via sts), struggling mysql db configured (from memory, xml config dont need , spring/cloudfoundry auto-injects required user/password etc, been while since deployed cf). i have tried both of following configurations: @bean public basicdatasource datasource() throws propertyvetoexception { //cloudfoundry config final cloudenvironment cloudenvironment = new cloudenvironment(); final list<mysqlserviceinfo> mysqlservices = cloudenvironment.getserviceinfos(mysqlserviceinfo.class); final mysqlserviceinfo serviceinfo = mysqlservices.get(0); basicdatasource bean = new basicdatasource(); bean.setdriverclassname("com.mysql.jdbc.driver"); bean.seturl(serviceinfo.geturl()); bean.setusername(serviceinfo.getusername()); bean.setpassword(serviceinfo.getpassw

html - Visual Studio 2013 Capitalization Rules -

i have been working on learning angular2 project using great blog post, cross-platform single page applications asp.net core 1.0, angular 2 & typescript . i created app.html file following html <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" [routerlink]="['/home']"><i class="fa fa-home fa-fw"></i>&nbsp;photo gallery</a> </div> </div> when highlight code , ch

How to split date string using Selenium webdriver -

i'm retrieving text value of last updated time application. output looks this: 03/02/2016 5:40:78 time dynamically changing. using "get text" retrieve last updated time , outputting console. i want split data. use split function achieve same. can observe there space between date , time string[] datetime = driver.findelement(by.xpath("your locator")).gettext().split(" "); string date = datetime[0]; string time = datetime[1]; system.out.println(date); system.out.println(time);

joomla - T3 template caching -

i have t3-framework based template on joomla site installed. when make changes template (for ex. site name/slogan, css color values thememagic, ...) , save, nothing updates in front-end. have turned global site caching off, nothing happend. css files code not change, though if switch css less, links css files in page souce code change less, nothing more, code kept same (old). may there internal caching function in t3 can turn off or may wrong saving changes template? most of time happens when permissions folders not set correctly. navigate files , folders via control panel , check permissions set as: write-protect critical directories , files changing directory permissions 755. file permissions 644.

ios - CLLocationManager not calling its delegate method -

i developing app involves tracking new location , updates server in x mins. stopping location updating when time diff equal or greater x mins, sending server , start updating location if less x mins. didupdatetolocation delegate methos not called when less x mins. i posting code here: - (void)locationmanager:(cllocationmanager *)manager didupdatetolocation:(cllocation *)newlocation fromlocation:(cllocation *)oldlocation { if (thediff > 10.0f || mydate == nil) { [self stopupdating]; } else { [self.mlocationmanager startupdatinglocation]; } } try this., //in .h cllocationmanager *locationmanager; @property (nonatomic,retain) cllocationmanager *locationmanager; // synthesize in .m @synthesize locationmanager; //in viewdidload locationmanager = [[cllocationmanager alloc] init]; locationmanager.delegate = self; locationmanager.distancefilter = kcldistancefilternone; // whenever mov

java - Data Structure to store given data, search and remove operation should be efficient -

i working on project in java . in project, first url web using jsoup . now performance reason, have store [ tag name, tag id, tag class name ] in container, , known tag id either null or unique. example, ["a", "fullsitelink", ""] ["div", "", "mob-footer"] ["div", "", "clear"] ["br", "", ""] ["ul", "", "mob-footer-links"] so please tell me data structure stores these information every tag, , can search, remove tag in efficient way. help me. in advance. so please tell me data structure stores these information every tag, , can search, remove tag in efficient way. i use hashmap . 1 of efficient data structures quick insertion, lookup, , removal. if isn't suited intend search style, a binary tree flexible data structure o(log n) search, insertion, , removal.

How to suppress a proc's return value in tcl prompt -

i'm relatively new in tcl, in tcl prompt, when invoke proc return value, proc's return value echoed tcl. there way stop (without affecting puts or similar functionality) example bash$ tclsh % proc {} { puts "hello"; return 34; } % hello 34 % now how suppress 34 coming screen? appreciated. update: proc part of tool, earlier did not have return value, conditionally can return value. can called script , there won't problem (as bryan pointed out). , can called interactive prompt, after necessary outputs, return value getting printed unnecessarily. 1) don't have facility of changing user's tclshrc 2) existing scripts should continue work. , seems strange every time proc called, after necessary outputs, number gets printed. user, needless information unless has caught value , wants something. wanted value delivered user, without getting printed prompt/ui (hope i'm clear ) the interactive shell code in tclsh , wish print non-empty re

ios - UIAppearance with UITableViewCell selectedBackgroundView -

in header uitableviewcell , selectedbackgroundview , backgroundcolor not labelled ui_appearance_selector , following code works: uitableviewcell *cellappearance = [uitableviewcell appearance]; cellappearance.backgroundcolor = kcellbackgroundcolor; uiview *selectedview = [uiview new]; selectedview.backgroundcolor = kmainprimarycolor; cellappearance.selectedbackgroundview = selectedview; the background colors of cells , selected animation modified of tables. ideas why works? know if properties on other objects work when not marked ui_appearance_selector .

javascript - i need to send a post request from the worklight adapter -

i using ibm worklight need send post request server worklight adapter calling in way supposed xml content response server getting html , failing kindly me same post request sending through rest client xml output coming perfectly my code in adapter is function showattributes() { var truevar ="true"; var pubvar ="public"; var gridvar = "gridview"; var gvar ="grid view 1 "; var request = '<rdf:rdf xmlns:dcterms="http://purl.org/dc/terms/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rs="http://www.w3.org/2001/sw/dataaccess/tests/result-set#" xmlns:rrmnav="http://com.ibm.rdm/navigation#" xmlns:rrmviewdata="http://com.rdm/viewdata#" xmlns:rt="https://crizz.net/qw/views" xmlns:rm="http://www.crizz.com/xmlns/rdm/rdf/" xmlns:xsd="http://www.w3.org/2001/xmlschema#" xmlns:rql="http://www.criz

python - Activating set_trace() selectively at runtime in pdb or sisters -

in pdb/ipdb/pudb, there trick whereby can selectively activate set_trace() statements during runtime? i'm debugging complex code probabilistic behavior, , interact program without debugger distracting, , when situation of interest arises, activate set_trace/s. (this combined logging, not relevant question). i think might possible conditionals, there better way? i think there no such way, pudb (and other debuggers) can set_trace() unconditially. i'm not sure trying accomplish moving condition set_trace() itself.. if have repetitive code there, wrap in function.

python - enforce captcha with google recaptcha v2 -

i had implemented google recaptcha v1 portal. want implement google recaptcha v2 portal. able display widget. want check validation part in python django backend. there way enforce , have captcha images displayed, development purpose, check code flow validation.

excel - Relative paths for VBScript file -

i have vbscript file open excel file , run macro. excel file located in same folder vbscript file. use relative paths call it, can move folder around without rewriting paths in script. right vbscript looks this: option explicit on error resume next excelmacroexample sub excelmacroexample() dim xlapp dim xlbook set xlapp = createobject("excel.application") set xlbook = xlapp.workbooks.open("c:\users\ben\desktop\geocodingbatchfile\files\geocodingstart.xlsm") xlapp.run "export" xlapp.quit set xlbook = nothing set xlapp = nothing end sub rather using full file path, great if this: set xlbook = xlapp.workbooks.open(".\geocodingstart.xlsm") you can use filesystemobject path script file, this sub excelmacroexample() dim xlapp dim xlbook dim fso set fso = createobject("scripting.filesystemobject") dim fullpath fullpat

What's the frame to write Kinect skeleton track program with gesture users can define with C#? -

i'm writing program kinect skeleton track program.while definition of gesture written in program. want definition of gesture defined user.one way of doing dfa. don't konw how start c#. can 1 help? try using lists store coordinates of skeleton's joints (kind of buffer) , maybe run dfa. define transitions range of coordinates every direction , , final state when elements in buffer approximativily in same area. so in c# need create datatype save sequece of gesture updated when user adds one.lists buffers stated below. when saving gesture code : while(!joint_stable && (i < buffer.count() ) ) { while ((buffer.joint.elementat(i+1).x-buffer.joint.elementat(i)).x>0 && (buffer.joint.elementat(i+1)-buffer.joint.elementat(i).y )>0 ) //think adding tolerence here { gesture.add("upper_right"); } ... } just advice , kinect sensor not accurate try establish kind of tolerance. i hope answer or @ least give inspiration :)

c++ - How do I make a button respond according to any input text? -

i have project working on. want user input specific number '8123' , clicks on 'show count', outputs message 'you have 8123'. if user inputs '812' , clicks on 'show count', should output 'this number 812'. /* make class name global variable */ tchar szclassname[ ] = _t("codeblockswindowsapp"); char str1[5], str2[5]; hwnd textbox; case wm_create: { hwnd hwndtextbox = createwindow (text("edit"), text (""), ws_visible | ws_childwindow | ws_border | wm_gettext, 100, 20, 130, 20, hwnd,(hmenu) null, null, null); createwindow (text("button"), text ("process "), ws_visible | ws_child , 200, 100, 70, 20, hwnd,(hmenu) 1, null, null); if ( sendmessage ( hwndtextbox , (uint) cb_addstring, (wparam) 0, (lparam) te

javascript - How to validate element directive in angularjs -

i want validate multi-select in angularjs. @ least 1 item should selected in multi-select. if not submit button should not enable. using require validate form. able make compulsory selection of first name using require , how compulsory multiselect . form <form ng-submit='addstudent()' name='studentform' novalidate=""> <div class="col-md-4"> <div class="col-md-12"> <label for="name">first name *</label> <input ng-model='student.first_name' name="name" type="text" placeholder="first name" required class="form-control"> </div> </div> <div class="col-md-4"> <div class="col-md-12"> <label for="name">last name </label> <input ng-model='student.last_name' name="name" type="text" placeholder=&q

java.lang.ClassCastException in Arrays.sort call though implementing Comparable -

i trying sort array of rectangles using arrays.sort . class rectangle implements comparable<rectangle> , have overridden compareto() method. these 2 classes: rectangle , tester class. public class rectangle implements comparable<rectangle> { private int length; private int width; public rectangle(int length, int width) { this.length = length; this.width = width; } public int getlength() { return length; } public int getwidth() { return width; } public int getperimeter() { return (2*length) + (2*width); } public int compareto(rectangle x) { int p2 = ((rectangle)x).getperimeter(); return this.getperimeter()-p2; } public string tostring() { return "perimeter: " + this.getperimeter(); } } import java.util.*; public class test { public static void main(string[] args) { rectangle[] rectangles = new rectangle[4]; rectangles[0] = new rectangle(3, 4); rectangles[1] = new rectangle(2, 6)

html - How to make <p> wrap around a word that is larger than the rest of the text -

i'm having trouble getting <p> text wrap around couple words made bold , large span tag. i'm linking code pen. html <div class="infocontainer"> <!--begin info section--> <div class="bio"> <h3>story of band</h3> <p><span id="biopop">coldclock<br>knockout</span> hard rock band hailing tampa bay, florida. band formed in april of 2015 after vocalist robby lynch , drummer bryan acton placed craigslist ad seeking bassist.</p> </div> </div> css in codepen link because wouldn't format properly. here's code pen link. . only add float:left in #biopop. it should work!!

ruby - Set hash value at arbitrary location -

i working on application i'd modify part of existing hash looks like: {a: {b: {c: 23}}} to be: {a: {b: {c: [23]}}} however, exact key set dynamic , @ unknown depth in hash. there way set value in hash given array of keys? i'm hoping like: my_hash['a','b','c'] = new_value getting value arbitrary depth straightforward via recursion, since traversal works on copies of data, rather references, don't know way set value without rebuilding entire array during traversal. except syntax ( my_hash['a','b','c'] ), following want h = {a: {b: {c: { e: 23}}, d: 34}} keys = ['a','b','c'] def replace_nested_value_by(h, keys, value) if keys.size > 1 replace_nested_value_by(h[keys.first.to_sym], keys[1..-1], value) elsif keys.size == 1 h[keys.first.to_sym] = value end end puts h replace_nested_value_by(h, keys, 42) puts h

Excel Formula Flag Triggering -

what i'm trying in excel figure out way trigger flag after condition has been met. e.g. have numbers , b. static while b changes. have flag f false. when b>a, f changes true , stays true regardless of future value of b. i trying circular reference, couldn't initial value out of it. possible while using formulas? i've been trying avoid using vba. or point in right direction appreciated. thanks a formula based solution circular references , allowing iterations messy. if can find can create in first place, after while nobody remember , how maintain it. vba writes value cell condition met more reliable , maintainable way. the code along lines of private sub worksheet_change(byval target range) if not intersect(target, range("b1")) nothing if range("f1") = false if range("b1") > range("a1") range("f1") = true end if end if end sub

salt stack - Using SaltStack, how can I watch for *one* file change in a git repository? -

for example, have git.latest state this: foobar: git.latest: - branch: production ... i want define cmd.run or cmd.wait state runs if , if one particular file in foobar git repository has changed. don't care if other files of repo have changed. how can that? there doesn't seem obvious in current release of saltstack (2015.8.4) if you're using github (or similar), use file.managed watch file changes: /tmp/egg: file.managed: - source: https://raw.githubusercontent.com/mafrosis/dotfiles/master/readme.md - source_hash: sha1=bf5b231d1b3dc9bc3217896f9f5d1c903b0779dd cmd.wait: - name: touch /tmp/bacon - watch: - file: /tmp/egg

sonarqube - Clicking on issue elipse link just shows a lightbulb, why? -

Image
clicking on ellipse link next issue, e.g. i little light-bulb icon x in lower right hand side of window. if click on link duplicated code similar x icon. why this? how fix this? this turned out browser problem. refreshed firefox , lightbulb icon expands window showing correct information. refreshing firefox fixed persistent "still working..." problem no menus, etc. available after installed sonarqube on new server.

Transactions and Continuation tokens in Windows Azure Storage Tables -

how many transactions fired retrieving 1200 entities in azure storage tables, keeping continuation tokens in mind. i have read " windows azure tables returns maximum of 1000 entities in single request , returns continuation token when more results(remaining 200 entities) available." see @ ( http://blog.smarx.com/posts/windows-azure-tables-expect-continuation-tokens-seriously ). because azure charges on basis of no. of transactions perform on cloud; want know: how many transactions executed single request returns 1200 entities(rows) continuation token after 1000th entity(row) result? how many transactions executed single request returns 1200 entities(rows) continuation token after 1000th entity(row) result? it depends. documentation states windows azure table returns maximum of 1000 entities in single request . means in case, minimum number of transactions 2 maximum number of transactions 1200. depends on how data partitioned , load on storage acc

excel - Pivot table with multiple items per transaction -

i trying create pivot table , pivot chart in excel 2016 based off of cattle auction data. data each auction includes: head of cattle, total weight, avg weight, price per lb, , price head. trying show avg price per head of particular weights. trouble when 1 transaction 30 head @ $800 , next 1 @ $700 shows average price of $750. want show average weight of 31 cattle @ $796 not average of transactions @ $750. ideas? from you've laid out in question, sounds should calculations in data before pivot it. basically, make new column [transaction] * [the head of cattle], in case new column values 24000 , 700, respectively. from there, can insert pivot table , use custom calculation. while in pivot table click on 'options' , click on "fields, items, & sets". set calculation in formula bar new field divided head of cattle.

html - Make <a> tag clickable for bigger area -

i have menu, want tag clickable on bigger area on hover, width , hegiht of menu. this code have now: http://jsfiddle.net/uwjtc/14/ html <div id="box"> <ul> <li><a href="#">basic good</a></li> <li><a href="#">this longer one</a></li> <li><a href="#">shorter</a></li> </ul> </div> css #box ul { width: 230px; height: 160px; float: right; margin: 0px 0 15px 900px; background:#999; list-style: none; } #box ul li { background: red; border: 1px solid #222; } #box ul li:hover { background: yellow; } #box ul li { padding: 10px; } i hope know mean. if don't please ask. like so? http://jsfiddle.net/allendar/uwjtc/16/ #box ul li { padding: 10px; display: block; width: 100%; }

java - How do I stream a SoundCloud users tracks? -

this first app building, not knowledgeable. have followed tutorial here http://www.sitepoint.com/develop-music-streaming-android-app/ , created simple music streaming app. however, streams whatever random songs come not sure where. have researched , found endpoint should /users/{userid}/tracks. guess not sure how implement this. adjusted url base endpoint many combinations of the ( https://api.soundcloud.com/users/ {userid}/tracks) can think of or see. changing wrong thing? need change more stored url? extra information - using android studio - can't post api reference link because of low reputation not hard find the api endpoint have correct, need pass clientid on every request. sign sc developers here . if clientid 9038420384208424 api call request should this: api.soundcloud.com/users/duvetcover/tracks/?client_id=9038420384208424&limit=200&linked_partitioning=1 the &limit=200 , &linked_partitioning=1 optional parameters.

mysql - .sql file failing to execute -

i in final steps of submitting lab school final condition being have copy/paste of commands corresponding question sql file named 'lab2.sql'. i've done when attempt execute file receive follow errors: source lab2.sql -bash: /*name: no such file or directory : no such file or directory -bash: /*section:: no such file or directory -bash: /*lab: no such file or directory -bash: /*can: no such file or directory -bash: /*consequently,: no such file or directory -bash: /*is: no such file or directory -bash: /*use: no such file or directory -bash: lab2.sql: line 12: syntax error near unexpected token `(' 'bash: lab2.sql: line 12: `alter table vendor add constraint vendor_v_code_pk primary key (v_code); portion of 'lab2.sql' file. /*name*/ /*student id*/ /*section: b*/ /*lab 2*/ /*can v_code column accept null values?: no*/ /*consequently, product entity existence-dependent of vendor entity?: yes*/ /*is product entity optional vendor entity?: yes*/ /*use

JSESSIONID and CSRF-TOKEN Spring security filters -

which concrete filters, provided spring security components, responsible 'dofilter' work jsessionid , csrf-token respectively? e.g. usernamepasswordauthenticationfilter handle login form posted client.

java - WebElement Visible and sometimes not Visible -

the element become visible , not become visible. element not in dom. how handle situation using selenium webdriver? 1st can wait element visible on dom webdriverwait wait = new webdriverwait(driver, 15); wait.until(expectedconditions.visibilityofelementlocated("your locator"))); you can check if element present on dom or not. use below code same if (driver.findelements("your locator").size() != 0) { driver.findelement(your locator).click(); system.out.println("element exists"); } else{ system.out.println("element not exists"); } hope :)

java - building maven project causing error -

when deploying maven project using command mvn clean install i got following error error : failed execute goal org.codehaus.mojo: tomcat-maven-plugin:1.1 : deploy-only (deault - cli) on project testapp : cannot invoke tomcat manager : server returned http response code : 403 url : http : //localhost : 8080/manager/html/deploy?path=%2ftestapp&war = -> i changed code in pom.xml <plugin> <groupid>org.codehaus.mojo</groupid> <artifactid>tomcat-maven-plugin</artifactid> <version>1.1</version> <configuration> <url>http://localhost:8080/manager/html</url> <warfile>target/testapp.war</warfile> </configuration> </plugin> when changed configuration url http://localhost:8080/manager/html chaned http://localhost:8080/manager/text then maven project deployed successfully. am doing correct? may know exact difference between them? thank y

debugging - Symfony 2 App debug mode error -

i'm trying implement twig custom error pages in symfony website (just following cookbook), when turn off debug mode (throught app kernel in app.php) whole application error 500 server. when debug mode true, application works fine. anyone had similar problem? check server's error logs , app/logs/prod.log find error causing 500 error there. clearing cache rm -rf app/cache/prod helps.

sql server - set date in create view -

i trying create view in sql server 2008 r2. need enter current date date import done. here have: set nocount on; declare @sql varchar(4000) --@cd date --set @cd = convert(varchar(30), cast(getdate() date), 110) -- insert statements procedure here set @sql = 'create view vw_gcs_export select division, [primary image id],[item number], [brand name],[marketing description], [colours]as colors,[live date],[sample type],substring([filename],charindex('+ char(39) + '_' + char(39) +',[filename],1)+1,charindex('+ char(39) + '.' + char(39) +',[filename],1)-5) batchid, '+ char(39) + '670' + char(39) +' status, [primary image id] + '+ char(39) + '_p' + char(39) +' [shot name], cast(null varchar(50))as [swatch/variation],cast(null varchar(50))as [alternate shot],[username],' + cast(convert(date,sysdatetime(),110)as varchar(10)) + ' [import date], cast(null varchar(50))as [retu

java - Panel with JScrollPane - Maintain preferred height for components -

i have mainpanel jscrollpane. has single button inside fixed height. the height of mainpanel should fixed @ 3 times height of button. so, mainpanel should button , amount of free space below button. now, dynamically add buttons mainpanel have added vertically , after 3 buttons scrollbars have kick in. which layout manager should use mainpanel achieve effect?

recursion - Recursively dropping elements from list in Haskell -

right i'm working on problem in haskell in i'm trying check list particular pair of values , return true/false depending on whether present in said list. question goes follows: define function called after takes list of integers , 2 integers parameters. after numbers num1 num2 should return true if num1 occurs in list , num2 occurs after num1 . if not must return false. my plan check head of list num1 , drop it, recursively go through until 'hit' it. then, i'll take head of tail , check against num2 until hit or reach end of list. i've gotten stuck pretty early, have far: after :: [int] -> int -> int -> bool after x y z | y /= head x = after (drop 1 x) y z however when try run such after [1,4,2,6,5] 4 5 format error. i'm not sure how word line such haskell understand i'm telling do. any appreciated! :) edit 1: error in question: program error: pattern match failure: after [3,num_fromint instnum_v30 4] 3 (num_f

System Variable missing for QTP? -

anyone ever had problem - open qtp on primary machine , tells me resources missing. odd since qtp files stored on central file server. if correct works fine. but, open qtp on secondary machine run tests after building them, , same missing resources. opening test on different machines , resetting path resources causing missing resources. i guessing missing system variable, not sure what. tried looking @ 2 machine system variables, nothing obvious pointing qtp files. note- started occurring when got new primary machine. unfortunately, did not notice until after have wiped old machine. again, expect need in system's environment variables, not sure what. any ideas? suggestions on read might help? name of psychic direct me in finding answer? :-) thanks, jamie i'm not sure mean if correct works fine sometime see problems network mapping going stale, in case accessing remote drive ( cd /d x: ) or re-preforming net use fixes problem.

html - My JavaScript works as inline code but not as an include file. Any ideas why and how to fix it? -

i have form: <form id="searchform" class="search_field" method="get" action=""> ... ... </form> then javascript: var form = document.getelementbyid("searchform"); form.dosearch1.onclick = searchpage; form.dosearch2.onclick = searchpage; form.showfeaturechoices.onclick = function( ) { var cbs = form.feattype; ( var c = 0; c < cbs.length; ++c ) { cbs[c].checked = false; } document.getelementbyid("featuresdiv").style.display = "block"; } function searchpage() { var form = document.getelementbyid("searchform"); var searchtext = form.searchbox.value.replace(/-/g,""); form.searchbox.value = searchtext; if (searchtext != "") { // collect features search for: var features = [ ]; var feattypes = form.feattype; (

How to know what's coming from push notification in iOS? -

i can't nslog simulator doesn't support push notification. how can view data coming push notification , what's in launchoption dictionary? first of want real devices check push notification. there 1 method check content of push notification in ios - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { nslog("%@",userinfo);//in userinfo content of push notification. } may you.

django - Coverage.py warning: No data was collected -

i having problem on testing django application. passes tests coverage.py doesn't give report coverage. luck on this? thanks try this: $ coverage run --source='./' manage.py test myapp $ coverage report

android - React Native ViewPagerAndroid with multiple visible pages -

Image
i've been trying use viewpagerandroid show carousel "stops" @ each item so: it appears react-native-carousel , react-native-swiper don't support these features yet on android. have native viewpager need do, i'm having problems incorporating react native environment. the native component carouselcontainer uses layout.xml , expects viewpager subcomponent. <com.mycompany.ui.carouselcontainer android:id="@+id/pager_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_margintop="10dp"> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="190dp" android:layout_height="280dp" android:layout_gravity="center_horizontal" /> </com.mycompany.ui.carouselcontainer > carouselcontainer framelayo