Posts

Showing posts from August, 2012

javascript - Clipboard in Angular Js -

i have csv content in angular 1 want copy clipboard. using clipboard.js https://github.com/zenorocha/clipboard.js if giving clipboard text button, getting copied. <button class="btn" data-clipboard-text="gets copied"> copy clipboard</button> but if dynamically setting text below, nothing gets copied. new clipboard('.btn', { text: $scope.test; }); $scope.test has csv content anything missing ?

excel vba - VBA How to stop when setting cells equal to each other automatically changes small numbers to a percentage? -

when setting 2 cells each other, if number small automatically sets receiving cell percentage , not actual number, how avoid this? i found solution problem, selected entire range of numbers once had been pasted , selected them before doing: selection.numberformat = "general"

multithreading - Python & web scraping performance -

i trying python based web scraping execution time pretty critical. i've tried phantomjs, selenium, , pyqt4 now, , 3 libraries have given me similar response times. i'd post example code, problem affects three, believe problem either lies in shared dependency or outside of code. @ around 50 concurrent requests, see huge desegregation in response time. takes 40 seconds 50 pages, , time gets exponentially slower greater page demands. ideally i'm looking ~200+ requests in 10 seconds. used multiprocessing spawn each instance of phantonjs/pyqt4/selenium, each url request gets it's own instance i'm not blocked single threading. i don't believe it's hardware bottleneck, it's running on 32 dedicated cpu cores, totaling 64 threads, , cpu usage doesn't typically spike on 10-12%. bandwidth sits reasonably comfortably @ around 40-50% of total throughput. i've read gil, believe i've addressed using multiprocessing. webscraping inherently slow thi...

vba - Visual Basic commands to copy a file from subfolder to another subfolder -

i have question copying file current application directory directory , subfolder. for example, want copy file current application working directory\files\settings.ini , want copy documents\subfolderexample\settings.ini what came is: my.computer.filesystem.copyfile(my.application.info.directorypath & ("files\settings.ini"), my.computer.filesystem.specialdirectories.mydocuments & "subfolder\settings.ini") but doesn't seem work me @ all. i fixed it! brother working on code before me later today put "try" thingie reason , doesn't want copy file way. removed try thingie , it's working fine now.

android - get bigger bitmap from view than getDrawingCache() can do -

i have relativelayout , want save content bitmap . there tonns of solutions here no 1 suits task. main difficult view has, lets say, 700x900 px size. want screenshot of view size 1000x1000. cannot make screenshot getdrawingcache() , scale because views inside relativelayout shrinked/stretched. think need resize view itself, make bitmap it, , resize back. but! if resize view bigger screen , getdrawingcache() works visible part of view. cannot put scrollview workaround such behaviour. appreciated.

Ms-Access Query only allows 255 characters -

i running issue 1 of unbound textboxes. of users send out long comments in "comment" box , in database, shows 255 characters max. here query insert data database. txtcomment textbox trying change. currentdb.execute _ "insert ipa_raw_data(date_ipa, auditor, area, operator, safely, lineclearance, ppe, verifydoc, gvi, compbefore, nonconf, procsteps, trained, points, comments) " & _ "values ('" & me.txt_date.value & "', '" & me!txt_name.value & "', '" & me!txt_area.value & "', '" & me!txt_operator.value & "', '" & me!cb_safe.value & "', '" & me!cb_lc.value & "', '" & me!cb_ppe.value & "', '" & me!cb_vdp.value & "', '" & me!cb_gvi.value & "', '" & me!cb_cbf.value & "', '" & me!cb_...

c# - Dependencies not flowing between dependent projects, causing System.IO.FileNotFoundException -

lets solution has 2 projects: the first called "mainproject" (a .netstandard 2.0 project). the second called "mainprojecttests" (a nunit test project) unit tests each class "mainproject". the first project (mainproject) has nuget dependency called "dependencyx". obviously, project "mainprojecttests" has reference "mainproject". so when test runner runs test of "mainprojecttests" calls methods "mainproject" using "dependencyx" i'm getting system.io.filenotfoundexception exception: system.io.filenotfoundexception : not load file or assembly 'dependencyx, version=1.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies. why getting exception? when add "dependencyx" "mainprojecttests" works fine, seems me not practice... how solve it? i'm using visual studio mac community 7.2 preview (7.2 build 583) thanks help. edit: tri...

java - RegEx for Complex String -

i new using regex , trying use java engine. example string trying parse following: name:"sfatg";affil:100;aup:1;bu:false name:"sf tac 1";affil:29.3478;aup:19;bu:false name:"sf tac 2";affil:22.2222;aup:14;bu:false name:"sf tac 3";affil:44.4444;aup:0;bu:false name:"sf disp 4";affil:82.4742;aup:0;bu:false what hope regex achieve extract values appear after : , before ; . in addition, not want include quotes within entries name . however, (in particular case) would keep space appears in entry bu . not, however, want have name field appear data entry of bu though. i'd want false , not false name field. my ultimate goal using regex create array of groups/data values array contain following: [0]: sfatg [1]: 100 [2]: 1 [3]: false [4]: sf tac 1 ...etc. i thinking creating groups each value because able create array combining pattern , matcher classes, such that: string regex = "some fancy regex works"; patt...

ios - Vary for Traits in XCode 8 orientation -

i confused if 'vary traits' right thing define different set of layout constraints portrait & landscape mode on iphone. objective have different layouts portrait & landscape modes on iphone (doesn't matter on ipad). tried 'vary traits' , define different set of nslayoutconstraints portrait & landscape modes seems not working. if have constraints p1 & p2 active portrait mode , c1 & c2 landscape mode same view, should job. 'vary traits' meant job? also how undo variations might have added using 'vary traits'? you need following - set constraint in portrait mode. select landscape mode. disable constraints set in portrait mode. assign new constraints landscape. go in portrait mode , disable constraints set in landscape mode. that's it. hope works. feel free comment if have confusion..

How to open multiple terminals in docker? -

i need launch 2 distinct processes on docker container requires 2 terminals.what best way achieve this? you can run docker exec -it <container> bash multiple terminals launch several sessions connected same container.

javascript - google apps scripts check contact exist, then update from sheet -

not sure i've gone wrong. trying check if contact exists before creating it. once done, adding timestamp row. var dateformat = utilities.formatdate(new date(), "gmt-2", "yyyy-mm-dd' 'hh:mm:ss"); var tkhcontacts = spreadsheetapp.openbyid('###').getsheetbyname('contacts'); function update(){ // -- update contacts -- runs on master spreadsheet tkh contacts emf (contact) // importrefresh(); don't need var range = tkhcontacts.getlastrow(); var updatecol = tkhlastupdatedcol(); var data = tkhcontacts.getrange(updatecol+"1:"+updatecol+range).getvalues(); for(var n=range;n>1;n--) { var lastupdate = tkhcontacts.getrange(updatecol+n).getvalue(); // last update col var email = tkhcontacts.getrange("h"+n).getvalue(); var fname = tkhcontacts.getrange("c"+n).getvalue(); var lname = tkhcontacts.getrange("d"+n).getvalue(); var city = tkhcontacts.getrange(...

c# - How to get Selenium and Geckodriver to ignore unsecure locally served webpage on local execution -

i have latest geckodriver (0.18.0) , webdriver (3.5.1.0). running selenium tests locally , remotely. when run tests remotely against https site, run fine. i use following references: using nunit.framework; using openqa.selenium; using system; using openqa.selenium.firefox; using browser.core.framework.resources; using openqa.selenium.remote; using system.reflection; my remote code works is: desiredcapabilities caps = null; caps = firefoxoptions.tocapabilities() desiredcapabilities; caps.setcapability("acceptinsecurecerts", true); if (firefoxprofile != null) { caps.setcapability(firefoxdriver.profilecapabilityname, firefoxprofile.tobase64string()); } caps.setcapability(capabilitytype.version, null); caps.setcapability(capabilitytype.platform, null); var buildnumber = assembly.getexecutingassembly().getname().version.tostring(); caps.setcapability("build", buildnumber); caps.setcapability("name", testcontext.currentcontext.test.name); console...

c# - Where do I put supplemental files in a Windows Service? -

ok, here's situation. have written windows service. testing "console" app has shown promising results. unfortunately, can't figure out put file. have json data critical application. it's in file. i'd rather not go detail on that, know has in file,and it's critical. it's not config file, needed. anyway, i've added file windows service project. problem is, can't quite figure out right code , settings use put file in right place when service gets installed. this second windows service have ever written, , first 1 (years ago) didn't require supplemental files. i wrote service in visual studio 2015, on windows 7. testing on local machine here @ office, go on production machine. help, please? ideas should put file , how should reference in code? i saw site said should use following: system.io.directory.setcurrentdirectory(system.appdomain.currentdomain.basedirectory); but didn't seem when did this: filepath = environmen...

c# - QBPOS export request received and processed but no response -

i'm looking qbpossdklog , can see request being processed not receiving response queried information. feel missing simple. if going test code make sure platform x86 or going receive com error. using c# , qbposfc3. using system; using system.net; using system.drawing; using system.collections; using system.componentmodel; using system.windows.forms; using system.data; using system.io; using interop.qbposfc3; using system.xml; namespace qbpos { public class po { [stathread] public static void main(string[] args) { po_query(); } public static void po_query() { bool sessionbegun = false; bool connectionopen = false; qbpossessionmanager sessionmanager = null; try { sessionmanager = new qbpossessionmanager(); imsgsetrequest requestmsgset = sessionmanager.createmsgsetrequest(3,0); requestmsgset.attribute...

Angular cli ng serve only showing app work -

serving node showing whole web app have build ng serve showing app works. using node serve app including ng router function.i searching whole web cannot see answers. enter image description here

CSS HTML place a white square on an image -

i have div entire background of image. in middle of image want have white box has text in it. tried relative position stretched out parent. here code <div id="desk-linkedin-image" style="background: url('img/linkedin/at_desk_linkdenin_optimization.jpg');width: 100%;"> <div style="background-color: #ffffff; width: 475px; height: 46%;padding-left: 2%;"> <p style="font-size: 20px;"> text text text</p> <p style="font-size: 20px;"> text text text</p> <p style="font-size: 20px;">text text text</p> </p> </div> </div> try giving child div absolute position,then margin left , margin top,something <div id="desk-linkedin-image" style="background: url('http://knowledgeoverflow.com/wp-content/uploads/2013/03/food_photography_burger_by_masterdev777-d3h1ryk.jpg');width: 100%;heig...

Preorder traversal in python: suppressing output -

i have tree exists tree object: class tree: ... class node: ... self.branch_type='node' self.children=[] # list of immediate children ... class leaf: ... self.branch_type='leaf' ... this representation written else, i'm building on top of. i've written preorder_traverse() function so: def preorder_traverse(node, preorder_ls, verbose=false): preorder_ls.append(node) if node.branch_type == "node": if verbose: print(node) preorder_traverse(node.children[0], preorder_ls) preorder_traverse(node.children[1], preorder_ls) elif node.branch_type == "leaf": if verbose: print(node, node.name) usage: >>>preorder_ls = [] # init empty list filled >>>preorder_traverse(node, preorder_ls) this populate preorder_ls , desired, prints out objects whenever call preorder_traverse ! weird because happens if set verbose false. th...

linux - Subversion svn+ssh, sshd 100% CPU -

in past few days have been doing extensive testing of subversion different clients, operating systems, client , server versions , have noticed strange behaviour windows clients connecting linux servers, hitting them excessive cpu usage on sshd process, linux clients not exhibit behaviour. a sample test setup follows: server linux ubuntu 16.04.3 lts, openssh_7.2p2 ubuntu-4ubuntu2.2, openssl 1.0.2g 1 mar 2016, subversion version 1.9.3 (and 1.9.7). client tortoisesvn 1.9.7 when checking out large repositories linux server hit on sshd process, process running 100% cpu usage. in effect slows down performance , speed @ checkout runs. linux clients connecting same server not cause load on server. this happens when compressions turned off , when encryption cyphers changed, different versions of subversion. behaviour identical. i'm not sure address issue not happens tortoisesvn sliksvn well. direction appreciated. if you're looking way controlled set of users access ...

regex - Notepad++ find/replace for every value in a comma separated list -

i'm trying find values within comma separated list , replace them value. for example, had following file: { letter: a, }, { letter: b, }, { letter: c, }, i have list "b, c". want make change every value within list. example: { letter: a, }, { letter: b, word: bat }, { letter: c, word: cat }, how go doing in notepad++? in advance!

git - Gogs throws a "Permission denied" error when I delete public key file from client -

i installed gogs (go git server) on raspberry pi3 using offical gogs/gogs-rpi docker image, run as suggested : docker run --name=gogs -p 10022:22 -p 10080:3000 -v /var/gogs:/data gogs/gogs-rpi i used laptop register admin user via gogs webinterface , added public key account. can clone git repositories pi laptop using command: git clone ssh://git@192.168.178.50:10022/peter/my_repo.git i enter key-phrase , works fine. now strange part... when delete public key file (id_rsa_gogs.pub) laptop , run above command again 'access denied' error. does know be? registered public key in gogs. why need have version of public key on client machine? never heard of case in public key needs stay client. udapte if rm .pub keyfile , run ssh -tv git@192.168.178.50 -p 10022 -i /home/peter/.ssh/id_rsa_gogs this: openssh_7.2p2 ubuntu-4ubuntu2.2, openssl 1.0.2g 1 mar 2016 debug1: reading configuration data /home/peter/.ssh/config debug1: reading configuration data /etc/ssh/s...

hibernate - Spring data JPA native query skip locked -

i want execute skip locked query on oracle using spring data jpa, tried following: @lock(lockmodetype.pessimistic_write) @query(value = "select * user id=?1 update skip locked", nativequery = true) user findone(uuid id); i tried above , found generated query contains for update , not skip locked (below generated query logs): select ent0_.column1 name, ent0_.created_date created_2_33_0_ table_name alias_name ent0_.column1=? update if remove @lock query method, generated query not have for update . please suggest how can generate query for update skip locked , required.

java - getCurrentUser() functions error -

firebaseuser currentfirebaseuser = firebaseauth.getinstance().getcurrentuser(); currentfirebaseuser.getdisplayname(); this code works functions when auth google when auth facebook nullpointerexception. check user using code if (firebaseauth.getinstance().getcurrentuser() == null) { gotologinscreen(); } else{ string uid = firebaseauth.getinstance().getcurrentuser().getuid(); } the documentation getcurrentuser() says will, in fact, return null if there no current user (there no 1 logged in). should expect case possibility. if want know possible if there user logged in, should instead use authstatelistener check login event calling getcurrentuser() in onauthstatechanged() see if returns non-null.

php code entering my html -

Image
i'm trying insert data php page mysql databse. when refresh page parts of php code being displayed on page rather being processed below code(sensitive info blocked): <?php $servername = "localhost"; $username = "*******"; $password = "*******"; $dbname = "accounts"; // create connection $conn = mysqli_connect($servername, $username, $password, $dbname); // check connection if (!$conn) { die("connection failed: " . mysqli_connect_error()); } $sql = "insert myguests (firstname, lastname, email) values ('john', 'doe', 'john@example.com')"; if (mysqli_query($conn, $sql)) { echo "new record created successfully"; } else { echo "error: " . $sql . "<br>" . mysqli_error($conn); } mysqli_close($conn); ?> and screenshot of "view source", can see sort of stops doing it's php , displaying page. thought...

python - How to apply same operation on every block of block matrices in numpy efficiently? -

i have big 2d array following shape: b = [b_0, b_1, b_2, b_n] where b_0, b_1, ..., b_n have same number of rows, different number of columns , n may large. have 1d array idx shape (n+1,) , , b_i = b[:, idx[i]:idx[i+1]] and idx[-1] (the last elements of idx ) total number of columns of b . i want same matrix operation every b_i , example: b_i.t()@b_i or 2d array: d = [[d_0], [d_1], ..., [d_n]] with d_0, d_1, ..., d_n have same number of columns equal number of rows of b , different number of rows, , d_i = d[idx[i]:idx[i+1], :] and want compute d_i@b_i . so question how implement in python , avoid using for loop? the following example: import numpy np timeit import default_timer timer # prepare test data n = 1000000 # number of small matrix idx = np.zeros(n+1, dtype=np.int) idx[1:] = np.random.randint(1, 10, size=n) idx = np.cumsum(idx) b = np.random.rand(3, idx[-1]) # computation start = timer() c = [] in range(n): b_i = b[:, idx[i]:idx[i+1]...

How to change a specific entity of a specific record stored in a file in c++ -

hi friends want modify specific entity of specific record stored in file. have stored record in file as roll no: 35 name: adnan irshad status: not admitted roll no: 40 name: adeel ahmed status: not admitted roll no: 30 name: arish adnan: not admitted roll no: 35 name: shan status: not admitted here want search record via roll no , change status of record admitted input 30 roll no search record , program search record , change status admitted. have done code change 1 record when record nothing happen. code here char stat[13]; cout<<"enter registration no"; cin>>reg_no; fstream out("intermediate.txt",ios::in|ios::out|ios::ate|ios::app); out.seekg(0,ios::beg); out.read((char*)&std,sizeof(std)); while(!out.eof()) { record_no++; if(strcmp(std.get_reg_no(),reg_no)==0) { found=1; break; } } location=(record_no-1...

django - Python, if else and key modification -

Image
i have 1 program/website read output text file. python read each of line , display on website. there 2 output python read , display, visual id , time delay. able display visual id in 1 column , both visual id, time delay perfectly. question my problem when want display 'time delay' take first output line 'visual id' column, display 2 column. i want display 'time delay' in 1 column. views.py open(path) input_data: line in input_data: if 'visual' in tokens , line.startswith('2_visualid_'): prev_key = line.lstrip('2_visualid_').rstrip() data.update({prev_key: []}) if 'time' in tokens: if search_string in line , prev_key in data: data[prev_key].append(next(input_data).lstrip('2_mrslt_').rstrip()) else: if search_string in line: p...

javascript - Lighthouse incorrectly states I have not registered a Service Worker -

the source web app can found here: - https://drive.google.com/open?id=0b7rmd3rn8_hdnw1zswroxzbtclu see line 11 in registerserviceworker.js register serviceworker lighthouse reporting: - does not register service worker , user not prompted install web app failures: manifest not have icons @ least 192px, site not register service worker, manifest start_url not cached service worker. why not seeing service worker registered?

Java formatting issue -

Image
for assignment told need format output in columns instead of top bottom in image... guide: here code outputs downwards , not in columns public void displaystudentanswers(char[][] responses, char[] goodanswers, int numstudents, int numquestions) { //number wrong keep track of how many each student got wrong can calculate percent later double[] numwrong; numwrong = new double[numstudents]; for(int i=0; i<numstudents; i++) { system.out.printf("student %d%n", i+1); for(int j = 0; j<numquestions; j++) { if(responses[i][j] == goodanswers[j]) { system.out.printf("%2d) %c%n", j+1 , responses[i][j]); } else { system.out.printf("%2d) %c (%c)%n", j+1 , responses[i][j], goodanswers[j]); numwrong[i]++; } } } i new java programming , appreciate help!

multithreading - Android Thread Safety; Data Injection into a thread -

i have created example: import static java.lang.thread.sleep; public class example implements runnable, iexternal { object o = null; // construstor parameters thread example(object o){ this.flag = (boolean)o; controller.iextofexample = (iexternal) this; } volatile boolean flag = true; object p1, p2 = null; public volatile string result= ""; @override public void run() { while (flag){ try { sleep(1000); } catch (interruptedexception e) { e.printstacktrace(); } // code result = p1.tostring() + p2.tostring(); } } @override public void reset() { flag = false; } @override public boolean methodb(object o1, object o2) { p1 = o1; p2 = o2; return true; } } interface iexternal{ void reset(); boolean methodb(object o1, object o2); } class controller { ...

kotlin - Can we achieve compile-time type safety for a union of types we can't control? -

let's have function: fun dosomething(vararg pairs: pair<string, *>) { // things pairs } the problem approach allows type second half of pair (e.g. pair<string, customtype1> ). what if want allow finite number of types, how achieve that? if function had simpler signature, achieve restriction via overload, so: fun dosomethingsimpler(param: boolean) { // boolean implementation } fun dosomethingsimpler(param: int) { // int implementation } // etc. if restricted type "set" in control, use interface or sealed class achieve this. e.g. sealed class root class child1 : root() class child2 : root() fun dosomethingicancontrol(param: root) { // root implementation } yet if don't have control on types or primitive, how prevent * allowing through? i know use smart-casts run-time safety, can done @ compile time? or language disallow it? edit 1 i know create own box types (e.g. myboolean ) , use common interface or sealed c...

botframework - In Bot-framework, I am not able to connect the socket using "Receive activities from the bot" -

in bot-framework, not able connect socket using "receive activities bot" rest client( refer api document ) please find below response "start conversation" restful api { "conversationid": "bok3llphr5i3y2pnajskng", "token": "0em5dhesphs.daa.qgbpaesamwbsagwauabiahianqbjadmaeqayahaabgbbagoauwbrae4arwa.z0auwimr0we.znmgkfrh6tc.0i6lq2-9fhuq6coaers8oyrgsftth5engqyzy2r89vu", "expires_in": 1800, "streamurl": "wss://directline.botframework.com/v3/directline/conversations/bok3llphr5i3y2pnajskng/stream?watermark=-&t=0em5dhesphs.daa.qgbpaesamwbsagwauabiahianqbjadmaeqayahaabgbbagoauwbrae4arwa.z1l1sn8r0we.iqjtkv2cn6s.icdu3otuy3uprep78uutimbz-a4pa7dmdw02kkp_mzk", "referencegrammarid": "a2e8d13d-bcf4-bb58-b85a-b539c4e5a1c4" } i try connect socket "streamurl", unable connect socket. socket return: connection fails. for socket connection use io s...

c# - Using PushStreamContent with Xamarin hangs and causes bad request -

previously have used pushsteamcontent in xamarin upload data server captured on the app's device. (not sure when changed) code timeout when trying upload string large file. have pulled down code source control , built once worked , doesn't work anymore. has run problems using pushstreamcontent xamarin , .net standard? if create .net core console app , use same code works fine.

python - py2exe googlemaps.exceptions.TransportError 'x509 certificate routines' -

i have program works fine before putting through py2exe process. 1 of packages used googlemaps geolocation. after turning program .exe file using py2exe run .exe file , following traceback error: traceback (most recent call last): ... file "googlemaps\client.pyc", line 356, in wrapper file "googlemaps\geocoding.pyc", line 68, in geocode file "googlemaps\client.pyc", line 233, in _request googlemaps.exceptions.transporterror: [('system library', 'fopen', 'no such proc ess'), ('bio routines', 'bio_new_file', 'no such file'), ('x509 certificate rout ines', 'x509_load_cert_crl_file', 'system lib')] i ran similar issues requests module when using py2exe. resolve issue, needed explicitly state path of ca_bundle using verify parameter per documentation here . had include cacert.pem file in files bundled program in setup.py file py2exe uses. setup(console=['prog...

asp.net mvc - How to rewrite MVC Actions & properties to ASP Core MVVM Razor Pages -

in new release of asp core 2.0 last month, introduced razor pages, has me in loop since old controller & model frpm mvc missing asp core 2 razor pages. my understanding page default binding of properties using [bindproperty] attribute outside action/method!!!!, because moved mvvm framework opposed mvc framework. question: while trying rewrite traditional actions, since there no controllers, how move code new razorpages mvvm framework, i.e. and , how bind properties, , actions/handlers? since properties not in signature, how action/handler know properties passed view/razor page? what pagemodel? public class createmodel : pagemodel // pagemodel, new or same old model? { private readonly appdbcontext _db; public createmodel(appdbcontext db) { _db = db; } [bindproperty] public customer customer { get; set; } // why property outside? public async task<iactionresult> onpostasync() { if (!modelstate.isvalid) ...

jquery mobile page stuck loading -

i trying put app runs jquery mobile front end , node js backend. the problem experiencing page not loading 1 of routes. i have proper links: <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" /> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> here code: <% include partials/header %> <div data-role="header" class="ui-header ui-bar-a" role="banner"> <h1 class="ui-title" role="heading" aria-level="1">settings</h1> </div> <ul data-role="listview" class="ui-listview"> <a href="/signin" class="ui-link-inherit"><li data-corners="false" data-shadow="fa...

pivot table - LEFT JOIN doesn't behave as expected as gives NULLs in MySQL -

i completing this challenge hackerrank. it asks: pivot occupation column in occupations each name sorted alphabetically , displayed underneath corresponding occupation. output column headers should doctor, professor, singer, , actor, respectively. it involves table of data: name occupation ashley professor samantha actor julia doctor britney professor maria professor meera professor priya doctor priyanka professor jennifer actor ketty actor belvet professor naomi professor jane singer jenny singer kristeen singer christeen singer eve actor aamina doctor we want pivot table occupation such each name sorted alphabetically , displayed underneath corresponding occupation. output column headers (which don't actually) should doctor, professor, singer, , actor, respectively. however, when run mysql code: select d.name, p.name, s.name, a.name ( select @row_number:=@row_number+1 row_num...

embedded - Semaphore in Ada -

this assignment , have been asked implement semaphore in ada description below. however have implemented semaphore.adb , called semaphore in producerconsumer_sem.adb created. i output following. i'm not sure if initialization of semaphore correct s: countingsemaphore(1,1); . i don't know call s.wait , s.signal randomly called s.wait before producer put item in buffer x := i; , s.signal after x := i; . correct way? producer-consumer problem program producerconsumer.adb implements non-reliable implemen- tation of producer-consumer problem, data lost. in following, use 3 different communication mechanisms achieve reliable implementation of producer-consumer problem. semaphore the ada language not directly provide library functions semaphore. however, semaphores can implemented means of protected object. create package specification semaphore in file semaphores.ads , corresponding package body in file semap...

css - Bulma's navbar-buger doesnt connect to menu items in Vue.js 2 -

i trying implement navbar application front end built using vue 2.0 , bulma . works on desktops , on smaller screens showing burger icon not showing elements. present. <template> <div class="container is-fluid"> <div> <nav class="navbar is-dark"> <div class="navbar-brand"> <a class="navbar-item" href="#"> <img alt="k r o n o s" height="100px"> </a> <div class="button navbar-burger" data-target="navmenu"> <span></span> <span></span> <span></span> </div> </div> <div class="navbar-menu" id="navmenu"> <div class="navbar-end"> <div class="navbar-item"> <a class="" ...

linux - If the size of the file exceeds the maximum size of the file system, what happens? -

for example, in fat32 partition, maximum file size 4gb. able create 5gb file vim , saved file , opened again, console output broken staircase. have 3 questions. if size of file exceeds maximum size of file system, happens? in case, why break? in unix system call, stat() can succeed 2gb(2^31 - 1). have file system? there relationship between limits of data in stat() , limits of each feature in file system? if size of file exceeds maximum size of file system, happens? by definition, can never happens. happens system call (probably write(2) ...) failing, , code doing should take care of case. notice fat32 filesystems restrict maximal size of files 2gigabytes. use better file system on usb key if want more (or split(1) large files in smaller chunks before copying them fat32-formatted usb key). if using <stdio.h> notice fflush(3) , fprintf(3) , fclose(3) (and other standard functions) can fail (e.g. because failing write(2) ). the console outp...

mysql - GoLang Dynamic SQL Query in App Engine -

i want make dynamic sql in golang , cant seem find correct way it. basically, want do: query := "select id, email, user" var paramvalues []string filterstring := "" if userparams.name != "" { paramstring += " id = ?" paramvalues = append(paramvalues, userparams.name) } if userparams.userid != "" { if len(paramstring) > 0 { paramstring += " and" } else { paramstring += " where" } paramstring += " email = ?" paramvalues = append(paramvalues, userparams.userid) } stmtout, err := db.prepare(query + paramstring) err = stmtout.queryrow(paramvalues).scan(&id, &email, &something) related building dynamic query in mysql , golang i've been unable find solid way doesn't allow sql injection. issue above solution queryrow() not take []string parameter. i want protect sql injection, fmt.sprintf doesn't solve problem. this way can ...