Posts

Showing posts from 2010

erlang - How does receive block work? -

i had simple question , can't seem find answer it. question if have function recording state (recursive) , send multiple messages it, keep going through receive block until no longer has messages in "mailbox"? state(fridge) -> receive pat1 -> io:format("ok"), state(s); pat2 -> io:format("not ok"), state(s) end. so if i'd send process 3 messages (pat1, pat2, pat1) using "!" , not able go loop before receiving messages still print out following? 1> "ok" 2> "not ok" 3> "ok" sorry if isn't put, simplifying question might make hard picture asking. your question isn't clear seem asking whether process receive 3 messages if they're sent before target process has called receive — if that's question, answer yes. when send message process, goes process's message queue until process calls r...

jrebel - Disable reloading in Grails 3.1 / springloaded -

i'm trying disable automatic reload/recompiling in grails 3.1 use jrebel instead. find springloaded rather limited, more importantly fails file /users/engrun/development/projects/grailspoc/grails-app/controllers/grailspoc/hellocontroller.groovy changed, recompiling... java.lang.illegalaccessexception: class org.springsource.loaded.reloadabletype can not access member of class org.springframework.aop.framework.cglibaopproxy$classloaderawareundeclaredthrowablestrategy modifiers "public" i have tried kinds of settings have found available, however, none disables reloading when running run-app command i have tried disable.auto.recompile=true on command line, grails_opts, , in application.yml i have tried -noreloading flag, both on command line , grails_opts. according docs, should have worked https://grails.org/wiki/auto%20reloading and answer accepted correct 1 here how can disable reloading in grails 3.0.0 app? not work either. have succeeded in d...

latex - Auctex cannot find a working TeX distribution on spacemacs with Osx ElCapitan -

i following error when try build latex spacemacs text editor : tex-command: error : auctex cannot find working tex distribution. make sure have 1 , tex binaries in path environment variable. if fyou using osx el capitain or later remember add /library/tex/textbin/ path i have installed mactext torrent linked on official site : https://tug.org/mactex/mactex-download.html the /library/tex/textbin/ path doesn't exist me if install mactex. i have tried add library/tex/textbin path didn't work. the texshop text editor building latex correctly somehow. how can fix problem , tex distribution ? need change path ? so, after debugging him. realized forgot leading / in path. spacemacs searching in ~/library instead on /libraby

proxy - iOS Safari development ".local" domain issue -

1) have asp.net app running on pc (under "xyz.local" domain) 2) have third party dns configured on pc (created zone "xyz.local") 3) have fiddler proxy running @ port 8888 4) have windows , ios tablets dns configured desktop pc's ip address , proxy configured desktop pc's ip address , fiddler proxy port (8888) on windows tablet, can access web app both ie , chrome via "xyz.local". on ios tablet, can access web app chrome, not safari. requests safari don't reach fiddler. suggested safari requires add www @ start, tried "www.xyz.local" (i added alias(cname) dns records) , nothing. but, tried setting "www.xyz.com" , worked. anybody knows why? need go ".local" , not ".com" tld. rfc 6762 reserves top-level label .local multicast dns. not use .local ordinary dns. use real, registered domain name instead. if absolutely positively cannot use real domain, @ least pick 1 of reserved names guar...

ios - MKMapView fails to load tiles with HTTP 410 error -

i have problem mkmapview . map fails load tiles when zoom in. -(void)mapviewdidfailloadingmap:(mkmapview *)mapview witherror:(nserror *)error error: domain=geoerrordomain code=-204 "(null)" userinfo={simpletilerequesterunderlyingerrors=( "error domain=geoerrordomain code=-204 \"(null)\" userinfo={httpstatus=410, nserrorfailingurlstringkey= http://gspe19.ls.apple.com/tile.vf?flags=1&style=20&size=2&scale=0&v=11037825&z=15&x=6205&y=12336&sid=0246704635757302674107153038443966765357&accesskey=1454685602_q3bvuyvhbdxsso0a_j0fk7eyq9b21npshv7grlzr4wfkkhxb4vo7%2blxcgsxj4zzhvhtalvwsypa3plu60cdrmrfwmwcybgrla9mchv%2fhorhotu9agi72vqp9ukzw%2b0gkqfrhpcw4xr%2f%2fttvgjz7wu4u4kna8k2rvvq%2foffhjq7oo4nyectvy0ur4i9d3sxf%2btn9dcxu8agdrjignb }", ... edit: seems related cache somehow, i'm not sure. problem disappears time after loading same map region in maps application. thanks in advance i analysed , d...

c# - Hosts Redirect 400 Error Web Page Cannot be Found -

i'm trying test application against oauth microsoft account login. i have added following hosts file 127.0.0.1 testdomain.co.uk my application running on https when run app runs follows; https://localhost:44308/home now when hack url https://testdomain.co.uk:44308/home i certificate warning (which expected). however, when click continue site, 400 web page cannot found error? any ideas on doing wrong here? you need tell web server should handle testdomain.co.uk project. web server (iis express) not know it, default set handle "localhost" host only. how change described here: https://stackoverflow.com/a/32365556/3835864

javascript - JQuery Autocomplete with countries -

i'm trying make autocomplete country codes in jquery. i'm using code example. in site, works well, values, appear list in front of input, , not example in site. couldn't run on jsfiddle, here my code . you! var countries = { "argentina (ar)":"ar", "united states (us)":"us", "comoros": "km", "congo (brazzaville)": "cg", "congo, democratic republic of the": "cd", "cook islands": "ck", "costa rica": "cr", "côte d'ivoire": "ci", "croatia": "hr", "cuba": "cu", "cyprus": "cy", "czech republic": "cz", "denmark": "dk", "djibouti": "dj", "dominica": "dm", "dominican republic": "do", }; ...

java - How to check if all arguments in method are of specific type? -

i have method takes variable amount of arguments: public void test(object[] ... args) {} how can check if all arguments double[]? loop , make sure each object[] double[]. note cannot use primitive double here not object. boolean alldoublearr = true; for(object[] o : args) { if(!(o instanceof double[])) { alldoublearr = false; break; } }

javascript - All files are not getting from file upload control using jquery -

i facing problem during images upload. i have input type file control in form , more input controls can added using jquery. problem this: when control values, return first value file control. how can added files in control? here code: javascript $(document).ready(function() { $('#add_more').click(function() { $(this).before($("<div/>", { id: 'filediv' }).fadein('slow').append( $("<input/>", { name: 'file[]', type: 'file', id: 'file', accept: '.jpg, .jpeg, .gif' }), $("<br/><br/>") )); }); $('#upload').click(function(e) { var name = $(":file").val(); if (!name) { alert("file must selected"); e.preventdefault(); } else { //upload images var filedata = $('#file').prop("files")[0]; var form_data = new formdata(...

How do you load a custom JAR into the SceneBuilder that's built into IntelliJ? -

i'm trying load custom control scenebuilder that's running inside of intellij. downloaded plugin gluon . in stand-alone version have installed, option import custom jar available clicking gear icon under 'library'. see nothing when scenebuilder run inside of intellij in tabbed editor view. i think importing jar allow me see show in intellij, no such luck. shows when scenebuilder ran stand-alone. intellij built-in scene builder is not same as uses gluon's scene builder . former version embeddded in ide, introduced intellij idea 14, two years ago , without several features or menus or recent improvements , while latter complete , updated version 8.1.1, allows using latest features available and or adding custom controls, have done. if check intellij help , recommend using stand-alone version (though still point old 2.0 oracle's version), don't refer 1 embed. if want use custom controls, option here gluon's version. note: i've ...

java - How to serialize all int and boolean field to String with Jackson Json lib -

i'm working on aria2 jsonrpc remote revoke, , found out aria2 accept strings value, number 1 should "1". although can use jsonserializer annotation or use module method, think there should easy way apply " int string serializer " of fields of type int. could give me hint how this? finally, found article has described 3 steps that, , thought may through answer: create custom serializer extending stdserializer class create object of simplemodule class, adding custom serializer , specifying class must used register module on objectmapper instance ref: jackson: create , register custom json serializer stdserializer , simplemodule classes

php - codeigniter insert to mysql with external variable -

i sending form in $post , means jquery post, file called: register.php now variable called "name" ... in register.php code: <?php include "external.php"; $ci->load->database(); $fullname=$_request['name']; $data = array( 'full_name' => $fullname ); $ci->db->insert('tbl_users', 'full_name'=>''); if( $_request["name"] ) { $name = $_request['name']; echo "welcome ". $name; } ?> the external.php load codeigniter. request name want insert db... the code inserting db [full_name table] empty name.. , got problem: a php error encountered severity: warning message: mysql_real_escape_string() expects parameter 2 resource, boolean given filename: mysql/mysql_driver.php line number: 314 how can insert $_request["name"] database ? in view <?php echo form_open_multipart(base_url().'m...

Apache Drill not using max RAM -

i'm running apache drill 1.0(and on 1.4) locally on ubuntu machine has 16gb of ram. when work large tab delimited file(52 million rows, 7gb), , perform select distinct columns[0] `table.tsv` ,performance seems not improve @ second time same query ran (both took 53 seconds). second time same query ran, takes less half time compared first query. seems drill not using allocated memory. my conf/drill-env.sh file looks like: drill_max_direct_memory="14g" drill_heap="14g" export drill_java_opts="-xms$drill_heap -xmx$drill_heap -xx:maxdirectmemorysize=$drill_max_direct_memory -xx:maxpermsize=14g -xx:reservedcodecachesize=1g -ddrill.exec.enable-epoll=true" i did within drill alter system set `planner.memory.max_query_memory_per_node`=12884901888 however, when check memory usage using smem, it's using 5gb of ram. if cut table size 1 million row, can see first query completed in 3.6seconds , second time same query ran, took 1.8 seconds...

html - How can I wrap flexbox children so that multiple children are stacked next to another child? -

i have table-like layout using flexbox: +--------------+---------------+-----------------+---------------+ | 1 | 2 | 3 | 4 | | | | | | +--------------+---------------+-----------------+---------------+ as page gets smaller, i'd wrap content end this: +--------------+-------------------------------------------------+ | | 2 | | | | | +-------------------------------------------------+ | 1 | 3 | | | | | +-------------------------------------------------+ | | 4 | | | | +--------------+----------...

.net - Standard conformant way of converting std::time_t to System::DateTime? -

i have found several answers related converting std::time_t value system::datetime , back. however, answers seem neglect type of std::time_t undefined in standard. solutions cast std::time_t whatever needed or apply arithmetic operations std::time_t object possible since it's arithmetic type, there no specification result of such operation. know most compilers define time_t int of size fact alone has changed int32 int64 in many implementations shows changes indeed possible. so i've come solution should work type of std::time_t . works have seen. wondering - are there possible pitfalls might unaware of? template <> inline system::datetime marshal_as(const std::time_t &from_object) { // returns datetime in local time format time_t (assumed utc) const auto unix_epoch = makeutctime(1970, 1, 1, 0, 0, 0); const auto unix_epoch_dt = system::datetime(1970, 1, 1, 0, 0, 0, system::datetimekind::utc); const auto secondssinceepoch = std::difftim...

Assigning the output of a C program in unix shell script and checking the value -

let's have c program evaluates either 0 or non 0 integer; program evaluates boolean value. i wish write shell script can find out whether c program evaluates 0 or not. trying assign return value of c program variable in shell script seem unable so. have; #!/bin/sh variable=/path/to/executable input1 i know assigning values in shell script requires not have spaces, not know way around this, since running seems evaluate error since shell interprets input1 command, not input. there way can this? i unsure how check return value of c program. should use if statement , check if c program evaluates value equal 0 or not? this basic #!/bin/sh variable=`/path/to/executable input1` or #!/bin/sh variable=$(/path/to/executable input1) and return code program use echo $?

methods - Accessing variables inside a Javascript promise chain -

i using chained promise in javascript (i think). there then() function in chain. want access variable inside promise, or somehow return variable via http response object. var gettitle = function(response) { console.log("starting gettitle. response: " + response); //this works var horseman = new horseman(); // object headless browser horseman .useragent("mozilla/5.0 (windows nt 6.1; wow64; rv:44.0) gecko/20100101 firefox/44.0") .open('http://www.google.com/ncr') .type('input[name="q"]', 'github') .click("button:contains('google search')") .keyboardevent("keypress",16777221) // press enter .waitforselector("div.g") .title() // gets title of page .then(function(t) { console.log("title: " + t); // works }) .close(); console.log("title ...

javascript - how to pass value from a boostrap modal child to parent? -

i been trying pass value window modal child parent window, doesn't work. modal doesn't hide or send value parent window when click save . application.php <body> <h3 class="h3 black">application</h3> <form class="form-horizontal" method="post" action="admin-controller.php" name="f1"> <input type="text" name="p_name" id="n1" > <?php include 'includes/calendar.php'; $calendar = new calendar(); echo $calendar->show(); ?> </form> </body> <script src="https://code.jquery.com/jquery-2.1.0.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.14.0 /jquery.validate.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0msbjdehialfmubbqp6a4qrprq5ovfw37prr3j5elqxss1yvqotnepnh...

java - Converting String to Char with If/Else Statement -

this question has answer here: how compare strings in java? 23 answers i'm new programming , i've been searching days solution lab i'm working on. lab pretty simple , believe have logic down, when executing code, i'm not getting desired results. program asks input of 3 integers , 1 character. if character 's' program print sum of first 3 integers, if character 'p,' product, 'a,' average, , other character prints error. below code. asks 3 integers , character result error, if type in 's,' 'p,' or 'a.' any appreciated. thanks, joe int n1, n2, n3; string numberfromkb; string charfromkb; scanner keyboard = new scanner (system.in); numberfromkb = joptionpane.showinputdialog("enter first number."); n1 = integer.parseint(numberfromkb); numberfromkb = joptionpane.s...

java - Received byte array has different values than sent, AES encryption + IV -

i'm trying encrypt communication using aes, in java. the key hardcoded, , iv generated randomly through securerandom , sent first 16 bytes of encrypted message. however, when try read first 16 bytes of received message, don't same byte array generated. here's problematic code: static byte[] bytes = new byte[16]; public static byte[] encrypt(string key, string message) { try { securerandom random = new securerandom(); random.nextbytes(bytes); system.out.println("outputting generated iv:"); for(int i=0; < bytes.length; i++){ system.out.println(bytes[i]); } ivparameterspec iv = new ivparameterspec(bytes); secretkeyspec skeyspec = new secretkeyspec(key.getbytes("utf-8"), "aes"); cipher cipher = cipher.getinstance("aes/cbc/pkcs5padding"); cipher.init(cipher.encrypt_mode, skeyspec, iv); byte[] encrypted = base64.encodebase64(cip...

icc - How to disable warning using a pragma with intel c++ compiler -

i cannot find reliable document on how avoid warnings pragma. documentation says warning pragma compatible microsoft compiler should be: #pragma warning ( push ) #pragma warning ( disable:1234 ) #pragma warning ( pop ) which not working icc (icc) 15.0.3 20150407 on gnu/linux system. however, working is: #pragma warning disable 1234 i not find working syntax push/pop however. know official documentation that?

xcode ui testing - Is CodedUI test supported on Windows Server 2012 -

i have created codedui test application runs on windows server 2012. test can detect object controls via drawhighlight, not recognize mouse click or keyboard actions. has run codedui test on windows server 2012 platform? codedui supported on windows server platform?

exchange server - Creating appointments for multiple users in one request -

i need use impersonation create events on multiple user's calendars @ same time. is possible send single request multiple soap envelopes event details, or need send separate requests each event needs created? if using impersonation then answer no because impersonation set @ envelope level need multiple request. ews allows batching these requests batched within 1 envelope , hence 1 security context. if used service account had been granted access mailboxes trying access possible. cheers glen

docker compose build single container -

using compose, if run docker-compose build , rebuild all containers : > docker-compose build building elasticsearch step 1 : elasticsearch:2.1 ---> a05cc7ed3f32 step 2 : run /usr/share/elasticsearch/bin/plugin install analysis-phonetic ---> using cache ---> ec07bbdb8a18 built ec07bbdb8a18 building search step 1 : php:5.5.28-fpm ---> fcd24d1058c0 ... even when rebuilding using cache, takes time. question is: is there way rebuild 1 specific container? yes, use name of service: docker-compose build elasticsearch

mysql - Get SUM of two fields in 2 different related tables -

i'd sum of amount column in 2 related tables. invoices table: ----------------------------------------- | id | student_id | created | updated | ----------------------------------------- | 5 | 25 | date | date | ----------------------------------------- invoice items table: ------------------------------ | id | invoice_id | amount | ------------------------------ | 1 | 5 | 250 | ------------------------------ | 2 | 5 | 100 | ------------------------------ | 3 | 5 | 40 | ------------------------------ payments table: ------------------------------ | id | invoice_id | amount | ------------------------------ | 1 | 5 | 100 | ------------------------------ | 2 | 5 | 290 | ------------------------------ desired output: -------------------------------------- | id | invoicetotal | paymenttotal | -------------------------------------- | 1 | 390 | 390 ...

java - Trying to migrate custom generic gson deserializer to jackson -

currently deserializing gson , retrofit using retrofits gsonconverterfactory: gsonbuilder gsonbuilder = new gsonbuilder(); gsonbuilder.registertypeadapter(new typetoken<map<book, collection<author>>>(){}.gettype(), new booksdeserializer(context)); gson gson = gsonbuilder.create(); retrofit retrofit = new retrofit.builder() .baseurl(url) .addconverterfactory(gsonconverterfactory.create(gson)) .build(); bookservice service = retrofit.create(bookservice.class); response<map<book, collection<author>>> response = service.getbooks().execute(); i use jacksonconverterfactory provided retrofit? need provide jackson mapper. there way provide type information mapper did gson? simplemodule simplemodule = new simplemodule(); // todo provide mapper info needed deserialize // map<book, collection<author>> mapper.registermodule(simplemodule); retrofit retrofit = new retrofit.builder() .baseurl(url) .addconverterfac...

mongodb - How to avoid loading referenced documents when creating a new document? -

i have playlist document references many song documents, in turn reference others documents: /** @document(collection="playlists") */ class playlist { /** * @var \doctrine\common\collections\collection * * @referencemany(targetdocument="song", simple=true) */ protected $songs; } /** @document(collection="songs") */ class song { /** * @var string * * @referenceone(targetdocument="foo", simple=true) */ protected $foo; /** * @var string * * @referenceone(targetdocument="bar", simple=true) */ protected $bar; } another document like references 1 playlist : /** @document(collection="likes") */ class { /** * @var playlist * * @referenceone(targetdocument="playlist", simple=true) */ protected $playlist; } each time persist (insert) new like document, of references (deep or not) loaded (a lot of as...

php - Locating a specific string in a column between two strings which are not always there? -

long story short, let's assume have field in column called 'whyisthisalist' 'table' contains: {example1:"hereistext";example2:"ohlookmoretext";example3:"isthisevenreal"} how extract text between example1 , example2, given example2 isn't there because this: {example1:"hereistext";example7:"ohlookmoretext"} it should return "hereistext" if goes well. my idea far: $sql = "select substring(left(whyisthisalist, locate('\";', whyisthisalist) +0), locate('example1:\"', whyisthisalist) +0, 100) table locate('\";', whyisthisalist) > 0 , locate('example1:\"', whyisthisalist) > 0 order id desc limit 1"; what needs done/doesn't work: need next occuring "; after previous located string. possible? or there other workaround? i'd glad help. the following regex first colon first semi-colon: \:([^;]*) simplifyi...

scala - Complex custom Matcher -

i writing tests json output of api calls in api, written play on scala. in tests, pattern keeps appearing, , deduplicate it. val response = sut.index()(fakerequest()) val expected = json.parse("""{ "channels":[] }""") status(response) must equalto(ok) contenttype(response) must besome.which(_ == "application/json") contentasjson(response) mustequal expected my first approach this: def assertsamejson(response: future[result], expected: jsvalue): unit = { status(response) must equalto(ok) contenttype(response) must besome.which(_ == "application/json") contentasjson(response) mustequal expected } but not feel idiomatic @ all. seems adding xunit asserts in specs i leading to response must besamejson(expected) the closest thing managed was def besamejson(other:any) = be_==(other) ^^ ((t: future[result]) => contentasjson(t)) , be_==(ok) ^^ ((t: future[result]) => status(t)) but not check cont...

Meekro DB query -

what equivalent query in meekro db working 1 have?: $sql = "delete data date < date_sub(now(), interval 2 week)"; not working query: db::delete('data', "date=%s", '(now() - interval 2 week)');

c++ - Wrong Output from Map -

i have problem outputting elements map. code: #include <iostream> #include <map> #include <string> int main() { int t,n; std::string cont; std::cin >> t; while(t--) { std::cin >> n; std::map<std::string,int> citire; std::map<std::string,int>::iterator it; for(int i=0; i<n; i++) { std::getline(std::cin,cont); citire[cont]++; } for(it=citire.begin(); it!=citire.end(); ++it) std::cout << it->first << " " << it->second << '\n'; std::cout << '\n'; } return 0; } for input: 2 6 03 10103538 2222 1233 6160 0142 03 10103538 2222 1233 6160 0141 30 10103538 2222 1233 6160 0141 30 10103538 2222 1233 6160 0142 30 10103538 2222 1233 6160 0141 30 10103538 2222 1233 6160 0142 5 30 10103538 2222 1233 6160 0144 30 10103538 2222 1233 6160 0142 30 10103538 2222 1233 6160 0145 30 10103538 2222 1233 6160 0146 3...

c# - Adding custom headers in .NET WebAPI 2 hosted by IIS 8.5 -

i wrote webapi application c# works fine while developing when in production, hosted iis 8.5 got problem. in order enable cors (cross origin resource sharing) in controller, implemented option action: [httpoptions] [allowanonymous] public httpresponsemessage options() { httpresponsemessage res = new httpresponsemessage(); res.headers.add("access-control-allow-headers", "user-agent, content-type, accept, x-applicationid, authorization, host, content-length"); res.headers.add("access-control-allow-methods", "post"); res.headers.add("access-control-allow-origin", "*"); res.statuscode = httpstatuscode.ok; return res; } as wrote before works ok on visual studio in production, when make options request using fiddler, answer always: http/1.1 200 ok allow: options, trace, get, head, post server: microsoft-iis/8.5 public: options, trace, get, head, post x-powered-by: asp.net date: fri, 05 feb 2016 1...

javascript - Bootstrap Carousel giving Invalid Selection Error -

i have bootstrap 3.3 carousel on web page , load list of pics rotate. carousel works fine if user clicks on either right or left arrow advance pic manually javascript error dialog pops , says invalid selection. have triple checked bootstrap js file loading correctly , seem since carousel works on automatic mode css files correct. can tell me fix invalid selection error? have searched bootstrap.js file , not have specific message coming somewhere else. code connected left , right arrow simple anchor tag href="#introcarousel" role="button" data-slide="prev" sorry wasting time. issue extension in chrome causing problems. once extension disabled worked. thanks, terry

typescript - Angular2 http.get in constructor can't see 'this' -

i trying data server, , constructor of class can't see this of class save incoming data variable this . import {injectable} '/angular2/core'; import {gamemodel} 'app/model/games/games'; import {component} "angular2/core"; import {http_providers, http} 'angular2/http'; @component({ providers: [http_providers, http] }) export class dataprovider { games:gamemodel[]; constructor(private http:http) { console.log('this.games constructor', this.games); //undefined http.get('app/service/php/games.php') //.map(res => res.json()) .subscribe(function (data) { var games = []; var response = data.json(); (var = 0; < response.length; i++) { var game = new gamemodel( response[i].id, response[i].gamename, response[i].fullname, ...

java - Restructuring data into nested maps - override put to avoid null? -

i need dump list of complicated java objects in yaml. needed structure first converted them nested lists , maps. it's kind of like: - item 1 name : value name : value - list ... - item 2 ... or in eclipses debugger view [...,...] list , {name:value,name:value} map looks [{item1={name:value, name:value[{anotherlist}]}item2=...]. it's mess, it's not long , not difficult understand, tedious. the problem few of theses blocks optional, few empty lists or null values: - item 1 null : null name : [] - item 2 , on which messy , can't read in again. , can't check 1 of higher level lists or maps because might contain empty lists, empty maps or nulls. don't want write if (value != null && !value.isempty) on , on again. see have 3 options: i technically modify template, don't want mess if don't have to. go on whole construct afterwards , take out nulls , empty constructs. manually writing long , nested , r...

php - Issue with uploading image from Android to Mysql -

i'm working on social app , want upload image in database, tried code , worked. file in folder problem path couldn't mysql database figured out $_files['uploaded_file']['name'] empty don't know how solve this. addstatus.java : public class addstatus extends appcompatactivity implements view.onclicklistener { private progressdialog pdialog; edittext status; button send,upload_img; string user_id; private textview messagetext; private imageview imageview; private int serverresponsecode = 0; private progressdialog dialog = null; private string imagepath=null; jsonparser jsonparser = new jsonparser(); private static final string uploadserveruri = "http://192.168.1.10/social/addstatus.php"; private static final string tag_success = "success"; private static final string tag_message = "message"; protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.add_stat...

linux - lstat() blocks for 15 minutes -

my linux (fedora) machine becomes unresponsive 15 minutes when open/save file. investigated , it's related windows mounted directory in /mnt. can reproduce simple 'ls -al /mnt'. subsequent ls commands return quickly. after period of time same problem shows , i'm forced take 15 minute break... strace , ltrace both point lstat(): # strace 13:37:22 lstat("/mnt/todo-dino", 0x211ce40) = -1 ehostdown (host down) 13:52:24 open("/usr/share/locale/en_us.utf-8/lc_messages/coreutils.mo", o_rdonly) = -1 enoent (no such file or directory) # ltrace 13:37:22 __lxstat(1, "/mnt/todo-dino", 0x01e1ee40) = -1 13:52:24 dcgettext(0, 0x4120ce, 5, 0, 0x1e24850) mnt$ ls -al ls: cannot access todo-dino: host down total 40 d????????? ? ? ? ? ? todo-dino the windows machine mount in above /mnt/todo-dino not down reported. in down, 15 mins quite long wait... after 15 minute period directory s...

How to create Custom Google Search Engine not for Specific Websites but for Specific Keywords? -

i want embed google custom search engine in website, , have been able set 1 following google's instructions . the options control panel provides let set engine searches through content of specific websites using user's search queries. however, want set engine search google user's query in relation specific topic adding predetermined keyword query. for example let's specified keyword word "pink" if user entered query: elephants in engine, should return google search results for: pink elephants i haven't been able set kind of engine. google's control panel custom engines provide space specify keywords search engine, typing in specified word here doesn't achieve desired effect. it narrows search results not extent typing search specified keyword google does. does know how set kind of custom engine?

Difference between C# and Java's ternary operator (? :) -

i c# newbie , encounter problem. there difference between c# , java when dealing ternary operator ( ? : ). in following code segment, why 4th line not work? compiler shows error message of there no implicit conversion between 'int' , 'string' . 5th line not work well. both list s objects, aren't they? int 2 = 2; double 6 = 6.0; write(two > 6 ? 2 : six); //param: double write(two > 6 ? 2 : "6"); //param: not object write(two > 6 ? new list<int>() : new list<string>()); //param: not object however, same code works in java: int 2 = 2; double 6 = 6.0; system.out.println(two > 6 ? 2 : six); //param: double system.out.println(two > 6 ? 2 : "6"); //param: object system.out.println(two > 6 ? new arraylist<integer>() : new arraylist<string>()); //param: object what language feature in c# missing? if any, why not added? looking through c# 5 language specification section 7....

Junit test not running testwatcher methods in scalatest -

i have few classes of junit tests wanna use testwatcher class so class extends c { @test def testa = { //tests } } class b class b extends c{ @test def testb ={ //tests } } class c below trait c extends testwatcher { override def failed(er:throwable, des:description) { val writer = new filewriter(new file("d:\\test_"+des.getmethodname+".txt" )) writer.write("false") writer.close() } override def succeeded(des:description) { val writer = new filewriter(new file("d:\\test_"+des.getmethodname+".txt" )) writer.write("true") writer.close() } } it seems when run tests, succeeded , fail methods in c never ran , files never created. i have tried using @runwith(classof[junitrunner]) doesn't work either any ideas?

c++ - Android ndk undefined reference using crypto++ -

so have build static libary of crypto++ android. want build own libary , use crypto++ libary. build use android mk: local_module := mylib local_src_files := staticlibrary3.cpp local_static_libraries := crypt local_ldlibs := -llog include $(build_shared_library) include $(clear_vars) local_module := crypt local_src_files := libcryptopp.a include $(prebuilt_static_library) now when link libary project, lot of errors undefined referneces this: string.c:600: error: undefined reference 'std::__stl_throw_length_error(char const*) or alloc.h:158: error: undefined reference 'std::__node_alloc::_m_allocate(unsigned int&) what have done wrong? your application.mk must define app_stl fits stl settings used prebuilt cryptopp library.

java spring - override property value received from property file -

i have scenario, encoded password value property file. have own implementation of decryption, want decrypt password java class , want use decrypted value further, referred. for example <bean id="mydatasource" class="org.apache.common.dbcp.basicdatasource" ... // more attributed set properties user, hostname etc. p:password="${mypropertey.password}" > above code need implement below, specific password attribute, rest properties fine, password need decrypt before used. (below implementation wrong, have mentioned give more , clear idea) <bean id="mydatasource" class="org.apache.common.dbcp.basicdatasource" ... // more properties p:password="mydecryptbean.decryptmypassword(${mypropertey.password})" > basically, need decrypt password, property file, before used establish database connection. thanks time , !! since using spring highly recommend looking propertyresourceconfigurer class. see...

php - Specific email conditional on Radio Button selected in Form -

thank info here, seem missing make send each particular email address. basis code came thread: send php form different emails based on radio buttons <form name="contact-form" method="post" action="contact.php"> <div class="form_details"> <input type="text" id="field_name" name="sender_name" class="text" value="name"> <input type="text" id="field_email" name="sender_email" class="text" value="email" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = 'email';}"> <input type="text" id="field_subject" name="sender_subject" class="text" value="subject" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = ...