Posts

Showing posts from April, 2015

delphi - Passing parameter value to Function or Procedure with random order -

is there way in delphi pass parameter value function or procedure random order, don't have make sure order right. example: procedure insertemp(id: integer;name: string;gender: string); begin //content end then use procedure this: insertemp(1,'zemmy','male'); but if @ time change function parameter order this: procedure insertemp(id: integer;nickname:string;name: string;gender: string); begin //content end i have make position correction function following: insertemp(1,'jim','zemmy','male'); can pass parameter value without correcting order? maybe way this: insertemp(gender = 'male',nickname = 'jim',id = 1,name = 'zemmy'); thank help. having 2 or more parameters of same type, called procedure cannot determine meaning. i think answer can mix of whosrdaddy's comment lu rd's answer . using overloading record constructor, can obtain smart solution. type temployee = rec...

How to modify a binary state of a file in python? -

i'm desperated now. no matter how hard tried, searched , made different scripts, still can't modify way need to. it's simple, want read first byte of file, in binary it's 00 00 00 10 , complement 11 11 11 01 , write in it's place, if file 2 bytes example, : 00 00 00 10 #first byte 01 10 10 10 #second byte after modification be: 11 11 11 01 #complement of first byte 01 10 10 10 #second byte remains intact it appreciated if shed light on problem. it sounds want read-append mode. with open('file', 'r+b') file: data = f.read(1)[0] data = (~data) % 256 file.seek(0) file.write(bytes((data,))) opening mode r+b . r read, + means enable writing, b means binary, result of reads bytes object instead of string. f.read(1)[0] reads first byte of file , extracts values resulting bytes object integer (the indexed value of bytes object integer) ~data negation of returned byte. since python doesn't have real...

android - How to handle load balancing in Microsoft Azure -

i using microsoft azure.i want know how microsoft azure handle traffic @ server. weather write code handling traffic or microsoft azure handle server traffic itself. please me. azure has feature of load balancing data traffic. purpose traffic manager used. a traffic manager profile has created enable feature link : https://azure.microsoft.com/en-in/documentation/articles/traffic-manager-overview/ hope you

hibernate - Create JSF 2.0 with Richfaces 4.0 / Primefaces project using Maven -

i new jsf , richfaces. in need create project jsf 2.0 , richfaces 4.0 , hibernate using maven. i have go through many tutorials , confused installing maven archtypes, plugins , adding repositories etc. i using ubuntu 12.04 , eclipse (kepler) , mysql . i have installed maven using sudo apt-get install maven2 help me clear knowledge , create new project (for beginner) using jsf 2.0 richfaces 4 / primefaces (able remove richfaces & add primefaces , vice versa) maven hibernate spring (if needed how use) my approach like: install new eclipse. there many elipse-maven plugin issues have been resolved since kepler. start new maven 3 project, webapp archetype maven-archetype-webapp , create proper folder structure add dependencies need integrate spring, jsf-2, hibernate etc. pick them 1 one, , make sure using right versions, latest release.stable version. for example, here can see versions primefaces i think this tutorial starter. can check pom fil...

Keeping microsecond precision when passing datetime between django and javascript -

it seems django, or sqlite database, storing datetimes microsecond precision. when passing time javascript date object supports milliseconds: var stringfromdjango = "2015-08-01 01:24:58.520124+10:00"; var time = new date(stringfromdjango); $('#time_field').val(time.toisostring()); //"2015-07-31t15:24:58.520z" note 58.520124 58.520 . this becomes issue when, example, want create queryset objects datetime less or equal time of existing object (i.e. mymodel.objects.filter(time__lte=javascript_datetime) ). truncating microseconds object no longer appears in list time not equal. how can work around this? there datetime javascript object supports microsecond accuracy? can truncate times in database milliseconds (i'm pretty using auto_now_add everywhere) or ask query performed reduced accuracy? how can work around this? tl;dr: store less precision, either by: coaxing db platform store miliseconds , discard additional precision ...

android - Not able to set action bar background color and selected listview color -

Image
i have used following code: listview.setmultichoicemodelistener(new abslistview.multichoicemodelistener() { @override public void onitemcheckedstatechanged(actionmode mode, int position, long id, boolean checked) { final int checkedcount = listview.getcheckeditemcount(); mode.settitle(checkedcount + " selected"); } @override public boolean oncreateactionmode(actionmode mode, menu menu) { mode.getmenuinflater().inflate(r.menu.mymenu, menu); return true; } @override public boolean onprepareactionmode(actionmode mode, menu menu) { return false; } @override public boolean onactionitemclicked(actionmode mode, menuitem item) { switch (item.getitemid()) { case r.id.delete: //my delete code ...

javascript - Maxlength and copy paste in Cordova/PhoneGap Android Apps -

i using maxlength in cordova based android app. have implemented maxlength using code- $('.limit-eight').keyup(function(e) { if (e.keycode != 8 || e.keycode != 46) { if ($(this).val().length >= 8) { $(this).val($(this).val().substr(0, 8)); } } }); but whenever user copies , pastes, text pastes without restriction. attach on paste event $('.limit-eight').on('paste', function() { // logic here console.log('text pasted!') })​

ios - Terminating app due to uncaught exception reason: 'Application windows are expected to have a root view controller at the end of application launch' -

feedcontentvc *feedvc= [[feedcontentvc alloc] initwithnibname:@"feedcontentvc" bundle:nil]; navigationcontroller = [[uinavigationcontroller alloc] initwithrootviewcontroller:feedvc]; navigationcontroller.navigationbar.barstyle = uibarstyleblack; [window setrootviewcontroller:navigationcontroller]; although things looks correct in doing, please confirm following: window strong property in appdelegate . should [self.window setrootviewcontroller:navigationcontroller] . put breakpoint , check feedvc not nil. you have statement in code [self.window makekeyandvisible]; .

automated tests - How can I do performance testing of 10000+ users on Jmeter or any other opensource -

i have perform load testing particular application, know jmeter can't test desktop app can convert web link purpose of testing. my client has provided there 15000 users particular application? how can test huge number on j meter, need add 15000 vusers.? i searched solution , found need create different servers, option have create 15 different servers (not feasible) please advise if there other open source can that. thanks !!! p.s. quite new in performance testing i don't think need 15000 virtual users simulate amount of real users. real users don't hammer server non-stop, need time "think" between operations. for instance, given following situation: user each 15 seconds page load time 5 seconds it means each user sends 3 requests per minute. 15000 users send 45000 requests per minute stands 750 requests per second can simulated single modern mid-end computer. if proceed jmeter encourage getting familiarized jmeter performance , t...

html - Make navigation div expand entire height of the page -

i have navigation div on left of page. want span entire height of page.following html , css structure. #wrapper{ position: relative; min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -112px; } .main_wrap{ height: 100%; min-height: 100%; position: relative; } .container{ height: 100%; position: relative; } .main-sidebar{ position: absolute; top: 0; left: 0; min-height: 100%; height: 100%; width: 195px; z-index: 810; } .sidebar{ height: 100%; } .content_wrap{ height: 100%; min-height: 100%; position: relative; } .content_box{ width: 1000px; margin: 0px auto; } html: <div id=“wrapper> <div class=“main_wrap”> <div class=“container> <div class="main-sidebar"> <div class="sidebar"> <!—left navigation part goes here—> </div> </div> </div> </di...

objective c - Google plus sign in crashes in ios 9 -

while sign in app in ios 9 through google plus account got these message in debug area. working ios 8 -canopenurl: failed url: "com.google.gppconsent.2.4.1://" - error: "this app not allowed query scheme com.google.gppconsent.2.4.1" -canopenurl: failed url: "com.google.gppconsent.2.4.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.4.0" -canopenurl: failed url: "com.google.gppconsent.2.3.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.3.0" -canopenurl: failed url: "com.google.gppconsent.2.2.0://" - error: "this app not allowed query scheme com.google.gppconsent.2.2.0" -canopenurl: failed url: "com.google.gppconsent://" - error: "this app not allowed query scheme com.google.gppconsent" -canopenurl: failed url: "hasgplus4://" - error: "this app not allowed query scheme hasgplus4" -canopenurl: failed url: "goo...

javascript - working with array(s) in JQuery -

i inputting values array in jquery 1,4,7,3. when displaying array values, displays 1,3,4,7. i need 1,4,7,3 when inserted. code. var selectedvalues = []; var $ctrls = $("[id*=chkprocessroutes] input:checkbox"); $("[id*=chkprocessroutes] input:checked").each(function () { var l = parsefloat(($ctrls.index($(this)))); var ll = parsefloat(l) + 1; selectedvalues.push(parsefloat(ll)); }); if (selectedvalues.length > 0) { alert("selected value(s): " + selectedvalues.tostring()); } else { alert("no item has been selected."); } try this: var selectedvalues = $("[id*=chkprocessroutes] input:checked").map(function () { return $(this).val(); }); if (selectedvalues.length > 0) { alert("selected value(s): " + selectedvalues.tostring()); } else { alert("no item has been selected."); }

android - It is possible that i am login 1000 different device with my gmail account? -

i developed 1 android application ,for food deliver boys , want login user same gmail id. question ,it possible 1000 device access single gmail account @ time. it's not possible. gmail support indicates has limit of 15 simultaneous imap connections per account. each user account intended single use. means if have multiple users accessing same account or more 1 imap1 client accessing gmail @ same time, may reach connection threshold , receive error message, 'too many simultaneous connections.' gmail has limit of 15 simultaneous imap connections per account hope helps.

php - How to generate same random string from two numbers even if we swap them? -

i looking following logic in php: first number 491 second number 784 goal generate common encrypted string these 2 numbers, if reverse them: <?php function common_string_generator($num1, $num2) { return enc_string_generator($num1, $num2); } # first $room_one = common_string_generator(491, 784); # second $room_two = common_string_generator(784, 491); if($room_one===$room_two) { print "success"; } else { print "failure"; } ?> #am here: <?php ........ $n1 = md5($num1, $num2); $n2 = md5(num2, num1); ........ ?> i not able fix order of both numbers got reverse since both numbers ids of users going private chat room. the both ids unique, , encrypted string these unique, want unique encrypted string become id of chat ro...

c# - How can I throw exception inside a Generic Type Method? -

is there way throw or safely return exception inside generic method? my sample code looks this: public ienumerable<t> findaverage<t>(float a, float b) t : new () { try { ..... averaging instructions here...... } catch(exception e) { throw e } } now seems problem whenever create test classes, mean literally separate projects test, error redirects main source code of created library. thought there way return exceptions without being redirected main library source? any || ideas || simple answers great. thanks! generally speaking, unless there clear need so, better not catch/re-throw exceptions @ low level of code, instead let them bubble front end (i.e. either front end or test code) them handle them appropriate. in case, if exception in averaging code, reasonable handling of be? if not handling this, don't catch @ all.

google cloud messaging - GCM messages are not received with android app at all -

i have old problem: cannot receive gcm messages android app. according server log succesfully delivered gcm server , sent further, client side app doesn't seem have received them. this gcm-relevant fragment of manifest: <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <!-- gcm requires google account. --> <uses-permission android:name="android.permission.get_accounts" /> <!-- keeps processor sleeping when message received. --> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.vibrate" /> <!-- app has permission register , receive data message. --> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <uses-permission android:name="android.permission.read_phone_state" /...

vb.net - How To Handle Devexpress windowsUI Back Button -

hy all, make use devepress windowsui desktop project. added 1 pieces form name: form1 , i've tried call him parent form mainform, , results have been successful, , put code calling form in event windowsui.querycontrol (). after form1 appears, press button in flyoutpanel, , lead initial display page of main form. form1 not removed** document view of program moved form1 display home page. my question is: how or code when button on form1 press had appeared issued or **dispose .? if press button display form1 back, show form1 display first time @ show.** best regard., tafary,

reactjs - Using React contextTypes with react-router -

i know it's rather undocumented feature, since react-router has no clean way of passing props child route components, wanted use context. <router history={history}> <route component={application} path="/(:id)"> <indexroute component={editdocument} /> </route> </router> class application extends component { static childcontexttypes = { charts: pt.array.isrequired, } getchildcontext() { return { charts: this.getcharts() }; } render() { return <div>{this.props.children}</div> } } class editdocument extends component { static contexttypes = { charts: pt.array.isrequired, } componentwillmount() { this.context.charts === undefined } } i using react 0.13 now. can solved using 0.14? you try {react.cloneelement(this.props.children, {someextraprop: })} so pass additional stuff views e.g. function renderapp(data) { ...

c - passing argument 1 of ' 'makes pointer from integer without a cast -

i working on autosar project , hence code generated based on particular software , may odd. file first.c completley c. question regarding accessing value stored in pointer variable in c. i have header file 'header.h' refrences function , looks below. header file further accesses seperate function file. header.h static inline std_returntype first_element(uint32 *data){ return first_element_read(data); } this function called in c file 'first.c' follows. int x; int result; void func_call(void){ result = first_element(x); printf("the value in result %d", &result); return 0; } i want access value variable 'data' there in header file x variable in c file. when way warning saying passing argument 1 of 'first_element' incompatible pointer type. , no data displayed. kindly point out mistake here. thanks ton in advance! first_element takes argument of type uint32 * . you call argument o...

html - Set baseline of flexbox elements -

consider html <div class="container"> <div class="element"> <div class="top"> <div>a</div> <div>b</div> </div> <hr/> <div class="bottom"> <div>c</div> </div> </div> <div class="element"> <div class="top"> <div>a</div> </div> <hr/> <div class="bottom"> <div>b</div> <div>c</div> </div> </div> <div class="element"> <div class="top"> <div>a</div> </div> <hr/> <div class="bottom"> <div>b</div> </div> </div> </div> i want line elements horizontally using flexbox, such horizontal rules align. seems align-items: baseline right thing – if...

c# - ASP .NET MVC 5 multiple clients with different domains -

i have build web-application using asp .net mvc. has serve different customers, each customer accesses page via domain. domain application supposed load customer specific data. has provide login mechanism. i'm fimiliar jsf, there solve problem via webfilters. does asp.net mvc provide similar webfilters or there better solution solve problem? i wish there tutorial or example adresses problem, after hours of googeling not find anything. i'm searching wrong keywords, don't know how mechanisms called. there several ways of doing this, example use routing ( is possible make asp.net mvc route based on subdomain? ) go getting username url. var user = request.url.host.split('.')[0];

c++ - Any instance access all instances (of a class) -

this may seem trivial question, or may have misunderstood previous information/the research i've done far. but possible have object function (in c++) can access instances of own type? in context of usage. wanted have button class, whereby instantiate multiple buttons call function call reference buttons. buttoninstance.ismousetargetting(cursorcoordinates); is possible? if efficient? or should have class owns button instances call each instance check if mouse coordinates match up? i'm under impression looking advice on how design this. in context of usage. wanted have button class, whereby instantiate multiple buttons call function call reference buttons. you want in button container. button not button container , in gui context have established hirerarchy. or should have class owns button instances call each instance check if mouse coordinates match up? yes. have window/container class this.

cocos2d: skeletal animation apply to cloth mesh which is added by addMesh to the character -

i create many clothes saved in separate files, , add cloth mesh human character, human character acting skeleton, cloth not, know how make work skeleton? thanks much! ~lindy you should create meshskin object using skeleton object of human. , set meshskin object cloth mesh.

php - Starting with a fresh Magento install -

i've been customising copy of magento 1.5 3-4 years , have pretty broken rules on how suppose customise it. making impossible upgrade , have other magento people work on it. the best thing me start fresh copy of magento , follow rules. however, struggling find guides on how bring over: 1) orders 2) products 3) product images important note need keep order , product ids same. anything people can suggest? otherwise, thing can think doing, compare copy of magento original , revert changes back.

Analytics.js track webapp multiple domains -

we have webapplication hosted on our servers. customers use our predefined (sub)domains , other customers use own domain (paid users). as want track total usage of established webapps i'd use same tracking code on domains? customers can add own tracking code (i've figured out how this). so possible this? sub1.domain.com -> ua-xxxxxxx-1 sub2.domain.com -> ua-xxxxxxx-1 customer3.com -> ua-xxxxxxx-1 customer4.com -> ua-xxxxxxx-1 here best tutorial it http://www.ericmobley.net/guide-to-tracking-multiple-subdomains-in-google-analytics/ https://developers.google.com/analytics/devguides/collection/gajs/gatrackingsite#multipledomains the trick cookies domain property: ga('create', 'ua-xxxx-y', {'cookiedomain': 'example.com'}); ga('create', 'ua-xxxx-y', auto); most of time setup auto. check doc more info cookiedomain. to tracking across domain , subdomains as mentioned above, default setu...

javascript - Access parameter of Node.js module function -

im totally new node.js , couldn't find similar question problem. i'm sure it's easy solve 1 of u guys... @ least guess. i'm trying special paragraph of wikipage using npm mediawiki module node.js! paragraph using pre-defined function following: bot.page(title).complete(function (title, text, date) { //extract section '== check ==' wikipage&clean string var result = s(text).between('== check ==', '==').s; }); thats working. want is: use "result" outside of code block in other functions. think has callbacks im not sure how handle pre-defined function mediawiki module. the example function of module wikipage looks following: /** * request content of page title * @param title title of page * @param ispriority (optional) should request added top of request queue (defualt: false) */ bot.prototype.page = function (title, ispriority) { return _page.call(this, { titles: title }, ispriorit...

java - How do copy on write collections provide thread-safety? -

this question has answer here: how can copyonwritearraylist thread-safe? 2 answers how copy on write collections provide thread-safety , in scenarios useful implement? the way make brand new copy of list every time altered. reads not block, , pay cost of volatile read. writes not block reads (or vice versa), 1 write can occur @ once.

how to solve Test run failed: Instrumentation run failed due to 'Native crash' in robotium -

i trying junit test facing following issue. when select android junit test right clicking on project shows following message test run failed: instrumentation run failed due 'native crash' and when right click on testapk.java , select android junit test, shows test run failed: instrumentation run failed due java.lang.classnotfoundexception two cases occurs here source code. @suppresswarnings("unchecked") public class testapk extends activityinstrumentationtestcase2 { private static final string launcher_activity_full_classname = "com.nhn.android.ndrive"; private static class launcheractivityclass; static { try { launcheractivityclass = class .forname(launcher_activity_full_classname); } catch (classnotfoundexception e) { throw new runtimeexception(e); } } public testapk() throws classnotfoundexception { super(launcheract...

performance - Java: Reusing vs Reallocating reference to container object? -

tl;dr: in java, better, reusing of container object or creating object every time , let garbage collector work i dealing huge amount of data in java have following type of code structure:- version1: for(...){//outer loop hashset<integer> test = new hashset<>(); //some container for(...){ //inner loop working on above container data structure } //more operation on container defined above }//outer loop ends here allocated new memory every time in loop , operations in inner/outer loop before allocating empty memory again. now concerned memory leaks in java. know java has garbage collector instead of relying on should modify code follows:- version2: hashset<integer> test = null; for(...){//outer loop if(test == null){ test = new hashset<>(); //some container }else{ test.clear() } for(...){ //inner loop working on above container data structure } //more operation on container defined above }//ou...

HashMap example in JavaScript -

i have string below. 10=150~jude|120~john|100~paul@20=150~jude|440~niroshan@15=111~eminem|2123~sarah i need way retrieve string giving id. e.g.: give 20; return 150~jude|440~niroshan . i think need hashmap achieve this. key > 20 value > 150~jude|440~niroshan i looking pure javascript approach. appreciated. if you're getting above string in response server, it'll better if can in below object format in json format. if don't have control on how you're getting response can use string , array methods convert string object. creating object better choice in case. split string @ symbol loop on substrings splitted array in each iteration, again split string = symbol key , value add key-value pair in object to value object using key use array subscript notation e.g. myobj[name] var str = '10=150~jude|120~john|100~paul@20=150~jude|440~niroshan@15=111~eminem|2123~sarah'; var hashmap = {}; // declare empty object /...

sql - what should i index -

i'm complete index dummie, i've read , watched quite bit of vids on indexing can't seem figure out. the table looks following: id int componentid int value float timestamp datetime imagine database having 2 million records , following: select value log componentid = x , timestamp >= select convert(varchar(8),dateadd(day, -1, getdate()),112) that should me values selected component within last 24 hours and im wondering if should index on componentid, timestamp or both thanks in advance! i suggest create covering index on table like: create unique nonclustered index idx_indexname on dbo.tablename(componentid, timestamp) include(value) this should improve performance of query index seek. value stored in leafs of index rid of lookups data selecting in index.

c++ - Initializing entire array with memset -

i have initialised entire array value 1 output showing garbage value. program works correctly if use 0 or -1 in place of 1. there restrictions on type of values can initialised using memset. int main(){ int a[100]; memset(a,1,sizeof(a)); cout<<a[5]<<endl; return 0; } memset, other say, sets every byte of array @ specified value. the reason works 0 , -1 because both use same repeating pattern on arbitrary sizes: (int) -1 0xffffffff (char) -1 0xff so filling memory region 0xff fill array -1. however, if you're filling 1 , setting every byte 0x01 ; hence, same setting every integer value 0x01010101 , unlikely want.

linux - Qt splash screen not shown in python -

i'm trying add splash screen program, coded in python 2.7 , using pyqt4 libraries. main file is: #!/usr/bin/env python pyqt4.qtcore import * pyqt4.qtgui import * logindialog import logindialog mainwindow import mainwindow import time import sys if __name__ == "__main__": try: app = qapplication(sys.argv) mw = mainwindow() # create , display splash screen splash_pix = qpixmap('images/sherlock_splash.png') splash = qsplashscreen(splash_pix, qt.windowstaysontophint) splash.setmask(splash_pix.mask()) # adding progress bar progressbar = qprogressbar(splash) # adding message splash.showmessage('discovering nodes...', qt.alignright | qt.alignbottom, qt.darkred) splash.show() app.processevents() in range(0, 100): progressbar.setvalue(i) # simulate takes time time.sleep(0.1) splash.close() # ...

php - Execute a function on "place an order" submit in Woocommerce -

is there woocommerce before or after "place order" (check out) hook can execute function when user clicks on "place order" button. couldn't find proper hook this. here list of woocommerce hook. can find according requirement woocommerce hooks

Force by config to use tls 1.0 in a wcf client c# -

we have web app has client implemented wcf. client uses ssl_lvl3 make handshake external service. turns out service disabled ssl_lvl3, need change tls 1.0. there way force tls security in c#: servicepointmanager.securityprotocol = securityprotocoltype.tls; but changes security of services used app , not services accept tls. what change web.config force wcf service use tls. there way this? this binding of service: <binding name="xxxx" closetimeout="00:01:00" opentimeout="00:01:00" receivetimeout="00:10:00" sendtimeout="00:01:00" allowcookies="false" bypassproxyonlocal="false" namecomparisonmode= "strongwildcard" maxbufferpoolsize="524288" maxbuffersize="655360" maxreceivedmessagesize="655360" textencoding="utf-8" transfermode="buffered" usedefaultwebproxy="true" messageencoding="text"> ...

Hibernate Session Does not released in logout operation -

there project on hibernate , struts when login in project hibernate session created , when click on logout link sessions remains same. i using show processlist; command in putty see session details. what reason behind situation?

timeout - JDBI: @QueryTimeOut not applying with Redshift database -

i have added @querytimeout annotation dao interface that's used jdbi. <dependency> <groupid>io.dropwizard</groupid> <artifactid>dropwizard-jdbi</artifactid> <version>0.7.1</version> </dependency> it doesn't though, i.e. query can still run longer specified timeout , nothing happens. @sqlquery("select position, industry [...]") @querytimeout(60) collection<contentbypositionandindustry> findall(); i'm wondering if maybe driver doesn't support feature? <dependency> <groupid>com.amazonaws</groupid> <artifactid>redshiftjdbc41</artifactid> <version>1.1.6.1006</version> </dependency>

javascript - Can we get the position of any device accurately with its IP address? If yes, which is the best API for that? -

how can position of device accurate city/street level, ip address. there api's powerful enough that? i researched , found google's geolocation tools provide something—but not powerful , couldn't trusted 100%. can find out position (with ip & other data fetch) on our own? there 'hybrid' apis combines different ip location finding tools(like google geolocation, ip2location or others) increase accuracy? this question may not question, needed hints or links new apis/technologies. me. note: answers specific 1 browser only, location welcome. any appreciated. thanks. i think it's not possible make work fine. example in poland in 1 of our mobile , phone operator (plus gsm) when use mobile internet show warsaw ip address.

python - Django Apache Subdomains -

i followed steps reference link multiple sites in django , configured in apache .but 1 thing how call domains in templates if type domain names directly in address bar working. want server through links( <a href="">domain1</a> ) for both separate settings.py , wsgi.py mentioned above. i have separate urls both. domain1_urls.py from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^$', 'domain1.views.domain1', name='domain1'), ) domain2_urls.py from django.conf.urls import patterns, include, url urlpatterns = patterns('', url(r'^$', 'domain2.views.domain2', name='domain2'), ) index.html <li><a href="{% url 'domain1' %}">domain1</a></li> <li><a href="{% url 'domain2' %}">domain2</a></li> the landing page domain1 ..in landing page template there link...

Android Emulator with proxy: "@" in the password? -

according android documentation: if emulator must access internet through proxy server, can use -http-proxy option when starting emulator, set appropriate redirection. in case, specify proxy information in in 1 of these formats: http://<machinename>:<port> or http://<username>:<password>@<machinename>:<port> what if password contains special caracter "@" ???? try urlencoding "@" in password %40 .

html - @media screen best practice for my dimensions -

i new @media screen please gentile. i not have fluid setup rather fixed setup 3 different device setups. mobile = max-width 500px. tablet = max-width 740px. laptop/desktop/desktop hd = width 980px. -- so correct saying following: @media (max-width: 500px) { } @media (max-width: 740px) { } @media (min-width: 741px) { } you need have smallest screen-width last, this: @media (min-width: 741px) { } @media (max-width: 740px) { } @media (max-width: 500px) { } as css reads top bottom, max-width: 740px overlap, 320px still less 740px. you set min-width: @media (max-width: 500px) { } @media (min-width:501px) , (max-width: 740px) { } @media (min-width: 741px) { } then can place them want. edit: this better: [ css 741px , above here ] @media (max-width: 740px) { } @media (max-width: 500px) { } this way, need fix widths, font-sizes , such in media-queries, , don't need write background-colors , font-colors if should stay same.

c# - BizTalk does not call WCF service -

Image
i have created local wcf service has method insertorupdate(string) connects database , insert/update data. if run service tutorial code here (8) , test wcf test client vs 2013 works great. now want call method via biztalk server application have saved wsdl file service , imported biztalk project via consume wcf service wizard. have created small orchestration looks this: the in port points directory on hard drive , looks kinds of xml files. out port set http transport http://localhost:43250/services/myservice.svc . have signed , deployed biztalk applicationon local machine , if put xml file in port directory disappears after short time service not called. in biztalk management console following error: the published message not forwarded because no subscribers found. error occurs when subscribed orchestration or subscribed sendeport not registered or necessary check subscription message properties not promoted. resolve error, use biztalk administration console. ...

javascript - getting html and jscript to validate a password? -

just quick question im unsure why not working html: <label>password </label> <input type="password" id="pword"><br> <label>confirm password </label> <input type="password" id="confpword"><br> js: function passwordvalidation(){ var username = document.getelementbyid("unamem"); var password1 = document.getelementbyid("pword"); var confpword1 = document.getelementbyid("confpword"); if (password1 != confpword1){ window.alert("passwords don't match") }else{ window.alert("well done match") } } surely code should work? whatever type in, never hits else block. ideas? thanks change if if (password1.value != confpword1.value){ window.alert("passwords don't match") }

download - After downloading XCode, it doesn't show up on my disk -

today, on macbook pro os x 10.10.3, launched app store application , downloaded xcode 7. after download has ended, cannot find update file on disk. app store says xcode 7 installed, indeed it's not. xcode application on disk still old version 6.4 , there no trace of xcode 7, nor installer on disk. launched xcode 6.4 upgrading should have been launched afterwards, nothing happened. window confirms: it's version 6.4 (6e35b). turned off machine , rebooted. nothing changed. downloaded xcode 7 once again. same trouble. idea? solution? if don't find way install xcode 7 try install xcode 7.1 beta. works fine me: https://developer.apple.com/xcode/download/

azure - AzCopy advanced pattern matching / last x blobs -

i working on backup solution our blob storage. 1 of requirements being able partial backup (will used test environments), i'd take last ~1000 blobs uploaded storage , copy other storage account. our blobs named numbers 1, 2, ..., 756479,... i cannot see parameter 'take last x blobs' in azcopy.. i have tried specify /pattern parameter, not seem support /pattern: 756* not copy blob named 756479. works prefix, without *, match unwanted blobs, such 756, 7560, 75612... could clarify whether real regex pattern matching possible in azcopy, or how solve issue? no, azcopy doesn't support regex pattern matching when source blob, blob service supports prefix blob query. , unfortunately, there isn't option in azcopy specify "last" n blobs. if implement incremental backup mechanism, perhaps can check whether option /xo fits requirement: excludes older source resource. resource not copied if source resource older destination. for further detail...

How to send a connection string as a parameter to MsBuild to perform SQL Schema Compare? -

the sql server data tools team blog mentions possible use msbuild perform schema comparison of 2 dacpacs or databases. however, not mention how pass in connection string source , target database. if set parameter /p:source="my connection string" error: msbuild : error msb4177: invalid property. name "initial catalog" contains invalid character " ". the command-line powershell script sends msbuild is: msbuild ".\schemacompare.proj" /t:sqlschemacompare /p:source="$sourceconnstring" /p:target="$targetconnstring" /p:xmloutput="$schemacomparereportpath" where schemacompare.proj contains content suggested on sql server data tools team blog it turns out have replace semicolons in connection string %3b , so: $sourceconnstring = $sourceconnstring.replace(";", "%3b") explanation: prevents delimiter collisions between sql server connectionstring value , msbuild /p (a.k...

How to set priority for test methods execution using TestNG + JAVA Reflection -

i have trying execute test script of reflections has annotated @test following way: class<?> classname = class.forname(format); //load class name @ runtime constructor<?> customconstructor = classname.getconstructor(webdriver.class); //create customized constructor , initalize driver testbase method[] method = classname.getmethods(); //call list of methods in current class file (method me : method) { if (me.getname().startswith("test")) { //check wheather class prefix test method getmethods = class.forname(format).getdeclaredmethod(me.getname()); //loading methods @ runtime. if(getmethods.isannotationpresent(test.class)) { //the method annotated @test execute here, using invoke() method of reflection. } } but, problem not able run @test methods per priority value. executing randomly. can tell me how run @test methods base...

bash - gpg batch-encryption with my own key without keyboard interaction -

Image
i need save couple of files on webserver , have them encrypted own public key before. therefore wrote simple bash-script: #!/bin/bash ls *.7z > filelist.txt while read currow gpg --encrypt -ac --recipient myemail@example.com $currow done < filelist.txt rm filelist.txt but doesn't work. each file dialog have enter password (twice). how can avoid this? thank you you using -c option, short equivalent of long --symmetric option. not using public key cryptography using option, why asked password. try changing -ac -a in script above.

LINQ Group and Distinct -

i still working through understanding linq. below sql trying convert. distinct ident's max seq equals class. select es.ident eqpseq es inner join eqpseq esmax on esmax.ident= es.ident es.class = 4 group es.ident, es.seq having es.seq= max(esmax.seq); the data looks like ident seq class 10 1 4 10 2 5 10 3 4 the result of when class = 4 should be ident 10 the result of when class = 5 should null. i thought linq query might work returning 2 rows of ident 10. from es in eqpseqs join esmax in eqpseqs on es.ident equals esmax.ident es.class == 4 group es new { es.ident, es.seq } g g.key.seq == g.max(p => p.seq) select new { ident = (int?)g.key.ident } any thoughts appreciated. in interested see linq fluent style also. yeah, given sample data not surprising same value twice. joining table on ident value of ident same in every row. result of join is, essentially, cartesian product of rows: ...

c# - Windows Service not retrieving edited SQL rows -

i tried find answer using search, feel wording poorly decent results. i have windows service uses linq-sql. should pull data table every 20 seconds, process data, update row accordingly , rinse , repeat. sqldatacontext sqldb; protected override void onstart(string[] args) { servicelog1.writeentry("service1 started"); sqldb= new sqldatacontext (); //initalize , start timer service action timer timer = new timer(); timer.interval = 20000; // 20 seconds timer.elapsed += new elapsedeventhandler(this.dowork); timer.start(); } public void dowork(object sender, elapsedeventargs args) { list<items> items= sqldb.items.where(i=> i.processed == false).take(20).tolist(); if(items.count > 0) servicelog1.writeentry("processing " + items.count + " queue items."); //work work... //set items processed == true //su...

mysql - update all rows at once with different where condition my sql -

i have table name details in there 2 columns. first 1 name , second gender. table consist around 50 entries of names , gender male/female. trying update gender column contains male , female both according person gender. want change data gender = male female , female male here's query i've tried: update details set gender = 'm', gender='f' gender = 'm'; if need in 1 statement, try using case statement instead: update details set gender = case when gender = 'm' 'f' else 'm' end gender in ('m', 'f')

linux - Simple shell. Mixed pipes and output -

let's consider: cat > outout.txt | cat > outout2.txt i don't know how interpret this. input second command? when cat doesn't receive filename argument, takes input stdin , sends stdout, effect of first part of command chain put whatever typed (until eod) file outout.txt: cat > outout.txt if goes normally, command produces no output, , second part of command chain gets nothing put outout2.txt: cat > outout2.txt so file outout2.txt made empty full command chain: $ cat > outout.txt | cat > outout2.txt note, however, outout2.txt will output if first "cat" invocation generates output. example, if outout.txt cannot modified , send stderr output stdout: $ chmod a-w outout.txt $ cat 2>&1 > outout.txt | cat > outout2.txt then outout.txt empty, following text written outout2.txt (the exact text of message may depend on shell - i'm using bash 3.2): -bash: outout.txt: permission denied

jquery - Using Bootstrap modal popup -

i have started using bootstrap modal popup. looks great except 1 annoying thing need create whole div hierarchy using modal popup. e.g. <div class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button> <h4 class="modal-title">modal title</h4> </div> <div class="modal-body"> <p>one fine body&hellip;</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">close</button> <button type="button" class="btn btn-primary">save changes</button> </div...

image - Android Zoomview center -

i tried create zoom view image scaled center. however, if change initial position of image , pinch image moves lower right corner of window. reference used pinch zoom view of android developer , changed parameters. have ideas fix that? package android.oli.com.fitnessapp; import android.content.context; import android.graphics.canvas; import android.graphics.color; import android.graphics.paint; import android.graphics.rect; import android.graphics.drawable.drawable; import android.util.attributeset; import android.view.motionevent; import android.view.scalegesturedetector; import android.view.view; public class zoomview extends view{ private drawable micon; private float mposx; private float mposy; private float mlasttouchx; private float mlasttouchy; private scalegesturedetector mscaledetector; private float mscalefactor = 1.f; private static final int invalid_pointer_id = -1; // ‘active pointer’ 1 moving our object. private int mac...

php - Laravel 5.1 and Fractal: including pivot table data on the transformer -

tables: contact , company , relationship table custom pivot attribute company_contact (company_id, contact_id, is_main) company , contact have many many relationship ( belongsto on both models). expected output when retrieve contacts of company: { "data": [ { "id": 1, "name": "johndoe", "is_main": false }, { "id": 2, "name": "janedoe", "is_main": true } ] } expected output when retrieve contact list ?include=companies : { "data": [ { "id": 1, "name": "john doe", "companies": { "data": [ { "id": 501, "name": "my company", "is_...