Posts

Showing posts from June, 2013

c# - Replace multiple string with the same -

want want replace domain in text string hyperlink. so domain.com , www.domain.com , http://domain.com , http://www.domain.com , etc. replaced <a href="http://www.domain.com"> is possible replace these @ once don't have bunch of replace statements? thought first replacing each unique placeholder , replacing link don't have worry re-replacing string. or maybe regex? horrible @ regex example great if that's best. alternatively, there better option i've not considered? is same domain or loosely resembling address? if it's domain.com replace few possibilities listed if it's shaped address try regex like ((http://)?(www\.)?([a-za-z0-9]+)\.([a-z]{1,2,3})) and replace <a href="\1"> (usually regex refer capturing groups (whatever inside parenthesis) $1 $2 $3 in visual studio it's \1 \2 \3) this if using gui tool in visual studio, programatically have access groups of regex match , find group 1 but de...

updates - Programatically Get the Latest Version Number of Firefox -

how can parse version number of firefox programatically. so, don't have visit page every time. have run script, , give me latest version. http://download.cdn.mozilla.net/pub/mozilla.org/firefox/releases/latest/update/win32/en-us/ the file have ".complete.mar" in it. it's file word "complete" under directory. how can parse version "40.0.2" it. the simple answer mozilla release engineering provides way download latest version. see https://ftp.mozilla.org/pub/firefox/releases/latest/readme.txt for example, want download latest linux 64-bit english version of firefox. would: curl -lo firefox.tar.bz2 'https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-us' tar -xjf firefox.tar.bz2 cd firefox ./firefox --version mind stable releases , not rc or nightly. see release notes in appropriate subfolder . notes: the curl command url surrounded single quotes ( ' ) avoid bash interpreting...

angularjs - Using $http with $exceptionHandler -

i want post errors happen inside angular application. i followed approach given in related question , suggested in answer, injected $injector , got $http service there. line uncaught error: circular dependency: $http <- $exceptionhandler <- $rootscope keeps comming. here fiddle problem with relevant code: var mod = angular.module('test', []); mod.config(function ($provide) { $provide.decorator("$exceptionhandler", ['$delegate', '$injector', function ($delegate, $injector) { var $http = $injector.get("$http"); }]); }); mod.controller('testctrl', function ($scope) { }); if comment line var $http = $injector.get("$http"); the circular dependency error gone. i think i'm missing in understanding. doing wrong? after all, seems have worked others. any suggestion on how achieve initial goal of 'posting errors service' welcomed. thanks everyone ...

F# canopy - how to use LiveHtmlReporter? -

i trying f# , canopy log tests in html files. so here says need is: open configuration open reporters reporter <- new livehtmlreporter() :> ireporter this didn't work me. managed start livehtmlreporter using chrome start it. struggling make save reports after tests finished. when try use: reporter <- new livehtmlreporter(chrome, "c:\\") :> ireporter let livehtmlreporter = reporter :?> livehtmlreporter livehtmlreporter.savereporthtml @"c:\" "report" it throws invalidoperationexception unhandled error @ me before tests , doesn't save anything. besides that, when tests run - can see context titles, , test names not printed - pass or fail without test name. another thing taking screenshot on error - doesn't happen. i think doing wrong @ bottom of code. going wrong? i had same problem. should help. reporter <- new livehtmlreporter(chrome, configuration.chromedir) :> ireporter let livehtmlreporter...

java - Factor table algorithm with complexity O(n·sqrt(n)) -

the following code prints table of factors of each number 0 n . can me rewrite following o(n²) time code has complexity o(n·sqrt(n)) time ? i rewrote algorithm have o(n·log n) can't figure out complexity. public static vector<vector<integer>> facttable(int n) { vector<vector<integer>> table = new vector<vector<integer>>(); (int = 1;i <= n; i++) { vector<integer> factors = new vector<integer>(); (int f = 1; f <= i; f++) { if ((i % f) == 0) factors.add(f); } table.add(factors); } return table; } for each factor f of i, i/f factor of i.

python - How would I make what the user typed for else into a variable/input? -

else=(x = raw_input("enter\n")): print(x) i have tried doing basing off of correct statement... x = raw_input("enter\n") print(x) if doing if statement , wanted input after else ran run normal in if/else flow. depending on trying have better way it. not sure skill level highly recommend jessica mckellers basic tutorials on youtube or basic python tutorial tigerhawk recommended. if something: print("hello") else: x = raw_input("enter ") print(x)

ios - Round number to nearest "nth" based on first non zero -

i want round double nearest non 0 number follows decimal. for example: x = 0.002341 rounded = 0.002 x = 0.000048123 rounded = 0.00005 for cases base number > 0, should perform such x = 1.000234 rounded = 1.0002 i know can use double(round(1000*x)/1000) if know number of digits, want work number. there swift function this? you can have little fun logarithms solve this: func roundfirst(x:double) -> double { if x == 0 { return x; } let mul : double = pow(10, floor(log10(abs(x)))) return round(x/mul)*mul } the non-fractional part of log10(abs(x)) gives positive or negative power of ten of inverse of number use multiplier. floor drops fraction, , pow(10,...) gives multiplier use in rounding trick. i tried in playground few numbers. here i've got: println(roundfirst(0.002341)) // 0.002 println(roundfirst(0.000048123)) // 5e-05 println(roundfirst(0.0)) // 0.0 println(roundfirst(2.6)) // 3.0 println(ro...

android - Send SMS from application with concatenated Text -

i confused. application not send if sms message has concatenated text, why? it's work: receiver = 99999; smshelper smshelper = new smshelper(ctx); smshelper.sendsms(receiver, "it's work!"); don't work concatenated text. receiver = 99999; string text1 = "not"; string text2 = "working"; string smsfulltext = text1.concat(text2); smshelper smshelper = new smshelper(ctx); smshelper.sendsms(receiver, smsfulltext); my smshelper.class public class smshelper{ private static final string action_send = "sms_send"; private static final string action_received = "sms_received"; private context ctx; private string text; public smshelper(context ctx){ this.ctx = ctx; } public void sendsms(string receiver, string sms){ this.text = sms; pendingintent peitsend = pendingintent.getbroadcast(ctx,0,new intent(action_send),0); pendingintent peitreceived = pendingintent.getbroadcast(ctx, 0,...

html - How to create a CSS class that includes other class to prevent repeating multiple css class? -

i have list of css combination gives me desired outcome. however, find myself repeating lists. e.g. <div id="div1"><h4 class="muted-text text-center cursive text"> text 1</h4></div> <div id="div2"><h4 class="muted-text text-center cursive text"> text 2 </h4></div> <div id="div3"><h4 class="muted-text text-center cursive text"> text 3</h4></div> <div id="div4"><h4 class="muted-text text-center cursive text"> text 4</h4></div> i want able such: <div id="div1"><h4 class="portfolio-title"> text 1</h4></div> <div id="div2"><h4 class="portfolio-title"> text 2</h4></div> <div id="div3"><h4 class="portfolio-title"> text 3</h4></div> <div id="div4"><h4 class=...

android - Binary XML file line #2: Error inflating class fragment when create @+id/map -

when app try fragment show follow logcat binary xml file line #1: error inflating class fragment" here activity_maps.xml layout file: <fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment"/> here permission in androidmanifest.xml: <application> <permission android:name="xxx.xxx.xxx..permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="xxx.xxx.xxx.permission.maps_receive" /> <uses-permission android:name="android.permission.call_phone" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permi...

vba - Run-time error '91' ... attempting to index multiple columns -

the following snippet giving me "object variable or block variable not set" error cindx = wsmain.range(cells(i, begcol), cells(i, endcol)).find("churn", matchcase:=true, lookin:=xlformulas, lookat:=xlwhole) if not cindx nothing if wsmain.cells(i, statuscol) = "active" wsmain.cells(i, cindx.column) = " " end if end if the first line culprit. research far suggests has way i'm indexing range official documentation says i'm attempting possible. i've reviewed posts find on here same title mine none of them appear directly applicable situation. insights appreciated. happy post surrounding code if more context helpful. also curious whether can this: with wsmain cindx = .range(cells(i, begcol), cells(i, endcol)).find("churn", matchcase:=true, lookin:=xlformulas, lookat:=xlwhole) if not cindx nothing if .cells(i, statuscol) = "active" .cells(i, cindx.column) = " ...

php - Docker - Run Apache on host and container for different websites -

Image
i want use docker in order able run old application requires php 5.3, while still having other websites on host server, running on host apache. so have sitea.com, siteb.com, sitec.com running on host, using host apache / php / mysql server, , have sitez.com installed in docker container, should using container's apache / php host mysql server. here's representation of architecture i'd obtain : my issue seems can't run apache in container, since port 80 in use on host. my goal people access sitea.com, siteb.com, sitec.com , sitez.com, without having specify different port of websites. i managed sitez.com running using port 8080, it's not option. thanks ps : please note i'm completly new docker. edit : can find working solution here . vonc showing me way go :) i can't run apache in container, since port 80 in use on host. sure can: in container, can run apache on port want. but when docker run , then need map containe...

swift - cannot invoke avgArray with an argument list of int -

i'm new swift, , start learn language following the swift programming language . in book, there exercise question ask me write function calculate average of array. here code: func avgarray(elements: int...)->double{ var avg:double = 0 var sum = 0 var count = 0 element in elements { sum += element count += 1 } avg = double(sum) / double(count) return avg } let numberlist = [2,3,6,7,2,7,0,9,12] let average = avgarray(numberlist) i don't know why can't pass array function. also, there way besides using count variable keep track of number of elements in array? i don't know why can't pass array function. your elements not array, variadic parameter. change func avgarray(elements: [int])->double{ and should go. is there way besides using count variable keep track of number of elements in array? absolutely. count property of array itself. can use in code this: avg = double(sum) / double(elements.count)

How set align a Paragraph in Shape by VBA Excel? -

Image
in shape have 2 paragraphs, paragraph 1 right-aligned , paragraph 2 left-aligned: if want change alignment of paragraphs inside shape, using vba excel, how go that? it opinion quite simple. check code: sub alignparagraphs() dim shp shape set shp = activesheet.shapes(1) dim txtrng2 textrange2 set txtrng2 = shp.textframe2.textrange txtrng2 .paragraphs(1).paragraphformat.alignment = msoalignright .paragraphs(2).paragraphformat.alignment = msoalignleft end end sub

How to parse geoJson file into Leaflet layers -

i'm interested in different symbology different geojson features, based on criteria available in geojson file. know can accomplish oneachfeature hook, want user have layer control (layer display on/off) on parsed layers. create layergroup. i'm js , leaflet novice , having trouble figuring out how individual feature geojson file added layergroup. some of code: var active = new l.layergroup(); var inactive = new l.layergroup(); // kcdfp_parcel geojson file variable ( var i=0; < kcdfp_parcel.features.length; ++i ) if (kcdfp_parcel.features[i].properties.inactive == 0){ // inactive=no // how add active layergroup???? var overlays = { "active": active, "inactive": inactive}; l.control.layers(overlays).addto(map); the advantage of oneachfeature gives direct access layer created feature. also, if using new keyword, you have capitalize name of "class" . easier not use new : var active = l.layergroup(); var inactive...

github - How to merge features branches to branch develop in Git? -

i new git , have simple question though has been asked many times in forum, want restrict question following scenario 1) feature (files a, b , c modified) cut 'develop' 2) feature b (files , d modified) cut 'develop' feature has been merged branch 'develop' successfully now question is, approach should follow merge 'feature b' branch 'develop' should pull latest version of 'develop' , merge changes of 'feature b' (or) other best approaches merge 'feature b' 'develop' 'file a' has changes? if alone working on featureb branch, pull --rebase develop best practice: replaying featureb changes on top of featurea . (and git push --force after). if multiple developers working on featureb , merge of develop featureb has done, before merging featureb develop. in both cases, idea same: test integration of both features locally (pull or rebase), before merging develop . do not me...

X-Cart checkout is empty -

i have problem x-cart website. when click on "buy now" button on 1 product, , after click on "my cart" checkout section, returns cart empty although click buy product. here website: http://www.farlin-cambodia.com/home.php?cat=591 how can fix it? the store you're referring of version 4.1.6, that's old version there no adding cart without redirect (with ajax). behaviour in question still there, feature added custom mode. if js enabled in browser, , if store considers it's enabled, the js script supposed send data script minicart_content.php, , php script process received data further. doesn't happen , , there no js errors, makes me believe problem in code of minicart_content.php, file being modified too. if js disabled in browser ( , if click corresponding button in store in pink side menu block - "if javascript disabled in browser click here"), custom scenario not applied, store uses default functionality allows add pr...

javascript - Load image from potentially-null interpolated URL values in AngularJS -

i trying load image 2 different scope variables values follows: $scope.image.baseurl = "http://localhost/myapp/public/"; $scope.image.relativeurl = "app/images/template/001/section.png"; the values dynamically loaded, , undefined. in case either value undefined, no image should loaded. consider following example: <img ng-src="{{image.baseurl + image.relativeurl}}"/> this doesn't work. in case, if relativeurl undefined, resolves first scope variable value , tries access baseurl value. console error 400 status code due request http://localhost/myapp/public/ . consider following example: <img src="{{image.baseurl + image.relativeurl}}"/> this doesn't work, either. in case, compiler not able resolve scope variables until angular loads, url curly braces used make request. console error 400 status code due request http://localhost/myapp/public/image.baseurl%20+%20image.relativeurl . another question recommende...

ruby on rails - Basic ActiveModel methods not working on objects -

i asked question earlier calling associated model attributes. specifically, asked trying display names of vip model instances associated event. initially had <% @organization.events.each |event| %> <p> <table> <tr> <td> <%= event.name %> </td> <td> <%= event.vips.name %> </td> </tr> </table> </p> <% end %> which changed <%= event.vips.first.name %> and worked little while. adjusted <% event.vips.each |vip| %> <%= vip.name %> which worked little while. when came computer after taking break, new event form submissions no longer displaying vip's name on organization show page, though database being updated vip_id foreign key. in fact, when tried <%= event.vips.first.name %> again, got error saying "undefined method `name' nil:nilclass...

Integrating tesseract with Android Studio -

i working on android project have use tesseract library. have downloaded source here , trying build using steps readme source. when run command in cmd ndk-build -j8, getting errors: [armeabi] compile thumb : lept <= open_memstream.c [armeabi] compile thumb : lept <= fopencookie.c [armeabi] compile thumb : lept <= fmemopen.c [armeabi] compile++ thumb: lept <= box.cpp [armeabi] compile++ thumb: lept <= pix.cpp [armeabi] compile++ thumb: lept <= pixa.cpp [armeabi] compile++ thumb: lept <= utilities.cpp [armeabi] compile++ thumb: lept <= readfile.cpp in file included jni/com_googlecode_leptonica_android/box.cpp:17:0: jni/com_googlecode_leptonica_android/common.h:22:24: fatal error: allheaders.h: no such file or directory #include <allheaders.h> ^ coin file included jni/com_googlecode_leptonica_android/pixa.cpp:17:0: jni/com_googlecode_leptonica_android/common.h:22:24: fatal error: allheaders.h: no such file or directory ...

How to remove unused dependencies from a clojure leiningen project? -

i have leiningen clojure project , there lot of dependencies in it. want automatically remove of dependencies not being used. how do this? please help. bare hands: comment dependency entry suspect useless using #_ (eg. #_[org.ow2.asm/asm-all "4.2"] ) , try compile. with tool: eastwood clojure linter implemented leiningen plugin. need using :unused-namespaces option (not enabled default). i'll let head doc.

php - is_user_logged_in not working in premiumpress theme -

i'm having problem function_is_user_logged_in. can seen on http://dev.cellarsale.co.za/index.php/listing/example-listing-2/ . i'm trying make "buy now" line disappear unlogged people. it's not working on website part of code : ob_start(); (...) <table> <tbody> (...) <?php if(is_user_logged_in()){ ?> <tr id="buynow" style="display: none;"> <td colspan="5" class="bidbox biddingbox"> <div class="wrap"> <span class="label label-default pull-right" onclick="jquery('.biddingbox').hide();" ><?php echo $core->_e(array('account','48')); ?></span> <hr /> <form method="post" action="" class="row clearfix" onsubmit="return checkbidding();"> <input type="hidden" name="auction_action" value="newbid...

ios - How can I make a circular progress meter with using own picture? -

Image
i want make meter picture. i have 2 meter images - color meter image , gray meter image. and want make mater shown in above image using them. but don't have idea. i got sample code making circular meter , filling color in it. here code: cashapelayer *circle=[cashapelayer layer]; circle.path=[uibezierpath bezierpathwitharccenter:cgpointmake(29, 29) radius:27 startangle:2*m_pi*0-m_pi_2 endangle:2*m_pi*1-m_pi_2 clockwise:yes].cgpath; circle.fillcolor=[uicolor clearcolor].cgcolor; circle.strokecolor=[uicolor greencolor].cgcolor; circle.linewidth=4; cabasicanimation *animation=[cabasicanimation animationwithkeypath:@"strokeend"]; animation.duration=10; animation.removedoncompletion=no; animation.fromvalue=@(0); animation.tovalue=@(1); animation.timingfunction=[camediatimingfunction functionwithname:kcamediatimingfunctionlinear]; [circle addanimation:animation forkey:@"drawcircleanimation"]; [imagecircle.layer.sublayers makeob...

ffmpeg - what is recommended to use with Mpeg-dash, VBR or CBR? -

i need trans code videos use them mpeg-dash, bitrate, shroud use variable bitrate (vbr) or constant bitrate (cbr). which of them work better mpeg-dash? both have advantages , disadvantages. since mpeg-dash can used adaptive streaming having cbr can improve playback because vbr can temporarily go on bitrate threshold , trigger stream switch if average bitrate within limits. with cbr easier calculate bandwidth use etc. since constant. the problem cbr can degrade quality more complex scenes. best compromise use called constrained vbr , vbr constrained maximum 110% of nominal data rate. source

javascript - How to get contents from HTML or JS using Objective c? -

Image
my boss asking me list of songs info following page: http://mp3.sogou.com/music.so?query=love%20me%20like%20you%20do&st=1 so if use chrome open link, won't see html contents regarding list of songs. however, if right click , choose inspect elements, can see info regarding each song. dont' know html thing. dynamic html or js? need write codes in objective c song list info. how can it? can 1 guide me right direction please?

c# - Dictionary<DatafeedStagingTableRow, List<UserIdsTableRow>> records; - Tell me why this is a bad idea -

so have code blindingly fast. i'm sure i'm doing terrible thing; need confirm , give me reason why. i have process datafeed ~80,000 records, , can match of ~250,000 records either network id, hr personnel number, or combination of legal org code , local id. none of these 3 identifiers permanent – of them change, though not @ same time (small miracles). have nothing leverage primary key, , users can match more 1 record coming in results. in fact, identifiers not unique - can have multiple matches against particular hr personnel number, example. need flag users have more 1 active account, example (among other things). goes without saying not code. the basic approach shred 250k results coming database 3 lists, each keyed 1 of 3 identifiers. each datafeed record, build unioned list of matches each. shockingly, slow. i've tweaked code point can consolidate matches 80,000 rows , execute validation checks against them in less 1 second, think may have had sell so...

wordpress - Replace anchor tag with span tag -

i have created custom menu having many items , sub items, markup <a href="#">item</a> but parent element need replace anchor tag span tag having class styling purpose, parent elements. should this, <span class="my-class">parent element</span> . can 1 please guide me? you can control css applying css menu below: <?php wp_nav_menu( array('theme_location' => 'header-menu' ,'container_class'=> 'header')); ?>

javascript - Using rel attribute in document on change function? -

i use below code dynamic textbox. when change id=iuname1 has show result in fffinalresult1. when change id=iuname2 has show result in fffinalresult2. don't. <script type="text/javascript"> var counter = 0; $(function () { $("#btnadd").bind("click", function () { var div = $("<div />"); div.html(getdynamictextbox("")); $("#textboxcontainer").append(div); }); }); function getdynamictextbox() { counter++; return 'item code : <select name="iuname" id="iuname" rel="' + counter + '" class="iuname" >'+ <?php foreach($titem $row) : ?> '<option value="<?php echo $row->productid;?>"><?php echo $row->productid;?></option>'+ <?php endforeach;?> '</select>'+ ' batch : <input id...

amazon sns - Sending attachment using AWS SNS(Simple Notification Service) -

i using aws sns sending alert emails. email content long therefore wish send file attachment rather sending email content. can done using sns ? no, can't. the sns faq not come out , explain explicitly, can inferred several statements: amazon sns messages can contain 256 kb of text data, including xml, json , unformatted text. the ”email” transport meant end-users/consumers , notifications regular, text-based messages readable. in addition, since not have access email header space when publishing sns, not possible specify necessary multipart coding email client decide embedded attachment. can't send html emails (well, could , standards-conforming email client not render them html). now, many email clients theoretically recognize http://... in email body , turn them clickable links, allowing link desired file... of course not same thing attaching files. i there not appear mechanism attaching files emails in sns.

Difference between <= and >= in VHDL? -

can please tell me difference between <= , >= in vhdl?i know greater than/less or equal sign.can precise , explain code of line how execution takes place.i know signal assignment use <= example in state machines or whenever use when >= pops out.can please tell me difference? there difference writing these in if-statements , elsewhere. when using these in if-statements mathematical operation taking place. wrote comparision done, checking if value great-or-equal, smaller-or-equal value compare to. when writing codes outside of if-statements part of vhdl syntax , has no mathematical meaning, how languagre constructed. signal_a <= signal_b -- assign signal b signal a -- when whats inside when block case when => -- stuff when others => -- other stuff end case;

openshift - issue with git ignore file inside war file -

i'm uploading war file openshift. question if put git-ignore file inside war file, git ignore files listed in git-ignore file ? kind appreciated. no, git not ignore files specified in .gitignore file inside of war file. how git read file? if want use .gitignore exclude files should use default maven structure , let openshift build project on server , deploy it.

javascript - Sorting HTML table with subitems with JS -

i have following table: <table border="0" cellspacing="0" cellpadding="0" id="table1"> <tbody> <tr> <th onclick="sorttable(0, this); return false;" class="sort-up" order="-1">columna</th> <th style="width: 12em;" onclick="sorttable(1, this); return false;" class="sort-none">columnb</th> <th style="width: 9em;" onclick="sorttable(2, this); return false;" class="sort-none">columnc</th> <th style="width: 10em;" onclick="sorttable(3, this); return false;" class="sort-none">columnd</th> <th style="width: 6em;">columne</th> </tr> <tr id="tr217e9b6c" type="root" level="217e9b6c" depth="0"> <...

List of functions with defined signature in Dart -

in dart, possible have list of functions have defined signature? i'm looking like list<(int, int) -> int> listoffunctions; which of course wrong. i can do list<function> listoffunctions; but don't know signature. thanks hints. just create typedef function typedef int myfunction(int a, int b); list<myfunction> listoffunctions;

go - Golang how do I simulate users idling on a webpage? -

hi guys wondering how might simulate users idling webpage i'm making part of website show how many concurrent connections there server right don't have access more 1 computer. it works , shows 1 person online, want write small little go program can set variable say, 100 people, , launch it, stay running , see if site correctly shows 100 people connected it. i had like package main import ( "net" ) func main() { go connecttoserver() go connecttoserver() go connecttoserver() } func connecttoserver() { servaddr := "http://localhost:1337" tcpaddr, err := net.resolvetcpaddr("tcp", servaddr) if err != nil { panic(err) } _, err = net.dialtcp("tcp", nil, tcpaddr) if err != nil { panic(err) } } it runs don't know if right way it, since they're go routines , ending instantly program starts stops right away need way keep connections alive without program stopping...

ios - AFNetworking SSL Request -

i user af send https request [self.manager post:downloadurlstirng parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) { if (success) success(responseobject,passparameters); } failure:^(afhttprequestoperation *operation, nserror *error) { if(failure) failure(operation.responseobject,error,passparameters); }]; and have set securitypolicy yes self.manager.requestserializer = [afjsonrequestserializer serializer]; self.manager.securitypolicy.allowinvalidcertificates = openssl; but still got code -1012 , error_message : in order validate domain name self signed certificates, must use pinning. this sets security policy allow invalid certificates , stops domain name validation also.: afsecuritypolicy *securitypolicy = [afsecuritypolicy policywithpinningmode:afsslpinningmodenone]; securitypolicy.allowinvalidcertificates = yes; [securitypolicy setvalidatesdomainname:no];

MediaWiki Hook for Installing Extension -

i did research on mediawiki hooks. to best of knowledge, hook adding/updating database tables https://www.mediawiki.org/wiki/manual:hooks/loadextensionschemaupdates . however, need hook fires on installing new extension. how achieve that? i'd execute create table statement once - when extension installed. installing extension doesn't require mediawiki update, why above hook not suit needs. edit to clarify: i'm developing extension requires access custom table in database. that's why need execute create table statement whenever extension installed. first: have noticed, there no such hook. need check installed extensions cron job (if it's server), or on, say, each 100th request wiki, using job queue (if doing in extension). from there, have few options, depending on if need catch every single extension, or of them: check registered extensions, like: $registry = extensionregistry::getinstance(); $extensions = $registry->loaded(); this wo...

Fatal error: Maximum execution time of 30 seconds exceeded in C:\xampp\htdocs\wordpress\wp-includes\class-http.php on line 1610 -

i facing error while installing jet pack plugin on wordpress localhost site. have search on site many answer not fulfill requirement please locate file [xampp installation directory]\php\php.ini (e.g. c:\xampp\php\php.ini ) open php.ini in notepad or text editor locate line containing max_execution_time and increase value 30 larger number (e.g. set: max_execution_time = 90 ) then restart apache web server xampp control panel if there still same error after that, try increase value max_execution_time further more.

In the Android Studio 1.3 and later,what should be added in my .gitignore for a project? -

as android studio improved,now latest version 1.3.2,what should in .gitignore can develop well? checkout ignore file: https://github.com/github/gitignore/blob/master/android.gitignore also, you can install plugin: https://github.com/hsz/idea-gitignore

java - How can I set the dimension of some particular JButton component (in this case btnPlus)? -

i tried use setsize() didn't work. used setpreferredsize(new dimension(x,y)). yes work changes size of components in (opanel) panel. want change size of btnplus. import javax.swing.*; import java.awt.event.*; import java.awt.*; public class mycalc { public static void main(string[] args) { jframe main= new jframe(); jpanel bpanel= new jpanel(); jpanel opanel= new jpanel(); jpanel txt= new jpanel(); jpanel panel=new jpanel(); jbutton btn0= new jbutton("0"); jbutton btn1= new jbutton("1"); jbutton btn2= new jbutton("2"); jbutton btn3= new jbutton("3"); jbutton btn4= new jbutton("4"); jbutton btn5= new jbutton("5"); jbutton btn6= new jbutton("6"); jbutton btn7= new jbutton("7"); jbutton btn8= new jbutton("8"); jbutton btn9= new jbutton("9"); jbutton btndot= new jbutton("."); jbutton btnplus= new jbutt...

Force recompilation of certain files in rails assets pipeline -

i'm using ruby on rails 4.1.9. is there way define whitelist of files should recompiled anytime, if don't change? for example: have few .js.erb files injected rails variables. so, if original file not changing, need recompilation.

c# - Not able to insert. Doesn't show any errors but doesn't insert as well -

Image
this insert statement. records not inserting no errors showing also. please help protected void btn_add_click(object sender, eventargs e) { if (btn_add.text == "submit") { string height = txtheight.text; string topdia = convert.tostring(txttopdiameter.text); string bottomdia = convert.tostring(txtbottomdiameter.text); string shaftthick = convert.tostring(txtshaftthick.text); string blackwt = convert.tostring(txtblackweight.text); string totmanhrperpole = convert.tostring(txttotmanhrpoledata.text); string plate_length = convert.tostring(txtplatelength.text); string plate_dia = convert.tostring(txtplatedia.text); string plate_thickness = convert.tostring(txtplatethick.text); system.collections.hashtable ht = (system.collections.hashtable)session["userdetails"]; int64 usrid = (int64)ht["userid"]; string createdby = convert.tostring(usrid); ...

Dynamic Topologies vs Fine-grained topologies in Apache Storm -

quick background: customer can have multiple event processors (actions taken on particular input) , each of these event processors changed independently. as optimization have grouped processors single customer single topology. advantage isolation across customers , on flip side entire topology customer needs redeployed if single processor changed, plus downtime takes kill topology , redeploy new topology. now options contemplating is: dynamic topology: no easy way change spouts , bolts @ runtime. storm swap doesn't seem available yet. there way dynamically update topologies without deployment or way hot deploy topologies. have 1 topology per event processor per customer. end having thousands or 100 thousand topologies , seems incorrect. have read through this old post, not of help. whats recommendation.

xml - How to add MessageID in SOAP request using Axis2 and Rampart -

i trying build client application consume external server application using axis2 , rampat 1.6 . everything seems fine when checking soap request, since soap encrypted , signed expected. following policy.xml file used purpose: <wsp:policy wsu:id="mypolicy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" xmlns:wsam="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wst="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#samlassertionid"> <wsp:exactlyone> <wsp:all> <sp:signedsupportingtokens xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702"> <wsp:policy> <sp:usernametoken sp:includetoken="http://docs.oasis-open...