Posts

Showing posts from April, 2014

c# internet explorer control , make style none as if wpf window style none and allowtransparency -

i wonder, there way make internet explorer style none window wpf application. thanks, code : public static void test() { system.type otype = system.type.gettypefromprogid("internetexplorer.application"); shdocvw.internetexplorer ie = activator.createinstance(otype) shdocvw.internetexplorer; ie.menubar = false; ie.toolbar = 0; ie.statusbar = false; ie.addressbar = false; ie.width = 800; ie.height = 600; ie.visible = true; ie.navigate("http://m.naver.com"); } i don't know way achieve shdocvw.internetexplorer, use system.windows.controls.webbrowser : window window = new window(); window.windowstyle = windowstyle.none; window.resizemode = resizemode.noresize; window.width = 800; window.height = 600; webbrowser webbrowser = new webbrowser(); webbrowser.navigate("http://m.naver.com"); window.cont...

regex - Scrapy not crawling all links -

i using scrapy crawl , scrap site of fixed domain . want crawl site matches fixed regular expression , ignore rest. code works returns around 10-15 pages out of atleast 1000 pages. code is: name = "xyz" allowed_domains = ["xyz.com"] start_urls = ["http://www.xyz.com"] rules = (rule(sgmllinkextractor(allow=[r'\/v-\d{7}\/[\w\s]+']),callback='parse_item'),) def parse_item(self, response): sel = selector(response) title = sel.xpath("//h1[@class='no-bd']/text()").extract() print title can please tell me doing wrong ? i don't think code problem, site crawling has limit how many requests handle specific ip in given period. try implementing sleep(2) calls in between , see if makes difference.

asp.net - how can I input and display the data via the database quickly? -

i have webpage in users input data , data supposed stored in database , @ same moment should displayed in display section. i have trivial question please. how can take result database displayed same moment user inputs in database? cronjob, checks database every second new results have been input or not? e.g. have registration form register properties in property webpage. if user submits form database, how can keep checking whether database updated or not? users expect property listing displayed on webpage within second

Form with icon on Bootstrap v3.1.1 -

i cannot show double icon bootstrap v3.1.1. when using old version bootstrap class "icon-user" work not glyphicon icon bootstrap v3.1.1 <div class="col-xs-6" > <div class="left-inner-addon"> <i class="glyphicon glyphicon-user"></i> <input type="text" class="form-control" placeholder="username" /> <br> <i class="glyphicon glyphicon-book"></i> <input type="text" class="form-control" placeholder="password" /> <br> <input class="btn btn-success" type="submit" value="submit"> </div> css style .left-inner-addon { position: relative; } .left-inner-addon input { padding-left: 30px; } .left-inner-addon { position: absolute; padding: 10px 12px; pointer-events: none; } .rig...

jquery - addClass in $(window).resize function .on('click' not working -

please have @ jsfiddle link http://jsfiddle.net/3arqa/ if background orange means ul has mobile-nav added class name else background yellow. now if orange , click on link should alert here, nothing happen. if uncomment line in $(document).ready(function.... it work, if add class in markup section. what doing wrong? want class mobile-nav to toggle depending on screen size , of course on.('click' working if have class ul.nav.mobile-nav... here code, help! <span class="show-window-width"></span> <ul class="nav"> <li> <a href="#">one</a> </li> <li> <a href="#">two</a> </li> <li> <a href="#">three</a> </li> <li> <a href="#">four</a> </li> </ul> <script type="text/javascript"> var d = {}; d.winw = $(window).wi...

oop - Polymorphism Error C++ -

i'm trying create object these classes , error in main() on line: employee1->employeeid(29); the error says "employeeid set protected" , should work. appreciated thx :) here's code below: code deleted* well compiler correct, employeeid protected. sure didn't mean use setemployeeid instead? e.g. employee1->setemployeeid(29);

ruby on rails - Division of labour: Capistrano vs Chef -

where draw line between provisioning (chef) , deployment (capistrano)? for example, take creating nginx , unicorn setup rails. installing nginx chef territory. things configuration files ( nginx.conf , unicorn_init.sh ) , unicorn config ( unicorn.rb )--how divide up? the official capistrano 3 tutorial makes no mention of related web or app server configuration. so responsibility these? this opinion-based, i'll answer anyway. you draw line wherever want draw line. chef's main guiding philosophy is: you know infrastructure best... some organizations use chef setup shared folders, links, assets, etc (like cap deploy:setup does). organizations just manage infrastructure bits (users, permissions, software installed). , organizations deploy entirely chef (no capistrano @ all). it's personal preferences , organizational culture.

Counting presence of discount ranges in SQL -

i have simple orders table product being sold has column discount per order. example: order number discountprcnt 1234 0 1235 10 1236 41 what create output can join order table customer table , group discounts ranges email, follows: email_address 0-20 20-50 50-100 joe@abc.com yes yes tom@abc.com yes yes so idea determine if each customer (here designated email) has ever received discount in specified range, , if not, should return null range. a simplified version of table structure is: customer table: custid email 123 joe@abc.com 234 tom@abc.com 456 joe@abc.com so emails can repeat across customers. orders table: custid orderid amount discprcnt 123 1234 50.00 0 234 1235 75.00 10 456 1236 20.00 41 select c.email, count(o1.order_number), count(o2.order_number), count(o3.order_number) customer c, order o1, order o2, order o3 c.custid = o1.cus...

java - Resetting a new thread repetitively -

in program, there button, "display", , button, "reset". user enters number of prime numbers want in text field , clicks "display" button. then, first x prime numbers appear in text area. in code, have: declarations: thread go; thread newthread; jlabel howmanylabel; jtextfield howmany; jbutton display; jbutton reset; jtextarea primes; action event: public void actionperformed(actionevent event) { object source = event.getsource(); if (source == display) { display.setenabled(false); if (go == null) { go = new thread(this); go.start(); } else { newthread = new thread(this); newthread.start(); } } else if (source == reset) { display.setenabled(true); howmany.settext(" "); primes.settext(" "); } } run method: public void run() { int quantity = integer.parseint(howmany.gettext()); int numprimes = 0; ...

excel vba - Enter a number into a message box then replace numbers in a macro -

i have following macro. when run macro message box appear asking file number. file number replace 000 in macro , macro run. application.screenupdating = false range("c4:d4").select activecell.formular1c1 = "000" sheets("sale ()").select sheets("sale ()").name = "sale (000)" activeworkbook.save sheets("sale (000)").copy before:=workbooks("sales index.xls").sheets(2) windows("sales index.xls").activate sheets("index").select range("b3").select selection.entirerow.insert range("a3").select activecell.formular1c1 = "000" range("a3").select activesheet.hyperlinks.add anchor:=selection, address:="", subaddress:= _ "'sale (000)'!c9" selection.font.underline = xlunderlinestylenone range("b4:f4").select selection.copy range("b3").select activesheet.paste application.cutcopymode = false activecell.formular...

javascript - Text Will Not Fill Up Div -

i designing stat board call center , having trouble getting 2 elements size correctly. have used automatic text resizer called fittext(link below). have gotten every other element work fittext except 100% , 100 listed in code. cannot figure out why 100% , 100 stay small compared sizes of divs contained in. both containers 100% width. have played around hundreds of css combinations no avail. appreciated. via requests below, here jsfiddle link. http://jsfiddle.net/neggly/57tvw/ css #wrap { position: absolute; height:100%; width:100%; margin:0 auto; background-color: black; } #statuscolorwrap { background-color: aqua; float: left; width: 1%; height: 100%; } #numberwrap { background-color: #ff0; float: left; width: 20%; height: 100%; } #announcementwrap { background-color: coral; float: left; width: 79%; height: 100%; } #queuewrapper { height:40%; width:100%; float: top; background-colo...

java - Uncaught SyntaxError: Unexpected token ILLEGAL -

i have following code (jsp) <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <script type="text/javascript"> $(document).ready(function() { <c:foreach items="${messages}" var="msg" varstatus="i"> alert("${msg.description}"); </c:foreach> }); </script> ans messages arraylist passed jsp controller. model.addattribute("messages", messages); return "the_above_jsp"; this working fine until description value hold following string value. new task assigned project hip tensile strength analysis : data management/analysis task due date 20140408 when description has value show error uncaught syntaxer...

javascript - Iterating over a 2D array -

here json object: { "status": "ok", "user": { "auth_token": "xxxxxx", "name": "john dot", "pictures":["http://xxxxx.com/me/picture"], "nickname":"tg", "yob": "1986", } } var pjson = json.stringify(this.responsetext); pjson = json.parse(pjson); i interested in getting keys , values in user object. tried each loop: for (var key in pjson.user) { console.log('here'); console.log(key); } didn't work. not sure why, idea why - cheers.

android - libgdx sharedPreferences -

i have been struggling long. can 1 take @ code , tell why cannot find saved file. public static void save(){ try{ filehandle filehandle = gdx.files.local("data/testscore.xml"); filehandle.writestring("test", false); gdx.app.log("settings", "saved " ); boolean exists = gdx.files.internal("testscore.xml").exists(); gdx.app.log("settings", "loaded " + exists); }catch(throwable e){ gdx.app.log("settings", "not saved " + e); } } my log cat 04-04 17:31:18.863: i/settings(14274): saved 04-04 17:31:18.873: i/settings(14274): loaded false fixed boolean exists = gdx.files.local("data/testscore.xml").exists();

jquery validations are not working on IE10 -

here using validation on form. works on chrome, firefox gives problem in ie10. of validations not working email, telephone. , problem on html pages. $('#contact').validate({ onfocusout: function (element) { $(element).valid(); }, rules:{ prenume:{ required:true, }, nume:{ required:true, }, email:{ required:true, email:true }, password_new:{ required:true, }, telefon:{ required:true, }, address:{ required:true, }, password_repeat:{ required:true, } }, messages:{ prenume:{ required:'<div style="color:red; padding-left:0px;" >acest c&#xe2;mp este obligatoriu.</div>', }, nume:{ required:'', }, email:{ required:'<div sty...

c# - Submit button not Firing -

i have webform app has submit button store sql server. here code it. try { sqlconnection insc = new sqlconnection(@"data source=2011-goa-rcc3\sqlexpress;initial catalog=s.i.-dbase-web;integrated security=true"); insc.open(); sqlcommand cmnd = new sqlcommand(); cmnd.connection = insc; cmnd.commandtext = "insert global_dcr(sr_no, comp_id, br_code, br_name, region, node, comp_date, comp_time, wan_ip, network_type, circuit_type, ciruit_id, mlln_id, cbs_atm_tba, link_stat, call_cat, problem_des, backup_work, status, resolved_date, resolved_time, total_downtime, bsnl_details, docket_id, action_owner, remark) values(@sr_no, @comp_id, @br_code, @br_name, @region, @node, @comp_date, @comp_time, @wan_ip, @network_type, @circuit_type, @ciruit_id, @mlln_id, @cbs_atm_tba, @link_stat, @call_cat, @problem_des, @backup_work, @status, @resolved_date, @resolved_time, @total_downtime, @bsnl_details, @docket_id, @acti...

android - How detect when the phone enters into a nfc field using card emulation -

i'm using card emulation uicc se (no hce). min api sdk 17 , target 19. as far remember in android 2.x intent aware app if phone goes nfc field, field_on intent. ¿is there anyhow nowadays? the ndef detection is, obviously, not valid me far i'm passive one. situation is: "hey you're being reading active element". thank you browsing through current aosp source , nfc service on gs4, there couple of intents/broadcasts want: this seems sent when external rf field activates secure element: com.android.nfc_extras.action.rf_field_on_detected this seems sent when application on se selected: com.android.nfc_extras.action.aid_selected this seems sent when apdu received se: com.android.nfc_extras.action.apdu_received this seems sent when se activated: com.android.nfc_extras.action.se_listen_activated this seems sent when se's mifare functionality accessed: com.android.nfc_extras.action.mifare_access_detected moreover, found following...

php - Matching ONLY Numbers / Persian Characters And Latin -

i need regex code matches numbers/persian characters , latin ( a-z ) i wrote following code preg_match("/[a-za-z\s\x{0600}-\x{06ff}0-9_\.\- ]/u",$_post['input'] ) and works fine . but there problem, dont want input have ( @,#,!,%,$,&,* ) characters . any ideas? just use negative lookahead assertion in regex check there no such character. place @ beginning of regex. mean after / . (?!.*[(@#!%$&*)]) for example: preg_match("/^(?!.*[(@#!%$&*)])[a-za-z\s\x{0600}-\x{06ff}0-9_\.\- ]+$/u",$_post['input'] )

security - Can a man-in-the-middle intercept an SSL packet and duplicate it? -

afaik, ssl encrypt message under secure. still have concern whether or not man in middle can catch packet , duplicate e.g. 1000 times application data broken small segments (implementation dependent size, <=16kb). segment is compressed given sequence number added mac (sequence number included in mac calculation) encrypted given ssl record header contains sequence number note role of sequence number in process. if man-in-the-middle duplicates 1 such segment, received can detect using sequence number. , attacker cannot forge sequence number since included in mac record header. sequence number gives ssl protection against duplication, deletion, reordering , replay attacks.

python - Generating pdf & midi from musicxml -

i've been trying load musicxml file, edit (removing several parts), , create pdf sheet document + midi/mp3, of using python. i've first looked @ music21 , load musicxml file right, far find, not output proper file (all details in output files have disappeared, that's left notes , title) then found abjad looked promising. did output great quality ly/pdf files, there no musicxml imported. then, discovered lilypond comes musicxml2ly script. able call , result lilypond file in python using sh (great lib !) abjad lilypond parser not parse (the doc says parses "large subset" lilypond, without more precisions). finally, found music21 had exporter abjad python objects seems not present in codebase anymore , source code exporter exported notes. i'm little out of options, achieve these goals ? (additional point : still don't know how i'm going second part, going midi/mp3 using soundfonts, may not hardest part. suggestion ?) if have...

php - Javascript copy & symbol from div to input malfunction -

i cannot find answer question... the problem. javascript copying text div input (textbox), fails copy & & , , copies &amp; . see code plus example. i have following code (on different pages, simplify put here): input want text copied. <input name="artist" id="txtartist" type="text" placeholder="introduce artist" /> div text copied from. data populated sql database. <div id="art0"><div onclick="copytext(0)">mumford & sons</div></div>' the function fails... function copytext(rowid){ var content = document.getelementbyid('art'+rowid).innerhtml.replace(/<\/?[^>]+(>|$)/g, "\n"); document.getelementbyid("txtartist").value = document.getelementbyid('art'+rowid).innerhtml; document.getelementbyid("txtartist").value = content; } expected result inside textbox: mumford & sons actual result ins...

java - Compressing a given image n times using huffman coding technique -

i writing program in java in takes input user how many times given image needs compressed, based on should compress image. initially convert image pixel matrix, find probabilities of each pixel appearing in matrix , apply huffman code obtain code in form of 0's n 1's. now if try compress 2nd time have 2 probabilities i.e of 0 n 1.hence cant apply huffman code now. so can done in situation? you apply arithmetic code on 2 symbols. if, example, there many more zeros ones arithmetic code reduce total number of bits encoding zeros each less 1 bit, , ones more 1 bit. (this done considering output bits binary fraction, , each new input bit reducing range of binary fraction.) however find after compressing using huffman codes, have close same number of ones zeros. not compressible way. or way.

c++ - How to colorize selections in ncurses? -

i'm working on roguelike right in ncurses , c++. right i'm coding title screen, looks this: game name company name (n)ew game (q)uit but i'd user able use arrow keys highlight selection , maybe reuse functionality later inventory screen. problem can't figure out how colorize new game , not quit when selected , vice versa. far code this: mvaddstr((height-1)/2, ((width-4)/2)-(newgame_button.length()/2),newgame_button.c_str()); mvaddstr((height+1)/2, ((width-4)/2)-(quit_button.length()/2),quit_button.c_str()); mvaddstr((height-10)/2, ((width-4)/2)-(titlename.length()/2), titlename.c_str()); mvaddstr((height-8)/2, ((width-4)/2)-(companyname.length()/2), companyname.c_str()); then have key handler. tried this: if(ch == key_down) { start_color(); init_pair(1, color_blue, color_black); attron(color_pair(1)); attroff(color_pair(1)); } but doesn't work. i'm pretty new ncurses totally obvious overlooking. thanks! the best/easiest wa...

Python function misbehaves when called multiple times -

i wrote function in python create simple 4 column table in html. when call file, returns table correctly. issues arise, however, if called multiple times in single script. first 1 appears ought to. second time called, of rows beneath title row have 6 columns (two blank) instead of four. third time, there ten columns (six blank). i started coding recently, don't know what's going on behind scenes here. when function called twice or more times in succession, new instance of function called? variables 'reset' speak? this code of called function: def fourcolumntable(title1, list1, title2, list2, title3, list3, title4, list4): error = 0 #check lists of same length if(len(list1) != len(list2) or len(list1) != len(list3) or len(list1) != len(list4)): error = 1 table = "error: lists must same length" if(error == 0): tablelist = [] #append <table> tag tablelist.append('<table class="ta...

mysql - PHP: if condition then redirect1 else redirect2 -

i'm trying make simple check here. want select db record represents username , password. problem if starts. whether i'm putting in form credentials exist in database or not still don't redirected. besides using mysqli_num_fields($result) , tried using mysqli_num_rows($result) , still doesn't work. starting drive me nuts. also tried var_dump of $result , got this: object(mysqli_result)#2 (5) { ["current_field"]=> int(0) ["field_count"]=> int(1) ["lengths"]=> null ["num_rows"]=> int(0) ["type"]=> int(0) } which i'm not sure how interpret. <?php $con=mysqli_connect("localhost","root","xxxxx","test"); $pass = $_post['pass']; $uid = $_post['uid']; $result = mysqli_query($con, "select uid test.login uid = '$uid' , pass = '$pass'"); if(mysqli_num_fields($result) == 0) { header('location: index.html')} el...

if else statement double printing C -

i'm writing program adds line numbers c files. filenames command line arguments wanted user have chance enter them if forget when run program. ask user if want enter filenames , answer 'y' or 'n'. given 5 tries answer correctly if invalid character entered after 5 tries program prints error message , terminates. if user enters invalid character have print '[y/n]?' screen prompt user letters. if invalid character entered though goes through loop twice , prints them out side side. why happen? compiler.c file: #include <stdio.h> #include <stdlib.h> #include <string.h> #include "linenumadderheader.h" #include "miscellaneousheader.h" #include "errorcheckedfunctionsheader.h" int main(int argc, char *argv[]){ int = 1; char ch; int answertries = 0; char *seperatedfilenames[argc - 1]; if (argc < 2){ fprintf(stderr, "no files entered compiling.\n"); answer: do{ if (answertries == ...

html - CSS Box Model Chrome border color -

Image
i trying reproduce happening in fiddle not able that. i have code similar this html{ font-size: 2em; background-color: #ff0000; } table td{ background: #d0d0d0; border: 10px solid white; } <div> <table> <tr> <td> <table> <tbody> <tr class="row1_fixed"> <td>row header 1</td> </tr> <tr class="row2_fixed"> <td>row header 2</td> </tr> <tr class="row3_fixed"> <td>row header 3</td> </tr> </tbody> </table> </td> <td> <div> ...

php - Opencart With Codeigniter getting 404 error -

im using codeignitier framework , want install opencart, used sub folder in public_html , called store ! now when load in im getting 404 error ideas?? so public_html looks like: application assets cgi-bin store system uploads .htaccess index.php php.ini welcome.html thanks in store sub-directory, in file .htaccess (not .htaccess.txt) find rewritebase / , replace rewritebase /store/ this can 1 reason other reason can in codeignitor's .htaccess file

Does Vim have a certain syntax to combine commands on command mode? -

i noticed syntaxes when use vim for example [<motion>]<operator><motion> e.g. <gg><d><g> // delete top of file bottom of file <d><g> // delete current line bottom of file and for <operator><operator> e.g. <y><y> // inline copy <d><d> // inline delete <>><>> // inline right-indent ok, these. for syntax or way combine command know few patterns. and me think there many ways combine commands on vim looks messy me i think vim should have basis of command. i know does vim have syntax combine commands? can give me further information this? think of actions sentences , commands words in sentence: verbs, objects, prepositional phrases, modifiers grouped in sentence according grammar (like grammars) has corner cases makes lot of sense overall. hell, vim has transitive , intransitive verbs! the basic rules quite simple: {count}operator{motion} {count...

cmd - user input in R (Rscript and Widows command prompt) -

i trying figure out, how can run r script, using rscript in windows command prompt , ask user input. so far, have found answers on how ask user input in r's interactive shell. effort in doing same readline() or scan() has failed. example: i have polynomial y=cx x can take more 1 values x1 , x2 , x3 , on. c variable know, need in order calculate value of y ask user xi values , store them somewhere inside script. uinput <- function() { message(prompt"enter x1 value here: ") x <- readlines() } is way go? additional arguments? as.numeric help? how return x1 ? , implementation differ depending on os? thanks. that's general way go, implementation needs work: don't want readlines, want readline (yes, name similar. yes, dumb. r filled silly things ;). what want like: uiinput <- function(){ #ask user input x <- readline(prompt = "enter x1 value: ") #return return(x) } you want error...

java - Target host must not be null error -

i'm having issue fetching json url android, , have error stated in titles url. have posted relevant code below. if more required, can provide it. @ moment, have provided snippets of code being flagged error. the error: 04-06 23:13:44.533 20566-20855/edu.appdesign.leaguestats e/androidruntime﹕ fatal exception: asynctask #1 process: edu.appdesign.leaguestats, pid: 20566 java.lang.runtimeexception: error occured while executing doinbackground() @ android.os.asynctask$3.done(asynctask.java) @ java.util.concurrent.futuretask.finishcompletion(futuretask.java:355) @ java.util.concurrent.futuretask.setexception(futuretask.java:222) @ java.util.concurrent.futuretask.run(futuretask.java:242) @ android.os.asynctask$serialexecutor$1.run(asynctask.java) @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1112) @ java.util.concurrent.threadpoolexecutor$worker.run(threa...

machine learning - Retrieve candidate attributes for a node in Decision Tree using R -

i using r creating decision tree using cart. did using feature_vectors <- read.table("c:/users/dvs/desktop/tagme!-data/train/feature_vectors.txt", quote="\"") set.seed(1234) ind <- sample(2, nrow(winequality.red), replace=true, prob=c(0.7, 0.3)) traindata <- winequality.red[ind==1,] testdata <- winequality.red[ind==2,] myformula <- quality ~ fixed.acidity + volatile.acidity + citric.acid + residual.sugar + chlorides + free.sulfur.dioxide + total.sulfur.dioxide + density + ph + sulphates + alcohol table(predict(wine_ctree), traindata$quality) print(wine_ctree) plot(wine_ctree) now, need print list of candidate attributes possible root node. ie node minimal deviation in (im)purity values selected root node. there way use built in functions or have modify source?

c# - The variable name '@ArrivedDate' has already been declared. Variable names must be unique within a query batch or stored procedure -

private void btnsave_click(object sender, eventargs e) { sqlconnection connection = new sqlconnection("data source=nla-hp;initial catalog=gtbdb;persist security info=false;user id=sa;password=dbadmin"); sqlcommand command = new sqlcommand("insert machine values (@branchname, @machinename, @arriveddate, @faultdetail, @returndate, @remark, @technician)", connection); connection.open(); try { //variables declaration string branchname = cbbranches.text; string machinename = txtbmachine.text; datetime arriveddate = dtparrive.value; string faultdetail = rtxtbfault.text; datetime returndate = dtpreturn.value; string remark = rtxtbremark.text; string technician = txtbtechnician.text; //add values command.parameters.addwithvalue("@branchname", branchname); command.parameters.addwithval...

c++ - Pointer to template function which is NOT member of any class -

i have pointer template function has 2 parameters of type t . template <typename t> typedef bool( * f )( t, t ); template <typename t> bool mniejsze (t pierwszy , t drugi){ if( pierwszy < drugi) return true; return false; } template <typename t> bool wieksze (t pierwszy, t drugi){ if( pierwszy > drugi ) return true; return false; } but get: error: template declaration of 'typedef'| edit: pass pointer: right way? template <typename t> t minmax(t a[], int n,bool &f){ return f(a[0],a[1]); } in c++11 can use aliases: template<typename t> using f = bool( *)( t, t ); usage: f<int> f1 = wieksze; f1( 3, 4); http://ideone.com/kyujwp in c++03 there workoround: template<typename t> struct f { typedef bool( *type)( t, t ); }; usage: f<int>::type f1 = mniejsze<int>; f<int>::type f2 = mniejsze<int>; f1( 3, 4); template<typename t...

Primary constructors in C# vnext -

the language feature implementation status brought attention via c# chat . have couple of questions of features not covered in this existing question . some of new features obvious such getter-only auto-properties public int y { get; } = y; ... awesome. but others not clear on... primary constructors class point(int x, int y) { … } it may gap in knowledge, haven't come across term "primary constructor" before, some research seems suggest shortcut defining following class point { private int x; private int y; public point(int x, int y) { this.x = x; this.y = y; } } is correct interpretation? does mean can still constructor overloads (the term "primary" implies so)? can refer these implicit backing fields in other constructors/methods? is correct interpretation? almost, not exactly. default, primary constructor parameters not captured fields; are, however, accessible in instanc...

ios - GMSGeocoder - how to set response language -

when using app in foreign country, google gmsgeocoder returning response in local language automatically. how can set return the response in english? im using gms sdk 1.7 , code this: gmsgeocoder *geocoder = [[gmsgeocoder alloc] init]; [geocoder reversegeocodecoordinate:self.celllocation.coordinate completionhandler:^(gmsreversegeocoderesponse *respones, nserror *err) { if([respones firstresult]) { gmsaddress* address = [respones firstresult]; nsstring* fulladdress = [nsstring stringwithformat:@"%@, %@",address.thoroughfare, address.locality]; self.thetextfield.text = fulladdress; } else { self.thetextfield.text = @""; } }];

android - Deleting files from applications data folder -

i have tablet need execute service binary file continually receive data chip , store various data files in "/data/data/com.example.binary/received/" folder. have fileobserver set on folder perform action on files created , once close event given fileobserver trying delete file. have issue with. can delete files if in "/data/data/com.example.binary/" folder if in "/data/data/com.example.binary/received/" folder cant delete it . seems android permission issue. there way around this?. so far have tried , failed by 1) trying execute "rm /data/data/com.example.binary/received/file1.xy" 2) trying file.delete() fyi - have read , write permissions. , file handles file closed, that's when file's close event fired fileobserver. i can delete files adb using "rm file1.xy" and binary file our client , cannot change location creates output files.xy . . in received folder. suggestions? ps: /data/data folder location installe...

android - Rotate the image as per the passed orientation to the functions using Native Code -

i want rotate image per passing orientation function in rotatebitmap() funcation. i have taken reference method this awesome library. what want :: i want rotate image per passing orientation in function after want apply gray scaling effect image , if want downnsample image , return thumbnail of image calling activity. here below have pasted native code .. what have tried far :: #include <jni.h> #include <android/log.h> #include <android/bitmap.h> #include <stdio.h> #include <cstring> #include <unistd.h> #define log_tag "libphotophun" #define logi(...) __android_log_print(android_log_info,log_tag,__va_args__) #define loge(...) __android_log_print(android_log_error,log_tag,__va_args__) #define logd(...) __android_log_print(android_log_debug,log_tag,__va_args__) typedef struct { uint8_t alpha; uint8_t red; uint8_t green; uint8_t blue; } argb; class jnibitmap { public: uint32_t* _storedbitmap...

httpclient - android HttpGet/HttpPost parameters allways arrive as null to the server -

i'm trying send data server seems send null values, idea? idea add new customer through mobile application database hosted in server. here's code: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_nuevo_insert); //etresponse = (edittext) findviewbyid(r.id.etresponse2); etnombre = (edittext) findviewbyid(r.id.etnombre); etapellido = (edittext) findviewbyid(r.id.etapellido); etedad = (edittext) findviewbyid(r.id.etedad); nombre = etnombre.gettext().tostring(); apellido = etapellido.gettext().tostring(); edad = etedad.gettext().tostring(); } public void insertar(view view) { // call asynctask perform network operation on separate thread // working in localhost can't put localhost in address, // must put ip address or crush new httpasynctask().execute("http://192.168.1.34/android/insertcustomer.php"); } public st...

asp.net - custom input instead of @Html.Editorfor -

i use @html.editorfor(model=> model.score) in "create" view write <select> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> </select> but how connect select write model.score ??? you should use dropdownlistfor instead of editorfor. in case be: @html.dropdownlistfor(m => m.selectedscore, model.possiblescores) where names self-described. an example of usage

How does one rewrap text in a column in Vim? -

Image
i have column-oriented text of form: tr # date description programmer ----- ----------- --------------------------- ----------- 12345 01-apr-2014 april fool's joe sewell joke. not! now want widen description column , rewrap column only new width. let's say, sake of question, add spaces myself more this: tr # date description programmer ----- ----------- --------------------------------- ----------- 12345 01-apr-2014 april fool's joe sewell joke. not! now comes bit need on. want perform visual block selection (ctrl-v or ctrl-q in gvim) on description column , perform ex command or mapping rewrap text selected width, producing: tr # date description programmer ----- ----------- --------------------------------- ----------- 12345 01-apr-2014 april fool's joke. joe sewell not! i can deal subse...