Posts

Showing posts from June, 2015

Python: Read file with list as list -

i have placed list in text file. want python read text file , return contents list. however, instead reading content string: text file: ['a','b','c'] python: ids=[] writtenfile =open('file.txt') readfile=writtenfile.read() ids= readfile writtenfile.close() print ids what returned ['a','b','c'] string, not list or text. there way can retrieve ['a','b','c'] text file , store in ids string ids list ['a','b','c'] , not string ? "['a','b','c']"? use ast.literal_eval literally evaluate contents of file written though string: data = ast.literal_eval(open('data.txt').read()) # create file, read contents, evaluate

javascript - Image not appearing in mobile view -

i've been developing mobile-first site, using firefox primary browser. have branding logo @ top of page, loaded way of wordpress customizer. logo appears fine in firefox, disappears in chrome , safari when @ width of 320px. (that's base width project.) i'm troubleshooting , trying find best way fix problem. i'm not sure what's causing issue, yet, though. hoping other perspectives on this. here's link: --- link removed --- thanks! i suggest had helped me lot of times when did not know comes problem: reduce content part want fix(or in case if have bug , not know comes - start removing code element element). btw in developer tools showing lot of errors.

sharepoint 2010 - Set SPUser command in powershell -

can please confirm if powershell command sharepoint 2010 sends email when adding users sp groups. cannot test out right confirming whether if case how can not make send email user when being added group. comparing in ui when add user group there default check box sending email users. set-spuser -identity 'contoso\jdow' -web http://test -addpermissionlevel "contributor" thanks the code supplied doesn't add user sharepoint group. gives user contributor access site. default, not send email. have write powershell script send email. to add user group, this set-spuser -identity 'contoso\jdow' -web http://test -group 'groupname'

amazon s3 - copying file from local machine to Ubuntu 12.04 returning permission denied -

how grant myself permission transfer .crt file local machine aws ubuntu 12.04 server? i using following command machine , receiving permission denied response. scp -i /users/me/key_pair.pem /users/me/ssl-bundle.crt ubuntu@ec2-50-150-63-20.eu-west-1.compute.amazonaws.com:/etc/ssl/certs/ i following comodo's instruction. refer heading configure nginx virtual host link. have not set regards permission user. little new me , appreciate further sources of information. i changed permission of path on server , transferred file! with reference file permissions , gave /etc/ssl/certs/ path "add other write & execute" permission chmod command when ssh'd ubuntu server: sudo chmod o+wx /etc/ssl/certs/ then, on local machine, following command copied file on directory , transferred destination: scp -i /users/me/key_pair.pem /users/me/ssl-bundle.crt ubuntu@ec2-50-150-63-20.eu-west-1.compute.amazonaws.com:/etc/ssl/certs/ it write permission need,

python - OLS using statsmodel.formula.api versus statsmodel.api -

can explain me difference between ols in statsmodel.formula.api versus ols in statsmodel.api? using advertising data islr text, ran ols using both, , got different results. compared scikit-learn's linearregression. import numpy np import pandas pd import statsmodels.formula.api smf import statsmodels.api sm sklearn.linear_model import linearregression df = pd.read_csv("c:\...\advertising.csv") x1 = df.loc[:,['tv']] y1 = df.loc[:,['sales']] print "statsmodel.formula.api method" model1 = smf.ols(formula='sales ~ tv', data=df).fit() print model1.params print "\nstatsmodel.api method" model2 = sm.ols(y1, x1) results = model2.fit() print results.params print "\nsci-kit learn method" model3 = linearregression() model3.fit(x1, y1) print model3.coef_ print model3.intercept_ the output follows: statsmodel.formula.api method intercept 7.032594 tv 0.047537 dtype: float64 statsmodel.api method tv

c++ - Why does realpath() return error EEXIST? -

my program running in linux environment, compiled gcc version 4.4.7. i using realpath() "canonicalize" file paths. path of every directory , file feed realpath() exists, of course essential realpath() work properly. however, realpath() fail error code 17, name eexist , string description "file exists". that baffles me. of course exists, scream @ realpath() . realpath() unmoved ranting. documentation realpath() @ http://pubs.opengroup.org/onlinepubs/009695399/functions/realpath.html lists errors cause fail, eexist not 1 of them. why realpath() fail in way? examples of directory , file paths cause eexist error: an absolute path directory: /alpha/bravo/charlie/delta an absolute path file: /alpha/bravo/charlie/foo.txt a relative path file: ../../charlie/foo.txt a path file has dot in it: /alpha/bravo/charlie/./foo.txt but examples not definitive, because other files exact same patterns, , in same directories, succeeed. ther

excel - ActiveVBProject.References Error in .FullPath -

we have module checks machine information troubleshooting purposes. 1 of sub modules checks each reference breaks. single reference, microsoft office soap library 3.0 halts on error. we can work around it, i'm interested know causing error. reference valid, not broken. method of reference object fails library. method 'fullpath' of object 'reference' failed private sub geteachref() dim ref variant dim strref string 'on error resume next <- allows rest of code complete each ref in application.vbe.activevbproject.references frmabout.lst_about.additem "[reference] " & ref.description frmabout.lst_about.list(frmabout.lst_about.listcount - 1, 1) = ref.fullpath <- error here if ref.isbroken = true frmabout.lst_about.list(frmabout.lst_about.listcount - 1, 2) = "broken link" end if next end sub

php - Laravel [ErrorException] unserialize(): Error at offset 78 of 82 bytes -

i trying queue command in laravel. using database queue driver. dispatch happens fine , can see entry on database. when run listen command terminal php artisan queue:listen getting following error: [errorexception] unserialize(): error @ offset 78 of 82 bytes after 3 long hours of pulling own hair, able solve this. posting fix, in case, faces same issue. i injecting eloquent model command , laravel had trouble serializing/deserializing eloquent model after using serializesmodels trait. solution pass eloquent object id, instead of entire object, , fetch object in handler using id.

VlookUP as a solution or Multiple 'IF , 'And' & 'Or' statements for an Excel query (non VBA) -

have been racking brains problem, through these sites solution 1 has me beat!!! if can me appreciate it. oh guys can make sense of ramblings , problem :-) problem lies around 2 different inspection types , 2 different times (dates) required complete them. inspection type 1 has 3 days completed , inspection type 2 has 1 day . looking formula when columns a2000:e2000(could more, less depends on amount of inspections) copied , pasted sheet column f states(dynamically) if inspection type 'on target' or 'not on target' b c e f 1 inspection type date issued date due date completed on target 2 inspection type 1 19/05/2015 22/05/2015 20/05/2015 on target 3 inspection type 1 18/05/2015 21/05/2015 24/05/2015 off target 4 inspection type 2 10/05/2015 11/05/2015 11/05/2015 on target 5 inspection type 1 15/05/2015 16/05/2015 15/05/2015 on ta

NoClassDefFoundError when developing a basic java SWING app -

i'm learning swing on intellij. made quick app on gui designer contains button. compiled fine whenever run it throws error exception in thread "main" java.lang.noclassdeffounderror: com/intellij/uidesigner/core/gridlayoutmanager here's code (i run file main file) import javax.swing.*; import java.awt.event.mouseadapter; import java.awt.event.mouseevent; /** * created leon_clemente on 6/3/15. */ public class myfirsttest extends jframe { private jtabbedpane tabbedpane1; private jpanel panel1; private jbutton browsebutton; private jbutton uploadbutton; private jcheckbox checkbox1; private jcheckbox checkbox2; public myfirsttest() { /* browsebutton.addmouselistener(new mouseadapter() { @override public void mouseclicked(mouseevent e) { super.mouseclicked(e); } }); */ setvisible(true); } private void createuicomponents() { } } so read on foru

php - best way to update chat room quickly, and reliably? -

i working on basic chatting service, school project, , going used amongst students. have been quite successful, have had 1 problem. updating chatroom. in many of tests tends use 10 seconds message received, , recognized user sent it. it running php push messages chatfile , jquery load file. chat updated every 3 seconds. in tests chatfile gets updated instantly, actual chat not update fast, @ average of approximately 10 seconds. i believe must limiation in jquery. should move away jquery , find better solution, or there code? appreciated. in advance! there php in there too, load username , room name jquery code: var roomname = "<?php echo $_get["room"]; ?>"; var prevdata = ""; update(); setinterval(function(){update()},3000) $("#send").click(function(){ sendmessage(); }); $('#message').keyup(function(e){ if(e.keycode == 13) { sendmessage(); } }

javascript - How to use multiple directory for angular js templates? Using grails angular template asset pipeline plugin -

we want have project structure this: assets/javascripts/ - featurea/ - templatea.html - controllera.js - featureb/ - templateb.html - controllerb.js but angular template asset pipeline plugin accepts 1 directory/folder on config templates. grails { assets { angular { templatefolder = 'templates' modulenamebase = 'app' compresshtml = true preservehtmlcomments = false includepathinname = false } } } is there anyway plugin able scan nested folders under given template folder?

objective c - PSPDFKit upgrade -

i upgrading pspdfkit latest version having issues methods changed. looked in changelog not luck, , documentation not yet. i have following code [pdfcontroller.emailbuttonitem setsendoptions:pspdfdocumentsharingoptioncurrentpageonly|pspdfdocumentsharingoptionallpages|pspdfdocumentsharingoptionflattenannotations|pspdfdocumentsharingoptionembedannotations]; that want make work latest version. have seen in new version have like: pspdfdocumentsharingviewcontroller *sharingvc = [[pspdfdocumentsharingviewcontroller alloc] initwithdocument:document visiblepages:nil allowedsharingoptions:pspdfdocumentsharingoptioncurrentpageonly|pspdfdocumentsharingoptionallpages|pspdfdocumentsharingoptionflattenannotations|pspdfdocumentsharingoptionembedannotations]; but don´t know how apply pspdfviewcontroller object (pdfcontroller). also know how move new version: pdfcontroller.emailbuttonitem.mailcomposeviewcontrollercustomizationblock = ^(mfmailcomposeviewcontroller *mailcontroller) {

JSON parameters not available in request hash (Rails, omniauth-google-oauth2 gem) -

overview i want implement google oauth2 server side (hybrid) omniauth google oauth2 gem (0.2.6). however, code parameter send app not added request.params hash. thus, omniauth throws error, can't find code. details after retrieving auth code google send server (by ajax): // send code server $.ajax({ type: 'post', url: '/auth/google_oauth2/callback', contenttype: 'application/json', success: function(result) { // handle or verify server response. }, processdata: false, data: json.stringify(password_result) }); this throws error: "error" : "invalid_request", "error_description" : "missing required parameter: code" after going through stack, figured out following: as long have 'application/json' set content type, rack parses params correctly , env object contains parsed parameters: "action_dispatch.request.request_parameters"

Visual Studio 2015 RC intellisense does not display parameter list -

Image
i have been using visual studio 2015 since ctp 6 , have noticed ide not show parameter list when type opening parenthesis "(". this expecting see: in screenshot above see the create method has 2 overloads , displays when type open parenthesis. in visual studio ctp 6 , rc, nothing happens. cannot see overloads or parameter list. is bug? there anyway fix issue? here's answer: go tools, options, text editor, languages, general. check following options (override 'mixed' check): - auto list members - parameter information

authentication - Problems reading and writing MIFARE cards -

when i'm triying read or write mifare classic card following output: nfc-mfclassic r mfoc_output.mfd mfoc_output.mfd nfc reader: acs / acr122u picc interface opened expected mifare classic card uid starting as: 00000000 got card uid starting as: 049f30b2 aborting! any ideas? thank answer michael, that's not working either output: nfc-mfclassic r mfoc_output.mfd nfc reader: acs / acr122u picc interface opened found mifare classic card: iso/iec 14443a (106 kbps) target: atqa (sens_res): 00 04 uid (nfcid1): 04 9f 30 b2 sak (sel_res): 08 guessing size: seems 1024-byte card reading out 64 blocks |nfc_initiator_transceive_bytes: mifare authentication failed nfc_initiator_transceive_bytes: mifare authentication failed nfc_initiator_transceive_bytes: mifare authentication failed nfc_initiator_transceive_bytes: mifare authentication failed nfc_initiator_transceive_bytes: mifare authentication failed nfc_initiator_transceive_by

javascript - HTMLCollection Length does not match logged object -

Image
// find posts var posts = node.getelementsbyclassname("usercontentwrapper"); var post, text; console.log(posts); console.log(typeof(posts)); console.log(object.keys(posts)); console.log(posts.length); the above outputs: :( don't understand. why length 0? works in fiddle: http://jsfiddle.net/p7yfv37s/ i printed object again after length, , still shows length: 4. if put cursor on i icon see htmlcollection state captured upon first expansion. not show state @ moment of console.log invocation. most logging performed before dom loaded or node dynamically populated javascript. htmlcollection kind of live collection track dom changes ( more info difference between htmlcollection , nodelist ) see simple example: http://jsfiddle.net/p7yfv37s/1/

ruby on rails - Low level caching for collection -

i want use redis low level caching in rails app. in controller books: class bookscontroller < applicationcontroller def index @books = book.order(:title) end end and view iterates on this: <ul> - @books.each |book| <li>= "#{book.title} - #{book.author}"</li> </ul> now want exact same result cached. have redis setup , running. should use cached_books method in controller this: @books = book.cached_books.order(:title) and leave view is, or use book.cached_title , book.cached_author in view , leave controller is? and how cached_books method in book model? class book < activerecord::base ... def cached_books rails.cache.fetch([self, "books"]) { books.to_a } end end for simplicity sake leave out expire strategies now, need there. so should use cached_books method in controller this: yes, can. although there's gotchas have aware of. book activerecord . when call book.some

sql - Postgres 9.2 find, compare and replace two values in column -

hi trying run query find 2 values in same column, compare them , set highest value both , bit confused. i can not work out how prettily have gone ugly approach , still lost. i have table data in bit this fruitname fruitvalue apples 11 pears 10 oranges 2 i want able query table , values apples , pears. want replace value of apples or pears based on highest value like this fruitname fruitvalue apples 11 pears 11 oranges 2 the code below gets me highest value select max (fruitvalue) fruit fruitname in ('apple','pear') but can work out how turn result variable , assign fruitname. for example $variable = select max (fruitvalue) fruit fruitname in ('apple','pear') update fruittable set fruitvalue = '$variable' fruitname = 'apple'; update fruittable set fruitvalue = '$variable' fruitname = 'pears'; no need variable, can use select maximum value di

Cannot load static resources when using web fragments and spring -

i have main spring hello webapp, has include in web.xml include web-fragment. can't seem access tot static resources in jar, im using tomcat 7, servlet 3, spring 3.2.3.release and jar structure test.jar->meta-inf->test.css but when load app, url: http://localhost:8686/spring-fragment-test/test.css does not seem work, keep getting 404 i have configured following: spring.xml in main app <!-- enables spring mvc @controller programming model --> <annotation-driven /> <!-- handles http requests /resources/** efficiently serving static resources in ${webapproot}/resources directory --> <resources mapping="/resources/**" location="/resources/" /> <!-- resolves views selected rendering @controllers .jsp resources in /web-inf/views directory --> <beans:bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <beans:property name="prefix"

php - Is it possible to change the string in an array from mysql output -

this question has answer here: convert 1 date format in php 12 answers i know if possible change string format in array. in example down below change $doletzterwurm['date'] format 0000-00-00(year-month-day) day-month-year. i know use old mysql query, change soonish ;) <?php $search1 = "select * `wurm_stats` order `id` desc limit 1"; $letzterwurm = mysql_query($search1); while ($doletzterwurm= mysql_fetch_array($letzterwurm)) { echo "<br></br><div style='text-align:center;color:#ffffff;font-size: 24px;'>letzter wurm eintrag " .$doletzterwurm['date']. " von " .$doletzterwurm['eingetragenvon']. " </br>"; } ?> it's possible, see date function. echo '[...]' . date('d-m-y', $doletzterwurm['date']) . '[...]

neo4j - Neoj4 native driver vs REST -

i'm working neo4j neo4jclient library .net ( https://github.com/readify/neo4jclient/wiki ) this library uses rest capabilities of neo4j. wondering if isn't performance issue compared example java jdbc-drivers ( http://neo4j.com/developer/java/ ). the applications developing real-time , should performant (noticable delays not acceptable).

excel - Local (workbook-specific) functions without using VBA or VSTO -

i looking way create workbook-local functions in c++ (unmanaged). vba not appropriate use case. unfortunately, that's way know of create workbook-local function. (i'm not terribly familiar vsto, there may way there, cannot used managed code this.) know how create functions xlls, , know how create automation addin exposes functions through idispatch. however, both of these seem global functions only. does know way this? worksheet != workbook i don't know of way create worksheet-local functions. in vba expose functions need standard module (.bas) without option private module option set, exposing public function - function usable in every worksheet of workbook that's containing it. a worksheet class module, , lives object instance: public function members therefore not usable worksheet functions. functions workbook-local , not worksheet-local . now, that's meant anyway, given add-in approach being referred creating "global" fun

provisioning - unable create ondrive with csom -

i create users via code csom since months. assign them license , create 1 drive fill structure of folders , shares points. worked well, in recent weeks provisioning onedrive stops working. means command csom createpersonalsiteenqueuebulk executed without error, however, users onedrive not done , impossible create folders. if log onto office 365 user account , create ondrive can use csom code create folder , on. here code executed without error. (48h after onedrive not create) _context.authenticationmode = clientauthenticationmode.default; _context.credentials = new sharepointonlinecredentials (email, getsecurepassword); profileloader _profileloader = profileloader.getprofileloader (_context); _profileloader.createpersonalsiteenqueuebulk (emailids); _profileloader.context.executequery (); the questions are: where can follow requests put in queue creating onedrives in office 365 administration interface ? does methode change ? can use parameter i

java - TomEE starts but Netbeans gives "Failed to start" error -

i'm using netbeans 8.0.2 (also, tried in latest nightly build) , trying start tomee plume server on port 8084 (tried on different port too). server starts , works fine, netbeans thinks not started , after approximately 2 minutes of waiting ("waiting tomcat") throws error window "tomcat failed start" or that. there questions similar mine difference have totally no errors, "tomcat failed start" window, can't put log here says nothing useful. also, available solutions not working me. i believe there's communication problems between netbeans , tomee, i'm sure problem in netbeans because tomee works , starts should, localhost:8084 gives me tomcat page though netbeans think failed start. there's small chance reason tomee not sending confirmation netbeans after starting, have no ideas how check that. i've looked same issues, 2 common problems "'127.0.0.1*' not recognized internal or external command" , same have

git merge - git - exclude commits when rebasing -

i have merged feature not ready go master. without realizing rebased bad master branch good. but not sure how pull bad commits out of other story. here git log file commit 15bb0d630f9b9cf59axxxxxxx8100d3a7302 author: moises zaragoza <mzaragoza@xxxx.com> date: mon jun 1 11:45:31 2015 -0400 updates commit 3caf183afe3f5d7dcfxxxxxxxa239d44c8dfd11a author: moises zaragoza <mzaragoza@xxxx.com> date: mon jun 1 11:45:31 2015 -0400 updates commit 3c6c81c7a3215fcdxxxxxxxb56a5540745c397 author: moises zaragoza <mzaragoza@xxxx.com> date: wed jun 3 16:59:31 2015 -0400 bad commit should not here if haven't pushed code yet, can interractive rebase , delete commits : git rebase --interractive 3c6c81c7a3215fcdxxxxxxxb56a5540745c397^ you end editor commit history: 3c6c81c7a3215fcdxxxxxxxb56a5540745c397 bad commit should not here 3caf183afe3f5d7dcfxxxxxxxa239d44c8dfd11a updates 15bb0d630f9b9cf59axxxxxxx8100d3a7302 updates if wa

unit testing - Nosetests assert_equal apparently not equal to python == -

i'm programming temperature control setup has different sources (in example one): source = source() sources_dict = { key: source } temp_control = tempcontrol(args) #a dictionary built on instantiation based on args #and assigned temp_control.sources sources_dict defined same args of tempcontrol(args). see content of loop works , not. for key, value in tempcontrol.sources.iteritems(): assert_equal(value, sources_dict[key]) #fails tempcontrol.sources[key] == sources_dict[key] #works value == sources_dict[key] #works when not, following error message: assertionerror: <pvd_temp_control.source object @ 0x02aa63b0> != <pvd_temp_cont rol.source object @ 0x02aa6330> -------------------- >> begin captured stdout << --------------------- sources_dict: {'cu': <pvd_temp_control.source object @ 0x02aa6330>} tempcontrol.sources: {'cu': <pvd_temp_control.source object @ 0x02aa63b0&g

angularjs - ngMaterial dependency not working -

there 2 pages home.html , about.html using 'ui.router' when click router (about.html) current view (home.html) down , new view appears on top , vice versa. happening when ngmaterial include dependency , want use angular material . solution? just updated bower , resolved it. so, solution was: bower update

Analytics PHP Interface (GAPI) User Impersonation -

i've got around 100 sites in analytics across few different google accounts , 1 single account has full permissions every site. if possible i'd avoid having manually add permissions google service account each analytics profile. i'm using google analytics php interface when attempting impersonate user using $delegate_email argument, following exception: gapi: failed authenticate user. error: "{ "error": "unauthorized_client", "error_description": "unauthorized client or scope in request." } i have read elsewhere needing 'delegate domain-wide authority service account' using google apps admin console. don't have google apps @ all. there way around this? tl;dr there way read access google analytics using service account , impersonating user without google apps? i first encourage go through various scenarios listed on google oauth 2.0 documentation , decide best application. service ac

Git: how to compare to changesets without comitting them? -

given have code generation tool updates files in our working dir. run tool 2 different parameters , want understand difference brings. possible git somehow? something has worked me like: # make change git diff > first-try.patch # make different change git diff > second-try.patch interdiff first-try.patch second-try.patch the interdiff shows diff of diffs, useful. typically need patchutils installed on linux machine interdiff. the other choice be: # make change git commit -m "first try" # make note of commit id... call commit1 # restore tree git reset --hard head^ # make second change git commit -m "second try" git diff commit1 head # go original starting point. git reset --hard head^ i idea less, since can screw things if make mistake. it's easier in other ways (doesn't require interdiff, instance). note: might think can reference commit1 since back-pedaled, that's not true. git leave object around , clean later, lon

html - How to make div's width fit content not window -

in following code, how make "#wrap" width fit childs width, , not limit browser window bounds ? html <div id="wrap">wrap <div id="menu">menu</div> <div id="large-content">large content</div> </div> css #wrap{background: #eee;} #large-content{background: #f1c40f; width: 1000px; height: 300px} #menu{background: #2c3e50; width: 100%; height: 50px} jsfiddle https://jsfiddle.net/67egnpho/1/ the childs width 100% fitting it. adding display: inline-block; keep inline it's contents. #wrap{background: #eee; display: inline-block;}

spring-saml assertion from fake idp -

sp metadata generated wantassertionssigned="false" allow process fakes saml response in spring-saml sp. maybe obvious, i'd experts confirm it. if create fake idp "non signed metadata" , in relying-party.xml set signassertions="never" encryptassertions="never", i can send sp assertion want because verifyassertionsignature skipped , check "// make sure @ least 1 assertion contains authentication // statement , subject bearer confirmation " positive. i have changed default , boolean wantsigned = true; in org.springframework.security.saml.websso.webssoprofileconsumerimpl because cant allow in no way. thanks in advance alessandro setting wantassertionssigned false mean incoming messages not require digital signature (equivalent of never/never in shibboleth). agree it's dangerous setting , make meaning more explicit.

css - html float stacking order -

i have tree elements i'd floated, <div class="title">name</div> <div class="description">slogan</div> <div class="navbar"></div> css is: .title, .description{ float:left; } .navbar{ float:right; } i'd site description sit underneath title before navbar does. so, know html wrong, 2 float lefts should in own div , div should have percentage width forces them stack, setting width not i'd it's limiting can entered. ideally need 3 inline elements width can dynamic. thanks! jesse. edit: here's fiddle: https://jsfiddle.net/flw8xac0/1/ as can see nav bar stacks first just put .description under .navbar , remove float . <style> .title {float: left;} .navbar {float: right;} </style> <div class="title">name</div> <div class="navbar"></div> <div class="description">slogan</div> https://jsfid

javascript - Open page with a pre expanded table row -

i have bootstrap table expandable rows, want is, opening page expanded row (say first row). below table using. <table class="table no-padding-table"> <thead> <tr> <th>date</th> <th>date2</th> <th>date3</th> </tr> <tbody> <tr data-toggle="collapse" data-target="#extend{{$index}}" ng-repeat-start="date in dates"> <td> <p>{{date}}</p> </td> <td> <p>{{date}}</p> </td> <td> <p>{{date}}</p> </td> </tr> <tr ng-repeat-end=""> <td colspan="3"

c++ - CLion CMakeLists.txt add argv arguments to configuration -

i have configuration in cmakelists.txt set(source_files client/client.cpp) add_executable(client ${source_files} client/client.cpp) so can launch client.cpp in clion (shift + f10). if need launch client.cpp argv parameter (it has 1 integer parameter) must change configuration in clion adding program arguments. maybe can add parameters using cmakelists.txt? cmakelist responsible configuring program, generating makefile, build program binary. clion launch binary using arguments specified.

how to send parameter to a dll with nunit command? -

i run through console myprogram.dll nunit . i'd myprogram.dll coded receive specific date date stop. nunit-console myprogram.dll i know achieve writing date stop in text file , function [test] read in document. there more direct way?

android - ListView has "blank" rows -

Image
my listview size isn't updating according adapter, , i'm not sure why (this happening after filter based on category, i'll post category filter well) can see after looking @ images there blank rows in filtered tab. image of "all" tab: here getview method: public view getview(int position,view view,viewgroup parent) { layoutinflater inflater = ctx.getlayoutinflater(); view rowview = inflater.inflate(r.layout.list_item, null, true); try { item = getforname(names.get(position)); if (i.iscategory()) { rowview = inflater.inflate(r.layout.cat_item, null, true); textview text = (textview) rowview.findviewbyid(r.id.cattxt); text.settext(i.gettitle()); text.settypeface(null, typeface.bold); } else { textview text = (textview) rowview.findviewbyid(r.id.listtext); imageview image = (imageview) rowview.findviewb

php - Two layer conditional queries in Laravel -

i'm new laravel , have been searching through documentation , haven't found answer fits need do. i'm trying run flexible search query on products database. so people can search name or sku ect. don't can leave fields blank. so when input null replace "no(field)entered". my search query has first check if field null, if not, needs filter parameter given. a quick sql representation of i'm doing this. $results = db::connection('sqlsrv')->select("select top 500 * dbo.simpleorderview ('". $name ."' = 'nonameentered' or name '%". $name ."%') , ('". $sku ."' = 'noskuentered' or sku '%". $sku ."%') , ('". $description ."' = 'nodescriptionentered' or shortdescription '%". $description ."%')"); so query messy, works expected. i'd use eloquent clean , make perform way supposed to. thanks in

sql server - SQL Query to Get Sum of Program Values using Calculations and Conditions -

i asked question similar earlier don't think gave enough info trying do. have following tables. program table - prog_id, prog_name unit table - unit_id, unit_name, prog_id max_beds max_budgeted-beds max_unbudgeted-beds max_escalation-beds import_data table - bed_id, unit_id ...other unrelated data bed table - bed_id, bed_type_id bed type table - bed_type_id, bed_type i trying determine following column headers in output: occupied beds --total occupied beds (sum of beds of type 'regular' in import table) (sum(case when bed_type.bed_type_description = 'regular' 1 else 0 end)) 'total occupied' budgeted beds --occupied budgeted beds (if # of 'regular' beds program < max_budgeted_beds sum of 'regular' beds program, if > budgeted value = max_budgeted_beds program) (sum when < max

android - Total number of Play Store Views including the ones directed from Google Play App Search Results (not just from campaigns) -

google analytics has "google play referral report" helps in getting total number of views of our app description page on google play app. counts views directed campaign or source. if search app on google play app , open description page , install app, data not shown in "google play referral report". there way can absolute total number of app description page views of app including referrer page views, direct search on google play app or direct url open without campaign.

jquery - Javascript if an option is selected than a new sets of option appear -

in nutshell, when user selects option, set of options appear in relationship option selected. below have done far: the html: <form method="" action=""> <input type="file" placeholder="upload project"> <select id="selectprovider"> <option disabled selected> select training platform </option> <option value="1"> option 1</option> <option value="2"> option 2 </option> <option value="3"> option 3 </option> <option value="4"> option 4 </option> <option value="5"> option 5 </option> </select> </form> the javascript: <script> $(function(){ if ($('#selectprovider').val(1)) { //that's stopped } }); </script> i.e. if option 1 selected followi

python 2.7 - Import only library essentials from Pandas -

i using pandas python program. importing pandas slows down load-up bit, wondering if there's way import bare essentials doing from pandas import x . the functions using are: import pandas pd df = pd.read_csv df[""].apply() df.to_csv("file.csv")

c# - rdlc report not showing the report -

i showing rdlc report gives me error (the report definition "rptattendence.rdlc" report not specified). here code doing wron it? in advance. private void rptattendence_load(object sender, eventargs e) { try { oledbconnection con = new oledbconnection(@"provider=microsoft.ace.oledb.12.0;data source=c:\users\jani\documents\saloo.accdb"); oledbcommand cmd = new oledbcommand(); cmd.commandtext = "select student.name, student.fname,class.name class, [section].name [section], attendence.attendence, attendence.dat [date] " + "(((attendence inner join student on attendence.studentid =student.id) inner join class on attendence.classid= class.id) inner join [section] on attendence.sectionid = [section].id)"; oledbdataadapter adapter = new oledbdataadapter(); datatable table = new datatable(); cmd.connecti

Typescript Marionette UI object -

i have tried implementing marionette itemview in typescript , wanted use ui object simplify calls ui elements described in marionette documentation . i made following example simplify it: /// <reference path="scripts/typings/marionette/marionette.d.ts" /> interface settings { el: template: function } class myapp extends marionette.itemview<backbone.model> { constructor(options: settings) { super(options); } ui = { hello: '.hello' } events() { return { 'click @ui.hello': 'heyworld' } } heyworld() { console.log("hey heyworld!!!!"); } } window.onload = () => { var app = new myapp({ el: document.getelementbyid('content'), template: (data) => { return '<div class="hello"><p>hej world - click me</p></div>'; } }); app.render();

android studio - HAX kernel module is not installed - AMD processor -

i've installed android studio , i'm trying run hello world app see works should. evidently doesn't. i've followed every step on android developer site setting android studio, yet error when try run app: emulator: error: x86 emulation requires hardware acceleration! please ensure intel haxm installed , usable. cpu acceleration status: hax kernel module not installed! i searched bit , realized haxm intel processors, , i'm running amd processor. tried installing emulator bluestacks suggested in this thread didn't @ all. has got clever solution problem? you might uninstall haxm, works intel processors. lot of answers in forum have pointed using genymotion ( https://www.genymotion.com/ ) amd processors

node.js - Seeding a file using Webtorrent -

i'm trying seed html file using webtorrent in nodejs. callback webtorrent indicates client started seeding when copy-paste hash on client-side download file, nothings happened. here code on server-side: client.seed(file, function (torrent) { debug('started seeding %s - %s', torrent.infohash, torrent.files[0].name); }); what problem , how can debug see going on? i found answer. it's simple replacing webtorrent hybrid-webtorrent , works perfectly.

coffeescript - JQuery attr() on div not returning value -

i'm working backbone app written in coffeescript. i'm trying access cid associated each div in list of divs. each div has same 'contact' class , cid associated integer value. <div class="contact-list"> <div class="contact" cid="1"></div> <div class="contact" cid="2"></div> <div class="contact" cid="3"></div> <div class="contact" cid="4"></div> <div class="contact" cid="5"></div> </div> i want find element cid of 4: console.log "all", $('.contact') div in $('.contact') console.log div console.log div.attr('cid') the loop appears break upon calling .attr(). (when comment out line, code prints 5 divs. otherwise prints first) suggests must calling .attr() incorrectly? when iterating on jquery object element reference referrin

c# - Displaying specific information on aspx page using database -

Image
i building website asp.net web forms, , sql database. on 1 particular page have number of houses informations. there 571 houses in total. when click on particular house, want bring new page more information house. data coming table in database. is there way of knowing house has been selected, , display data on new aspx page house? i know create many separate aspx pages each house there 571 houses , there have 571 aspx pages. far wasted code. when click on house name want 1 aspx page want know have selected house , display information specific one. accessing database information house , displays it. the main obstacle here knowing house has been selected. know how display information database. houses.aspx when click house name want display page 1 below. houseinfo.aspx houseinfo.aspx.cs using (sqlconnection connection = new sqlconnection(configurationmanager.connectionstrings["connectionstring"].connectionstring)) { using