Posts

Showing posts from August, 2013

How can I import a module into powershell without waiting for it to complete? -

i have psm1 file want load $profile, takes long load. prefer load "in background" doesn't prevent immediate action in powershell prompt. if run job, don't functions psm1 file. ideas how can this? doesn't there flags "load in background" import-module. powershell jobs run in own session. imagine importing module working fine, not in powershell session want. see about_job_details why module take long load? maybe can improve that?

What are all the jars in External Library section in intellij maven project -

so on left hand side of intellij,i have project collapsable element , beneath external libraries section. i'm not sure jars in section. for instance, of jars - first few of them highlighted (library home) in brackets written it. see different kind of directory (different icon) called < 1. 7 > path in brackets well. inside it, has many jars saying library home. i've different kind of icon directories structure maven: group-id:artifact-id:version. i'm confused why of these maven , others library home, , how got there in first place. googling libraries in intellij floods result related how add 3rd party library intellij project, not interested in. the ones called < 1.7 > core libraries java sdk (version 7 in case). the ones (library home) set via project structure - ctrl + alt + shift + s. in project structure can define jars or directories in project settings -> libraries or platform settings -> global libraries . these configure

How can we safely store powershell credentials for script usage -

i looking secure means store powershell credentials use in scheduled-task script keep running road blocks. windows server 2008 environment primarily. the biggest issue have found if throw password out securestring text file , read in later, credential object inherently flawed use scriptable object. provides method exposes clear text information. $credentialobject.getnetworkcredential().password this means if has access system , task scheduler, can extract password used in script little trouble. does know of way around this? if take credential object , save using export-clixml , user exported can decrypt it, , on same computer. so scheduled task has run user. but task has able decrypt credential use it. there no way around that. can modify task or modify code task runs can credential. as @ebgreen said, setting credentials on scheduled task only, , not using credential object @ all, work, depends on you're trying do, can't tell without code. you try u

Yammer IOS SDK Doesn't Display Attachments -

with yammer ios sdk, getting image attachment message not display image. call works javascript sdk not ios sdk. -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath{ //navigate attachment screen if ([[[arrmessages objectatindex:indexpath.row] valueforkey:@"attachments"] count] > 0) { nslog(@"attachments : %@", [[arrmessages objectatindex:indexpath.row] valueforkey:@"attachments"]); nslog(@"content class : %@", [[[[arrmessages objectatindex:indexpath.row] valueforkey:@"attachments"] firstobject] valueforkey:@"content_class"]); nsstring *strcontentclass = [nsstring stringwithformat:@"%@", [[[[arrmessages objectatindex:indexpath.row] valueforkey:@"attachments"] firstobject] valueforkey:@"content_class"]]; if ([strcontentclass isequaltostring:@"image"] || [strcontentclass isequaltostring:@"video"]) { deta

ios - How to have two NSManagedObject classes with the same superclass -

i have 2 classes, mammals , fish , both inherit general superclass, animals . i'd store mammals , fish using core data, i've made them both subclasses of nsmanagedobject. so, when want mammals , fish , execute couple fetch requests. my question animals superclass. it's properties , methods used 2 subclasses, should nsmanagedobject well? if so, mammals , fish need explicit nsmanagedobject subclass because subclass animals ? is approach flawed? sorry if super-basic question, if answer "yes; no." 1 of answers here warned against using inheritance in data model, hence apprehension. make own decision whether inheritance model tie in knots in future. in direct answer question inheritance tree like... nsmanagedobject -> animal -> mammals -> fish so @interface animal : nsmanagedobject and @interface fish : animal just wary core-data not take complex rearrangement if need upgrade model in fut

jquery - How to disable Safari elastic scroll to stop a fixed div with a lower z-index being visible? -

i have div .drawer (cart drawer) has z-index lower main wrapper #pagecontainer of website. sits below. when button clicked main wrapper moves left reveal div underneath. everything fine except when viewing in safari due elastic scrolling if scroll past top of website can see div thats underneath. every other browser seems fine issue due elastic scroll. i need div fixed , display:block; don't want disappear when drawer closes. ideas how can disable elastic scroll site? or if there need apply css? any appreciated. here's demo site .drawer { position: fixed; display: block; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; top: 0; bottom: 0; padding: 0 ($gutter / 2) ($gutter / 2); max-width: 95%; z-index: 10; }

javascript - PHP doesn't process the form -

i'm having little problem here. have form jquery disables submit input when form submited. the problem is: use php process data when input submit clicked. apparently button being disabled first, php can not perform processing. need find way prevent this, take in code snippets: <form class='send' action='{$_server['php_self']}' method='post'> <!--form data--> <input type='submit' name='finish' value='send'/> </form> jquery function disable: $('.send').on('submit', function() { $(this).find('input[type="submit"]').prop("disabled", true); }); and php code process: if(isset($_post['finish'])) { //do things } as said, php don't process form because js disabled button prevent multiple submitions. how process php before disable button? thanks! since disabling submit button not send on to server in $_post variable

java - Remove commands from Spring-Shell -

i'm looking build diagnostic utility using spring-shell tech support team. idea drop executable jar on system, run app , have run through bunch of diagnostics. i want disable/remove of commands auto-loaded org.springframework.shell.commands package, , can't quite figure out how that. possible? failing that, customize command can output own help. can't work, though able figure out how remove them list of commands display when user hits tab . @cliavailabilityindicator({"!", "//", "script","system"}) public boolean isavailable() { return false; } any ideas? turns out, according http://docs.spring.io/spring-shell/docs/current/reference/htmlsingle/#d4e173 , spring shell apps can called command line argument disable internal commands. did in application's main method add argument myself. public static void main(string[] args) throws ioexception { arraylist<string> argslist = new arraylist<strin

vb.net - Reading seperate integers in a line -

i have line of text , integers this: text 10 9 8 my code far reads integers this: 1 10 109 1098 my code: dim total string x = 0 listbox1.items.count - 1 each ch char in listbox1.items(x) if char.isdigit(ch) total = string.concat(total & ch) listbox1.items.add(total) end if next next i want code read integers this: 10 9 8 thanks try this. idea good, added items.add @ wrong point. dim total string x = 0 listbox1.items.count - 1 each ch char in listbox1.items(x) if char.isdigit(ch) total = string.concat(total & ch) end if next listbox1.items.add(total) next end sub

Unit test for Spring boot Hibernate JPA based DAOs -

i trying write unit tests spring boot based application uses hibernate/jpa entities & daos. here steps i’ve followed far: 1) added following pom.xml <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-test</artifactid> <scope>test</scope> </dependency> <dependency> <groupid>org.hsqldb</groupid> <artifactid>hsqldb</artifactid> <scope>runtime</scope> </dependency> 2) in ../test/resources/application.properties, i’ve added this: spring.jpa.hibernate.ddl-auto = create-drop spring.jpa.database = hsql spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.hsqldialect spring.datasource.driverclassname = org.hsqldb.jdbcdriver spring.datasource.url: jdbc:hsqldb:mem:scratchdb spring.datasource.username = sa spring.datasource.password = 3) in ../test/resources/import.sql i’ve added few ‘insert into…’, data creati

ios - AudioUnitSetProperty Swift errors -

i trying set bands in equalizer using audiounitsetproperty cant figure out syntax in swift. code looks this: var eqfrequencies: nsarray = [ 32, 250, 500, 1000, 2000, 16000 ] var nobands = uint32(eqfrequencies.count) audiounitsetproperty(self.myappunit, audiounitparameterid(kaunbandeqproperty_numberofbands), audiounitscope(kaudiounitscope_global), 0, 6, uint32(sizeof(nobands))) anyone know correct way of doing this? try (compiles me in xcode 6.3): var eqfrequencies: [uint32] = [ 32, 250, 500, 1000, 2000, 16000 ] audiounitsetproperty( self.myappunit, audiounitpropertyid(kaunbandeqproperty_numberofbands), audiounitscope(kaudiounitscope_global), 0, eqfrequencies, uint32(eqfrequencies.count*sizeof(uint32)) ) swift griped various int types, hence casts, , size calculation wrong, band swift array of uint32 s ( not nsarray ) should convert automatically unsafepointer<void> .

javascript - Node async callback being called for operations complete -

i trying use async library in order deal asynchronous functions, , unable functionality need. the basic idea building json object using multiple calls redis database. want return json object after redis calls have been completed, tried using async.parallel don't seem understand properly. my callback called empty json object , console logs within functions seen. here code: server.js: gethostobject(redis,sess.hostname,function(data) { console.log('calledback data: '+json.stringify(data)); }); gethostobject.js var async = require('async'); var gethostobject = function(redis, hostname, callback) { var hostobject = { hostname: hostname, pushers: [], tracklist: [] }; var getsongobject = function(err,song) { console.log('song got!'); hostobject.tracklist.push(song); }; var getsongs = function() { redis.lrange(hostname+":songs",0,-1, function(err,data) { if (err)

asp.net mvc - Dynamic _Layout page without the user logging in? -

i'm looking put dynamic information in _layout.cshtml file. menus rendered on screen should different per user. trying @ _loginpartial in default application, unlike page, don't have "login" form on page send controller. in mvc application, user should logged in. i'm trying integrate our erp solution have here has it's own web service. user log web service, able click link on page , directed application. logging in handled our erp solution. @ time, menu should rendered differently based on user's permissions. in practice, time user accesses application, should "logged in", , never not "logged in". the erp solution have believe allows access user's id number (among few other items) passed among it's pages. can query database other required information need (ex. staff member or student?). in application, don't know how information , store in session prior _layout loading. it seems you're mixing abstract id

ajax - JSON parsing an array from PHP filled with SQL data returns [object Object] -

i'm trying make php file retrieve data sql db ajax call, , store data in json format. ajax call $.ajax({ method:"post", datatype:"json", crossdomain:true, url:"getcourses.php", success: function(response){ var courses=json.parse(response); var el=""; for(var i=0;i<courses.length;i++) { console.log(courses[i].title); } }, error: function(request,error){ console.log("error: request " + request + "\nspecific error: " + error); } }); php function //this test, not actual sql query $query="select * courses order id;"; $result=$mysqli->query($query); if($result->num_rows >0) //if there @ least 1 row... { $myarray= array(); //...create array... while($row = $result->fetch_array(mysql_assoc)){ //...fetch it... $myarray[]=$row; //...and add row $myarray ([] means autoincremen

ios - How do I access an iPads Document Directory through an NSURL -

i building app uses core data store objects internally, , url document directory returning nill. [[[nsfilemanager defaultmanager] urlsfordirectory:nsdocumentdirectory indomains:nsuserdomainmask] lastobject]; what doing incorrectly, or no close need be? appreciated. thanks! use nscachesdirectory if data can downloaded again. or nsapplicationsupportdirectory if data can't restored.

arrays - How to find a list of steps needed to reorder a list to get another list? -

let's assume have lists (expressed arrays or whatever in language). these lists equally long , contain same unique elements - in different order. for example: first list: a, b, c, d second list: a, d, b, c now i'm trying find list of steps needed reorder first list match second list. in example, there 1 step: 3 -> 1 that is, because element @ index 3 moved index 1. note b , c change indexes, because "making space" d when inserted @ index 1, step should not included in list of moves! another example: first list: a, b, c, d, e, f second list: d, b, a, c, e, f changes: 3 -> 0, 1 -> 1 because d moved index 0 , b moved 1. note b, use original index 1 instead of have been after first move performed. these steps "performed @ once" - meaning there no order, create new list putting moved elements should , filling remaining slots remaining elements. now question is: know algorithm this? thanks in advance! :) if need shortes

javascript - CasperJS viewport & viewportSize not resizing browser -

is having issues lately casperjs or phantomjs viewport or viewportsize ? i've tried using page.viewportsize = {width: 1280, height: 1024}; casper.start() .viewport(800, 600); casper.options.viewportsize = {width: 1290, height: 1024}; no matter put them in code browser size still stays default 300, 400. /*jshint strict:false*/ /*global caspererror, console, phantom, require*/ var links = []; var casper = require("casper").create(); var w = window.innerwidth; var h = window.innerheight; function getlinks() { var links = document.queryselectorall("h3.r a"); return array.prototype.map.call(links, function(e) { try { // google handles redirects hrefs script of theirs return (/url\?q=(.*)&sa=u/).exec(e.getattribute("href"))[1]; } catch (err) { return e.getattribute("href"); } }); } casper.options.viewportsize = {width: 1600, height: 950}; casper.star

windows - Checking if two files in batch are the same size -

if have path 2 files in different windows directories, how can compare same size? %appdata%/profiles.ini %username%/desktop/profiles.ini i want compare same file, first thing comes mind check the files have same name the files same size if can suggest better ways or improvements please say. as know file names , why need check if names same? not tested. this test if files have same size @echo off set "file1=%appdata%/profiles.ini" set "file2=%appdata%/profiles.ini" /f "tokens=1,2 delims=?" %%a in ("%file1%?%file2%") ( if %%~za equ %%~zb ( echo equal ) else ( echo not equal ) ) edit. may fc command need (compares content of 2 files). @echo off set "file1=%appdata%/profiles.ini" set "file2=%appdata%/profiles.ini" fc "%file1%" "%file2%" && ( echo files same color )||( echo files different )

How to implement a simple DataSet authoring workflow in CKAN? -

is possible implement though ckan plugins/extensions workflow allows organization admins or sysadmins preview dataset, optionally adding feedback , sending editor corrections before making public? we still don't have clear idea of kind of workflow want implement, think combination of using organizations private datasets reviewed organization admins , made public might work. what don't have sorted out yet how track datasets have been reviewed, ones returned corrections, etc... can done custom fields ? btw, we're using ckan 2.3 datastore , datapusher enabled.

python - Qt Widget with slider -

Image
i'm writing gui application using pyqt4 , need create widgets , dialog windows can slided vertically. after clicking "add new widgets" button (and moving down) create dynamically new small widgets (containing 2 textedit objects). want avoid situation when window's height small show widgets obvious solution seems slider. tried use qslider i'm not sure if it's best way , how configure such slider. class mydialog(qdialog): def __init__(self, parent=none): qdialog.__init__(self, parent) self.smallwidgets = list() self.resize(450,500) self.buttonposition = 60 firstwidget = smallwidget(self) firstwidget.setgeometry(qrect(5,5, 450, 80)) self.addwidgetbutton = qpushbutton(self) self.addwidgetbutton.settext("add new widget") self.addwidgetbutton.setgeometry(qrect(165,self.buttonposition,120,40)) self.connect(self.addwidgetbutton, qtcore.signal("clicked()"), self.addnewwidget) def addnewwidget

scala - Integrate counters with gatling -

i want know if it's possible integrate kamon counters placed in code mailbox-size gatling obtain graphics of in report. you can: use influxdb + graphana, or graphite metric storage + dashboard have kamon push storage through statsd have gatling push influxdb or graphite: http://gatling.io/docs/2.1.5/realtime_monitoring/index.html this way, can have metrics, both gatling , system under test side side in same dashboard.

How to construct generic without protocol in Swift? -

i'm getting following error... 't' cannot constructed because has no accessible initializers when compiling... class sub<t : equitable> { func def(v : t) -> bool{ var d = t() // <- error return d == v } } var s = sub<int>() println(s.def(0), s.def(1)) // i'm expecting "true, false" i understand in order generic type initialized, needs conform protocol contains init() constructor. such as... protocol : equitable { init() } class sub<t : a> { but get error type 'int' not conform protocol 'a' at line var s = sub<int>() so how go making value type such int or bool conform protocol can initialized? you need extend int adopt protocol a: class sub<t : a> { func def(v : t) -> bool{ var d = t() return d == v } } protocol : equatable { init() } extension int: { } var s = sub<int>() s.def(0) // true s.de

connector net - Set Program Name for display in MySQL Process List -

Image
is there way specify program name entry in process list? usually, connections 'none' or 'mysqlworkbench'. there 1 case saw name of .exe running in list of connections don't know why. here's picture of i'm talking mysqlworkbench client connections management page. i'm using connector/net 6.9.6, , didn't see in connection string options.

mysql - Join Two Tables and Replace Values Where Conditions Meet -

i'm trying come expression join 2 tables (the first two) third one. i want select 'sitepage' , 'medium' , join first 2 tables on rows right 5 characters matching between 'sitepage' , 'campaign id'. additionally, if there match, 'program' replace 'medium'. syntax? sitepage | medium xyz.com/campaign=12345 | xyz.com/campaign=23456 | c campaign id | program 12345 | b sitepage | medium xyz.com/campaign=12345 | b xyz.com/campaign=23456 | c http://i.stack.imgur.com/pq35n.png i based answer off of @juan's, had make adjustments work. select sitepage, coalesce(t2.program, t1.medium) medium table1 t1 left join table2 t2 on right(t1.sitepage, 5) = coalesce(t2.`campaign id`, -1); @abhik heading in right direction too. it's more generic 1 above, assumes last 5 characters of sitepage pertinent ones. said, have gone

c++ - Boost.Asio TCP moved-to socket destructor not enough to cleanly close? -

consider test program : #include <boost/asio/io_service.hpp> #include <boost/asio/ip/tcp.hpp> #include <functional> #include <iostream> static void callback (boost::asio::ip::tcp::socket && socket) { //boost::asio::ip::tcp::socket new_socket = std::move(socket); std::cout << "accepted" << std::endl; } static void on_accept (boost::asio::ip::tcp::acceptor & acceptor, boost::asio::ip::tcp::socket & socket, boost::system::error_code const & error) { if (error) { std::cerr << error << ' ' << error.message() << std::endl; return ; } callback(std::move(socket)); acceptor.async_accept ( socket, std::bind(on_accept, std::ref(acceptor), std::ref(socket), std::placeholders::_1) ); } int main () { boost::asio::io_service service; boost::asio::io_service::work

Calabash how to speed up execution time -

i have android device connected pc. running calabash test use following command: calabash-android run <name>.apk features/<name>.feature now before running feature calabash uploads application again witch takes time. how can disable this? any appreciated! thank you! you can control reinstallation of app using hooks file. contains cucumber hooks before , after scenario. if didn't make hooks file running it's 1 sample project. the bit you're looking 'reinstall_apps' command. if remove app won't ever reinstalled, can bad thing it's necessary reset app completely. way handle tag features want app reinstalled @reinstall_app , before |scenario| puts "starting scenario - #{scenario.name}" reinstall_app if scenario.source_tag_names.include?('@reinstall_app')) ... end

d3.js - d3 multi layer doughnut chart labels and dataupdate -

i new d3js. trying adapt example of 3 ring doughnut chart posted in different topic on forum. i need additionally text labels displayed on arcs , action trigger animation , update of chart data: http://jsfiddle.net/b88eqqn0/2/ var path = gs.selectall("path") .data(function(d) { return pie(d); }) .enter().append("path") .attr("fill", function(d, i) { return color(i); }) .attr("d", function(d, i, j) { return arc.innerradius(innerradius+(40*j)).outerradius(innerradius+40+(40*j))(d); }) .on("mousemove", function(d,i,j){ tooltip.style("left", d3.event.pagex+10+"px"); tooltip.style("top", d3.event.pagey-25+"px"); tooltip.style("display", "inline-block"); tooltip.select("span").text(seriesnames[j]+": " +d.data.name+" " +d.value); }).on("mouseout",function(){ tooltip.style("display&quo

c++ - How to squash bug that only occurs with optimizations enabled -

i'm in bit of pickle. have code until ran fine has started fail when optimizations enabled. code runs fine optimizations disabled -o0 both -o1 , -o2 cause issue occur (i don't use -o3 ). unfortunately, can't post source code (it's rather involved , proprietary) i'm going attempt minimal working example. meanwhile i'd love hear experience manner of c++ capable of resulting in unexpected optimizations enabled (what gotchas? should review first?). here's @ least give general idea of code first found issue: struct slice { const char* m_data; size_t m_size; } char scratch[1024]; slice result; read(read, &result, scratch); // optimizations disabled, result contains 40 bytes of data optimizations enabled m_size zero!? this nothing fancy, simple , straightforward c++ . i'm using gcc-4.8.1 have same issue clang++ on os x (visual c++ on windows not appear have issue). usually such unstable behaviour (different results different

mySQL where clause with alternative -

Image
i have mysql query should return row incase found value, otherwise should use default value: mean, try find specific language return row, if language not found, query should use default specific language variable. (inside php code) eg. $language=fr , query should return fr language row otherwise, should return default en language row select * my_table lang="$language" i want return row of en language default row in case fr language (or other language) not found. how can this? you can use case , order by select * table lang = case when lang = 'fr' 'fr' else 'en' end order lang = 'fr' desc limit 1

android - Genymotion and a CPU without SSSE3 -

i tried launched app in genymotion instantly failed. log [1] indicated fact set of ssse3 instructions missing. f/libyourapp.so( 1571): (null):0 ((null)): aborted. incompatible processor: missing feature 0x10 - ssse3. indeed, processor not support set of instructions - see /proc/cpuinfo [2] can worked around? or option buy newer cpu? [1] http://paste.ubuntu.com/10939987/ [2] http://paste.ubuntu.com/10938859/

javascript - Add jQuery to WordPress page -

i need add jquery library wordpress page. page rendered plugin shortcode. i've used below methods don't see working jquery script. i tried add these below script in main plugin file plugin name , version go. desn't work: function my_init() { if (!is_admin()) { wp_enqueue_script('jquery'); } } add_action('init', 'my_init'); desn't work function my_init() { if (!is_admin()) { // comment out next 2 lines load local copy of jquery wp_deregister_script('jquery'); wp_register_script('jquery', 'http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js', false, '1.4.2'); wp_enqueue_script('jquery'); } } add_action('init', 'my_init'); i need add below library wordpress front end page? http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js but if use directly below works. <script type="text/javascr

javascript - Get css value with phantom js -

i using cucumber , capybara run automation tests chrome , have option run them headless phantom js i trying background-image url value , can achieve with element :errorcontainer, "body.error .message-container" alert = people_form.errorcontainer.native.css_value('background-image') this return url, fails when running tests using phantom js nomethoderror: undefined method `css_value' #<capybara::poltergeist::node tag="div"> how can background-image url here please thanks try in way, hope give idea: page.find('div.user-image')['style'].should == 'background-image:url(/images/user_image.jpg)'

c# - Ribbon not showing in XAML -

Image
how can link looks this <grid> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition/> </grid.rowdefinitions> <ribbon x:name="ribbonwin" selectedindex="0"> </ribbon> </grid> i error saying the type 'ribbon' not found. verify not missing assembly reference , referenced assemblies have been built. i added windows.system.controls.ribbon reference i've added reference path documented on https://msdn.microsoft.com/en-us/library/6taasyc6(v=vs.80).aspx i using wpf .net framework 4.5 on windows 8.1 the application must run on windows 7 (and higher) you'll need add ribbon control toolbox in vs2015, drag-and-drop ribbon-associated controls (e.g. ribbon tab, ribbon group, ribbon button, etc) toolbox previously-added ribbon in mainwindow.xaml form @ design-time. to add ribbon control toolbox in vs2015, ri

HTML table using MySQLi and PHP -

i'm trying make table connected database can use information in database. i think i'm on right way, table displays first row. got ideas on what's going on? <table id="fairtable"> <tr> <td>fair name</td> <td>date</td> <td>are there?</td> <td>website</td> </tr> <?php $sql = "select `name`,`date`,`present`,`website` `dates`"; $results = mysqli_query($conn,$sql); while($rowitem = mysqli_fetch_array($results)) { echo "<tr>"; echo "<td>" . $rowitem['name'] . "</td>"; echo "<td>" . $rowitem['date'] . "</td>"; echo "<td>" . $rowitem['present'] . "</td>&qu

angularjs - removes few js reference during build -

i got yo template angular modify add additional js references suit requirement. noticed " <script src="bower_components/flexslider/jquery.flexslider.js"></script> " removed index.html file when build it. wasn't suppose inside <!-- bower.js --> tag? why getting removed during build? same main.scss, @import "bower_components/font-awesome-sass/assets/stylesheets/font-awesome.scss"; removed during build. main.scss $icon-font-path: "../bower_components/bootstrap-sass-official/assets/fonts/bootstrap/"; $fa-font-path: "../bower_components/font-awesome-sass/assets/fonts/font-awesome/"; // bower:scss @import "bower_components/font-awesome-sass/assets/stylesheets/font-awesome.scss"; @import "bootstrap-sass-official/assets/stylesheets/_bootstrap.scss"; // endbower .browsehappy { margin: 0.2em 0; background: #ccc; color: #000; padding: 0.2em 0; } body { padding: 0; } index.html

excel - Not Null in VBA -

if sheets("dealcomparison").cells(z + 1, 1) <> "" is statement right? want check if particular sheet not equal null in vba dim x integer x = 2 dim z long dim myarray(1 9) string z = 1 9 if trim(sheets("dealcomparison").cells(z + 1, 1)) <> "" myarray(z) = sheets("dealcomparison").cells(z + 1, 1) debug.print myarray(z) end if next z this full code guys, now want is,i want check if empty , if not empty hav pass . so whaat should mention in else statement fine .. if wish determine if object null should use isnull function: debug.print isnull(sheets("dealcomparison").cells(z + 1, 1)) or debug.print isnull(sheets("dealcomparison")) to test if particular sheet null, question asks. if want test 0 length string more efficient test using len(string) = 0 string = "" strings stored in memory number of characters firs

ios - UITableView Separator line disappears when cell is inserted at first position and bottom cell is selected -

Image
i have code follows: #import "testtableviewcontroller.h" @interface testtableviewcontroller () @property (nonatomic,strong) nsmutablearray *testdataarray; @end @implementation testtableviewcontroller - (void)viewdidload { [super viewdidload]; self.testdataarray = [[nsmutablearray alloc] init]; for(int = 0; < 20; i++){ [self.testdataarray addobject:[nsstring stringwithformat:@"teststring - %@",@(i)]]; } } #pragma mark - table view data source - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { return self.testdataarray.count; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"testcell" forindexpath:indexpath]; cell.textlabel.text = [self.testdataarray objectatindex:indexpath.row]; return cell; } - (ibaction)insertnewelement:(uibarbuttonitem *)sender { [self

jsf 2 - Populate user form (edit row) with user-specific data in JSF Managed Bean -

i'm using jsf (primefaces) in liferay , have problems. i have list of people (datatable) edit button every row in datatable. users have property differ 1 row others, e.g. football, basketball, tennis, , every user have of these categories. depending on properties, there different page/form needs filled. so, have 1 managedbean (pendingrequest.java) acts dispatcher/switcher recieves data person in row , switches user appropriate form. form has backing bean (e.g. page signfootballer.xhtml has bean footballer.java have getters , setters fields in page signfootballer.xhtml). so, user clicks on edit button row in table, method dispatchrequest starts running , checks category (football,...) , depending on category , initialize new object of class footballer , sets properties fill form (e.g. setname("john"), etc... because "edit user" functionality of application). public string dispatchrequest(person p) { if (p.getcategory.equals("tennis")) {

android - Do multiple product flavors assets get packaged with ever build variant? -

i have multiple product flavors in android app assets(drawables, fonts, colors) different each flavor. curious when generate apk 1 of build variants, bundle assets of other build variants present? it not copy resources/source other flavours, can verify changing extension of .apk file .zip , extracting it!

How to save numbers from a string as an integer in swift -

question says all. need save string , substrings of string integer, can averaging numbers. i think want this: var mystring = "1234" var myint = mystring.toint()!

javascript - Display unobtrusive message for jquery autocomplete field -

i can't seem find answer problem. have simple jquery autocomplete field , entry required model. when check validation method not highlighted. <tr> <td> <b style="color:red">*</b>find user id or enter new:<br /> @html.validationmessagefor(x=>x.userid) </td> <td> <input id="users" class="usermodel" style="text-transform:uppercase" /> @html.hiddenfor(x=>x.userid, new { @id = "txtuserid" }) </td> </tr> $("#users").autocomplete({ delay: 0, minlength: 0, autofocus: true, source: function (request, response) { $.ajax({ type: 'post', data: { 'data': request.term }, datatype: 'json', url: '@url.action(&qu

java - Get input from button -

i have program receives input command line before. want make gui using java swing. supposed have program flow such below: while(!end){ in = getinputfromuser(); /*value can 1,2, or 3*/ execute(in); /* else */ end = isendcondition(); } how can input using 3 buttons instead? depending on how gui should work, typically use actionlistener definied on button. here complete example (including text field) oracle documentation: https://docs.oracle.com/javase/tutorial/uiswing/events/actionlistener.html

javascript - AJAX PHP LOGIN Page is not redirecting correctly -

basically i've got ajax login page working , when login want redirect page without reloading i'm not sure how done new langauge. many thanks index.php <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="jquery.js"></script> <link rel="stylesheet" href="styles.css" type="text/css" /> <title>popup login</title> <script type="text/javascript"> $(document).ready(function(){ $("#login_a").click(function(){ $("#shadow").fadein("normal"); $("#login_form").fadein("normal"); $("#user_name").focus();

jQuery randomly add class to list items with limit -

i have bit fo code working fine, either doesn't add class or ads classe of wide items within list. i trying find solution limit how many of list items can have class of wide. i using more masonry wall , limit number of wide items within wall. my current code below, there way limit this? // random masonry item class on homepage jquery(document).ready(function(){ var classes = [" ", "wide"]; jquery(".mix-target").each(function(){ jquery(this).addclass(classes[~~(math.random()*classes.length)]); }); }); something this? jquery(document).ready(function(){ var classes = [" ", "wide"]; var limit = 3; jquery(".mix-target").each(function(){ if (limit == 0) return false; var index = ~~(math.random()*classes.length); if (index == 1) limit--; jquery(this).addclass(classes[index]); }); });

Python module error - beginner -

so i'm trying import appkit python project. using pycharm, every time try import, following error message: you using pip version 6.0.8, version 6.1.1 available. should consider upgrading via 'pip install --upgrade pip' command. collecting appkit using cached appkit-0.2.8.tar.gz collecting flask (from appkit) using cached flask-0.10.1.tar.gz collecting pygobject (from appkit) using cached pygobject-2.28.3.tar.bz2 traceback (most recent call last): file "<string>", line 20, in <module complete output command python setup.py egg_info: traceback (most recent call last): file "<string>", line 20, in <module ---------------------------------------- command "python setup.py egg_info" failed error code 1 in /private/var/folders/3p/csss5m7x30ldjd4z0xt6sg380000gn/t/pycharm-packaging0.tmp/pygobject i've tried running command directly through terminal etc, , have upgraded version of pip 6.1.1 well. not sure if beginner