Posts

Showing posts from April, 2010

html - Can't get smooth egdes on a hexagon in css -

i've made hexagon container image, can't figure how add more smooth/curved edges on it. i hoping me. .hexagon { position: relative; width: 180px; height: 103.92px; background-color: #64c7cc; margin: 51.96px 0; } .hexagon:before, .hexagon:after { content: ""; position: absolute; width: 0; border-left: 90px solid transparent; border-right: 90px solid transparent; } .hexagon:before { bottom: 100%; border-bottom: 51.96px solid #64c7cc; } .hexagon:after { top: 100%; width: 0; border-top: 51.96px solid #64c7cc; } <div class="hexagon"></div> thanks help. you can achieve similar using divs z-index , radial-gradient: <div class="hexagon"></div> <div class="circle"></div> and css: body { background-color: #eeeeee; } .circle { width: 240px; position: absolute; top:15px; height: 240px; z-index: 2; backgro...

javascript - Scroll event on ExtJS combobox picker -

i want add handler scroll event on combobox's picker scroll, scroll event not fired. ext.define('test.mycombo', { extend:'ext.form.field.combobox', createpicker: function() { var me = this, picker = me.callparent(arguments); me.mon(picker, { 'afterrender' : function() { picker.gettargetel().on('scroll', function(){ console.log('scroll?'); }, me); }, scope: me }); return picker; }, }); you should listen on picker instead of targetel. ext.define('test.mycombo', { extend:'ext.form.field.combobox', createpicker: function() { var me = this, picker = me.callparent(arguments); picker.on('scroll', function(){ console.log('scroll...

java - Web service request (>8KB) failed with apache cxf client on JBOSS - HTTP response '411: Length Required' -

a web application using apache cxf client send requests remote web service. when web application deployed on tomcat ok. the requests failed sent when web application deployed on jboss , size of body (envelope) greater 8 kb; error below got generated: 17:57:15,387 warning [org.apache.cxf.phase.phaseinterceptorchain (connectorexecutor-21) interceptor xxx#{http://cxf.apache.org/jaxws/dispatch}invoke has thrown exception, unwinding now: org.apache.cxf.interceptor.fault: not send message. @ org.apache.cxf.interceptor.messagesenderinterceptor$messagesenderendinginterceptor.handlemessage(messagesenderinterceptor.java:64) @ org.apache.cxf.phase.phaseinterceptorchain.dointercept(phaseinterceptorchain.java:263) @ org.apache.cxf.endpoint.clientimpl.doinvoke(clientimpl.java:531) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:461) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:364) @ org.apache.cxf.endpoint.clientimpl.invoke(clientimpl.java:317) @ o...

ios - AES encrypt string appear \r\n -

Image
when use aes128 encrypt string, if encrypted string long contain \r\n in it. now have use empty string replace it. why encrypt-string contain \r\n , better way avoid or fix it. thanks. answers: it's caused base64 encoding process, every 64 characters insert \r\n . that base64 encoded string. actual encryption output array of 8-bit bytes, not characters. code base64 encoding encrypted data option insert line breaks every 64 characters, allow better printing of output. when decoded use nsdatabase64decodingignoreunknowncharacters option remove line breaks . in particular objective-c create base64 string nsdata is: - (nsstring *)base64encodedstringwithoptions:(nsdatabase64encodingoptions)options the options include: nsdatabase64encoding64characterlinelength set maximum line length 64 characters, after line ending inserted. which inserts "\r\n" (carriage return, new line) characters each 64 characters. if not want pass 0 option value. to d...

c# - Group objects in List by property in object that is List using LINQ -

i have list of objects (name of object ngramm) , object has property - list of strings (name of property rawngramwords). there property of rawngramwords - ngramcount - number of objects in list same rawngramwords (the same lists of strings in different ngramm). if there example 3 objects (ngramm) in list same rawngramwords need 1 ngramm object ngramcount property = 3. other 2 objects same rawngramwords lists should deleted list. used code: public static list<ngramm> countnwordsinngrams(list<ngramm> listofngramms) { list<int> indexesofngramsinlisttodelete = new list<int>(); for(int = 0; < listofngramms.count; i++) { for(int j = i+1; j < listofngramms.count; j++) { bool areequivalent = !listofngramms[i].rawngramwords.except(listofngramms[j].rawngramwords).any(); if(areequivalent == true) { indexesofngramsinlisttodelete.add(i); ...

java - Cannot use Components/Service/Repository in Controller class -

i have configurated dao layer(i've created test check it), , integrate project spring mvc. i've added configuration: @configuration @enablewebmvc @componentscan(basepackages = "com.szymon.controller") public class webmvcconfig { @bean public viewresolver viewresolver() { internalresourceviewresolver viewresolver = new internalresourceviewresolver(); viewresolver.setviewclass(jstlview.class); viewresolver.setprefix("/web-inf/views/"); viewresolver.setsuffix(".jsp"); return viewresolver; } } public class webinitializer implements webapplicationinitializer { public void onstartup(servletcontext container) throws servletexception { annotationconfigwebapplicationcontext ctx = new annotationconfigwebapplicationcontext(); ctx.register(webmvcconfig.class); ctx.setservletcontext(container); servletregistration.dynamic serv...

eclipse rcp - Custom Perspective Switcher Toolbar: How can I dynamically update it? -

i'm trying implement custom perspective switcher toolbar replace eclipse's built-in one. couldn't toolbar display, , it shown me due a bug dynamic elemen t in menu contribution, have use control element instead, described in the workaround dynamic bug . i have toolbar displaying following approach, cannot figure out how update dynamically. workaround instruction call contributionitem#fill(coolbar, int) workbenchcontrolcontributionitem 's update method instead of doing fill in createcontrol method. i don't know supposed call update , never gets invoked no matter do. have perspective listener knows when update toolbar, listener's callback call fill(coolbar, int) . wasn't sure how coolbar pass method, created 1 on current shell. the end result of toolbar displays correct number of items initially, when need add item, has no effect. call fill(coolbar, int) , adds new item toolbar, i've tried make coolbar , toolbar update not work. when re-lau...

mysql - Error Code: 1066. Not unique table/alias: 'circle_call_prefixes' -

i trying update tables using inner join but keep getting error error code: 1066. not unique table/alias: 'circle_call_prefixes' this code: update circle_call_destinations , circle_call_prefixes inner join circle_call_prefixes on circle_call_prefixes.circle = circle_call_destinations.destination set circle_call_prefixes.prefix = '1' , circle_call_destinations.circle = '2' circle_call_destinations.autono = '20' thanks :) it's old question, had same error... you should remove ", circle_call_prefixes" in first line. the right syntax is update t1 inner join t2 on t1.a = t2.a set ..... there no t2 between update , inner.

javascript - killSignal option in JSON config file with Forever module [node.js] -

i'm using forever nodejs , want use config file (a json file) start server. want use option --killsignal=sigterm , want in json file instead of using cli. possible? tried (according forever documentation )with: { "uid": "app", "append": true, "watch": false, "script": "app.js", "sourcedir": "/home/user/test/", "args": [" --killsignal=sigterm "], "logfile": "/home/user/test/log/foreverlog.log", "outfile": "/home/user/test/log/foreverlogout.log", "errfile": "/home/user/test/log/foreverlogerr.log" } but "args" line not work. tried putting last line in json file, or putting "script" : " --killsignal=sigterm app.js" and "sourcedir": "--killsignal=sigterm /home/user/test/" but none of these works. am missing something? ...

javascript - Is it possible to use animate with an attribute with jQuery? -

i want change opacity of element jquery (with fade in animation): $(`#pano-${index}`).animate({ 'opacity': 1}) but don't result want: <a-sky style="opacity: 1;"></a-sky> i want accomplish this: <a-sky opacity: 1></a-sky> is possible jquery? note: works ... doesn't have animation: $(#pano-${index}).attr('opacity', 1) as starter ten, timer loop... var opacity = 0, // starting opacity step = 0.1, // step size target = 1, // target value time = 50; // delay in milliseconds // start timer loop, , record it's index var interval = setinterval(function(){ // assuming selector works, set opacity $(`#pano-${index}`).attr({opacity: opacity}); // increment opacity step size opacity += step; // if reached our target value, stop timer if(opacity >= target){ clearinterval(interval); } }, time);

Linux kernel 3.10 for ARM -

where can linux kernel 3.10 arm7l? i tried using 1 pc when compile it, ask me processor architecture , there no arm option. thank you! in order configure , build arm architecture set environment variables or execute following commands sequence. arch=arm cross_compile= your path arm cross compile tools /bin/arm-none-eabi- make menuconfig instead of default x86 there arm based architectures list in menu.

What is on the first line of an XML Schema (XSD)? -

so before write xml schema, lot of tutorials use this: <?xml version='1.0'?> or <?xml version="1.0" encoding="utf-8" standalone="yes"?> <data-set xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> my question is, part for? website , why use it? there other methods this? if helps, doing convert excel worksheet xml. xml declaration <?xml version='1.0'?> xml declaration , not particular xsds xml documents in general. [definition: xml documents should begin xml declaration specifies version of xml being used.] as xsd xml document, may have xml declaration. here bnf of xml declaration ( xmldecl ) links definitions of constituent parts: xmldecl ::= '<?xml' versioninfo encodingdecl ? sddecl ? s ? '?>' note: only 1 xml declaration permitted in well-formed xml, , must @ top if anywhere . if violate requirement, you'll see error suc...

How to pass an array of string into single variable in php -

basically, have variable called $userid = $_post['userid']; can take 1 value. but want take multiple values if possible, $userid = 1,2,4,5 or $userid = 2 or $userid = 1,2,3,4,5,6,7 i don't know how multiple numbers here php script: <?php require "init.php"; function foo() { $numargs = func_num_args(); echo "number of arguments: $numargs \n"; if ($numargs >= 2) { echo "second argument is: " . func_get_arg(1) . "\n"; } $arg_list = func_get_args(); ($i = 0; $i < $numargs; $i++) { echo "argument $i is: " . $arg_list[$i] . "\n"; } } if(!empty($_post['userid'])){ $userid = $_post['userid']; $userid = foo($userid); $stmt = "select userid, forename, surname, email, age users userid in (?)"; $result = $conn-> prepare($stmt); $result->bind_param...

jdbc - I'm getting the following errors when I try to drop or delete a database table -

i'm getting following errors when try delete table. table include mismatched data type image? unable execute command: drop table "app"."gadget" ddl not permitted read-only connection, user or database.

c# - WebAPI Slow first call to service -

i having issues wcf , slow startup times, switched of code use webapi. while startup time has reduced massively (~8-15 seconds down ~2) still have odd latency on startup. ~2 seconds subsequent calls under 0.5 seconds consistently, until timeout occurs. i reviewed of applicationpool settings ensure there wasn't startup delays or idle timeout settings. i found link very slow first call web service didn't me - still same speed issue on cold start. found 1 first call web service each day slow again doesn't seem apply me. i enabled tracing on webapi service , found difference between first , second call 2 lines showing webhosthttpcontrollertyperesolver.getcontrollertypes . can't seem find difference can see. is there other sort of logging use determine going on? this summary of conversation beneath question well timeouts never same, same ballpark...to expand, publish server - first call ~2 seconds - subsequent calls ~0.5 seconds. after may...

maven - Suite Class not calling @BeforeClass & @AfterClass -

i have suite of test cases. want @beforeclass & @afterclass called before , after test case execution respectively. when run suite class using junit calls methods correctly, ie setup() called prior testcases , teardown() called after testcases completed.but when execute maven execute testcases , generate report using surefire not calling setup() & teardown() @runwith(suite.class) @fixmethodorder(methodsorters.name_ascending) @suiteclasses({test1.class, test2.class}) public class suiteclass{ public static webdriver driver; public static string baseurl; public static stringbuffer verificationerrors = new stringbuffer(); @beforeclass public static void setup() throws exception { driver = new firefoxdriver(); baseurl = "http://localhost:7070/myproject/"; driver.manage().timeouts().implicitlywait(30, timeunit.seconds); } @afterclass public static void teardown() throws exception { driver.quit(); ...

javascript - Select with border inside -

Image
i trying select border inside , custom icon.here did: <label class="custom-select"> <select class="form-control black"> <option>1to9</option> </select> </label> https://jsfiddle.net/o1r97q4o/ , here want do here's solution copied this article , modified work markup op. you had working positioning, , hiding native down-arrow. .custom-select { position: relative; /*don't need demo styling*/ float: left; min-width: 200px; margin: 50px 33%; } .custom-select:after { content: "▼"; font: 25px "consolas", monospace; color: #333; right: 11px; /*adjust position want*/ top: 18px; padding-left: 5px; border-left: 1px solid #999; /*left line */ position: absolute; pointer-events: none; } .custom-select select { /* hide native down-arrow */ -webkit-appearance: none; -moz-appearance: none; appearance: none...

javascript - Angularjs custom directive scope:true change it's parent scope -

i trying write 1 custom directive , put scope:true.as per knowledge should take parent scope , when change in model should change it's internal scope only. in below example find when ever change directive parent changed. can please tell me reason behind it. html <div class="container" ng-app="mymodule" ng-controller="maincontroll"> <div>lorem ipsum dolor sit amet, consectetur adipisicing elit. exercitationem harum numquam odio, tenetur earum deleniti culpa recusandae? temporibus expedita, porro numquam @ voluptas aspernatur nemo veniam nam, vel assumenda placeat!</div>{{text}}<br/> <input type="text" class="form-control" id="exampleinputemail1" placeholder="email" ng-model="text"> <firstdir></firstdir> </div> javascript var app = angular.module("mymodule",[]); app.controller("maincontroll",function($scope){ $scope.text = ...

ios - Why can't add UIView to UITableViewCell directly but contentView -

i never think question before may stupid. [cell.contentview addsubview:xxxview]; and [cell addsubview:xxxview]; apple said contentview should default superview contents. want know if bad if add subviews cell directly. apple document: the content view of uitableviewcell object default superview content displayed cell. if want customize cells adding additional views, should add them content view positioned appropriately cell transitions , out of editing mode. https://developer.apple.com/library/ios/documentation/userexperience/conceptual/tableview_iphone/tableviewcells/tableviewcells.html#//apple_ref/doc/uid/tp40007451-ch7-sw1 by default, editing control hidden until enter edit mode table in case, editing control appears (the minus button left of each row) , contentview gets resized , pushed right. gives "proper animation" effect. to test difference, try adding subview such uilabel text, cell rather cell.contentview. when add cell rather cell....

linux - Rooted android device throw EACCES: permission denied exception when I try to get CPU's temperature -

i try android devices' cpu temperature, , after little search found files store data of temperature, thing need read files. specifically, found device contain temperature in path "/sys/class/thermal/thermal_zone1/temp". i have added permission in manifest file. however, found in devices app running fine (4.1, 4.4, 5.1 version), in 2 devices, not work, printed log, shows eacces: permission denied i found both 2 devices have been rooted before. used adb shell su command , file exist , contain temperature data. it failed on selinux enforced device (i.e. device running android 5.0 , later ). you need custom rom, special policies access file app, or call adb shell setenforce 0 to disable until next boot (on rooted phone only)

facebook sdk 4.0 - Getting Unknown Host Exception While using RestFb -

i want connect data facebook using restfb throwing unknown host exception . my code package com.resrfb; import com.restfb.defaultfacebookclient; import com.restfb.facebookclient; import com.restfb.types.user; public class simplemeexample { public static void main(string[] args) { facebookclient facebookclient= new defaultfacebookclient("key"); user user = facebookclient.fetchobject("me", user.class); system.out.println("user="+ user); system.out.println("username= "+ user.getusername()); system.out.println("birthday= "+ user.getbirthday()); } } also wanted know how data user login web app using restfb here geeting accesstoken manually how user when logging in using facebook sdk. stack trace exception in thread "main" com.restfb.exception.facebooknetworkexception: network error occurred while trying communicate facebook: facebook request failed (http status...

c# - Not able to Consume wcf service POST method in Portable class library for xamarin android -

Image
i consuming wcf webservices(post method) in portable class library in visual studio xamarin android.app getting crash in post method.below code in pcl class1.cs namespace xamarinservicecall { public sealed class class1 : irestservice { public async task<string> getdata(usermodel model) { using (var client = new httpclient()) { var content = new stringcontent(jsonconvert.serializeobject(model), encoding.utf8, "application/json"); var result = await client.postasync("http://xamarin-rest-service/loginservice/validatelogin", content); return await result.content.readasstringasync(); } } } } irestservice.cs namespace xamarinservicecall { public interface irestservice { task<string> getdata(usermodel model); } } usermodel.cs public class usermodel { public string loginfrom { get; set; } ...

java - How to store Enum into Cassandra with Springdata? -

i trying store enum cassandra using springdata framework. possible? have defined enum: public enum currency { gbp, usd, eur } then define class "@enumerated" annotation on field: @table public class bondstatic { @primarykey private string id; private string isin; private string ticker; private date maturity; private double coupon; @enumerated(enumtype.string) private currency currency; ... these imports: import com.datastax.driver.mapping.enumtype; import com.datastax.driver.mapping.annotations.enumerated; then have component class spring: @component class cassandradataclr implements commandlinerunner { @autowired public bondstaticcassandrarepository bondstaticrepository; ... which autowired from: @repositoryrestresource(path = "/bond-static") interface bondstaticcassandrarepository extends cassandrarepository<bondstatic> { } where these imports: imp...

javascript - I want to Display Popup on tab close in angularjs? -

i'm trying display popup on tab/window close. if user clicks " leave page " cookies , session must cleared/destroyed. else if clicks on " stay on page ". should normal such before ? my code : $rootscope.onexit = function() { $cookies.remove('isauthenticated'); $cookies.remove('current_user'); $rootscope.isloggedin = false; }; $window.onbeforeunload = $rootscope.onexit; my code working properly means if window/tab closed deletes cookie the problem want done after popup result try add code remove cookies , isloggedin unload event , assign empty function onbeforeload event $rootscope.onexit = function() { $cookies.remove('isauthenticated'); $cookies.remove('current_user'); $rootscope.isloggedin = false; }; $window.unload = $rootscope.onexit; $window.onbeforeunload = function(){}

how to make a rollbutton work with a rollcounter in a yahtzee game c# -

Image
so have been working on yahtzee game , have gotten dice numbers , roll button working, want add rollcount label tells how many rolls player has left , after amount of rolls none disables roll button, code far roll button private void btnroll_click(object sender, eventargs e) { random random = new random(); int[] dice = new int[5]; globals.rollcounter += 1; if (chk1.checked == false) { dice[0] = random.next(1, 7); lbldie1.text = convert.tostring(dice[0]); } if (chk2.checked == false) { dice[1] = random.next(1, 7); lbldie2.text = convert.tostring(dice[1]); } if (chk3.checked == false) { dice[2] = random.next(1, 7); lbldie3.text = convert.tostring(dice[2]); } if (chk4.checked == false) { dice[3] = random.next(1, 7); lbldie4.text = convert.tostring(dice[3]); } ...

c# - iTextsharp CMYK colors result in another color -

Image
i'm working on little project need create pdf containging table text. table supposed have background color. testing sake i've simplified code this: using(var output = new memorystream()) using (var document = new document(pagesize.a4, 0, 0, 50, 120)) { pdfwriter.getinstance(document, output); document.open(); var table = new pdfptable(1); table.addcell(new pdfpcell(new phrase("blah blah blah")) {backgroundcolor = new cmykcolor(11, 8, 1, 0)}); document.add(table); document.close(); file.writeallbytes("e:\\test.pdf", output.getbuffer()); } as see i've set background color. yet somehow it's resulting in different color i'm expecting. can me figuring out doing wrong? tia

Conversion of query from oracle to mysql -

how convert below query oracle mysql. alter table test add constraint test_fk foreign key (id) references another_table(id) on delete cascade enable novalidate; when convert got following error in mysql error code: 1064. have error in sql syntax; check manual corresponds mysql server version right syntax use near 'enable novalidate' can body please me on this. thanks skp this standard syntax of adding foreign key using alter query official alter table tbl_name add [constraint [symbol]] foreign key [index_name] (index_col_name, ...) references tbl_name (index_col_name,...) [on delete reference_option] [on update reference_option] in query delete enable novalidate . try this alter table test add constraint test_fk foreign key (id) references another_table(id) on delete cascade; example http://dev.mysql.com/doc/refman/5.7/en/create-table-foreign-keys.html alter table products add foreign key fk_vendor(v...

sql server - SQL Create View query Executes successfully in Management studio but fails in C# code -

this question has answer here: create parameterized view in sql server 2008 5 answers here code cmd.connection = con; if (con.state == connectionstate.closed) { con.open(); } cmd.commandtext = "drop view [picklist]"; cmd.executenonquery(); cmd.commandtext = "create view [picklist] select a.desp_no,a.desp_date,a.custid,a.comp_name,a.ref_no,b.item_code itemid,b.pqty,c.serial_no,c.batchno,c.expiry,d.item_name,d.item_code,d.mrp,e.cust_name,e.address1,e.address2,e.address3,e.phone,e.email dbo.tbl_despdet inner join dbo.tbl_desp_sub b on a.desp_no=b.desp_no inner join dbo.tbl_desp_barcode c on c.desp_no=a.desp_no inner join tbl_itemmast d on d.item_id=b.item_code inner join dbo.tbl_custmast e on a.cust...

Allow other sites to embed videos though iframe options is set to Sameorigin in the response header -

we have videos website youtube. our site allows other users view videos , embed our videos in sites using <iframe> , again youtube. site owner has asked change x-frame options response header "sameorigin" earlier set "*". our website not embedable site owner/customer has asked workaround it. have been searching solution in vain. please suggest solution/workaround above problem. if not technically possible achieve should layman answer it. thank reading. suggestion highly appreciated. thank you. can allow x-frame particular page ? yes, can.create subdomain embeding url.

javascript - How do I know when the last async operation will finish? -

i'm building app in nodejs , involves sending external requests asynchronously. had 1 id: # client function sendajax(id) { $.ajax({ type: "post", url: "/fsfdsfd", data: json.stringify({"id": id}), contenttype: "application/json; charset=utf-8", datatype: "json", }).done(function (data) { //..... # server app.post("/dsfdsfd", function (req, res, nxt) { var id = req.body.id; anotherserverclient.sendexternalrequest(id), function(data) { //success //return result, when exactly? res.end("ok"); }, function (e) { // error, when exactly? res.end("error"); }); now have array: # client function sendajax(ids) { $.ajax({ type: "post", url: "/fsfdsfd", data: json.stringify({"ids": ids}), contenttype: "application/json; charset=utf-8", datatype: "json", }).done(function (data) { //..... # server a...

sql - Group_concat equivalent in postgresql 8.2.11 -

i using older version of postgres 8.2.11. can tell me equivalent of mysql's group_concat postgres 8.2.11. have tried array_accum , array_to_string , string_agg doesn't work in version the "not quite duplicate" in comments should point in right direction: create own aggregate function . first you'll need non-aggregate string concatenation function, this: create function concat(t1 text, t2 text) returns text $$ begin return t1 || t2; end; $$ language plpgsql; then can define own aggregate version of function: create aggregate group_concat( sfunc = concat, basetype = text, stype = text, initcond = '' ); now can group_concat want: select group_concat(s) t group g i dug out of archives think should work in 8.2. keep in mind 8.2 no longer supported might want upgrade @ least 8.4 possible.

php - swift save nsdate of core data into a mysql database -

in swift 2 app user can save entries core data. there data row nsdate format. the user select date date picker , store information core data, example: > 2016-03-09 23:00:00 +0000 my problem is, how can save format mysql database? can save datetime, result without time zone +0000 any ideas? :)

Using Different Sources for Testing and Release Android Studio -

i writing tests code make calls restful web service. need use different variables testing, staging , production. example staging release url can 'myapp.staging.com' whereas when test staging flavor should 'localhost/27015'. same goes production flavor. when release should 'myapp.production.com'. how achieve these flavor, buildtype combinations? you can use buildtype , flavor achieve it. if want different url different combination can use values inside resources. using flavor1, flavor2 have 4 build variants . can set url inside resource, example in strings.xml file. can set different files in these folder achieve want. src/flavor1/ src/flavor1debug/ src/flavor1release/ src/flavor2/ src/flavor2debug/ src/flavor2release/ you can set other values, example applicationid , in build.gradle file.

day() vs dayofmonth() in mysql -

consider select day("2016-05-22") and select dayofmonth("2016-05-22") both gives same output. day("2016-05-22") 22 and dayofmonth("2016-05-22") 22 is there diffrence between these 2 methods? according mysql reference manual day() synonym dayofmonth()

jquery - How do I add unique IDs to dynamically created input fields in Javascript? -

i using javascript create input fields dynamically limit of 10 allowed on form. need ensure these fields submitted correct place give them right id. question how do this? $(document).ready(function () { var max_fields = 10; //maximum input boxes allowed var wrapper = $(".input_fields_wrap"); //fields wrapper var add_button = $(".add_field_button"); //add button id var x = 1; //initlal text box count var num = new number; var newnum = num + 1; /*if (x = max_fields) { alert("you can't add anymore fields.") } */ $(add_button).click(function (e) { //on add input button click e.preventdefault(); if (x < max_fields) { //max input box allowed x++; //text box increment $(wrapper).append('<div class="clonedinput"><input id="" type="text" name="mytext[]"/><a href="#" class="remo...

linux - Write failed: Broken pipe -

i accessing vm server ip . today changed vm ip different ip.but while restarting network showed shutting down interface eth0: write failed: broken pipe after not able access old ip new ip assigned.i think shutted down eth0 interface . not able access.so how reset vm network configuration server ip??? not able ssh vm server . note: ahve server ip.i doing ssh ip first.then doing ssh vm ip. not able access directly vm outside. configuring vm new ip outbound access.

yum - error:Cannot find a valid baseurl for repo: google64 -

i wanna install vim using yum, however, yum doesn't work. , tried install other software using yum, result remains same. remembered typed commands this: yum clean all, maybe it's reason yum doesn't work. how repair yum configuring ? yum doesn't work

How to disable Java Decompiler in Eclipse -

i'm using eclipse mars 4.5.1 java decompiler (jd-eclipse plug-in v1.0.0). for class have binary file in multiple locations, because using 1 workspace several projects. jd keeps decompiling file, have source code it. can't link every binary file, because in locations it's packaged other binaries. is there way prevent jd decompiling? and if not, there way prevent jd decompiling altogether without uninstalling it? i tried disabling through general -> startup , shutdown, didn't have effect.

r - Rmarkdown hist() -

i'm trying knit rmd file html in rstudio, when hist() exit error: " ... withcallinghandlers -> withvisible -> eval -> eval -> hist". help highly appreciated. the code similar this: ```{r} hist(diamonds$carat) ``` my session info: r version 3.2.1 (2015-06-18), platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 7 x64 (build 7601) service pack 1 locale: [1] lc_collate=russian_russia.1251 lc_ctype=russian_russia.1251 lc_monetary=russian_russia.1251 [4] lc_numeric=c lc_time=russian_russia.1251 attached base packages: [1] stats graphics grdevices utils datasets methods base other attached packages: [1] ggthemes_3.0.2 ggplot2_2.0.0 rstudio (quite correctly) knits documents in clean session. hence, packages you’ve loaded in current session irrelevant. now, diamonds example dataset comes ggplot2 . if want use it, need load ggplot2 (or @ least dataset) inside rmarkdown document: ``...

android - C# - downloads get corrupted -

Image
so have xamarin android application can download files server, images heavily distorted (screenshot below), videos can't played, audio sounds weird etc., of time gets downloaded properly. , distortions happen on mobile network, when downloading on wifi, happen less frequently. there wrong download code or maybe save location has it? code downloading files: public static async task downloadfileasync(string url, string mimetype, stream filestream) { long receivedbytes = 0; long totalbytes = 0; webclient client = new webclient (); using (var stream = await client.openreadtaskasync (url)) { byte[] buffer = new byte[1024]; totalbytes = int64.parse (client.responseheaders [system.net.httpresponseheader.contentlength]); (;;) { int bytesread = await stream.readasync (buffer, 0, buffer.length); await filestream.writeasync (buffer, 0, buffer.length); if (bytesread == 0) { await t...

Delphi 10: Problems with SizeOf(string) - Windows vs Android -

i want send tmemostream android windows using indy idtcpclient , idtcpserver. the problem this: sizeof(string) in android 4 bytes sizeof(string) in windows 10 8 bytes in android used code: type tmyrecord = record x1: string; x2: string; end; var workrecord: tmyrecord; rinfo: tmemorystream; begin workrecord.x1:= 'hello'; workrecord.x2:= 'how you'; rinfo:= tmemorystream.create; try rinfo.write(workrecord, sizeof(workrecord)); //size of workrecord 8 bytes androidtcpclient.iohandler.write(workrecord, 0, false); rinfo.free; end; end; in windows 10 used code: type tmyrecord = record x1: string; x2: string; end; type tmyrecord = record x1: string; x2: string; end; var workrecord: tmyrecord; rinfo: tmemorystream; begin rinfo:= tmemorystream.create; try acontext.connection.iohandler.readstream(rinfo, sizeof(workrecord), false); rinfo.position:= 0; rinfo.read(workrecord, sizeof(workrecord)); //size ...

list - Create Python Dictionary -

a_lst = list() b_lst = list() tmp = list() c_dct = dict() while true: = raw_input("a=") a_lst.append(a) b = raw_input("b=") b_lst.append(b) if == "end": break a_lst.remove('end') print a_lst print b_lst in range(len(a_lst)): c_dct[a_lst[i]] = b_lst[i] print c_dct in code, combine 2 lists create dictionary. in result, dictionary not same position input. example, c_dct = {'q': 'w', 'e': 'r', 'o': 'p', '1': '2', '3': '4', '5': '6', 't': 'y', '7': '8', '9': '0', 'u': 'i'} instead of c_dct = {'1': '2', '3': '4', '5': '6','7': '8', '9': '0','q': 'w', 'e': 'r','t': 'y','u': 'i','o': 'p'} what goin...

java - How to set a minimum date -

i have 2 buttons. first button - depart , second - arrival. @ date of departure mindate = today. , arrival date mindate should equal selected date of departure oncreate(): final calendar nextyear = calendar.getinstance(); nextyear.add(calendar.year, 1); date today = new date(); date departs; initbuttonlisteners(today, nextyear); buttonclicklistener: public void initbuttonlisteners(final date today, final calendar nextyear) { findviewbyid(id.linearcalendar).setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { showcalendarindialog("select departure date", r.layout.calendar_dialog_customized); dialogview.init(today, nextyear.gettime()) .withselecteddate(new date(departdata)); } }); findviewbyid(id.lineararrive).setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { showcalendarin...

javascript - How do you create Facebook custom audiences from multiple URLs? -

we need generate custom audiences multiple urls bit confused sorry. 1. pixel code are these correct pixel code parameters use? fbq('init', '12345678912345567'); fbq('track', "pageview"); fbq('track', 'viewcontent'); 2. create audiences and add urls when creating audiences in ad manager using 'people view specific web pages'? 3. matching urls and if use 'url contains' option work wildcard? i.e. entering this: /segment-one/segment-two/ will match multiple urls/paths/pages this: www.domain.com/path/segment-one/segment-two/page-one.php www.domain.com/path/segment-one/segment-two/segment-three/page-one.php www.domain.com/path/segment-one/segment-two/segment-three/page-two.php also, can match partial segments this: /segment-one/segment or better specific , enter each url one-by-one using exact match? any appreciated. cheers

javascript - Gulp task runs once, executes twice -

Image
i'm using gulp compile stylus, task seems run twice making gulp-notify trip. here's gulpfile.js var gulp, plugins; gulp = require('gulp'); plugins = require('gulp-load-plugins')(); /** * watch changes on stylus files, when detecting change run stylus task * @return {void} */ gulp.task('watch-stylus', function() { gulp.src('./app/resources/stylus/**/*.styl') .pipe(plugins.plumber()) .pipe(plugins.watch('./app/resources/stylus/**/*.styl', { verbose: true, readdelay: 0 })) .pipe(plugins.exec('gulp stylus')) .pipe(plugins.notify("stylus compiled")) .pipe(plugins.plumber.stop()); }); /** * compile stylus , auto prefix compiled css * @return {void} */ gulp.task('stylus', function() { gulp.src(['./app/resources/stylus/**/*.styl', '!./app/resources/stylus/**/_*.styl']) .pipe(plugins.plumber()) .pipe(plugins.stylus()) ...

mongodb 3.0 global lock when updating a single document -

looking @ different mongodb operations found out mongodb 3.0 , wt engine, generating many different locks , upgrading global lock following: { "desc" : "conn4981286", "threadid" : "0x113f133400", "connectionid" : 4981286, "opid" : -371204669, "active" : true, "secs_running" : 0, "microsecs_running" : numberlong(377), "op" : "update", "ns" : "xxx", "query" : { "_id" : objectid("56c82738ccb2d079eec4867c") }, "client" : "xxx", "numyields" : 0, "locks" : { "global" : "w", "local" : "w", "database" : "w", "collection" : "w" }, ...

html - Javascript issue with IE11 -

my app working fine till ie9, stopped working when upgraded ie11. here sample html , js . issue in first run ie. on load works well. when select pda brand, second dropdown's options went blank. in console there script error invalid calling object error on object clonedoptions . function dynamicselect(id1, id2) { //alert("everytime") // browser , feature tests see if there enough w3c dom support // obtain references both select boxes var sel1 = document.getelementbyid(id1); var sel2 = document.getelementbyid(id2); // clone dynamic select box var clone = sel2.clonenode(true); // obtain references cloned options var clonedoptions = clone.getelementsbytagname("option"); // onload init: call generic function display related options in dynamic select box refreshdynamicselectoptions(sel1, sel2, clonedoptions); // onchange of main select box: call generic function display related options in dynamic select box s...