Posts

Showing posts from July, 2010

Unable to start activity ComponentInfo: android.view.InflateException: Binary XML file line #7: Error inflating class fragment -

i'm developing app in need show google map using google map v2. i'm getting following error , automatically app stoped. unable start activity componentinfo{com.example.getlocation/com.example.getlocation.show}: android.view.inflateexception: binary xml file line #7: error inflating class fragment my minsdk 12. show.java import android.app.activity; import android.os.bundle; import android.widget.toast; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; public class show extends activity { private googlemap googlemap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_show); try { // loading map initilizemap(); } catch (exception e) { e.printstacktrace(); } } /** * function load map. if map not created create * */...

java - how to get JSessionID in PhantomJS -

i not sure if question related phantomjs or simple javascript. i using ghostdriver open webpage , trying capture response headers. ghostdriver executes javascript , adds onresourcereceived event. like this: string responsescript = "var page = this,"+ "jsonresponse = \"\";"+ "page.onresourcereceived = function (res) {"+ "console.log(json.stringify(res));" /* line works fine want pass data somehow java program. that, came below alternative failing*/ "jsonresponse = jsonresponse + json.stringify(res, undefined, 4);"+ "};"+ "function getjsonresponse(){"+ "return jsonresponse;"+ "}"; ghostdriver.executephantomjs(responsescript); ghostdriver.get("cnn.com"); ghostdriver.executephantomjs("getjsonresponse();"); it fails b...

rabbitmqctl - How to read RabbitMQ unacknowledged messages / RabbitMQ cycle -

i want read payload, or messageid of unacknowledged messages in rabbitmq queue. possible? the reason want trying use rabbitmq dead letter feature build cycle auto-generating message periodically. briefly, create 2 queues - work queue , delay queue. set ttl of message in delay queue time frequency of need periodically. can have different messages different ttl different job purpose; put message delay queue. when message expires, gets republished work queue. message can sit in work queue long needed until consumer consume it. one consumer picks message, , process it. if processing succeeds, consumer needs acknowledge work queue, , write message delay queue; if processing fails (e.g., thread crashes), no acknowledgement. message re-appear in worker queue automatically. consumer can take job. when message sent delay queue gets expired again, gets republished, re-consumed consumer ...... cycle constructed, workload distributed. i want make sure there no missing or duplic...

sql - Access Pass Through & Access table -

i need use pass through query using odbc connection, need further refine sql using tables within same access database. how reference access table? access keeps thinking looking table via odbc connection rather database itself. first, create linked table in access, using odbc connection. then, write query against access database using whatever name give linked table, , names of access tables. be warned: if linked table contains large number of rows, linked tables can inefficient.

How can you apply a jQuery event handler to act only on the div the user is in? -

here's i'm trying do, have several multiple choice questions set using same html code, same class name (a div question 4 paragraphs within div answer choices). i want use jquery assign class called 'selected' answer choice (paragraph) user clicks on. , once they've clicked on answer choice, turn off click event question only. i'm not sure how apply div user clicking in , not entire page. here's have: $(document).ready(function() { function selecting() { $('.choices p').on('click', function() { $('.choices p').removeclass('selected'); $(this).addclass('selected'); }); $('.submit').click(function() { $('.choices p').off('click'); }); }; selecting(); }); you can use .closest() find current .choices element , target p element element like $(document).ready(function() { function selecting...

debugging - Using IntelliJ idea debugger attach android service or activity at the first beginning? -

i got android project build via ant commandline workflow, edit/debug intellij idea. i attach debugger service or running activities when apps running. want set breakpoint beginning of service initialize flow, make app restart , keep debugger attached, don't know how achieve it. to debug windows program, windbg's open executable work, android apps? update: i got service in app, i'd want make service wait debugger. has own process android:process=":service" . how can achieve this? maybe solution add these code service oncreate function, when want debug it? android.os.debug.waitfordebugger(); on phone go developer options -> select debug app, , select app. then, check "wait debugger". when start app, popup open "waiting debugger attach". after that, attach debugger in intellij. p.s. not sure how in ant, maven, specify "wait debugger" when running build.

c# - How to send a notification to a specific device using PARSE REST API with ASP.NET? -

can send push-message within app 1 specific device (probably device token ?) instead of sending devices ? here code public static bool pushnotification(string pushmessage) { bool ispushmessagesend = false; string poststring = ""; string urlpath = "https://api.parse.com/1/push"; var httpwebrequest = (httpwebrequest)webrequest.create(urlpath); poststring = "{ \"devicetype\": \"ios\"," + "\"devicetoken\": \"xxxxxxxxxxx\"," + "\"channels\": [\"\"], " + "\"data\" : {\"alert\":\"" + pushmessage + "\"}" + "}"; httpwebrequest.contenttype = "application/json"; httpwebrequest.contentlength = poststring.length; httpwebrequest.headers.add(...

Quick Launch is empty with Design Manager Snippet in SharePoint 2013 -

i'm trying create custom master page in sharepoint 2013. i've following options 1. through html 2. minimal master page. following either of above doesn't provide quick launch. tried put snippet master page it's empty. please let me know if you've faced similar scenario. regards, vikrant

Splitting string using symbols in C -

i have written code trying split long string simpler strings sort them out... when break nested loop, break first loop entirely?? my input "&$(, my,na$me(is" the output wanted "my na me is" how can solve this?? #include <stdio.h> #include <string.h> #include <ctype.h> int main(){ char splitter[100]; char mystring[1000]; char newstring[1000][1000]; int i,j,z,k=0; scanf("%s", splitter); scanf("%s", mystring); (i=0; i<1000; i++){ (j=k; j<1000; j++){ (z=0; z<100; z++){ if (mystring[j]==splitter[z]){ k++; break; } else { newstring[i][j]=mystring[j]; } } if (mystring[j]==splitter[z]) break; } } (i=0; i<10; i++){ printf("%s ", newstring[i]); }...

java - How to Share a local repository in the LAN through Subversive plugin for eclipse -

i using subversive plugin in eclipse helios. using have created repository in local drive. file:///d:/sample_repository/branches/phase1/mrt_oct28 now want share repositor other team members. systems installed subversive plugin. all these systems connected in lan. can tell me how can access repository. to share repository among multiple users/clients, need set proper subversion server on centralized system ( not pc!) backed regularly. the full details of setting server scratch beyond scope of stack overflow answer; the subversion manual explains quite well. all of pieces available apache & subversion project (which falls under apache organization), or can use pre-packaged solution collabnet subversion edge, ubersvn or visualsvn. while may technically possible share repository on unc path using file:/// protocol, not safe , not recommended or supported configuration. it's not unlike giving users unrestricted administrative access every computer touch...

web services - Upload Video Android server error 404 -

i'm trying upload video via webservice created me in java. sends video server returns "400 error, parameters wrong" did guys can me? private class sendvideotask extends asynctask<void, void, string> { @override protected string doinbackground(void... params) { try { final string url = server_url + "/rest/cloud/uploadfilepost"; form form = new form(); form.add("test_id", test_id); form.add("report_id", report_id); string encoded_file = cc.encodefiletobase64binary(mediafile); form.add("encoded_file", encoded_file); string resp = ""; closeablehttpclient httpclient = httpclients.createsystem(); httppost httppost = new httppost(url); list<namevaluepair> urlparameters = new arraylist<namevaluepair>(); urlparameters.add(new basicnamevaluepair("...

Generate random string in php/mysql -

i need generate random string when insert data in mysql. did read uuid or cast(rand) cant find looks can use it. my data comes app. i made new row called code , made unik. i hope can me :) how tell insert generate random string row code? // array json response $response = array(); // check required fields if (isset($_post['name']) && isset($_post['nummer']) && isset($_post['description']) && isset($_post['dato'])) { $name = $_post['name']; $nummer = $_post['nummer']; $description = $_post['description']; $dato = $_post['dato']; // include db connect class require_once __dir__ . '/db_connect.php'; // connecting db $db = new db_connect(); mysql_set_charset("utf8"); // mysql inserting new row $result = mysql_query("insert products(name, nummer, description, dato) values('$name', '$nummer', '$description', '$dato')"); ok ...

Storing a function inside a bash array element -

how can define function element of array? i know can this: function array[5](){ echo "you inside function"; } and valid function, in sense that, instruction array[5] , correctly execute function. unlucky, function not listed in keys of array, so, echo ${!array[*]} not return 5 key. for instance, following code: array[0]="first" function array[5](){ echo "you inside function"; } array[7]="seventh" echo ${!array[*]} only returns 0 7 . so, how can add function array element, can loop on it? you can't put function in array. can put function name in field. look: a_pretty_function() { echo "you're inside function"; } array[5]=a_pretty_function # execute it: "${array[5]}" when you're doing array[5]() { echo "you inside function"; } you're defining function called array[5] can check declare -pf array[5] . with mechanism can horribly ugly: array[5]() { echo ...

Can't update datagridview and form elements in C# -

in c# using visual studio express 2013, trying update datagridview event handler button click. button submit button updates sqlite database , updates datagridview reflect change. problem after update sqlite database (which updating successfully) datagridview doesn't update event handler (this set in getloggeddata(employeenumber, false) reference). (i tried updating text box, didn't update). after datagridview supposed update, added thread.sleep, user can see changes made before datagridview resets (getloggeddata() on last line of button click resets datagridview). the getloggeddata(employeenumber, false) method gets sqlite database datatable , sets datasource dgvlogged. check column , addrow shouldn't related problem. as side note, have tried using binding source no avail. // when button submit clicked private void btnconfirmentry_click(object sender, eventargs e) { modifyemployeejobs(); getloggeddata(employeenumber, false); thread.sl...

webdriver - Geb overwrite web driver -

i'm running tests using gradle specifying jvm properties in following manner: -dgeb.env=dev -dgeb.driver=org.openqa.selenium.htmlunit.htmlunitdriver this sets driver , configures environment in geb config script. want enable javascript htmlunit after specifying in environment property. more general, want overwrite driver in config script (i'm not interested in setting driver in every test's setup() block) i tried putting following code snippet in geb config script: if (system.getproperty("geb.driver")=="org.openqa.selenium.htmlunit.htmlunitdriver") { driver = { println "setting javascript" def driver = new htmlunitdriver() driver.setjavascriptenabled(true) driver } } this prints out message tests fail due java.lang.unsupportedoperationexception: javascript not enabled htmlunitdriver instance i'm bit surprised you're seeing setting javascript printed out happens driver cl...

Does PowerShell have an Infinity value -

does powershell have variable or value infinity? perhaps similar $null variable? i have tried $inifinity. have tried 1/0 generate value. there [double]::positiveinfinity . suspect if used 1.0/0.0 value. 1/0 should produce error, there no infinity value of integral types.

Oracle cascade remove only when last reference was deleted -

i modeling db shema oracle db there object man . object man references object address there may multiple man referencing same address how can make oracle cascade remove entry corresponsing object address , object man referencing it. but if last man referencing given 'address'? you need use trigger.

javascript - Displaying element on page load - using current URL -

i'm rusty @ javascript , html, , trying it. here's sample code of element i'd modify: <div class="table"> <h1>container</h1> <ul class="tabs"> <li><a href="#tab1">tab 1</a></li> <li><a href="#tab2">tab 2</a></li> <li><a href="#tab3">tab 3</a></li> </ul> <div id="tab_container"> <div id="tab1" class="tab_content"></div> <div id="tab2" class="tab_content"></div> <div id="tab3" class="tab_content"></div> </div> </div> this simple tab structure i'm using. can control tab display. i'd able control tab displayed when arriving on page, based on cu...

wix3.8 - RegistrySearch in WiX is not returning true for a value that is in the registry -

i have following commands in wix bundle: <variable name="instancename" value= "sqlexpress" /> <util:registrysearch id="sqlinstancekeyfound" root="hklm" key="software\microsoft\microsoft sql server\instance names\sql" value ="[instancename]" result="exists" variable="sqlinstancekeyfound" /> i can see sql server express instance in regedit on machine, log file reporting me: registry key not found. key = 'software\microsoft\microsoft sql server\instance names\sql' setting numeric variable 'sqlinstancekeyfound' value 0 condition 'sqlinstancekeyfound' evaluates false. why not returning true when can see value in regedit? add little more information, supposed check sql express 2014 instance. <util:registrysearch> defaults searching 32-bit registry. search 64-bit registry, set win64="yes" .

javascript - Contact Form - Append ".html" from URL after POST -

there may bit more this, haven't been able figure out. what have contact form on multiple pages post same "thankyou.html" page. exception of index file, every other page has ".html" extension end of name makes form cannot redirect correct page after form post. example: user fills out form > form post > redirects url below url of current form post: http://www.example.com/sub-domain.html/thankyou.html?(query parameters) what want url redirect as: http://www.example.com/sub-domain/thankyou.html?(query parameters) i pull in url parameters require using geturlvars so main question is. how can append ".html" variable subdomain form can post thankyou.html page? // pulls in url parameters var subdomain = window.location.pathname; var variable = geturlvars()["var1"]; var variable2 = geturlvars()["var2"]; $('input[name="xxredir"]').val('http://www.example.com' + subdom...

matrix - Simple c prog. error: invalid type arguement of unary '*' -

this first post here , i'm new c. i want write program able print matrixes. should like: ---- -o-- ooo- ---- so want printed beginning. my current code is: // 4. exercise // learn 2d arrays #include <stdio.h> char z; char s; char m1_ptr; void creatematrix() { for(z = 0; z != 4; z++) { (s = 0; s != 4; s++) { printf("%c", *m1_ptr); } printf("\n"); } } //------------------------------------------------------------------ int main() { char o = o; char c = '-'; // , variables matrix count: char matrix_1 [4][4] ={{c,c,c,c},{c,o,c,c},{o,o,o,c},{c,c,c,c}}; char *m1_ptr = &matrix_1 [z][s]; creatematrix(matrix_1 [0][0]); /* for(z = 0; z != 4; z++) { (s = 0; s != 4; s++) { printf("%c", matrix_1 [z][s]); } printf("\n"); } */ return 0; } it works if put void function main, since there more matrixes coming want in function make more read...

sql - No unique index found for the referenced field of the primary table -

when run booking table, show message "no unique index found referenced field of primary table". create table customer create table customer ( custid integer not null, fname char(18) not null, lname char(18) not null, street char(6) not null, city char(18) not null, province char(8) not null, country char(8) not null, postcode char(6) not null, gender char(6) not null, primary key (custid) ); create table booking create table booking ( bkgno integer not null, custid integer not null, fno integer not null, statusid char(3) not null, classid char(4) not null, orig char(18) not null, dest char(18), depttime date not null, arrtime date not null, bkgcity char(18) not null, paidby char(18) not null, fprice ...

double hashing with collision on first and second hash functions-java -

for double hashing, if there collision first hash function, you'd use second hash function, if there still collision? example, let's hash table size 15 , hash function (key + 3) % 15 , second hash function ((key % 8) / 3) + 2 . let's "insert 59" goes index 2 first hash function there key there. second hash function bring 3 let's there value there too. 59 inserted on hash table , why? thanks i want use double hashing, not chained hashing or linear probing. it not way calculate second hash function, since every probe(unavailability of slot) need have new hash function , not feasible. generic second hash function of type, h1(x) - first hash function, h2(x) - second hash function first time try following slot - h1(x), next probe - h1(x)+h2(x), next probe h1(x)+2*h2(x) ........ h1(x)+n*h2(x)

mysql - What is CHECKSUM in CREATE TABLE statement and what is default value? -

i see checksum = default defined in create statement table. 1 please tell me checksum in create table statement , default value ? create table schema.mytable ,no fallback , no before journal, no after journal, checksum = default, default mergeblockratio ( note: above structure taken teradata table structure can answer me in terms of database. the default uses systemwide global value can defined using dbs control utility. this applicable teradata databases, since checksum integrity implemented differently different databases (so it's not possible answer in terms of 'any database'), though may similar. more on teradata checksum see documentation . as checksum purpose, it's additional (to file system) data integrity verification. hash calculated on data being written, , written alongside it. on subsequent read hash calculated read data, , compared. if differ, means data corrupted.

SMS receive only my android Apps , others will not receive -

i want create android application, received sms , not receive native message apps . receive sms , , native message apps receive . coce:.. smsreceiver.java public class smsreceiver extends broadcastreceiver{ private final string tag = "mysmsreceive"; final smsmanager sms = smsmanager.getdefault(); @override public void onreceive(context context, intent intent) { notificationmanager mnotificationmanager = (notificationmanager) context.getsystemservice(context.notification_service); bundle extras = intent.getextras(); stringbuilder sb = new stringbuilder(); string strmessage = ""; string strmsgbody = ""; string strmsgsrc = ""; if ( extras != null ) { object[] smsextras = (object[]) extras.get( "pdus" ); ( int = 0; < smsextras.length; i++ ) { smsmessage smsmsg = smsmessage.createfrompdu((byte[])smsextras[i]...

How to count duration of answering questions in Google Forms? -

i have 2-step quiz in google docs. (spherical quiz in vacuum, example doesn't matter). is possible record in answer spreadsheet timestamps of opening 2nd step , submitting it or answering duration? hello dmitrylogvinenko, this can't achieved easily, first answer is: no, can't it. second answer may use workaround quite farfetched under conditions: if can sure user acces google form link give them , not embedding form in site, can automatically create short urls users answer form , give them these specifics short url answer it. these short url capable of telling when hit (that's equivalent when user opened form) , directly in form have timestamp on when form submitted can delta. of course need have correlation between submitted url , form answer, can performed in 2 differents way: - know has short url gave , in form have proceeded retrieval of username (only available in google apps business) - short url not point empty form, prefilled form specific f...

xcode - iOS - Development build working but Distribution build crash -

i facing issue/crash in distribution build app. not in development build. development running fine. (distribution app validate successfully) what problem while create distribution build. checked configs debug , release. here crash log : device when use distribution (distribution adhoc , upload hardware model: iphone4,1 process: appname [513] path: /private/var/mobile/containers/bundle/application/f2922a29-2e11-4377-xxxx-327a3dfc4612/appname.app/appname identifier: com.user.appname version: 1.2.5 (1.2.5) code type: arm (native) parent process: launchd [1] date/time: 2014-11-12 13:05:32.465 +0530 launch time: 2014-11-12 12:59:08.534 +0530 os version: ios 8.1 (12b411) report version: 105 exception type: exc_bad_access (sigsegv) exception subtype: kern_invalid_address @ 0xf0419f0b triggered thread: 0 thread 0 name: dispatch queue: com.apple.main-thread thread 0 crashed: 0 l...

array_chunk'ing a multi-dimensional array in PHP -

i have multi-dimensional array , looking split every 10 elements. array_chunk appeared solution, can't find suggests supports multi-dimensional arrays. is possible using php 5.3? this sample of current array: array ( [0] => cart object ( [cartid:protected] => 4337032 [userid:protected] => 271561 [orderid:protected] => 1042104 ) [1] => cart object ( [cartid:protected] => 4337032 [userid:protected] => 271561 [orderid:protected] => 1042104 ) ... , on ... ) what i'm looking for: array ( [0] => array ( [0] => cart object ( [cartid:protected] => 4337032 [userid:protected] => 271561 [orderid:protected] => 1042104 ) [1] => cart object ( ...

mule - Parameterized sub-flow -

is possible create parameterized sub-flow in mule? have same complex process twice, same, few minor differences. best way set bunch of flow variables in advance of flow reference , use variables in flow want parameterize, or there simpler way? you in correct direction. if have same piece of functionality want operate different set's of data, go sub-flows. approach have mentioned works , best possible can see.

javascript - Grab referrer to parent in iFrame (different domain) form hidden field -

i loading form in iframe using javascript , adding referrer url pass parameter iframe (step 1) populating hidden field on form (step 2). step 1 works fine , yields similar this: http://www.parentdomain.com/parentpage/?refurl=http://www.somereferringurl.com/somerefpage/ step 2 (where getting stuck) function gup( grabref ) { grabref = grabref.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexs = "[\\?&]"+grabref+"=([^&#]*)"; var regex = new regexp( regexs ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } var referrer = gup( 'refurl' ); function start() { var ref = document.getelementbyid('my-formfield-id');{ ref.value = referrer; } onload = start; } this (still) seems yielding parent referrer ( http://www.parentdomain.com/parentpage/ ), , (in fact) seems appending url string closi...

numpy - Python Pandas drop columns based on max value of column -

im getting going pandas tool munging 2 dimensional arrays of data. it's super overwhelming, after reading docs. can can't figure out how anything, if makes sense. my dataframe (simplified): date stock1 stock2 stock3 2014.10.10 74.75 nan nan 2014.9.9 nan 100.95 nan 2010.8.8 nan nan 120.45 so each column has 1 value. i want remove columns have max value less x. here example, if x = 80, want new dataframe: date stock2 stock3 2014.10.10 nan nan 2014.9.9 100.95 nan 2010.8.8 nan 120.45 how can acheived? i've looked @ dataframe.max() gives me series. can use that, or have lambda function somehow in select()? use df.max() index with. in [19]: pandas import dataframe in [23]: df = dataframe(np.random.randn(3,3), columns=['a','b','c']) in [36]: df out[36]: b c 0 -0.928912 0.220573 1.948065 1 -0.310504 0.847638 -0.541496 2 -0.743000 -1.09922...

Are Python's AsyncIO protocols necessary for writing an async HTTP library? -

i'm writing neat little async http library python ported (yet more robust) version of standard library's included http utilities. keep coming trying figure out whether necessary write protocol subclass or implement streamreader/streamwriter. i have done amount of reading through peps , not. i'm kind of person comes here absolute last resort because hate asking unnecessary questions or preventing need receiving it. thank in advance exceptional advice , wisdom, friends :) reader/writer pair should enough. while use own implementation in aiohttp some, (partially historic) reasons.

How to force image (cache) update in README.rst on GitHub -

in 1 of project i'm using external image link display screenshot via github page, automatically parses readme.rst github page of royweb i updated screenshot on web server several times in last weeks , realised not updated on github page since... think never updated ;-) github somehow downloaded image , loads it's cache servers. within readme.rst, there correct link: actual link royweb screenshot which can confirm, when load raw file: raw readme.txt on github but when check url of displayed image on github page, get: github cached screenshot of royweb does know how force "recache"? curl -x purge {url of cached badge image}

python - Tkinter Toplevel in OOP script: how? -

goal of script: (3) different windows, each in own class, own widgets , layout, created via toplevel , callbacks. when new (toplevel) window created, previous 1 destroyed. thus, 1 window visible , active @ time. problem? basically, i've tried many things , failed, must understand little of ["parent", "master", "root", "app", "..."] :( note on raising windows: have implemented successful example of loading frames on top of each other, , controlling visibility via .raise method. for problem, however, don't want load frames @ once. abstracted version of quiz program require quite lot of frames images, makes me reluctant load @ once. script (not working; bugged): #!/usr/bin/env python tkinter import * import tkmessagebox, tkfont, random, ttk class first_window(frame): """the option menu shown @ startup""" def __init__(self, master): frame.__init__(self, master) ...

sql - Update Foreign Key based on condition across both tables -

let's have custom fields table, , custom fields can grouped groups. lets have groups table. let's have convention whereby prefix of name of custom field should groupname_ groupname title column of groups table. how can update large number of existing custom fields take group id in sql? i've tried this: update fields, fgroup set group_id = fgroup.id name 'gp1\_%' , substring(name, 0, 4)) = lower(title) , fields.account_id=fgroup.account_id , fields.account_id = 111; this fails because update not take multiple tables. how can list of group names (gp1, gp2, gp3, gp4)? how modify prefix length? (not substring(name, 0, 4) , populated third parameter based on length of prefix until first underscore? your query looks sql-server or mysql syntax. in postgres can update single table in single statement. join in additional tables from clause. details in manual. for single group (with guesswork each column belongs to) update fields f set group = ...

php - FromJoomla MySQL Query with where condition on external database -

i have problem query field (avatarurl) database. in joomla module external database. can connect see avatarsurls (images) <?php if (!$link = mysql_connect('localhost', 'root', '')) { echo 'keine verbindung zu mysql'; exit; } if (!mysql_select_db('3d', $link)) { echo 'konnte schema nicht selektieren'; exit; } $sql = ' select avatarurl users username = 'username')' ; $result = mysql_query($sql, $link); if (!$result) { echo "db fehler, konnte die datenbank nicht abfragen\n"; echo 'mysql error: ' . mysql_error(); exit; } while ($row = mysql_fetch_assoc($result)) { echo "<img src='"; echo $row['avatarurl']; echo "' height='100' width='100' >"; } mysql_free_result($result); ?> i tried username mod_login. here login greeting code echo jtext::sprintf('mod_login_hiname', htmlspecialchars($user->get('name...

Create a Java application launcher with Eclipse -

so know how compile java project class files, don't know how run without eclipse. think have create specific java executable (.jar) launches class files or compile class files java executable, i've searched , found nothing on that. to make jar launchable, e.g. java -jar fun.jar, need add 1 line manifest.mf (which can done number of ways): main-class: a.b.c.mainclass where a.b.c.mainclass name of class file containing main(..) method should invoked.

Android: Custom view class with custom parameters -

well, not able find anywhere. might written somewhere may due poor skill of searching not able find it. so want is, want create class in pass string array , array class return me view number of button number of elements in string array. something like, public class customview extends view { public customview(context context, attributeset attrs, string[] array) { super(context, attrs, array); } } but not able this. because view class not support string array in constructor parameter. 1 have solution this? should move new approach achieve this? thanks, jay stepin . first, declare attributes follows: <resources> <declare-styleable name="piechart"> <attr name="showtext" format="boolean" /> <attr name="labelposition" format="enum"> <enum name="left" value="0"/> <enum name="right" value=...

php - yii cwebuser two seperate login in admin and frontend session issue -

i have 2 different types of users including admin users manage site , customers. have using cwebuser , define in config.php file. <?php 'user'=>array( 'class' => 'cwebuser', // enable cookie-based authentication 'loginurl'=>array('admin/'), //'allowautologin'=>true, 'statekeyprefix' => 'admin_', ), 'customer' => array( 'class' => 'cwebuser', 'loginurl' => '/site/', // enable cookie-based authentication //'allowautologin' => true, 'statekeyprefix' => 'frontend_', ) ?> the problem if logged in admin panel , open front end, automatically fetch admin users details , display in front end. both logins(admin , front end) different. how rectify session problem. i think usefull you http://www.yiiframework.com/forum/inde...

php - preg_replace with a div and dynamic id attribute -

i have div container wanted delete coding. div has id dynamic number. the div this: < div id="my-message-52617" class="label"> data inside div < /div> how can using preg_replace ? i used this: preg_replace("# < div id=\"my-message- ( . * ? ) \" class=\"label\">([^`]*?) < /div>#", "", $data); but seems doesn't work @ all. i need correct pattern replace data. it's not working... anyway bro... i have better solution friend of mine now. , it's working fine: preg_replace('/< div. ?id="my-message-[\s\s] ? < /div>/i', '', '< div id="my-message-52617" class="label">all data inside div< /div>');

ios - NSGliff for Swift Dictionary Key - Using uintptr_t? -

i need use nsglyph key in swift dictionary var glyph:nsglyph //set glyph var glyphdict:[nsglyph:cgpath] //will contain cache of glyphs converted paths var path = glyphdict[glyph] but get: error: '[nsglyph : cgpath]?' not have member named 'subscript' so guess apple hasn't defined subscript nsglyph? i've found code apple's vectortextlayer sample code uses cgglyph key in cfdictionary. how can adapt work in swift dictionary? cgpathref path = (cgpathref)cfdictionarygetvalue(glyphdict, (const void *)(uintptr_t)glyph); i understand code wrapping cgglyph uintptr_t. how in swift? i think you've copied different code in question. error happens when variable you're using dictionary optional, declared as: var glyphdict:[nsglyph:cgpath]? to solve issue, can read dictionary using optional chaining: var path = glyphdict?[glyph] note path optional itself.

ssl - Html5 <keygen> tag importance -

i getting started know html5 new elements. i have doubts in <keygen> tag. all can find understood, apart documents read, have following questions raise. is important creating every new website? where exact situation use <keygen> ? if not use this, issues can meet? is there relation between keygen , ssl ? can me fix sir? thanks in advance.

web applications - meteorjs WebApp.connectHandlers: how to match request params -

i want use express like request params. webapp.connecthandlers not match parameters /user/:name . should use middleware or something? have ever tried iron router ? here's excerpt api: router.route('/items/:_id', function () { var item = items.findone({_id: this.params._id}); this.render('showitem', {data: item}); });

java - Service-based design on a jboss server -

i looking best option use service-paradigm in jboss server. osgi no longer supported , spi works...oddly...in jboss else there? to give little bit of perspective, have ear file contains: lib/ jarthatusesspi.jar myejb.jar mywebinterface.war lib/ someotherdependency.jar for myejb.jar: it can see classes inside jarthatusesspi.jar the spi works in, detected should be for mywebinterface.war: it can see classes inside jarthatusesspi.jar the spi does not work , nothing automatically detected. if myejb approaches spi jar first , initializes spi stuff -basically store spi results in memory in singleton- , web interface then requests instance, see same instance with spi loaded instances. sure war , parent ear file looking @ same class same classloader, same instances etc, except spi stuff not work if run in web interface first... due fragile spi behavior , non-support osgi, i'm curious see jboss offers alternative, can't seem find any...

preg match - Replacing text using a loop in PHP -

i trying loop through every [footnote] , replace html. here sample text: hello [footnote], how [footnote], [footnote]? and using preg_match_all create count: $match_count = preg_match_all("/\[footnote]/", $content); i use count loop, find , replace text appropriate html: for ($i=0; $i < $match_count; $i++) { $new_content = str_replace('[footnote]', "<span class='footnote'>$i</span>", $content); } however, after, when echo $new_content; each [footnote] has same number, 2 : <span class="footnote">2</span> <span class="footnote">2</span> <span class="footnote">2</span> would know why number not incrementing? want <span class="footnote">1</span> <span class="footnote">2</span> <span class="footnote">3</span> str_replace replaces @ once, need preg_replace supports $limit ...

c++ - OpenGL program with Intel HD and NVidia GPU usage -

i new in opengl , want explain me how program uses gpu. i have array of triangles(class contains 3 points). here code draw them( know these functions depricated). glbegin(gl_lines); for(int i=0; i<trsize; ++i){ glvertex3d((gldouble)trarr[i].p1().x(), (gldouble)trarr[i].p1().y(), (gldouble)trarr[i].p1().z()); glvertex3d((gldouble)trarr[i].p2().x(), (gldouble)trarr[i].p2().y(), (gldouble)trarr[i].p2().z()); glvertex3d((gldouble)trarr[i].p3().x(), (gldouble)trarr[i].p3().y(), (gldouble)trarr[i].p3().z()); } glend(); and use depricated functions rotating, transforming, etc. when size of array bigger 50k, program works slow. tried use intel hd or nvidia gtx860m (the default nvidia program allows choose gpu) both works slow. maybe intel hd works bit faster. so, why there no difference between these 2 gpus? , program work faster using shaders? when size of array bigger 50k, program works slow. the major bottleneck when drawing in intermediate mode i...

linux - How to apply sed here? -

i have following string - <rom readonly="false" persist="false" type="string" name="rom_code_url">romcode_url_val</rom> now, want replace the romcode_ur_val following - dvb://1000.b.2cec.1/romcode_1.0.xml how can using sed? it's simple 's/pattern/replacement/' proper escaping, or equivalent expression. example: sed 's romcode_url_val dvb://1000.b.2cec.1/romcode_1.0.xml ' <input-file> note: trailing space important we're using spaces delimiters, rather forward slashes.

asp.net - How to cater Search from front-end in SQL Server query -

i have asp.net application. functionality required is: there 1 dropdown , gridview underneath. when page loaded first time, nothing selected in dropdown. query works like: select * mytable; then when select dropdown, query is: select * mytable col1 = @valueselected i want use single query both cases, i.e select * mytable case @valueselected when null col1 in ('all', 'passed', 'failed') else col1 = @valueselected end or select * mytable case @valueselected when not null col1 = @valueselected else null end but both dont work of now. any help/suggestions/pointers ? the syntax use used simulate if else condition using case statement in where clause wrong. if need specific list of values col1 try this. select * mytable ( col1 in ( 'all', 'passed', 'failed' ) , @valueselected null ) or col1 = @valueselected if want have values in col1 try this. select * mytable col1 = coalesce(@...

Rails not accessing mailer functions on Google Compute Engine -

a ubuntu 14.04 instance on google compute engine supposed host rails3 applications served via passenger/nginx. instance has sendmail installed. gce instance has firewall rule source ranges: 0.0.0.0/0 allowed protocols or ports: tcp:2525 established , configured send mail via sendgrid. telnet smtp.sendgrid.net 2525 connect , allows send e-mail via connection. traffic should flow. however none of following combinations don't hit timeout. nginx logs don't pick error, application's log state timeout being reached. invocations: actionmailer::base.smtp_settings = config.action_mailer.smtp_settings = followed basic bloc { :user_name => 'user', :password => 'aaabbbb', :domain => 'domain.tld', :address => 'smtp.sendgrid.net', :port => 2525, :authentication => :plain, :enable_starttls_auto => true } atempted in each of environment.rb, application.rb, environments/development.rb adding, before o...

chi squared - Why 2 outputs of chisq.test are different in R -

in following, why outputs of 2 chisq.test different, when data same: > df1 count position 1 1 11 2 6 12 3 12 13 4 23 14 5 27 15 > df2 count position 1 1 11 2 4 12 3 9 13 4 24 14 5 24 15 > mm = merge(df1, df2, by='position') > mm position count.x count.y 1 11 1 1 2 12 6 4 3 13 12 9 4 14 23 24 5 15 27 24 first method: > chisq.test(mm[2:3]) pearson's chi-squared test data: mm[2:3] x-squared = 0.6541, df = 4, p-value = 0.9569 warning message: in chisq.test(mm[2:3]) : chi-squared approximation may incorrect second method: > chisq.test(df1$count, df2$count) pearson's chi-squared test data: df1$count , df2$count x-squared = 15, df = 12, p-value = 0.2414 warning message: in chisq.test(df1$count, df2$count) : chi-squared approximation may...

Define AngularJS directive using TypeScript and $inject mechanism -

recently started refactoring 1 of angular projects working on typescript. using typescript classes define controllers convenient , works minified javascript files static $inject array<string> property. , pretty clean code without splitting angular dependencies class definition: module app { 'use strict'; export class appctrl { static $inject: array < string > = ['$scope']; constructor(private $scope) { ... } } angular.module('myapp', []) .controller('appctrl', appctrl); } right searching solution handle similar case directive definition. found practice define directives function: module directives { export function mydirective(toaster): ng.idirective { return { restrict: 'a', require: ['ngmodel'], templateurl: 'mydirective.html', replace: true, link: (scope: ng.iscope, element: ng.iaugmentedjquery, attrs: ng.iattributes, ctrls) => ...

c# - Entityframework.extensions error "Sequence contains more than one element" on batch delete -

i using entityframework.extended library in project, contains code first entity model. receiving error message "sequence contains more 1 element" when execute linq statement , perform batch delete library: var subjlocal = (from subjectlocal in customercontext.rostersummarydata_subject_local ((subjectlocal.fkrostersetid == 0) && (statsinfo.testinstanceidslist.contains(subjectlocal.fktestinstanceid)) && (subjectlocal.fktesttypeid == statsinfo.testtypeid) && (statsinfo.schoolyearidslist.contains(subjectlocal.fkschoolyearid)) && (subjectlocal.fkrostertypeid == 1) && (subjectlocal.fkschoolid == 0) && (subjectlocal.fkdepartmentid == 1) && (subjectlocal.fkcourseid == 1) &...