Posts

Showing posts from April, 2011

python - How to form tuple column from two columns in Pandas of only non empty values -

this extension of question using df['new_col'] = zip(df.lat, df.long) to combine multiple columns tuple how drop (or not add) empty elements (column) tuple should contain non-empty values just give example: instead of ('a','') or ('a',) display ('a') also, there way convert tuple set thanks helpful comments guys, here's worked me: import copy def remove_empty(x): c in copy.copy(x): if not c: x.discard(c) return x df['new_col'] = zip(df.lat, df.long) df['new_col'] = df['new_col'].apply(set) df['new_col'] = df['new_col'].apply(remove_empty)

c++ - Qt: Subclassed spinbox does not count -

i try subclass qt spinbox can mouse event. code compiles, events working, spinbox doesn't count or down. have set min value -9999 , max value 9999, default value 100. if click or down button, nothing happens. newspinbox.h: #ifndef newspinbox_h #define newspinbox_h #include <qobject> #include <qwidget> #include <qevent> #include <qmouseevent> #include <qspinbox> class newspinbox : public qspinbox { q_object public: newspinbox(qwidget *parent = 0); ~newspinbox(); public slots: void mousepressevent(qmouseevent *mouseevent); void mousereleaseevent(qmouseevent *mouseevent); }; #endif // newspinbox_h newspinbox.cpp: #include "newspinbox.h" newspinbox::newspinbox(qwidget *parent) : qspinbox(parent) { } newspinbox::~newspinbox() { } void newspinbox::mousepressevent(qmouseevent *mouseevent) { if(mouseevent->type() == qmouseevent::mousebuttonrel

ibm bluemix - Storing arrays or lists in edge/vertex properties Graph database? -

how store arrays/lists in edge/vertex property values ? thanks, are trying in ibm graph ? of now, types supported in ibm graph primitive data types : string , long, double , boolean. best option convert/serialize object string , store property of edge/vertex.

javascript - How to customize legend of a chart with Google Scripts -

i've been trying find answer this, have had no such luck. wondering if @ possible add customization legend of chart google scripts? if maybe guys point me in right direction of how accomplish this? in advance. here options have set far. options = {'title':'production', 'width':1366, 'height':768, 'vaxis': {'format': '$#,##0.00;($#,##0.00)', 'title': 'money'}, 'haxis': {'title': 'month'} }; sincerely, sicariuxs here example of how can use customize legend of chart google charts: var options = { //slicevisibilitythreshold: 0.01, chartarea:{left:10,top:0,width:'100%',height:'100%'}, height: 300, legend: { position: 'right', textstyle: {fontsize: 7}}, pieslicetext: 'none', colors:['

escaping - Character code pages: control code page assignment that means "the next rendered character (in this source code) is escaped?" -

Image
i acknowledge question may unanswerable, or extremely difficult answer. also, notwithstanding expect audience familiar escape sequences in e.g. scripting languages are, reasons of clarity you'll see later in post, i'll review concept: by "escaped," mean example printable characters interpreted "do not use next character usual; interpret in context." contexts include characters intended not interpreted code, literal printed characters, or conversely, characters may interpreted literal characters want interpret instead code. examples (more confusingly, realize) use latter case. specific example: regex used 'nix sed, which, when not escaped sed, this: ([^0-9]*)(20[0-9]{2})([^0-9]{1,2})([0-9]{1,2}) but when escaped shell pass regex sed such sed knows interpret characters not literal characters, regex code, whole string becomes uglier (and less human-readable): \([^0-9]*\)\(20[0-9]\{2\}\)\([^0-9]\{1,2\}\)\([0-9]\{1,2}\) escape characters (or

binary - Matlab representation of floating point numbers -

matlab results realmax('single') ans = 3.4028e+38. trying understand why number appears computer's binary representation, little bit confused. i understand realmax('single') highest floating point number represented in single percision 32-bits. means binary representation consists of 1 bit sign, 23 bits mantissa , 8 bit exponent. , 3.4028e+38 decimal representation of highest single precision floating point number, don't know how number derived. now, typing in 2^128 gives me same answer 3.4028e+38, don't understand correlation. can me understand why 3.4028e+38 largest returned result floating point number in 32 bit format, coming binary representation perspective? thank you. as ieee754 specifies, largest magnitude exponent e max =127 10 =7f 16 =0111 1111 2 . encoded 254 10 =fe 16 =1111 1110 2 in 8 exponent bits. exponent 255 10 =ff 16 =1111 1111 2 reserved representing infinity, 254 10 largest available. exponent bias 127 10 subtra

Anyone know why my Hello World in C++ isn't working out? -

Image
does know why hello world won't print anything? here process went through far: i downloaded visual studio 2015. i created new project , named hello world , checked empty remove pre compiled headers. after went source tab >insert new item , made new item, main function, , named main.cpp. after writing code pressed ctrl+5 , command prompt appears, it's blank. vs tells me project out of date before build it, heard isn't worry about. here's code #include <iostream> using namespace std; int main() { cout << "hello world!" << endl; return 0; cin.get(); } and picture of i'm getting after pressing ctrl+5 , build. the return 0 line going end program before cin.get() gets executed. flip order of return 0 , cin.get() .

java - Specifying the order of proxy creation in Spring -

i have spring application have following skeleton class class servicecaller { public result callservice() { //call remote service } } since calling remote service expensive operation, added caching in application. used ehcache spring annotations @cacheable , applied callservice() method. working fine , result objects getting correctly cached. later wanted add logger across servicecaller s such logger record every actual call remote service. did not want manually add logger.info() every such callservice method decided use spring aop implement this. i defined pointcut after-returning methods wanted log. working; noticed logger point cut invoked when had cache hit , actual callservice method not called. this, observed, happening because order of proxy servicecaller bean follows: aoppointcutproxy(ehcachecachingproxy(servicecallerbean)) . want logger pointcut invoked when actual callservice method called , not when returning cached value ehcache proxy

android - Validate text input by comparing it to an array of strings -

i want able take users input text field , compare if exists in string array. simple right such asking user "spell dog" , use input text in text field , once done compares word dog. can preset them or use inbuilt dictionary, research says use editview , change there, cannot think of anyway , other example found not quite answer it. thank in advance. maybe can you: can use hash hashmap<string,string> mdata; mdata.put("dog","..."); ... edittext1.addtextchangedlistener(new textwatcher() { @override public void aftertextchanged(editable s) { if (mdata.containskey(edittext1.gettext().tostring())) // success code } @override public void ontextchanged(charsequence s, int start, int before, int count) { } @override public void beforetextchanged(charsequence s, int start, int count, int after) {

android - What type of JSON parsing using volley I should use? -

i'm using volley , looking @ ( http://www.androidhive.info/2014/09/android-json-parsing-using-volley/ ) tutorial, don't know how make work. using objectjson, error says "it can't converted array" , if use arrayjson method doesn't found database elements. urljson - http://smkbaig.esy.es/get_info_test.php your json following php link provided starts { , tutorial said, that's json object, followed array called "receptai". if have followed tutorial correctly till end, should work using makejsonarrayrequest() you need paste code here further. what might want first follow tutorial way presented, , if responses successfully, start experimenting , changing. see using own json instead of coding both jsonarrays , jsonobjects , seeing both buttons functional.

deque - Dequeue implementation error in Java -

i tried implement dequeue. below part of code. used print() function in order print nodes in dequeue, seems nodes not connected @ all. the addlast() function tries new node @ connect dequeue. public class test<item>{ private node first, last; private int n; private class node{ item value; node next; } public void addlast(item item){ node oldlast = last; node last = new node(); last.value = item; last.next = oldlast; n++; } public void print(){ node temp = last; while(temp != null){ system.out.println(temp.value); temp = temp.next; } } public static void main(string[] args){ test<string> deque = new test<string>(); deque.addlast("hello"); deque.addlast("first"); deque.addlast("second"); deque.addlast("third"); } } in addlast()

regex - Foreach loop only acting on a portion of the first element in an array -

i have 5 fasta files in directory, can put array. when attempt open files in succession via foreach loop, perform regex on each file, first file in directory seems open processing. furthermore, when try print entire sequence in first file (via diagnostic print statement not shown), first half of sequence ignored. latter portion of sequence printed. if has insights on how overcome this, grateful. here code looks far. #!/usr/bin/perl use warnings; use strict; use diagnostics; $dir = ("/users/roblogan/documents/fakefastafilesagain"); @trimmedsequences; @arrayoffiles = glob "$dir/*"; #print join("\n", @arrayoffiles), "\n"; # diagnostic test print statement foreach $file (@arrayoffiles){ open (my $sequence, '<', $file) or die $!; # open each file in array while (my $line = <$sequence>) { $line =~ s/\r//g; # rid of new line breaks if ($line =~ m/(ctccca)[tagc]+(tc

graphics - How can I calculate the Z value of triangles? -

i trying implement z-buffer (depth buffer) polygon rasterization algorithm. of polygons triangles , understand 3 points (x,y,z) make triangle form plane. if have (x,y,z) values of verices, how calculate depth of every position on face of triangle? in opengl or webgl z-buffer applied after rasterization i.e. each pixel, not each vertex of triangle. in case need save z-value each pixel , pixel max z-value. done automatically in pipeline . if wanna calculate z-buffer vertices need own algorithm. example getting max z-value of triangle's vertices , sort triangles value. also check link more info.

Python disable list string "breaking" -

is there way disable breaking string list. example: >>> = "foo" >>> b = list() >>> b.append(list(a)) >>> b >>>[['f', 'o', 'o']] is there way have list inside of list string not "broken", example [["foo"],["bar"]] ? very esay: >>> = "foo" >>> b = list() >>> b.append([a]) >>> b [['foo']]

Accessing the 2D array in a Matrix class (C++) (Visual Studio 2010) -

i relatively new programming student , new c++ please bear me while struggle sort through this. i trying make matrix class few basic functions change it. objects created in matrix class should 100x100 2d array of floats. should able change value @ particular location in array value. relevant code follows: //in .h file class matrixc { private: float matrix[100][100]; public: void initializematrix(matrixc); void printmatrix(matrixc); void setvalue(matrixc, float, int row, int column); float getvalue(matrixc, int row, int column); } //in .cpp file void setvalue(matrixc matrix, float value, int row, int column) { matrix[row][column] = value; //error line } i getting following error @ line indicated above, first bracket in line highlighted: "matrixc matrix - no operator '[]' matches these operands." i error regarding "=" in same line. after googling, not life of me figure

How to add and use (signature/system level) permission in an android application -

i created application android reflection on "android-21" problem adding permission in manifest file after adding permission manually in "manifest.xml", error received in catlogs while trying run application saying no permission " android.permission.read_precise_phone_state ". after checking found permission's level has been changed "dangerous" "signature/system" , has comment "pending api council approval". there way permission or reflection original android manifest file. as far know way how eligible signature level permission (the apk) signed same certificate system image. or rather app/component exposes permission. (which android/system in case). there might apps out there permission in manifest, doesn't mean permission granted! treated differently in past, apps might no updated, or might wrong implemented.

html - Bootstrap - Centering Content, Then Left Aligning (in relation to center) -

i have 2 divs must centered using bootstrap class text-center (for mobile reasons). after applying class, image , text center perfectly. however, i'd text centered , left-aligned precisely in line left side of image. i've tried couple of things: first centering div , creating div around text, , left-aligning text text-left . however, text not stay centered , moves way left of column. i'd go left image. if set margin pixels text left-aligned image, not stay responsive , jumps on page when resized. here example of content centered, , example of happens when center , left-align text: https://jsfiddle.net/wgr165tl/3/ i'd find out how text centered left-aligned far left of image. necessary keep text-center class. input appreciated. <html> <head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mtjoasx8j1au+a5wdvnpi2lkffwweaa8hdddjzlplegxhjvme1fgjwpgmk

haskell - How to output minimal binary using Data.Binary and Data.ByteString.Lazy? -

minimal test code (bs.hs): import qualified data.binary b import qualified data.bytestring.lazy.char8 bslc main = bslc.putstr $ b.encode $ pad $ bslc.pack "xxx" data pad = pad bslc.bytestring instance b.binary pad put (pad p) = b.put p = p <- b.get return $ pad p and get: % runghc bs.hs | od -c 0000000 \0 \0 \0 \0 \0 \0 \0 003 x x x 0000013 % ghc --version glorious glasgow haskell compilation system, version 7.10.2 i expect "xxx". have no idea how first 8 bytes (7 x \0 + 1 x 003) come from. from comment, explanation of output format binary uses serializing bytestring s output length 64-bit integer followed contents of bytestring . generally, though, binary class of limited use. there's no guarantee of forward or backward compatibility, no mechanism allow schema evolution, no standard or specification instances allow cross-language interoperability. it's use

clojure - Changing 1-3 random index(s) in a sequence to a random value -

i changed value random. example '(1 2 3 4 5) one possible output. '(1 3 3 4 5) another '(1 5 5 4 5) there more idiomatic ways in clojure. example one: you can generate infinite lazy sequence of random changes initial collection, , take random item it. (defn random-changes [items limit] (rest (reductions #(assoc %1 (rand-int (count items)) %2) (vec items) (repeatedly #(rand-int limit))))) in repl: user> (take 5 (random-changes '(1 2 3 4 5 6 7 8) 100)) ([1 2 3 4 5 64 7 8] [1 2 3 4 5 64 58 8] [1 2 3 4 5 64 58 80] [1 2 3 4 5 28 58 80] [1 2 3 71 5 28 58 80]) user> (nth (random-changes '(1 2 3 4 5 6 7 8) 100) 0) [1 2 3 64 5 6 7 8] and can take item @ index want (so means collection index + 1 changes). user> (nth (random-changes '(1 2 3 4 5 6 7 8) 100) (rand-int 3)) [1 46 3 44 86 6 7 8] or use reduce take n times changed coll @ once: (defn random-changes [items limit changes-

GTK+ - setting the color of a button (in C) -

so problem follows - need create buttons in gtk/c program simple clickable, colored tiles. found thread gtk modifying background color of gtkbutton , few other resources supply similar answer, no matter set_fg function nothing , set_bg function either sets thin frame around button/widget - stays gray - or nothing. can please me solve problem or give me reasonable alternative creating set of colored tiles can clicked on , can dynamically change color?

c++ - How can i read characters through an array of string? -

i want 2 things in question, first code give me error: "string subscript out of range" , can't fix it!. second want me searching in array of string , read characters of each string. this problem: the problem test case: 2 5 ah ibrahim ahmed ahsan nas ahmed hossam ahmed menan bad 2 fou ayan soli output: 2 ahmed ahsan nas conan's assumption wrong! my code: #include<iostream> #include<string> using namespace std; int main() { short int t,n; cin>>t; string p,s[51],res; (int = 0; < t; i++) { int c=0,k=0; cin>>n; cin>>p; (int j = 0; j < n ; j++) { getline(cin,s[j]); } (int j = 0; j < n; j++) { (int z = 0; z < p.length(); z++) { cout<<s[j][z]<<" " <<endl; if (p[z]==s[j][z]) { c++;

javascript - How to differentiate HTTP method in html file? -

i have 2 1 rest end point hit html file , post. example: http://192.28.120.21:8098/restendpiont/rest.html -- request http://192.28.120.21:8098/restendpiont/rest.html -- post request post parameters in body. when ever end point calling, hits "rest.html" file, how can differentiate in html file http method(get/post).if request get, have return rest.html file otherwise should reditrecting other html file. could body have idea achieve above requirement.

python - Passing arguments to superclass constructor without repeating them in childclass constructor -

class p(object): def __init__(self, a, b): self.a = self.b = b class c(p): def __init__(self, c): p.__init__() self.c = c obj = c(a, b, c) #want instantiate c i want define c class object without rewriting p class constructor argument in c 's constructor, above code doesn't seem work. right approach this? clarification: the idea avoid putting parent class's constructor arguments in child class's constructor. it's repeating much. parent , child classes have many arguments take in constructors, repeating them again , again not productive , difficult maintain. i'm trying see if can define what's unique child class in constructor, still initialize inherited attributes. in python2, write class c(p): def __init__(self, a, b, c): super(c, self).__init__(a, b) self.c = c where first argument super child class , second argument instance of object want have reference instance of parent

asp.net mvc - How to compare viewbag value with model another value in mvc 4 -

i trying send viewbag action method view. when first page loads viewbag value null. when call checkpermissions action method viewbag gets value , return same view time viewbag contains value , want compare viewbag value value. tried following error appearing. cannot perform runtime binding on null reference. index view code. @model c3card.models.grouppermissionvm @{ viewbag.title = "index"; } @using (html.beginform()) { @html.labelfor(m=>m.groupid) @html.dropdownlistfor(m => m.groupid, model.grouplist, "please select", new { id = "ddlgrp" }) foreach(var permission in model.permissions) { if (viewbag.marlid.equals(permission)) { <label> @html.radiobuttonfor(m => m.perm_id, permission.perm_id, new {@checked="true"}) <span>@permission.perm_levelname</span> </label> } else { <label> @html

c++ - shared_ptr reference counting when spawning a std::thread -

i'm little new multithreading in c++11 , have specific question on spawning std::thread s shown below. notes class public method start in it. , thread_list vector holding std::thread s. void spawn() { std::shared_ptr<notes> note = std::make_shared<notes>(); std::thread thrd(&notes::start, note); thread_list.push_back(std::move(thrd)); } my question owns shared_ptr note after function finishes? reference thread thrd count reference , hence shared_ptr not destruct object reference? clarification appreciated. my question owns shared_ptr note after function finishes? thrd owns it, in way. not really. read on happens. does reference thread thrd count reference , hence shared_ptr not destruct object reference? kind of, not really. thrd doesn't count reference, , doesn't share ownership of note . it's handle thread. so owns note ? the notes::start function does . you've started thread executing note

php - How to i add CRON Job in Vesta CP Pannel What is Command -

Image
how can add file of php , txt in cron job of 10 mint example url : http://example.com/xx/file.php , http://example.com/xx/file.txt , i'm try command wget http://example.com/xx/file.php when add command panel email me in spam of error. for example: wget -q -o - "http://example.com/xx/file.php" > /dev/null 2>&1

javascript - Canvas : Getting rid of style attribute -

how rid of style automatically generated canvas? chrome: <canvas id="g_2" width="604" height="304" style="-webkit-user-select: none; touch-action: none; -webkit-user-drag: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); width: 302px; height: 152px;"></canvas> firefox: <canvas height="157" width="1076" style="-moz-user-select: none; width: 302px; height: 152px;" id="g_2"></canvas> p.s : not using javascript add style. to create canvas, using angularjs ng-repeating on canvas element using array, add new canvas , index appended array. here code snippet: <div class="tab-content" data-ng-repeat="tab in somearray"> <div role="tabpanel" class="tab-pane active"> <canvas id="someid_[[tab]]"></canvas> </div> </div> after canvas element created, setting width , height follows

Scala concurrency performace issues -

i have data mining app. there 1 mining actor receives , processes json containing 1000 objects. put list , foreach, log data sending 1 logger actor logs data many files. processing list sequentially, app uses 700mb , takes ~15 seconds of 20% cpu power process (4 core cpu). when parallelize list, app uses 2gb , ~ same amount of time , cpu process. my questions are: since parallelized list , computation, shouldn't compute-time decrease? think having 1 logger actor bottleneck in case. computation may faster bottleneck hides speed increase. if add more loggers pool, app time should decrease? why memory usage jump 2gb? jvm have store entire collection in memory parallelize it? , after computation done, jvm garbage collector should deal it? without more details, answer guess. however, guess might point right direction. parallelized execution should decrease running time problem might lie elsewhere. reason, cpu idling lot in single-threaded mode. not specify whe

android - Fetch data in Json array and send it to server -

i developing android application fetch data in j son array. want send said json array mysql database on server. db.open(); arraylist<hashmap<string, string>> arraylist = db.record(); gson gson = new gson(); string jsonpesan = gson.tojson(arraylist); db.close(); you need make web-service ,you can post data server using webservice. how send data mysql db without using jdbc , php or other webservice?

join - SQL, joining tables -

here problem. have 2 tables , b. both have field of date type. denote them date_a , date_b, correspondingly. problem join these 2 tables each other following method - each row x table need join row y b such among rows z b row y provides minimum value of expression abs(date_a(x)-date_b(z)), i.e. it's value in date_b closest value of date_a in x. assumingly, minimum unique, if it's not it's choose 1 of them randomly (but one). example. table a: "a", "b", "2015-10-01" table b: "c", "2015-10-07" "d", "2015-12-02" expected result: "a", "b", "2015-10-01", "c", "2015-10-07" p.s. platform teradata, if matters of course write join-condition based on logic, worst_case in parallel dbms teradata. result in product join (probably followed step return 1 matching row). for closest-match-join try find actual value using lag/lead logic: select

c++ - Speed up a people detection program, written using OpenCV 3.0 -

Image
i use opencv 3.0.0 , visual studio 2012. i've found program detect people , count them , determine direction of motion. it's slow. have idea how speed up? #include <iostream> #include <opencv2/opencv.hpp> using namespace std; using namespace cv; int main (int argc, const char * argv[]) { videocapture cap("c:/users/john/downloads/video/cam.avi"); cap.set(cv_cap_prop_frame_width, 100); cap.set(cv_cap_prop_frame_height, 110); if (!cap.isopened()) return -1; mat img; hogdescriptor hog; hog.setsvmdetector(hogdescriptor::getdefaultpeopledetector()); namedwindow("video capture", cv_window_autosize); while (true) { cap >> img; if (!img.data) continue; vector<rect> found, found_filtered; hog.detectmultiscale(img, found, 0, size(8,8), size(32,32), 1.05, 2); size_t i, j; (i=0; i<found.size(); i++) {

How to call directive from template html in angularjs -

html <script type="text/ng-template" id="profiletemplatehtml" > <div class="container profilepopup-cont" align="center"> <div class="row"> <div class="col-sm-3 zero-margin-padding" align="center"> <img id="displayimage" ng-src={{model.piclarge}} class="img-circle"> </div> ... </script> in html template file have call directive.my directive name 'help'.but if add call directive not working. how call directive inside html template in angularjs? i'm not sure understand question. here jsfiddle demonstrate how use custom directive inside ng-template. or try this.. angular.module('demo', []) .directive('help', function() { return { template: '<div>help! {{info}}</div>', scope: { info: '@info'

javascript - Order objects by occurrences -

i have following code creates objects of each word (words in wordsarray ) , checks number of occurrences of each word , stores along each object. var wordoccurrences = { }; (var = 0, j = wordsarray.length; < j; i++) { wordoccurrences[wordsarray[i]] = (wordoccurrences[wordsarray[i]] || 0) + 1; } console.log(wordoccurrences); this outputs: object { hello: 1, world!: 2, click: 1, here: 1, goodbye: 1 } i appreciate if me ordering objects occurrences e.g. ascending or descending order. have tried few ways none has yielded correct results. the desired output like: world! 2 hello 1 click 1 here 1 goodbye 1 try following: var wordoccurences = { "hello": 1, "world!": 2, "click": 1, "here": 1, "goodbye": 1 } var sortable = []; (var word in wordoccurences) sortable.push([word, wordoccurences[word]]) sortable.sort(function(a, b) {return a[1] - b[1]}).reverse() var result = {} for(var = 0; < sortabl

java - Database Manager can't connect to hsqldb -

after inserting data hsqldb, tried using database manager connect failed connect. i launched hsqldb in standalone mode. here error message: connection hsqldb (local) - target failed database lock acquisition failure: lockfile: org.hsqldb.persist.lockfile@a9e38b36[file =c:\program files (x86)\jetbrains\intellij idea 15.0.2\bin\target\misc.lck, exists=false, locked=false, valid=false, ] method: openraf reason: java.io.filenotfoundexception: c:\program files (x86)\jetbrains\intellij idea 15.0.2\bin\target\misc.lck (the system cannot find path specified) if launch hsqldb in standalone mode. happen said. in mode. db engine share same jvm application, process faster server mode. bad thing can't access outside. including database manager. if want view data tools. please launching db in server mode

Aurelia: fetch-client response doesn't have my data -

i've been banging head against fetch-client long , need help. i'm getting data skyscanner. request hits api , chrome's dev tools list in network tab complete fetch request code 200 , correct response body. import {inject} 'aurelia-framework'; import {httpclient} 'aurelia-fetch-client'; @inject(httpclient) export class flights { constructor(http){ http.configure(config => { config .withbaseurl('http://partners.api.skyscanner.net/apiservices/') .withdefaults({ mode: 'no-cors', headers: { 'accept': 'application/json', 'content-type' : 'application/json' } }); }); this.data = ""; this.http = http; } activate() { this.http.fetch('browsequotes/v1.0/gb/gbp/en-gb/uk/anywhere/anytime/anytime?apikey=myapikeygoeshere

osx - Ruby 2.3.0 gem pg version 0.18.4 install error El Capitan -

after "bundle install", keep getting error many times. errno::eacces: permission denied @ rb_sysopen - /users/daisukeishii/tasca- io/vendor/bundle/ruby/2.3.0/gems/pg-0.18.4/.gemtest error occurred while installing pg (0.18.4), , bundler cannot continue. make sure `gem install pg -v '0.18.4'` succeeds before bundling. gem install pg keeps giving same error -ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15] -psql (postgresql) 9.5.0 -mac el capitan -i checked related posts in stackoverflow not solve this. tried uninstall/install postgresql through brew. tried uninstall/install ruby do have idea solve this? i had problems installing pg gem , me did trick: archflags="-arch x86_64" gem install pg however, looking @ error message seems not having write permissions gem directory. maybe have tried install gem root sudo gem install pg , left behind directory under home directory having root owner instead of regular user. re

html - Flexbox sticky footer height issue on larger screen sizes -

Image
i have issue sticky footer made flexbox. works on resolutions upto 1366*768 on 1600*1300 pixels footer gets pushed bottom of visible screen despite there being little content. here html structure using. body , html { height: 100%; } #main { display: flex; flex-direction: column; min-height: 100vh; } #content { flex: 1; } <body> <div class="ui secondary pointing menu"> <a class="active item"><img src="/assets/images/ti.jpg" class="image ui small"></a> <div class="right menu"><a class="ui item">logout</a></div> </div> <div id="main"> <div id="content" class="ui container"> <div id="pie-menu" style="position: relative;"> <div class="dvsl-resize-triggers">

c# - addFontFile from Resources -

Image
i have added custom font using below code: privatefontcollection pfc = new privatefontcollection(); pfc.addfontfile("c:\\path to\\yourfont.ttf"); label1.font = new system.drawing.font(pfc.families[0], 16, fontstyle.regular); i added font file in resources. how add addfontfile resources? if included font in resources try function private void addfontfrommemory() { stream fontstream = this.gettype().assembly.getmanifestresourcestream("yourfont.ttf"); byte[] fontdata = new byte[fontstream.length]; fontstream.read(fontdata,0,(int)fontstream.length); fontstream.close(); unsafe { fixed(byte * pfontdata = fontdata) { pfc.addmemoryfont((system.intptr)pfontdata,fontdata.length); } } } edited how load resource assembly:(yournamespace.file.ttf) stream fontstream = assembly.getexecutingassembly() .getmanifestresourcestream("windowsformsapplication1.sbadr.ttf"); m

ios - Updating UI as the result of a request handler -

i have setup this; startup() { ... self.gcdwebserver.addhandlerformethod("get", path: "/hide", requestclass: gcdwebserverrequest.self, asyncprocessblock: {request in self.hide()}) ... } func hide() -> gcdwebserverdataresponse { self.view.hidden = true; print("hide") return gcdwebserverdataresponse(statuscode: 200) } when request /hide made, console shows print() call immediately, view not disappear arbitrary delay, somewhere between 10-30 seconds. how can have request result in view being hidden? try one, calling hidden on main thread. dispatch_async(dispatch_get_main_queue(),{ self.view.hidden = true; })

ssl - Accessing Secured Webservice via mobilefirst adapter -

i need access wsdl secured i.e https , need certificates etc access .what did followed steps specified here instead of directly downloading certificates browser: https://www-01.ibm.com/support/knowledgecenter/sshscd_7.0.0/com.ibm.worklight.installconfig.doc/admin/t_configuring_ssl_wl_adapters_backend_servers_certificates.html when last step keytool -v -list -keystore mfp-default.keystore keystore type: jks keystore provider: sun your keystore contains 1 entry alias name: backend creation date: 5 feb, 2016 entry type: trustedcertentry my doubt whether have done enough access secured https , need add here below sslcert , ssl pass in adapter.xml <?xml version="1.0" encoding="utf-8"?> <!-- licensed materials - property of ibm 5725-i43 (c) copyright ibm corp. 2011, 2013. rights reserved. government users restricted rights - use, duplication or disclosure restricted gsa adp schedule contract ibm corp. --> <wl:adapter name=&

tomcat8 - Tomcat not starting in eclipse within timeout -

my tomcat server not starting though increased timeout running extent not generating logs in console tab of eclipse , giving timeout? day before used run good. the server running when cleaned project , started server working properly

php - Why query not inserting record -

i trying insert simple 2 values in db neither inserting nor giving errors. not know what's happening. tried sql query outside if statement did not work. please help coding file <?php include 'includes/db_connection.php'; if (isset($_post['submit'])) { $name = test_input($_post["name"]); $fathername = test_input($_post["fathername"]); $sql = "insert student (name,fathername) values ('$name','$fathername')"; mysqli_query($conn, $sql); if(mysqli_query($conn, $sql)) { $last_id = mysqli_insert_id($conn); echo "new record created successfully. last inserted id is: " . $last_id; } else { echo "error: " . $sql . "<br>" . mysqli_error($conn); } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); r

android - Unable to use OptionsMenu in Fragment Activity -

i want use options menu inside fragment activity .i have used following code add option menu : 1.menu_chat.xml <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/action_viewcontacts" android:orderincategory="100" android:title="@string/action_view_contacts" app:showasaction="never"/> <item android:id="@+id/action_media" android:orderincategory="100" android:title="@string/action_media" app:showasaction ="never"/> <item android:id="@+id/action_search_message" android:orderincategory="100" android:title="@string/action_search" app:showasaction ="never"/> <item android:id=&