Posts

Showing posts from May, 2012

asp.net - ASP:Repeater not visible after databinding? -

i attempting create simple mobile view of website , list of product categories display on homepage... when try generate list of categories datatable kinda doesn't. nothing visible, if repeater took day off , went home. here's code: dim dt datatable = categories.getmaincategories(request("mainid")) rptcatbuttons.datasource = dt dim catname string = categories.getmaincategoryname(request("mainid")) 'dim catbutton button = ctype(rptcatbuttons.findcontrol("btncategories"), button) catbutton.text = catname rptcatbuttons.databind() and asp: <asp:content id="content1" contentplaceholderid="contentplaceholder1" runat="server"> <script type="text/javascript" src="js/count.js"></script> <asp:repeater id="rptcatbuttons" runat="server"> <itemtemplate> <div class="category-mobile" runat=...

Android - make toast or dialog inside static inner class of activity -

i having problem getting application context inside static inner class: public class mainactivity extends activity { ..... .... public static class smsalerthandler extends broadcastreceiver { @override public void onreceive(context context, intent intent) { .... .... toast.maketext(context, "this toast message!!! =)", toast.length_long).show(); } } } if give context giving exception unable add window — token null not application also if put getapplicationcontext() , showing error cannot make static reference non-static method getapplicationcontext() type contextwrapper yeap, static methods can't use references non-static fields. , context receive receiver not allowed make ui operations, can take in this article shows can each context received. ...

android - Large white box with the word {{query}} appearing in my WebView -

i created unofficial app miscers on @ bodybuilding.com. updated website , ever since i'm getting huge white box comes after page finishes loading. there's no error, doesn't occur on older black theme, doesn't occur on mobile site in browser , doesn't occur on basic webview. wondering if shed light on what's going on {{query}} message. it's impossible search due brackets being stripped every search field. image: http://i.imgur.com/rix7fv1.png

php - How to change Roundcube Objects? -

i'm trying change title of webpages on roundcube email server don't know how or alter roundcube object pagetitle. <title><roundcube:object name="pagetitle" /></title> you're looking (roundcube root)/program/localization/(then language choose)/labels.inc more pagetitle uses $config['product_name'] on config.inc.php in config folder

Json query on button press python / django -

currently stands have search bar , button on homepage so. <div class="input-group"> <input id="address" type="textbox" placeholder="city or zipcode" class="form-control"> <span class="input-group-btn"> <button class="btn btn-default" type="button" id="addresssearch">search</button> </span> </div> i have created api.py file within websites folder looks so. import urllib2 import json locu_api = '****' def loc_search(query): api_key = locu_api url = 'https://api.locu.com/v1_0/venue/search/?api_key=' + api_key locality = query.replace(' ', '%20') final_url = url + "&locality=" + locality + "&category=restaurant" json_obj = urllib2.urlopen(final_url) data = json.load(json_obj) item in data['objects']: print item['name'] print item['phone'] essentially tryi...

android - It seems that your device does not support camera -

i have come across error guess common in opencv apps. when try run app, says "it seems device not support camera(or locked)". have seen this , this , have done whatever have said, granting camera permission , rebooting device etc. still problem persists. know problem means other app must using camera , hence locked. when clear cache of apps using camera might me using camera, works once. after same issue. solution problem? thank you. i have run same problem opencv android, , found going phone's settings -> apps (or similar) -> your app -> permissions , enabling camera permission seems solve problem. hope helps.

ios - Improving UIWebView initialization time -

my company uses uiwebview display ads. issue i'm having initializing uiwebview appears expensive; profiling time profiler shows [uiwebview alloc] initwithframe:cgrectmake(0,0,500,500)] take 31–40ms. enough cause noticeable frame drops in games running @ 60 fps. is there way workaround slow initialization time? current ideas create uiwebview when app launches (but before gameplay has started), , reuse (potentially creating pool of them reuse, how uitableviewcell works) or try , see if wkwebview has better performance. here findings: wkwebview not initialize faster. creating wkwebview s took similar amount of time creating uiwebview s (in 1 test did, took 46ms create 2 wkwebview s. the first web view created takes longer create subsequent web views. first 1 takes 31–42 ms; subsequent ones take ~11ms create. news here creating first web view when e.g. app launches allows future webviews created more cheaply, avoiding 40ms hit while game running. creating poo...

php - jQuery-steps Formwizard and CakePhp not submitting -

i have webform in cakephp application (2.5.4) , , using jquery-steps (1.1.0) in conjunction jquery validate plugin (1.13.1) make multistep form. all seems going well, form not being submitted. have inkling how work? far can tell, end in onfinished event. here view file: <div class="col-lg-11 col-md-10 col-sm-10"> <!--nocache--> <?php if($this->session->flash()) { echo $this->session->flash(); } ?> <?php if($this->session->flash('auth')) { echo $this->session->flash('auth') ;} ?> <!--/nocache--> <?php // output success info if(isset($this->params['named']['success']) && $this->params['named']['success']=='1') : ?> // success message <?php endif; ?> <h1 class="lead">request pricing information</h1> <div class="formwrapper"> <?php echo $t...

node.js - Error sending email using nodemailer via Office365 smtp (MEANjs scaffold) -

i'm trying use office365 smtp send email using nodemailer (in meanjs scaffold), following error: [error: 140735277183760:error:140770fc:ssl routines:ssl23_get_server_hello:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:795:] i'm using following nodemailer options: { host: 'smtp.office365.com', port: '587', auth: { user: 'xxxx', pass: 'xxxx' }, secure: 'false', tls: { ciphers: 'sslv3' } } removing tls field doesn't make difference. missing? the solution simple. 'secure' field should 'secureconnection'. meanjs scaffold generated configs created mailer options 'secure' field. rest of options fine. needs working office365 smtp nodemailer options block, following should work: { host: 'smtp.office365.com', port: '587', auth: { user: 'xxxx', pass: 'xxxx' }, secureconnection: false, tls: { ciphers: 'ss...

php - Count the Number of match Word in Json -

Image
how can possibly count word matches string... matched '201' in this end... <?php $con=mysqli_connect("localhost","root","","project"); function loaddata() { global $con; $listdata=""; $sql=mysqli_query($con,"select fguests,mguests reserved"); while($row=mysqli_fetch_array($sql)) { $mf= array(); $mf[]=$row['mguests'].';'.$row['fguests']; $data = array( 'mf'=>$mf ); $listdata[]=$data; } return json_encode($listdata); } echo loaddata(); ?> this ajax... function x() { $.ajax({ url:"ajax/try.php", type:"get", datatype:"json", data:"", success:function(data) { $.each(data,function(i,item) { var m=item.match(/201/g).length; $(...

How do I get Pillow module to work on Python 2? -

i'm using mac yosemite. "from pil import image" works in terminal, doesn't work in sublime. when run in sublime, "importerror: no module named pil" "import image" doesn't work either. want work sublime, i'm not sure if it's problem editor though seems work in terminal.

java - Class Casting during Marshalling of JAXB -

objective : trying pass class through parameter c class use marshaling directly. error : [com.sun.istack.internal.saxexception2: unable marshal type "java.lang.class" element because missing @xmlrootelement annotation] this error given @ line pointed arrow(-->) comments : if try change c @ line 8 & 9 expression actual class works fine. there way without doing this. class casting no option think. public xmlmarshaller(class c){ try { jaxbcontext jaxbcontext = jaxbcontext.newinstance(c); marshaller marshaller = jaxbcontext.createmarshaller(); marshaller.setproperty(marshaller.jaxb_formatted_output, true); --> marshaller.marshal(c, new file("xmldyna/asd.xml")); --> marshaller.marshal(c, system.out); } catch (jaxbexception e) { e.printstacktrace(); } } this other class in case thinks error missing @xmlrootelement annotations. @xmlrootelement( name = "dynamic") public cl...

c++ - Why Clang++ doesn't run the global object constructor in another static library? -

we have library static_library.a build clang++, , there file bar.cpp include global object foo . but when use library in app layer xcode project, global object foo constructor doesn't been called. (the global object constructor registration job, , impact app behavior.) we think translation unit not linked executable file. //bar.cpp in static_library.a class foo { public: foo() { std::cout << " constructor called" << std::endl; } }; foo a; // <------if function called in app layer project, // global constructor object called. foo* getinstance() { return &a; } so there flag, can control behavior? you need -all_load linker flag. this question has more details. may interested in -objc or -force_load .

php - Styling for an HTML table from database -

Image
i need make results of query appears in table layout prototype showing below. i want know how make picture on left. , sandwich name , price lined on top , description under it. i'm using foreach echo query in table. foreach ($rows $row) { echo "<tr>"; echo "<td><img src=" . $row["image_file"] . "></td>"; echo "<td>" . $row["productname"] . "</td>"; echo "<td>" . $row["description"] . "</td>"; echo "<td>" . $row["price"] . "</td>"; echo "</tr>"; } mine showing this: there several ways this: nested tables rowspan css it depends on want. rowspan { echo "<tr>"; ...

java - Jar file doesn't work outside the project folder -

my jar file doesn't work outside project folder, unless put in same directory lib folder. when run jar command line this: c:\users\computer>java -jar sg.jar exception in thread "awt-eventqueue-0" java.lang.noclassdeffounderror: org/hiber nate/cfg/annotationconfiguration @ view.pessoaview.<init>(pessoaview.java:27) @ view.pessoaview$7.run(pessoaview.java:291) @ java.awt.event.invocationevent.dispatch(unknown source) @ java.awt.eventqueue.dispatcheventimpl(unknown source) @ java.awt.eventqueue.access$500(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.awt.eventqueue$3.run(unknown source) @ java.security.accesscontroller.doprivileged(native method) @ java.security.protectiondomain$1.dointersectionprivilege(unknown sour ce) @ java.awt.eventqueue.dispatchevent(unknown source) @ java.awt.eventdispatchthread.pumponeeventforfilters(unknown source) ...

ruby - Parse and transform text for articles reproduction -

i have input string one: if {decided|planned|wish} {to go|gonna} {camping|have outdoor rest|fishing|hunting}, {may like|need|just need|may use} sleeping bag [product name]. {it|this sleeping bag} {is intended|is ideal} [season] , {designed|sewed|made} [type] {type|form-factor}. now, need things: put values square brackets (ex. [product name] become hard wear mountain) take random words curly brackets , paste (ex. {decided|planned|wish} become planned} so, output string one: if wish go fishing, may sleeping bag hard wear mountain. sleeping bag ideal winter season , designed cocoon form-factor. i know how resolve #1 problem, but have on idea problem #2. also, there can nested square brackets, ex: {some word|{some word2|{some word3|some word5}}|some word4}. so need regular expression ruby, or maybe approach solve problem. suppose our text: text = 'if {decided|planned|wish} {to go|gonna} {camping|have outdoor rest|fishing|hunting}...

compilation - Compiling Fortran netCDF programs with all available libraries -

first of i've read topic can't compile code. compiling fortran netcdf programs on ubuntu i on ubuntu 14.04 , compiling fortran program uses netcdf. have compilation error this: terrain.f:(.text+0x17efd): undefined reference 'ncopn_' terrain.f:(.text+0x18111): undefined reference 'ncopn_' terrain.f:(.text+0x187cc): undefined reference 'ncclos_' terrain.f:(.text+0x187ea): undefined reference 'ncclos_' definitely says have not netcdf fortran librarries. installed zlib, hdf5, netcdf c , netcdf fortran according these web pages disable shared , disable dap options. http://www.unidata.ucar.edu/software/netcdf/docs/build_default.html http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-fortran-install.html this result of nc-config --libs command: -l/usr/local/lib -l/usr/local -lnetcdf -lhdf5_hl -lhdf5 -ldl -lm -lz this result of nf-config --flibs command: -l/usr/local/lib -lnetcdff -l/usr/local/lib -lnetcdf -lnetcdf -lhdf5_hl -lh...

javascript - Running a php script on a phonegap application -

i building app pulls data database. using ajax run php script located on external server , attempting return data json format. every time attempt run function calls script error stating url can not found. have added server domain whitelist in config file. i'm not sure else , appreciated. here code. index.html javascript run php script: $(document).on("pagebeforeshow", "#articlelist", function(){ $.ajax({ url: "http://domain/app/script/getarticlelist.php", type: "post", datatype: "json", data:{catid: catid}, success: function(data){ alert("success"); $("#article-list").empty(); var li=""; $.each(data, function(i,item){ li += '<li><a href="" data-class="artselection" id="'+data[i].id+'">'+...

scala - value mkString is not a value of org.apache.spark.rdd.RDD[Int] -

i changed line: val ratednum = rows.sortby(- _._2).map{case (user , ratednum) => ratednum}.take(20).mkstring("::") to: val ratednum = rows.sortby(- _._2).map{case (user , ratednum) => ratednum}.mkstring("::") but eclipse giving me error hint: value mkstring not value of org.apache.spark.rdd.rdd[int] what error mean? val ratednum = rows.sortby(- _._2).map{case (user , ratednum) => ratednum} this returns org.apache.spark.rdd.rdd[int] not gentraversableonce . although has lot of methods defined makes scala collection of int , it not ( abstract class rdd[t] extends serializable logging ). it's bit promise of collection int . have poll collection out before mkstring results. call .collect() on rdd[int] before perform mkstring . val ratednum = rows.sortby(- _._2).map{case (user , ratednum) => ratednum}.collect.mkstring("::") or can add implicit conversion: implicit def toarray[t](rdd: rdd[t]) = rdd.collect()...

apache spark - Can't zip RDDs with unequal numbers of partitions -

now have 3 rdds this: rdd1: 1 2 3 4 5 6 7 8 9 10 rdd2: 11 12 13 14 rdd3: 15 16 17 18 19 20 and want this: rdd1.zip(rdd2.union(rdd3)) and want result this: 1 2 11 12 3 4 13 14 5 6 15 16 7 8 17 18 9 10 19 20 but have exception this: exception in thread "main" java.lang.illegalargumentexception: can't zip rdds unequal numbers of partitions someone tell me can without exception: rdd1.zip(rdd2.union(rdd3).repartition(1)) but seems little cost. want know if there other ways solve problem. i'm not sure mean "cost", you're right suspect repartition(1) not right solution. repartition rdd single partition. if data not fit on single machine, fail. it works if rdd1 has single partition. when have more data no longer hold. repartition performs shuffle , data can end ordered differently. i think right solution give on using zip , because cannot ensure partitioning match up. create key , use join instead: val...

documentation - How can/should I document injection points? -

let's wrote library class. public abstract class abstractservice { @inject @named("file") private transient java.io.file file; } how can/should expose information injection point, developers can prepare providers?

javascript - Reset View after leaving it - SAPUI5 -

i need reset search-view on button click. means when leave view through "close"-button , go search, supposed reloaded: inputs empty result-table hidden as if reloaded i cant make sure reload view because once called, saved in core , cant deleted, without being unable again. right setting visibility false , true open or close view, cant find magic code here!^^ here happens when press close button: handleschliessen : function () { var p = this.getview('suche'); p.setvisible(false); sap.ui.getcore().byid("handler").getmodel("datenmodel").refresh(true); this.callbackmethod.call(this.callbackobject); }, any great guys, can provide more code if need, long :) my normal approach bind model (visibility result table, results, input fields) , set these model properties initial state when done. for instance, var initstate = { tblvisible : false, searchresults : [], input : "...

mysql: get affected row record after update -

i use 2 sql queries row record after update this, example: step 1: update point user test@gmail.com $sql = "update user set point=point-:point email=:email"; $result = $conn->prepare($sql); $result->bindvalue(':point', 2); $result->bindvalue(':email', 'test@gmail.com'); $result->execute(); step 2: have use sql query row['point'] after updated $sql = "select point user email=:email"; $result = $conn->prepare($sql); $result->bindvalue(':email', 'test@gmail.com'); $result->execute(); $row = $result->fetch(pdo::fetch_assoc); echo $row['point']; so, question is, ther shortcut this? such 1 single query achieve this? many thanks

html - Amatic SC normal 700 - rendering issue with question mark character? -

Image
i'm using amatic sc 700 normal google fonts. link on google fonts : https://www.google.com/fonts/specimen/amatic+sc . the issue right char ? converted in ® . the css code used is: @import url(http://fonts.googleapis.com/css?family=amatic+sc:400,700); body { font-family: 'amatic sc', cursive; font-style: normal; font-weight: 700; } the html looks : <html> ???? </html> this screenshot of issue : this jsfiddle link: http://jsfiddle.net/m4vev43a/ i tested issue on: chrome version 42.0.2311.90 firefox 37.0.1 opera 12.16 any idea how can fix this? browsers getting crazy? or it's bug in font? update: when using : @import url(http://fonts.googleapis.com/css?family=amatic+sc); so without suffix :400,700 question mark character displayed properly. unfortunately using above code + bold text totaly messing letter spacing in chrome, firefox, opera. this known issue bold version of amatic font, can s...

c# - regex works in online regex tester but not in .NET -

the following demo works fine online not when attempt run in c#/.net var regex = new regularexpressionattribute(@"@(?!.*?\.\.)[^@]+$"); assert.istrue(regex.isvalid("bob@bob.com")); here link post explain regex , trying the regularexpressionattribute requires full match of string. in case, matching starting @ @ character, start somewhere in between of string. not enough regularexpressionattribute. can think of adding implicit ^ @ start expression (and implicit $ @ end too, can drop well). so fix this, need make sure has match @ start to, e.g. .*? : new regularexpressionattribute(@".*?@(?!.*?\.\.)[^@]+"); and works. don’t need other regular expression flags. unfortunately, behavior of regularexpressionattribute mentioned in documentation. can verify in reference source however: // looking exact match, not search hit. matches // regularexpressionvalidator control return (m.success && m.index == 0 && m.l...

lotus notes - Run Time design change in lotusnotes -

i need change name , formula of columns of embedded view in lotus notes dialog box.i need change column name , formula when combo box value in dialog box changes.i added lotus script change column name , formula on combo box value change , added code reopen dialog box. dim w new notesuiworkspace dim view notesview dim col notesviewcolumn set view = db.getview("test") j= 0 ubound(sboxcolname) set col=view.columns(j) col.title=sboxcolname(j) col.formula=sboxcolformula(j) next call w.viewrefresh() but view column not updated in next open, gets updated when open view in designer , save view. when open view in designer can see column updated in design. there way embedded view column updated in runtime in past used code in server agent, has worked fine. changed datetime value in column coloring rows (copy column , change formula). after had send command rebuild view in db. set view = db.getview(*viewname*) set clm = view.columns(3) set new...

java - What can I do if Liskov Substitution Principle is violated? -

liskov substitution principle (lsp) states if object o1 type of s , can substituted object o2 type of t without violating original behavior(s) of users, s subtype of t. the common example used show lsp violation rectangle , derivative type, square. argument although intuitively square seems subtype of rectangle, there behavior of square different rectangle. conclusion square cannot subtype of rectangle lsp. all explanations discovered end there , find not helpful. want know should if have problem? create s not subtype of t, , what? solutions have solve it? can please enlighten me answer overhanging question? edit: rather elaborating example here, refer article . you can use 'has a' or 'uses' relationship if can not establish 'is a' relationship. this means instead of having class b inherit class a, can have class b contain instance of class a. coding practice avoid tight coupling between class , class b.

Is there a well-known algorithm for allocating planks to trucks? -

i have implement algorithm described below, , have 2 questions: is problem np-complete? is similar well-known algorithmic problem? the problem i have planks of wood of 3 lengths: 10m, 8m , 5m. i need transport these 1 place another. i have 3 types trucks can use this, truck a, truck b , truck c. each truck can carry @ 10 planks, truck can carry types of planks, , truck b can carry planks of 8m , 5m, , truck c can carry planks of 5m. each truck has own price list transporting planks: truck 1 plank $50 2-5 planks $100 6-10 planks $150 truck b 1 plank $30 2-5 planks $90 6-10 planks $140 truck c 1 plank $20 2-5 planks $80 6-10 planks $110 the goal of algorithm: find cheapest way transport collection of planks. example: have 5 planks of 10m, , 1 plank of 8m. there 2 possible distributions: 6 on truck a: $150 5 on truck , 1 on truck b: $100 + $30. so option 2 best. start solving more planks, number of possible combinations grow. the specific pricelist...

Octet String in SNMP has a value 8? -

hi have packet capture wireshark . i have opened file , saw below output in variable bindings. object name: .1.3.6.1.4.1.193.183.4.1.4.5.1.8(iso.3.6.1.4.1.193.183.4.1.4.5.1.8) value(octect string ) : 353038 can find integer value of octect string ? octect string , octal value mean same ? if , can octal value contain 8 in 353038 .. ? please guide how know integer value of octect string : 353038 octet strings defined octet string in asn.1 , snmp. there nothing called "octect string". meanwhile, octet strings have little relationship octal numeric system. when see 353038 octet string, means on wire snmp packet have arrived, , contains string of ascii characters "3", "5", "3", "0", "3", , "8". string nature, , not need integer (unless definition of .1.3.6.1.4.1.193.183.4.1.4.5.1.8 in corresponding mib document mandates fact). most of questions above invalid, misunderstood concept of octet str...

How to handle Javascript click by using selenium Webdriver? -

am using selenium webdiver. test-case is. login site. click on notifications link. am facing issue while clicking on notification link, having html code follows :- <ul class="rghtsec fr menu logged"><li><a href="javascript:;"> <div class="topicon notify"><span>&nbsp;</span></div> <div class="mtxt">notifications<span id="rjobcntr" class="rjobcntr"></span></div></a> <div class="submenu recommendtt"> <ul> <li><a target="_blank" class="blob" id="blobid" href="http://jobsearch.naukri.com/notifications"> fetching jobs may apply for</a></li> </ul> i have tried following 5 different ways: /*1*/ driver.findelement(by.xpath("//a[@class='mtxt']")).click(); /*2*/ driver.findelement(by.cssselector("div[class='t...

android - Replicate dynamic views in xcode -

Image
i have android app following setup: a slide out menu heading item & sub-items a view represent every heading item in menu access sub-items of main header see below walkthrough of views. how can replicate functionality in xcode? screenshots display android version of app. there frameworks allow me implement this? if not design pattern should use? in android version used following classes: pageslidingtabstripfragment public class expandablelistadapter extends baseexpandablelistadapter public class cardfragment extends sherlockfragment public class contentlistadapter extends arrayadapter thanks when create view slide out, set frame negative view remain on left hand side of home view.when press top left button use animation , change slide view frame on home view. for expanding table cells,you can use following third party library - skstableview. https://github.com/sakkaras/skstableview

c# - What is the alternative for DisplayMemberPath="Value" for Windows Store applications? -

i think there bug windows store applications when comes using displaymemberpath="value". here code <combobox height="40" verticalalignment="stretch" selectedvaluepath="key" displaymemberpath="value" x:name="combobox1" fontsize="25"/> var source = new dictionary<string, double>(); source.add("item1", 0.4); source.add("item2", 0.3); source.add("item3", 0.1); source.add("item4", 0.1); var formatedsource = new dictionary<string, string>(); foreach (var item in source) { formatedsource.add(string.format("[{0}, {1}]", item.key, item.value), item.key); } combobox1.itemssource = source; if use code in wpf in works perfectly. if use code in windows store application combo box empty , error thrown. there alternative way ...

Group by query behaviour in mysql -

table in mysql contains below records: +----------+----------+-----------+---------+-------+ | personid | lastname | firstname | address | city | +----------+----------+-----------+---------+-------+ | 1 | kumar | amit | sec-22 | noida | | 2 | kapoor | x | sec-24 | noida | | 3 | kapoor | y | sec-22 | delhi | | 4 | kapoor | z | sec-25 | delhi | | 5 | kapoor | w | sec-25 | gzb | +----------+----------+-----------+---------+-------+ when run below query: select city, firstname persons group city; below result shown: +-------+-----------+ | city | firstname | +-------+-----------+ | delhi | y | | gzb | w | | noida | amit | +-------+-----------+ i don't understand why firstnames each city not shown in table, there 2 records present noida , delhi each , 1 gzb please me understanding behaviour. @amitsh...

unit testing - Run MsTest separately from Visual Studio -

i looking tool either command line or gui copies changed assemblies solution separated folder - new build afterwards not influence test run. afterwards should executed configurable set of tests (only assemblies, filtering testcategories). when finished test results should shown. is there tool or set of tools these tasks? mstest.exe run test not copy necessary assemblies. using combination of mstest command line tool (or visual studio runner) in combination post-build step copy assemblies locally not good, because slow down every build, not run tests locally every time build solution. write little script copies necessary assemblies locally beforehand. hoping tool without me having write script. copy files to copy assemblies commandline can use standard copy command. copy "changed" assemblies harder, unless you're doing incremental builds. xcopy, copy suffice here. msbuild other tool can use copy files. can create post-build event or custom target do...

linq - Cannot create a model from a preexisting database in Postgresql, .NET provider for postgresql doesn't exist -

Image
i'm having problem that's blocking me on 4 days now. i'm developing wcf webservice , tried connecting postgresql database via visual studio 2010. installed npgsql, entityframework, linqtopostgresql, , devart dotconnect postgresql, shaolinq... nugetpackage manager. installed entity developer. i managed create connexion postgresql database, when try create model out of database (i add new devart linq sql model item), postgresql provider doesn't show in combobox! here screenshots more clarification : here in provider combobox 3 choices : .net framework data provider microsoft sql server compact 3.5 .net framework data provider microsoft sql server compact 4.0 .net framework data provider sql server here's screenshot references added project : thanks in advance help! the work-around managed apply moment using npgsqlcommand directly code , connecting database. can't use database entities classes @ least trick, now. still hope enli...

javascript - php echo alert message with new line '\n' not working -

i have message show using alert() $message = "no result found following info:name: ".$fullname."ic: ".$id." in database."; echo "<script>alert('".$message."'); window.history.back();</script>"; this working if add new line '\n' message $message = "no result found following info:\nname: ".$fullname."\nic: ".$id." in database."; it not show out pop out message. problem? edit not change newline in php, instead in javascript: 'no result found following info:\nname: '.$fullname.'\nic: '.$id.' in database.' ^ ^ ^ ^ ^ ^ or adding backslash: "\\n" . according panther, truth: use 'alert("' . $message . '")' .

javascript - Link from other site should open the first link of the site -

have @ site below, delete later:- [career page][1] on page, if come other website facebook/ linked in, should this:- ![image 1][2] and if visit same site, should below:- here js code related that. please suggest do:- function pageload() { $("#careerdiv").accordion({ collapsible: true, autoheight: false, active: false }); $("a#various15").fancybox({ 'width': 720, 'height': 390, 'autoscale': false, 'transitionin': 'elastic', 'transitionout': 'elastic', 'type': 'iframe', 'speedin': 600, 'speedout': 400, 'overlayshow': true, 'overlayopacity': 0.8, 'overlaycolor': '#000', 'padding': '0px', '...

responsive layout for all devices using bootstrap -

<div class="jumbotron vertical-center bgpurpletextoffwhite"> <div class="container"> <div class="row"> <div class="col-xs-2 col-sm-5 col-md-5"> </div> <div class="col-xs-3 col-sm-1 col-md-1"> <img src="./assets/images/pmflogo-transparent.png"/> </div> <div class="col-xs-7 col-sm-6 col-md-6"> <br> <h3>put me first </h3> </div> </div> </div> this code. want responsive devices, not behaving responsive @ present. distance between image & text changing resize browser window. want disatnce remain fixed throughout every device/size

How can I pass file using javascript/jQuery/JSON/Ajax to Insert into database as a blob? -

this question has answer here: how can upload files asynchronously? 25 answers i'm using front-end angularjs, there file upload option. when upload file pass back-end java web services , insert database. flow have do. my problem is, how can pass file using json ajax web services, please let me know further questions required. thanks in advance. ajax doesnt support file uploading. can use formdata fileupload work html5 supported browsers.and if want work older browsers can use iframe form fileupload. var form = $('form')[0]; var formdata = new formdata(form); $.ajax({ url: 'submitnewsection.html', data: data, type: 'post', success: function ( data ) { alert( data ); } });

PouchDB local storage with Android Webview -

Image
i use pouchdb synchronize local storage database remote couchdb database. in chrome, can see content of local storage slots (websql, indexeddb...) pourchdb inspector (add-on chrome) or tab ressources in developer tools: do know if possible content of local storage in android webview? if understand use chrome debug tools on android device? if maybe link can : https://developer.chrome.com/devtools/docs/remote-debugging#debugging-webviews

plone - When I upload a portrait, under some conditions the filename field is not set -

since filename set empty string ('') in fileupload field, not pass validation in zope.formlib. in these cases, no error raised , field quietly ignored. i not sure problem is. same file works , not work @ other times. any ideas?

java - Set two styles for a single cell -

how can set 2 different styles single cell? showing cell value in bold currency format eg: 2,300 . expected o/p: 2,300 but last style overrides earlier one, , can later property. xssfcellstyle my_style = (xssfcellstyle) wb.createcellstyle(); xssffont my_font=(xssffont) wb.createfont(); my_font.setboldweight(xssffont.boldweight_bold); my_style.setfont(my_font); xssfcellstyle currencyformat = (xssfcellstyle) wb.createcellstyle(); xssfdataformat df =(xssfdataformat) wb.createdataformat(); currencyformat.setdataformat(df.getformat("#,##0")); setting data here rowsavingstotal.createcell(a).setcellvalue(2300); rowsavingstotal.getcell(a).setcellstyle(my_style); rowsavingstotal.getcell(a).setcellstyle(currencyformat); you can put 1 style on cell. merge 2 of them : xssfcellstyle my_style = (xssfcellstyle) wb.createcellstyle(); xssffont my_font=(xssffont) wb.createfont(); my_font.set...

java - How to resize image's dpi from 96dpi to 72dpi -

i resize cellphone's images 731*974,but still has 920kb. want change image resolution 96dpi 72dpi(because found pictures in iphone 72dpi,and looks good). can give clue job? first thank all. you might want have @ this . in android resolutions differ lot, 1 image might not suitable phone resolutions.

git tag - Get tags below a particular tag in git -

i trying find out tags less given number. have assigned numbers 1 2000 tags git . now, want display tags below particular tag number. for example, query number (tag) 1234 , want git display tags less 1234 . how can that? to make sure understand, want compare tag names numerically? don't want compare tags in terms of commit ancestry? if so, following shell code should work: git tag | grep '^[0-9]*$' | while ifs= read -r tag; [ "${tag}" -ge 1234 ] || printf %s\\n "${tag}" done the above tells git print tags, filters out non-number tags, loops on each numerical tag comparing numerical value. if it's less value, tag name printed.

Parsing string input C# -

let's have string bound console input , must contain date data in of following formats: "dd/mm/yyyy" "dd.mm.yyyy" "dd,mm,yyyy" what safest way parse string datetime object? should use regex approach or iterate through string.format() method possible upper mentioned input formats till succeeds in parsing? it's not enough use datetime.parseexact or datetime.tryparseexact. / special formatting character, date separator character. in format string replaced whatever date separator application's current culture. can't escaped because not special character \ . cause problems if system's culture uses . (russia , other countries). to specify different date separator need create cultureinfo object separator want. following function accepts list of separators , tries parse dates using each separator until 1 of them succeeds: public static bool tryparsedate(string input, string[] separators, out datetime date) { var c...

C# - backgroundworker getting data continuously from Arduino via serial -

so have c# application getting values (6 variables) arduino. used timer calls read functionts every 100ms hangs ui , responds little heavy. want use backgroundworker continuously reads variables. put read calls in dowork method , put values in variables c# , assign them in label or something. doesn't work. (sorry english) namespace testtemp { public partial class tempreaderform : form { public tempreaderform() { initializecomponent(); } communicator comport = new communicator(); boolean portconnection = false; string red_light1; private void button1_click(object sender, eventargs e) { if (comport.connect(57600, "i'm arduino", 4, 8, 16)) { label1.text = "connection successful - connected "+comport.port; portconnection = true; backgroundworker1.runworkerasync(); // not sure if here should start backgroundworker. } ...

request - Http response code on demand -

i need test behavior of app i'm developing in front of different http response codes. know site or program returns http response http code want? not sure have understood need... maybe can try this: http://www.gethttpstatuscode.com/

How can I assign gulp node module in gradle-gulp-plugin? -

default location of node modules 'node_modules' directory in root of project. changed directory 'grunt' folder located in second depth of root directory. have let plugin know location of node_modules has gulp module. if do, plugin execute build. how can achieve this? afraid plugin not popular right , there nobody knows it. it's hardcoded, cannot change directory. in plugin source - https://github.com/srs/gradle-grunt-plugin/blob/master/src/main/groovy/com/moowork/gradle/grunt/grunttask.groovy private final static string grunt_script = 'node_modules/grunt-cli/bin/grunt'; if want in directory, maybe create own plugin , extend current gradle-grunt plugin or modify , submit pull request.

osx yosemite - Weird behaviour with zsh PATH -

i encourage weird problem zsh today. my environment mac os x yosemite, zsh 5.0.5 (x86_64-apple-darwin14.0) in .zshrc, have manually set path variable like export path="$path:~/.composer/vendor/bin" try echo $path in terminal, result expected (contained ~/.composer/vendor/bin ). try executing binary ~/.composer/vendor/bin , it'll return me "zsh: command not found" error. try switching bash, echo $path expected, have same result zsh shell. try executing binary ~/.composer/vendor/bin , no problem found. seem path var acting on bash shell. what's wrong zsh shell? thanks try using $home instead of ~ . in many situations, shells not expand ~ when expect them , better use $home . ~ intended short cut interactive use. (the case can recall ~ preferred in .gitalias, ~ expanded , variables not.)

apiblueprint - How to response for wrong passed parameter in Apiary? -

i saw following action section inside of apiary blueprint examples. want response http status 404 when user passes wrong parameter. example when user passes /questions/xyz instead of /questions/1. can see defined parameter after /questions must number when passed xyz itstead of number answer same object. ## questions [/questions/{question_id}] questions object has following attributes: + question - can put description each attribute here. + published_at - iso8601 date when question published. + url (string) + choices - array of choice objects. + parameters + question_id: `1` (number, required) - id of questions in form of integer ### view questions detail [get] + response 200 (application/json) { "question": "favourite programming language?", "published_at": "2014-11-11t08:40:51.620z", "url": "/questions/1", "choices": [ ...

AngularJS - Request timeout although resource exists -

i've created web application on raspberry pi, 1 have http requests gateway (the gateway , raspberry pi on same network). http requests made in angular, that: $http.get("http://192.168.3.9:8081/command=get?token").success(function(data){ console.log("token is: "+data); }).error(function(data, status, headers, config){ console.log("unable find token"); console.log(data); console.log(status); console.log(headers); console.log(config); }); now here there's problem, expected either have response or have error cors instead receive error says me requests ended due timeout. not possible because request url absolutely correct. how solve problem? p.s.: information useful: gateway , raspberry pi in home network, connect pc raspberry office network. the issue here have $http.get running in client's browser. therefore have 2 separate problems - need able resolve ip address/url, , need port number reach host. ...