Posts

Showing posts from March, 2010

MYSQL upgrade GROUP BY clause; this is incompatible with sql_mode=only_full_group_by -

we have upgraded mysql database; select l.subscriberid subscriberid email_list_subscribers l, email_queues q q.recipient = l.subscriberid , q.queueid = 2343 , queuetype = 'send' , l.listid in (31) group l.emailaddress having count(l.emailaddress) > 1 and get #1055 - expression #1 of select list not in group clause , contains nonaggregated column 'emailmarketer.l.subscriberid' not functionally dependent on columns in group clause; incompatible sql_mode=only_full_group_by what can do? try this: select l.emailaddress, group_concat(l.subscriberid) subscriberids email_list_subscribers l join email_queues q on q.recipient = l.subscriberid q.queueid = 2343 , queuetype = 'send' , l.listid in (31) group l.emailaddress having count(l.emailaddress) > 1; notes: never use commas in from clause. always use explicit, proper join syntax. this returns list of subscribers each email. if

html - Why does img tag without src take height in IE11? -

i discovered if img tag 100% width given no src takes lot of height in ie11. e.g. test following in ie11 , chrome: <img src="" alt="" style="width: 100%;"> <p>test text loren ipsum</p> is in ie11 or right way , other browsers wrong?

android - Change Activities' Fragment Inside the Fragment -

Image
i have activity, inside activity have fragment. fragment have onclick method supposed to change view. want change view inside using onclick method inside the fragment , use same activity. so far can do. fragment mfragment = null; class fragmentclass; fragmentclass = loginsignup.class; try { mfragment = (fragment) fragmentclass.newinstance(); } catch (exception me) { log.e(tag, me.tostring()); } fragmentmanager mfragmentmanager = getsupportfragmentmanager(); mfragmentmanager.begintransaction().replace(r.id.framelayout, mfragment).commit(); use below method public static void openfragment(fragmentmanager manager, fragment targetfragment) { try { string fragmentname = targetfragment.getclass().getname(); manager.popbackstack(); manager.begintransaction() .replace(r.id.framelayout, targetfragment, fragmentname) .addtobacks

Text string from table add to select option with jquery -

i have select option: <select class="mat"> <option value="0">mat 1</option> </select> and table: <table id="mat-table"> <tr> <td>option 1</td> <td>desc</td> </tr> <tr> <td>option 2</td> <td>desc</td> </tr> <tr> <td>option 3</td> <td>desc</td> </tr> </table> i want jquery copy text 'option 1', 'option 2' table select option , this: <select class="mat"> <option value="0">option 1</option> <option value="1">option 2</option> <option value="2">option 3</option> </select> please help. try this: $('#mat-table td:first-child').each(function(i) { var $option = $('<option>', { value: }).text(this.textcontent); $('.mat').append($option)

php - How to display controller's data -

i cant display data on view , think doing wrong controller dont understand. my controller namespace app\http\controllers; use illuminate\http\request; use app\http\requests; use app\projects; use auth; class welcomecontroller extends controller { public function __construct(projects $projects) { $this->middleware('auth'); $this->projects = $projects; } public function index() { $projects = projects::get(); $this->$projects; return view('welcome')->with('projects', '$projects'); } } route: route::get('test', [ 'uses' => 'welcomecontroller@index', 'as' => 'welcome', ]); view: <div class="panel-body"> <p>projects: </p> <p>users: </p> <h3>project: {{ $project->title }} </h3> what im ge

ios - Resizing text in UIWebView - Swift 3 -

i having problem, resizing text within uiwebview , html file located within bundle. have managed modified script work within obj-c , using swift 3 there no change text size, although optimal value changes correctly @ each click of button . here code - import uikit class viewcontroller: uiviewcontroller { @iboutlet var reswebview: uiwebview! @iboutlet weak var increasefont: uibarbuttonitem! @iboutlet weak var decreasefont: uibarbuttonitem! var defaults = ["textfontsize":40] @ibaction func fontbuttonpressed(sender: uibarbuttonitem) { var textfontsize = defaults["textfontsize"] switch sender.tag { case 1 : //when decrease textfontsize = textfontsize! - 10 case 2 ://when increase textfontsize = textfontsize! + 50 default: break } defaults["textfontsize"] = textfontsize print(textfontsize) var jsstring = "document.getelementsbytagname('body')[0].style.fontsize=&

html - DIV position and alignment issue -

Image
i trying create chat window per attachment below: this have created in jsfiddle : i trying make blue div payment information in center , top div in left, able make first div in left easily, cant bring payment div in center, not sure missing here code well <style> .chat_widget_body{float:left; width:100%; min-height:550px; padding:25px; box-sizing:border-box;} .chat_widget_bubble_green{background:#c5d6b6; float:left; display:inline-block; padding:15px; border-radius:6px; position:relative;font-family: "montserrat-regular"; font-size:15px; font-weight:400; color:#404040;} .chat_widget_bubble_green:after {right: 100%; top: 70%; border: solid transparent; content: " "; height: 0; width: 0; position: absolute; pointer-events: none; border-color: rgba(197, 214, 183, 0); border-right-color: #c5d6b7; border-width: 12px; margin-top: -12px;} .chat_widget_bubble_green > .msg_time{font-size:11px; float:left; width:100%; text-align:right; pa

mysql - Need to convert a table rows to column in another table based on Table 1 elements condition -

i have 2 tables t1 , t2. want insert data t2 based on conditions of t1. say t1 has data sid linkname s1 link1 s1 link2 s2 link1 s2 link2 s2 link3 s3 link2 i want insert data new table t2 having above link1, link2 etc columns in such way if s1 has link 1 column link1 show yes , on. example s3, column of link1 , link3 show no, link2 column show yes sid link1 link2 link3 s1 yes yes no s2 yes yes yes s3 no yes no just run query: select sid, max(case when linkname = 'link1' 'yes' else 'no' end) link1, max(case when linkname = 'link2' 'yes' else 'no' end) link2, max(case when linkname = 'link3' 'yes' else 'no' end) link3 t1 group sid; you can use create table as or insert add information table. note: uses fact 'yes' > 'no&#

linux - Redirecting non-www to www, but keeping other sub-domains intact -

i have 5 web pages different domain names. each of them uses same directory , same .htaccess file. i've redirected non www urls www lines: rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] now keep redirecting non wwws wwws, keep other subdomains without www. example: domain1.com should redirect www.domain1.com , subdomain1.domain1.com should still subdomain1.domain1.com , should not redirect www.subdomain1.domain1.com . keep in mind have 5 webpages hosted same directory , there more come. don't want change .htaccess file everytime there page added. i don't want mess .htaccess file need help! ps: there possibility take https account. https://domain.com https://www.domain.com http://domain.com http://www.domain.com https://sub.domain.com https://sub.domain.com http://sub.domain.com http://sub.domain.com thank in advance answers! just target rule main domain: rewritecond %{http_host} ^[^.]+\.[^

javascript - How do I get selenium-webdriver to ignore SSL errors in Firefox and PhantomJS? -

given these node dependencies: { "chromedriver": "^2.24.1", "cucumber": "^1.3.0", "geckodriver": "^1.1.2", "phantomjs-prebuilt": "^2.1.12", "selenium-webdriver": "^3.0.0-beta-2" } i phantomjs , firefox ignore ssl certificates. here how browser.js looks: require('geckodriver'); // main browser object var browserhandle; // load selenium webdriver , rules var webdriver = require('selenium-webdriver'), = webdriver.by, until = webdriver.until; // load phantomjs webdriver capabilities var phantomjs_exe = require('phantomjs-prebuilt').path; var customphantom = webdriver.capabilities.phantomjs(); customphantom.set("phantomjs.binary.path", phantomjs_exe); webdriver.builder() //.forbrowser('firefox') //.forbrowser('phantomjs') .withcapabilities(customphantom) .build(); any suggestions -

java - Add a character after every 10 characters in a string using subString() function -

this question has answer here: putting char java string each n characters 6 answers add line break after every 60 characters in string java [duplicate] 1 answer suppose string this: string msg = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" i want add character supposing 'f' after every 10 character iteration using substring function because can't call stringbuilder class ( used insert or append functionality). public class helloworld{ public static void main(string []args){ int = 10; string msg = "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

reactjs - Is there a way to have `react-scripts` include extra files in the root of the build? -

my situation: i'm hosting app created create-react-app on surge. in order have surge let react-router handle routes, have add 200.html root, , in order handle 404s, have add 404.html root. problem is, npm run build , index.html , favicon.ico added root of build directory. possible solution: i can copy other files making build script in package.json react-scripts build && cp 200.html 404.html build . question: is there better way have react-scripts add files root of build, rather relying on bash scripting in package.json? the answer settled on use bash scripts in package.json suspected, decided file operations in deploy script instead of build script, , rename index.html 200.html instead of copying files, as suggested create-react-app docs ; "build": "react-scripts build", "deploy": "npm run build && mv build/index.html build/200.html && surge build mydomain.com" i think doing file opera

php - Composer update - website stopped working -

i updated composer using cmd window , got these errors: [symfony\component\debug\exception\fatalerrorexception] class 'darryldecode\cart\cartserviceprovider' not found script php artisan clear-compiled handling pre-update-cmd event returned error [runtimeexception] error output: the website not online yet, , i'm running using xampp. now, when i'm trying access web site through localhost, error: fatalerrorexception in providerrepository.php line 146: class 'darryldecode\cart\cartserviceprovider' not found. in app.php file have: darryldecode\cart\cartserviceprovider::class, in application service providers, and: 'cart' => darryldecode\cart\facades\cartfacade::class, in aliases. any ideas on how website back? thanks! tty steps temporary remove darryldecode\cart\cartserviceprovider::class, and 'cart' => darryldecode\cart\facades\cartfacade::class, type command composer update and add

php - Get first entry from loop / while -

i need first id loop. loop: while ($row = $db->sql_fetchrow($result)) { echo ($row['post_id']) . '<br /><br />'; } echo result: 817856<br /><br />817865<br /><br />817870<br /><br />817871<br /><br />817873<br /><br />817874<br /><br /> in case need number 817856 var_dump var_dump($row['post_id']); var_dump result: string(6) "817856" string(6) "817865" string(6) "817870" string(6) "817871" string(6) "817873" string(6) "817874" i tried: reset , array_shift without success. thank you you need use variable track loop , first id while looping. default have assign variable true , id inside loop make variable false variable stay false. using if condition ok. $flag = true; while ($row = $db->sql_fetchrow($result)){ if($flag === true){ $id = $row['post_id'];

crash - Checking if a user is connected to the network in android -

in main activity have if (isnetworkavailable() == true) { log.i("testing", "available"); } else { log.i("test", "unaivalibale"); } then below have method private boolean isnetworkavailable() { connectivitymanager connectivitymanager = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo activenetworkinfo = connectivitymanager.getactivenetworkinfo(); return activenetworkinfo != null && activenetworkinfo.isconnected(); } i have set <uses-permission android:name="android.permission.access_network_state" /> in manifest , yet when run tha application stops, killing application wrong make class , add method properly: public class connectivitystatus extends contextwrapper{ public connectivitystatus(context base) { super(base); } public static boolean isconnected(context context){ connectivitymanager manager = (co

csv - Writing a list of lists to file, removing unwanted characters and a new line for each -

i have list "newdetails" list of lists , needs written csv file. each field needs take cell (without trailing characters , commas) , each sublist needs go on new line. the code have far is: file = open(s + ".csv","w") file.write(str(newdetails)) file.write("\n") file.close() this however, writes csv in following, unacceptable format: [['12345670' 'iphone 9.0' '500' 2 '3' '5'] ['12121212' 'samsung laptop' '900' 4 '3' '5']] the format wish in shown below: 12345670 iphone 9.0 500 5 3 5 12121212 samsung laptop 900 5 3 5 you can use csv module write information csv file. please check below links: csv module in python 2 csv module in python 3 code: import csv new_details = [['12345670','iphone 9.0','500',2,'3','5'], ['

javascript - Override a method from a Primefaces specific widget -

i want overwrite function of primefaces datatable component. according question: how find and/or override javascript in primefaces component based on widgetvar? possible using primefaces.widget.datatable.prototype. . want override function 1 datatable only, not all. this not work: <p:datatable widgetvar="mytable" ...> </p:datatable> .... <script type="text/javascript"> $(document).ready(function(){ if (pf('mytable') !== undefined) { pf('mytable').jq.datatable({ showcelleditor: function (c) { console.log('my function'); } }); } }); </script> is how supposed done or wrong? tested 1 of tables: pf('mytable').showcelleditor = function() { console.log('my function') } don't forget call generic implementation if need to: pf('mytable&#

aurelia - Bind across templates -

at app.html i'm drawing breadcrumb breadcrumb template <template> <nav> <ol class="breadcrumb"> <li repeat.for="crumb of breadcrumb" class="breadcrumb-item ${$last ? 'active' : ''}"> ${crumb.name} </li> </ol> </nav> </template> now, define different value "breadcrumb" property each page. prefer call breadcrumb template once, @ app.html. export class pagea { breadcrumb = ['parenta', 'childa'] constructor () { } } export class pageb { breadcrumb = ['parentb', 'childb'] constructor () { } } how can achieve this? if want declare breadcrumb custom element in app.html view (rather in each separate page view) , bind breadcrumb property values declare in child pages, straight forward solution use separate singleton service holds breadcrumb data. for example: import { singleton } "a

xamarin.ios - Stripe Xamarin. in app, Sign up and pay subscriptions plan, Can it be done? -

i been working on app common user can subscribe different plans, give different perks. i been trying using stripe's payment component xamarin component store but me, seems component give option request payment, not subscript plan. this leave me think, way can make happen, make whole "payment , subscriptions plan" code on native ios , android, after bind against pcl so conclude i'm looking more simple way create functionality, thanks time, so xamarin extension should used collect credit card details , "tokenize" card. actual handling of charge done backend server (as described in documentation extension under "sending token server"). once pass otken backend, can it-- including attach customer record setting source -attribute when calling create customer api endpoint. once you've created customer record, can create subscription using plans.

javascript - How to make multiple chunk of lines readonly in ace editor -

i tried make parts of code read-only in ace editor. i have tried using code given in jsfiddle $(function() { var editor = ace.edit("editor1") , session = editor.getsession() , range = require("ace/range").range , range = new range(1, 4, 1, 10) , markerid = session.addmarker(range, "readonly-highlight"); session.setmode("ace/mode/javascript"); editor.keybinding.addkeyboardhandler({ handlekeyboard : function(data, hash, keystring, keycode, event) { if (hash === -1 || (keycode <= 40 && keycode >= 37)) return false; if (intersects(range)) { return {command:"null", passevent:false}; } } }); before(editor, 'onpaste', preventreadonly); before(editor, 'oncut', preventreadonly); range.start = session.doc.createanchor(range.start); range.end = session.doc.cre

memory - What are system requirements for the Linux server where are remote agent of Bamboo? -

what system requirements linux server remote agent of bamboo? found requirements server bamboo server is: https://confluence.atlassian.com/bamboo/bamboo-best-practice-system-requirements-388401170.html at minimum remote agent needs jdk8 (or perhaps jre8), memory - around 512mb @ guess, , ability able communicate bamboo server. but if want able useful work you'll need make other capabilities available it, e.g. ant, maven, git, perhaps more memory... whatever required work supposed doing.

winforms - Communicate between two windows forms in C# -

i have 2 forms, 1 main form , other options form. example user clicks on menu on main form: tools -> options , cause options form shown. my question how can send data options form main form? know use properties, have lot of options , seems tedious odd thing do. so best way? form1 triggers form2 open. form2 has overloaded constructor takes calling form argument , provides reference form2 members. solves communication problem. example i've exposed label property public in form1 modified in form2. with approach can communication in different ways. download link sample project // your form1 public partial class form1 : form { public form1() { initializecomponent(); } private void button1_click(object sender, eventargs e) { form2 frm = new form2(this); frm.show(); } public string labeltext { { return lbl.text; } set { lbl.text = value; } } } // your form2 public partial class f

php - Concatenating data and text on select mysql -

fellows, i'm using php , code: select date_format(data,'%d/%m/%y'' às ''%h:%i:%s') data infografico group data displays this: (última atualização: 22/09/2016' às '09:37:16) the question is: how can ' doesn't appear? you need 1 single quotation mark @ beginning , end select date_format(data,'%d/%m/%y às %h:%i:%s')

Python - Adding a individual value to multiple strings in text file wich end with consecutive numbers -

i have little trouble working out problem because iam using for-loop now. i want edit text file: indicate somename x1 random qwerty indicate somename x2 random azerty indicate somename x3 random qwertz indicate somename x4 random asdfg indicate somename x5 here python script i'm running: #for in range (0,4): open('text.txt') fp, open('text2.txt', 'w') fo: line in fp: number = 10 if ('indicate somename') in line: in range (0,4): string = str(i) if (string) in line: print (string) content = line.strip() + " value = " '%d' % (number) else: content = line.strip() else: content = line.strip() fo.write(content + "\n") well... problem continues rewriting principal in here. re-writes original time. need original file is. this becomes output: in

How to fix this error in Slim framework? -

i installed slim framwork using composer in wamp server. but displays following error. i new slim. slim application error application not run because of following error: details type: errorexception code: 2 message: file_get_contents(templates/index.html): failed open stream: no such file or directory file: d:\wamp\www\photometa\vendor\twig\twig\lib\twig\loader\filesystem.php line: 131 trace 0 [internal function]: slim\slim::handleerrors(2, 'file_get_conten...', 'd:\wamp\www\pho...', 131, array) 1 d:\wamp\www\photometa\vendor\twig\twig\lib\twig\loader\filesystem.php(131): file_get_contents('templates/index...') 2 d:\wamp\www\photometa\vendor\twig\twig\lib\twig\environment.php(397): twig_loader_filesystem->getsource('index.html') 3 d:\wamp\www\photometa\vendor\slim\views\twig.php(87): twig_environment->loadtemplate('index.html') 4 d:\wamp\www\photometa\vendor\slim\slim\sl

database - Single DB field, with multiple referencing, MySQL -

i structuring db, need have field bed_types_id in table. this field has multiple options, ex. king, queen, 2 queens, 2 doubles, etc. if make field bed_types_id in table references table bed_types id, how reference more 1 option. ex: 1, 2, 3 king, queen, or 2 queens, bed types. how should relational database?? you need table 3 columns: id room_id bed_type_id if room has king , queen, table have 2 rows room.

bash - Split column and use first array to headerin awk -

i have file looks this: a=10 b=8 c=12 a=15 b=12 c=5 a=6 b=4 c=9 a=8 b=8 c=9 columns more. split file using awk , use letter before "=" header: a b c 10 8 12 15 12 5 6 4 9 8 8 9 i like: awk '{split($0,arr0,"="); print arr0[2]}' infile but still not know how use arr0[1] header. thank ideas. using awk can this: awk -f '[= ]' 'function prnt(start) { (i=start; i<=nf; i+=2) printf "%s%s", (i==start?"":ofs), $i print "" } nr==1 { prnt(1) } { prnt(2) }' file b c 10 8 12 15 12 5 6 4 9 8 8 9 and tabular formatted output use: awk -f '[= ]' 'function prnt(start) { (i=start; i<=nf; i+=2) printf "%s%s", (i==start?"":ofs), $i print "" } nr==1 { prnt(1) } { prnt(2) }' file | column -t b c 10 8 12 15 12 5 6 4 9 8 8 9

json - Unit Testing a method that uses REST calls in Swift -

let me start out stating i'm still unfamiliar i'm trying do, striving better! i'm working on project i'm writing unit tests , i'm having trouble how approach problem. the method i'm testing utilizes restapi call verify users credentials. i'm not sure best way unit test be. here method i'm looking make unit test for: @ibaction func loginbtnactivate(sender: uibutton) { let enteredemail: string = emailfield.text! let enteredpassword: string = passwordfield.text! let testinfo:[string: anyobject] = ["user": enteredemail, "password": enteredpassword] restapimanager.sharedinstance.postlogin(testinfo) { (json, statuscode) in if statuscode == 200 { let authtoken: tokenobject = (tokenobject(json: json)) try! self.keychain.set(authtoken.authorization, key:"authorization") try! self.keychain.set(authtoken.lifetime, key: "lifetime") try! self.ke

javascript - FireFox document.exeCommand('copy') not working -

i have following code : var doc = window.document; var copyfrom = doc.createelement("textarea"); copyfrom.textcontent = str; var body = document.getelementsbytagname('body')[0]; body.appendchild(copyfrom); copyfrom.select(); document.execcommand('copy'); body.removechild(copyfrom); this seems work fine on chrome able paste contents on 'str' variable. doesn't seem work on firefox/safari. safari not give clipboard access without user generated event. user initiated actions ( e.g ctrl + c/ cmd + c) can work copy items. about firefox, can give details regarding version. there has been change post 44.0 copy clipboard has been enabled.

swift - iOS 10 Quicklook Memory Usage -

when ill load images quicklookcontroller, used memory never freed memory management. example: override func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath) { let photofile = photos[indexpath.row] photo currentfilepath = photofile.filepath let preview = qlpreviewcontroller() preview.datasource = self self.navigationcontroller?.pushviewcontroller(preview, animated: false) } func documentsdirectoryurl() -> nsurl { let manager = nsfilemanager.defaultmanager() let urls = manager.urlsfordirectory(.documentdirectory, indomains: .userdomainmask) return urls[0] } func previewcontroller(controller: qlpreviewcontroller, previewitematindex index: int) -> qlpreviewitem { return documentsdirectoryurl().urlbyappendingpathcomponent(currentfilepath) } here ill load image. image size 200kbytes, size of 2500x1250 pixels. memory increased 10 mbytes, when ill close controller (back button) memory still

c# - Binding on a nested property without using XAML -

how make binding on nested target property, shape.stroke.color in wpf without using xaml ? for simple property i'm using code looking : var binding = new binding("mysourceproperty"); binding.source = mysourceobject; mytargetobject.setbinding(mytargetproperty, binding); where mytargetproperty can be, example, shape.strokeproperty . now, how can same thing on colorproperty of stroke of shape ? provided shape's stroke property holds solidcolorbrush, can use static bindingoperations.setbinding method: var shape = new path(); // or whatever var binding = new binding { source = colors.red }; // or whatever bindingoperations.setbinding(shape.stroke, solidcolorbrush.colorproperty, binding);

c++ - Why does reading from stdout using QProcess break my Windows application? -

i have cross-platform (windows 8/osx 10.10) test application which, part of test, needs spawn child process listen on port (can dynamic or specified). child process (call mockserver), upon startup, send stdout line looks like: server listening on localhost:50015 in code spawns mock server, i'm doing this: // globals qprocess servermockprocess; qstring serverport void startservermock() { servermockprocess.start(server_mock_exe); servermockprocess.waitforreadyread(2000); char buf[1024]; qint64 linelength = servermockprocess.readline(buf, sizeof(buf)); qstring output; int port = 0; if (linelength != -1) { output = buf; std::cout << output << std::endl; // successful startup produce output looks like: // server listening on localhost:50015 serverport = output.section(":", -1); serverport.chop(1); // remove newline port = serverport.toint(); } if (!port) {

python - Setting a local bool to control flow -

i have issue in python want while loop , ask player input number of dice , number of sides random dice rolls. on second loop , additional loops want ask if continue. if input 'n' or 'no' program exits. i able logic working global variable , changing variable in function after first time called second time user asked if want continue, understanding using global variables not python-way of doing things. improve this. the following code works except fact user never prompted exit. know because variable keeps getting set true @ beginning of while loop, don't know how set flag without resorting global variable. how set true/false variable locally (not-globally) , use control flow in program? import sys import random def get_user_input(first_loop): if not first_loop: another_time = input("would roll time?") if another_time.lower() in ['n', 'no']: sys.exit() # allows code above output on additional l

Why does Homebrew say "no git repository"? -

running brew --config gives homebrew_version: >1.0.0 (no git repository) ... why happening? can fix it? homebrew_version: >1.0.0 (no git repository) origin: https://github.com/homebrew/brew.git head: bbed7246bc5c5b7acb8c1d427d10b43e090dfd39 last commit: 4 hours ago core tap origin: https://github.com/homebrew/homebrew-core core tap head: ba0aa68066a89c0654152aba22819736b06987af core tap last commit: 77 minutes ago homebrew_prefix: /usr/local homebrew_repository: /usr/local/homebrew homebrew_cellar: /usr/local/cellar homebrew_bottle_domain: https://homebrew.bintray.com cpu: quad-core 64-bit haswell homebrew ruby: 2.0.0-p648 clang: 8.0 build 800 git: 2.10.0 => /usr/local/bin/git perl: /usr/bin/perl python: /usr/local/bin/python => /usr/local/cellar/python/2.7.12/frameworks/python.framework/versions/2.7/bin/python2.7 ruby: /usr/local/bin/ruby => /usr/local/cellar/ruby/2.2.4/bin/ruby java: 1.8.0_102 macos: 10.11.6-x86_64 xcode: 8.0 clt: 7.3.1.0.1.1461711523 x11:

ios - Nested multiple request with dispatch_group -

i make multiple requests server fetch posts , comments 1 after another. so, created example dispatch_group fetches posts serially 1 after , after finished posts, fetches comments 1 after another. here rough schema how works. fetch post 1 fetch post 2 fetch post 3 .... fetch post 50 fetch comment 1 fetch comment 2 ... fetch comment 50 so, these should work serially shown, fetches post 1, finishes , fetches post 2 finish , on. the following example works fine purpose. but, want have call know when syncing of 50 posts finished , when 50 comments finished. tried adding dispatch_group_notify after loop in requestone , requesttwo. but, notify method seems called when tasks have been completed. how can achieved ? not native english speaker so, please write down if need improve post, can still try :) @interface grouptest () @property (nonatomic, readonly) dispatch_group_t group; @property (nonatomic, readonly) dispatch_queue_t serialqueue; @end @implementation group

sqlite - sqlite2 to sqlite3 convert php code -

i'm trying run script on server. script uses sqlite2 database. php file written in sqlite2, on server have installed sqlite3. this code: if (!$db = sqlite_open ('chatdb')) { die('database problem. please try again later.'); } function sqlite_table_exists ($db, $mytable) { $result = sqlite_query($db, "select count(*) sqlite_master type='table' , name='$mytable'"); $count = intval(sqlite_fetch_single($result)); return $count > 0; } if (sqlite_table_exists($db, 'messages') == false) { $sql = 'create table messages (username varchar(50), message text, date date)'; sqlite_query ($db, $sql); } if (sqlite_table_exists($db, 'users') == false) { $sql = 'create table users (username varchar(50) unique, last_activity date, is_kicked integer default 0, is_banned integer default 0, kick_ban_message varchar(100))'; sqlite_query ($db, $sql); } if (sqlite_table_exists($db, '

c# - Smooth scroling in chart with datetime x axis -

Image
i have simple graph plotted in chart. on x-axis values datetime values. public partial class form1 : form { list<double> valuelist = new list<double>(); list<datetime> timelist = new list<datetime>(); public form1() { initializecomponent(); // fill lists values (int = 0; < 2000; i++) { double value = math.sin(i/20.0); valuelist.add(value); timelist.add(datetime.now.addminutes(i + 2)); } // add values chart (int = 0; < valuelist.count; i++) { this.chart1.series[0].points.addxy(timelist[i], valuelist[i]); } this.chart1.chartareas[0].axisx.labelstyle.format = "dd.mm-hh:mm"; } private void form1_load(object sender, eventargs e) { chart1.series[0].xvaluetype = chartvaluetype.datetime; chart1.chartareas[0].axisx.maximum = timelist.max().tooadate(); chart1.cha

c++ - Cmake cannot find boost libraries; but includedir and librarydir are set -

i new c/c++, cmake, , boost; i've read every post in of other people having same problem , couldn't figure out. edit: explained in comment, read another similar post , , i'm doing proposed in accepted solution (i.e. using components libraryname , set(boost_use_static_libs off) . actually, putting boost_use_static_libs off removed "lib" prefix libraries name in argn parameter. , seem need prefix.. i built boost android bjam and, hoping have done correctly, used command: ./b2 install include=/home/myuser/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/include include=/home/myuser/android-ndk-r12b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/include include=/home/myuser/android-ndk-r12b/platforms/android-19/arch-arm/usr/include toolset=gcc-arm target-os=android --prefix=/home/myuser/boost_build --with-system --with-random --with-date_time -sno_bzip2=1 link=static runtime-link=shared threading=multi and end folder structure: /home/myuser/boost

jupyter - is there a way to produce SVG with ipyvega? -

currently jupyter output seems give canvas element. vega allow svg output couldn't see way ipyvega. yes, possible. click on "open in vega editor" link under rendered plot, use drop-down menu in upper-right change renderer "svg", , click "export" button. i'm working on way programmatically export png & svg python within related altair project; can see relevant code here . move functionality ipyvega in future if people find useful.

linux - java remove first line from exec command output -

Image
relate first question @ execute linux command in java , display output html table have manage work, still have 1 other question: how can remove first line output? below code: <% string[] disk; string line; string process; process p; bufferedreader input; p = runtime.getruntime().exec("df -h"); input = new bufferedreader(new inputstreamreader(p.getinputstream())); %> <tr bgcolor="#f0f0f0"> <td> <b>disk</b> </td> <td> <b>size</b> </td> <td> <b>used</b> </td> <td> <b>avail</b> </td> <td> <b>use %</b> </td> <td> <b>mounted</b> </td> <td>

json - AngularJS Filter for comma separated values -

Image
i have 1 column in database has comma separated values example table: now want filter in angularjs application. i can filter name , etc, whoever column has 1 single string. however, i'm having difficulty sort if have sort fruits. for example: want sort orange, likes apple , etc. , stuck this. perhaps can me. here code in html file: <div class="col s12"> <div class="col s12 input-field"> <select ng-model="global.fruitfilter" ng-options="tp.fruits tp.fruits tp in tables= (table | filter: {region: global.name||undefined, cluster: global.amount||undefined :true) | unique:'fruit'" material-select watch> <option value="">select fruit</option> </select> </div> </div> i using ng-options he

ios - Image on annotation Swift -

trying use own image "pin" , have 4 different images. since i'm using alot of coords, way "stack them up" in advance. code following: struct location { let title: string let subtitle: string let imagename: string let latitude: double let longitude: double } let locations = [ location(title: "ben", subtitle: "the big", imagename: "de.png", latitude: 56.888214, longitude: 14.779658), location(title: "adam", subtitle: "bervesiell", imagename: "be.png", latitude: 56.588224, longitude: 14.779658), location(title: "david", subtitle: "downfall", imagename: "ce.png", latitude: 56.888214, longitude: 14.579668) ] location in locations { let annotation = mkpointannotation() annotation.title = location.title

laravel - Need to run 'composer update' on ssh on hostgator, but php -v to low -

need 🛬 framework - laravel hosting - hostgator problem statement :- need run 'composer update'. dependencies required minimun php -v of 5.5.9. have manualy upgrade php version of project directory 5.6 cpanel using 'php configration' plugin. when logged in using ssh, got php -v of 5.4.45. ofcourse targeting deafult php version of server. there way update php 5.6 or above on ssh also. no root user access. no support team also. 🎭 recently update composer , php in mac_system , used these commands terminal -local php update in mac os curl -s http://php-osx.liip.ch/install.sh | bash -s 7.0 -export path=/usr/local/php5/bin:$path (change php version create project) php update this above link.. used.. try command or link. think knowledge on it.

html - Text Over Image Isn't Working -

i'm trying put text on image , isn't working. puts text under image , can't bring up. my code: .happylady { position: relative; width: 100%; } .happylady p { float: left; position: absolute; left: 0; top: 80px; width: 100%; } <div class="bannerimage"> <img src="content/severroom.png" class="centerimage" /> <p>check out speeds 60mbps!</p> <a href="/cable/"><button >view packages!</button></a> </div> <div class="internet"> <div class="information"> <h3>internet</h3> <h7>cable, dsl & rural wireless</h7> </div <div class="happylady"> <img src="content/happylaptoplady.png" alt="" /> <div class="contents"> <h4 class="pricing">from <span class="d