Posts

Showing posts from June, 2015

linux kernel - is system(const char *command) lead to cpu sys 100% -

i create 1 background thread b,and in func of b, void func() { system('gzip -f text-file'); // size of text-file 100m xxx } i found sometime sys of 1 cpu(my server has more 1 cpu core) 100%. strace progress, found clone syscall consume more 3 seconds, execution time of gzip. **17:46:04.545159** clone(child_stack=0, flags=clone_parent_settid|sigchld, parent_tidptr=0x418dba38) = 39169 **17:46:07.432385** wait4(39169, [{wifexited(s) && wexitstatus(s) == 0}], 0, null) = 39169 so question is, 1. system('gzip -f text-file') lead 100% cpu sys ? 2. root cause sys_clone without clone_mm full copy of virtual memory mapping parent process child process, according https://www.kernel.org/doc/gorman/html/understand/understand021.html 343 allocate new mm 348-350 copy parent mm , initialise process specific mm fields init_mm() 352-353 initialise mmu context architectures not automatically manage mmu 355-357 call dup_mmap() responsible copyin

html - font face not working for IE8 ?? getting @font-face encountered unknown error.? -

i using font face include customised font named razing. font not working in ie8 works on ie9+ , other browsers. checked console in ie8 browser , found " @font-face encountered unknown error." tried using svg , fixes ?#iefix ain't working. please can u provide healthy solution overcome this, !! <style> @font-face { font-family: razing; src: url(fonts/razing/razing.eot); src: url(fonts/razing/razing.eot?#iefix) , url(fonts/razing/razing.ttf), url(fonts/razing/razing.woff), url(fonts/razing/razing.svg) format('svg'); } .abc{ font-family:razing;font-size:20px; } </style> <p class="abc"></p> try format('embedded-opentype') @ end of #iefix line. e.g. src: url(fonts/razing/razing.eot?#iefix) format('embedded-opentype'),

How to add more text styles into android project? -

Image
as question. want change text font in textview image below. i don't want use "bold" or "italic" style in textstyle. download font file here , put them in fonts folder under assets folder. , use below code applying font on textview : typeface font = typeface.createfromasset(this.getassets(), "fonts/walkway bold.ttf"); ((textview) findviewbyid(r.id.textview13)).settypeface(font);

Javascript - Uncaught Type Error: undefined is not a function - JQuery vertical navbar -

i have jquery bit of code .js file $(function () { // vertical tabs configuration $("#myverticaltabs").tabs().addclass("ui-tabs-vertical ui-helper-clearfix"); $("#myverticaltabs li").removeclass("ui-corner-top").addclass("ui-corner-left"); }) this code supposed add vertical navbar in app. followed tutoriel : http://jqueryui.com/tabs/#vertical , tried apply in asp.net mvc application. have put code javascript file referenced view in app. code of div supposed displayed vertical navbar : <div id="myverticaltabs"> <ul> <li><a href="#tabs-vertical-1">nunc tincidunt</a></li> <li><a href="#tabs-vertical-2">proin dolor</a></li> <li><a href="#tabs-vertical-3">aenean lacinia</a></li> </ul> <div id="tabs-vertical-1"> <h

android - Prevent activity from loading until task has completed -

i have 3 activities: mainactivity activity a activity b the user can start process in activity b. show notification helper % completed, , go mainactivity. but don't want user able app until process had completed, - there button on mainactivity want disabled until process has completed. anyway check if notificationbar still there when click button, or anyway check if async task still running? thanks private class downloadstuff extends asynctask<void, void, void> { protected void doinbackground(void... params) { // stuff in background return null; } protected void onpostexecute() { // disable button } } more info: http://developer.android.com/reference/android/os/asynctask.html

c# - Get previous item in grid winrt -

<grid x:name="gridgeneralproperties" horizontalalignment="left" height="613" margin="233,5,0,0" grid.row="1" verticalalignment="top" width="437"> <textblock textwrapping="wrap" text="general properties" fontsize="16" margin="162,10,18,573"/> <textblock textwrapping="wrap" text="name" margin="10,69,298,521" fontsize="14.667"/> <textbox textwrapping="wrap" text="{binding document.documentname}" isreadonly="true" margin="144,59,73,520"/> <appbarbutton x:name="appbarbuttoneditname" horizontalalignment="left" label="" margin="349,39,-12,0" verticalalignment="top" icon="edit" height="75"/> </grid> is there way access previous in grid? in case, if user clicks on appbarbutton, want

asterisk - Simplifying device creation in sip.conf -

i have define many similar devices in sip.conf this: [device](!) ; setting parameters [device01](device) callerid=dev01 <01> [device02](device) callerid=dev02 <02> ; ... [devicexx](device) callerid=devxx <xx> the question perhaps avoid setting device-name specific parameters using variable following? [device](!) callerid=dev${device_name:-2} <${device_name:-2}> ; setting parameters [device01](device) [device02](device) ; ... [devicexx](device) p.s. perfect, if there device constructor, reduce script following, but, think, not possible in asterisk. [device](!) callerid=dev${device_name:-2} <${device_name:-2}> ; setting parameters ;[device${magic_loop(1,xx,leading_zeroes)}](device) i've had results writing small program takes care of it. checks line saying like ------- automatically generated ------- and whatever after line, it's going regenerated detects there new values (it database or text file). then, run supervisor

Java Web Start applet - native library fails to load on second try -

i have applet loaded via java web start in browser. applet uses few native libraries things microsoft office interop , active directory communication. here's jnlp : <?xml version="1.0" encoding="utf-8"?> <jnlp spec="1.5+"> <information> <title>my applet</title> <vendor>my vendor</vendor> </information> <security> <all-permissions/> </security> <resources os="windows"> <!-- application resources --> <j2se version="1.6+" href="http://java.sun.com/products/autodl/j2se" /> <jar href="applets/myapplet.jar" main="true" /> <nativelib href="applets/jacob.jar"/> <nativelib href="applets/com4j.jar"/> </resources> <applet-desc name="my applet" main-class="

Python's subprocess: How do I hide the terminal window and still capture the output? -

this code works, terminal window pops (briefly): print 'trying wireless' while true: wlan = subprocess.popen("netsh wlan connect name='bsd'", stdout = subprocess.pipe, stderr = subprocess.pipe) out, error = wlan.communicate() if out.find('success') >=0: break print "still trying wireless..." time.sleep(0.5) print "connected!" this python 2.7 on windows 7. any way stop pop-up , keep grabbing output? thanks, nick. i don't have setup this, since there no answers found vaguely promising in docs . can try this: si = subprocess.startupinfo() si.dwflags = subprocess.startf_useshowwindow # tell windows use wshowwindow options si.wshowwindow = subprocess.sw_hide # showwindow option - 1 sounded useful wlan = subprocess.popen(...., startupinfo=si) # before add startupinfo argument

java - Comparing one array element to multiple array elements -

i have 2 text files have data below: file a: 4,12-98-1,38.4611,apo,tue,jan,07,14:31:34,2014 5,12-111-1,0.9520,apo,tue,jan,07,11:56:21,2014, 6,12-176-1,8.0510,apo,tue,jan,07,11:58:10,2014, 7,12-214-1,165.2349,apo,tue,jan,07,14:33:19,2014 8,12-293-1,61.2558,apo,tue,jan,07,14:35:11,2014 9,12-805-1,2.0987,apo,tue,jan,07,12:03:30,2014, 10,12-986-1,3.7740,apo,tue,jan,07,12:05:16,2014, file b: 4,12-98-1,43.6546,apo,tue,jan,07,10:26:32,2014, 5,12-111-1,1.0430,apo,tue,jan,07,10:28:18,2014, 6,12-176-1,13.5606,apo,tue,jan,07,10:30:04,2014, 7,12-214-1,44.7091,apo,tue,jan,07,10:35:27,2014, 8,12-293-1,44.3001,apo,tue,jan,07,10:37:14,2014, 10,12-805-1,2.6451,apo,tue,jan,07,10:39:01,2014, each of lines stored in array. want compare first array element of first line of file first array elements of lines in file b , first array element of second line of file first array elements of lines in file b , keep going.... till end of file. i managed ones match while reading both text files. can`t

ios - Getting height of UITableViewCell class without subclassing -

i'm trying calculate height of uitableviewcell without doing whole dance boundingrectwithsize. here's approach: + (cgfloat)heightforitem:(id<ddinfoitem>)item { if (!prototypecell) prototypecell = [[nsbundle mainbundle] loadnibnamed:nsstringfromclass([self class]) owner:nil options:nil][0]; [prototypecell configureforitem:item]; [prototypecell layoutifneeded]; cgsize size = [prototypecell.contentview systemlayoutsizefittingsize:uilayoutfittingcompressedsize]; return size.height+1; } unfortunately, line cgsize size = [prototypecell.contentview systemlayoutsizefittingsize:uilayoutfittingcompressedsize]; is returning nil... suspect because haven't set own constraints since not subclass of uitableviewcell. can confirm? there simple way of asking cell resize in situation? thanks! update i still getting 0 height thought i've subclassed , added constraints in ib. here's constraints on contentview in debugger: <n

regex - regexp pattern to match alphanumeric strings without initial spaces -

i have input pattern setted this: pattern="[a-za-z0-9]+" when type space in input, returns me error message ( ). but, when type mi full name, e.g. jhonatan sandoval , too. how can sett pattern no spaces before name? that work expect: pattern="[a-za-z0-9][a-za-z0-9 ]+"

actionscript 3 - AS3 Image editing library -

is there image editing library action script? want perform few basic tasks resizing image, cropping image, adding text etc. trying resize multiple images @ 1 time. tried doing following code: private function resizetorightsideadsize():void { var originalimage:uploadedimage = listofselectedimages.getitemat(0) uploadedimage; var scalewidth:number = rightsideadwidth/originalimage.originalwidth; var scaleheight:number = rightsideadheight/originalimage.originalheight; var resizeddata:bitmapdata = scalebitmap(originalimage.imagebitmap.bitmapdata, scalewidth, scaleheight); var encoder:jpegencoder = new jpegencoder(); var bytearray:bytearray = encoder.encode(resizeddata); //var bytearray:bytearray = imageencoder.getjpgbytearraydata(image); filereference.save(bytearray,"1.jpeg"); } public function scalebitmap(src: bitmapdata,

building - What to do after make test fails? -

on virtualbox vm openbsd: i trying build apr 1.5.1 in attempt build apache 2.4 server without packages( ie. source ) , when ran make test , testlock failed with: testlock : -line 300: timer returned late failed 1 of 4 ... *** error 1 in test (makefile:186 'check') *** error 1 in /a/b/c/d/e/f (makefile:127 'check') i have no idea it. course of action this? you may want try using older version of apr ; perhaps 1 openbsd packages site (somewhere this openbsd packages site ?) note: downloads , installations choose make sites these decision. please make sure read related documentation compatibility information, too, before making decision installing software in environment! also, version of openbsd may make difference package site best use... openbsd packages site above example of these sites may like. for future reference, can find more information these sort of packages in openbsd packages , ports documentation .

dictionary - How to hook into Mantle -

i'm using mantle , fits basic need. after declaring jsonkeypathsbypropertykey , propertyjsontransformer , can turn json dictionary object etpuser *user = [mtljsonadapter modelofclass:[etpuser class] fromjsondictionary:jsondict error:nil]; now want hook transformation process other complex fields (setting other properties not declared in jsonkeypathsbypropertykey ) in jsondict , can't find ways this how hook mantle ? try snippet: - (id)initwithdictionary:(nsdictionary *)dictionary error:(nserror *__autoreleasing *)error { nsdictionary *hookedvalue = [[nsdictionary alloc] initwithobjectsandkeys: @"defaultvalue1", @"defaultkey1", @"defaultvalue2", @"defaultkey2", @"defaultvalue3", @"defaultkey3", nil]; dictionary = [hookedvalue mtl_dictionarybyaddingentriesfromdic

php - Kendo AutoComplete doesn't work -

i have problem kendo autocomplete. trying search word, not work. i try see through console of google chrome, error show me this: "uncaught typeerror: cannot read property 'slice' of undefined" this code: html <head> <script src="librerias/jquery.min.js"></script> <script src="librerias/kendo.all.min.js"></script> </head> <body> <input id="#autocomplete" /> </body> <script> 'use strict'; (function($, kendo) { // select input , create autocomplete $("#autocomplete").kendoautocomplete({ datasource: new kendo.data.datasource({ transport: { read: "functions/autocomplet.php" }, schema: { data: "data" } }), datatextfield: "nombre", placeholder: "please select state" }); })(jquery, kendo); </sc

Delete all files from A subdirectory of ALL subdirectories in windows batch -

i have directory structure c:\users\x\appdata\local\microsoft\windows\temporary internet files c:\users\y\appdata\local\microsoft\windows\temporary internet files c:\users\z\appdata\local\microsoft\windows\temporary internet files ... i want delete temporary internet files\*.* c:\users\ x|y|z... \... is there way that? like : edit : @echo off /f "delims=" %%a in ('dir /b /ad c:\users\') ( del /q "c:\users\%%a\appdata\local\microsoft\windows\temporary internet files\"*.* )

performance - An efficient, optimized code for matching rows in a huge matrix -

i have huge matrix on need matching operation. here's code have written , works fine, think there room make more optimized or write code matching in less time. please me that? rowsmatched = find(bigmatrix(:, 1) == matchingrow(1, 1) & bigmatrix(:, 2) == matchingrow(1, 2) & bigmatrix(:, 3) == matchingrow(1, 3)) the problem code cannot use && operand. so, in case 1 of columns not match, program still checks next condition. how can avoid this? update : here's solution problem: rowsmatched = find(all(bsxfun(@eq, bigmatrix, matchingrow),2)); thank you you can use bsxfun in vectorized manner: rowsmatched = find(all(bsxfun(@eq, bigmatrix, matchingrow),2)); notice work number of columns, matchingrow should have same number of columns bigmatrix .

validation - Validators don't stop postback asp.net 4.5 -

here code page_validators undefined <asp:updatepanel id="updatepanel1" updatemode="conditional" runat="server"> <contenttemplate> <fieldset> <div class="form form-horizontal"> <div class="form-group"> <label for="ddlparentcampus" class="col-lg-2 control-label">parent campus</label> <div class="col-lg-4"> <select runat="server" class="form-control" id="ddlparentcampus"></select> </div> </div> <div class="form-group"> <label for="txtcampusname&qu

Can I change the displayed name of the UserName field in ASP.NET MVC IdentityUser? -

i'm using asp.net identity, , have extended identityuser class add own data. i'm using data annotations set display name, etc. of fields, because username field baked-in, can't annotate that. since i'm planning store email address in field, that's 1 want rename! if data annotations non-starter (and assume are), there other way achieve same result? can't override username property , add annotation?

sql - Join/merge 3 tables with count -

i have 3 tables: people: pid name 1 cal 2 example 3 4 person talkingpoints: tid pid talkingpoint 1 1 "..." 2 1 "..." 3 2 "..." facts: fid pid fact 1 3 "..." 2 2 "..." and i'm trying combine count of talkingpoints , facts 'people', example: pid name talkingpoints facts 1 cal 2 null 2 example 1 1 3 null 1 4 person null null (ordered talkingpoints desc, alphabetical, including 'people' rows not have values counts) i managed combine 'people' 1 other table: select a.pid,a.name, count(b.tid) people a, talkingpoints b a.pid=b.pid group b.pid; but query ignores rows 0 count (e.g. row 'person') i hacked query works correctly 'talkingpoints' have not been able adapt combine 'facts' example table

java - How do put each AsyncTask class in a separate file? -

i have few asynstask definined inside of main activity. tried make code more modular putting each 1 of these classes on separate file. unfortunately keep getting errors such not being able intents work. how connect code main activity. way if place code is(without imports) in mainactivity works fine. thanks package com.example.food4thought; import java.net.url; import twitter4j.twitterexception; import twitter4j.auth.requesttoken; import android.content.intent; import android.net.uri; import android.os.asynctask; import android.util.log; import android.widget.toast; // starts intent loads web browser , asks user log in twitter // , pin# public class twitterlogin extends asynctask<url, integer, requesttoken> { protected requesttoken doinbackground(url... arg0) { try { requesttoken = twitter.getoauthrequesttoken(); log.i("got request token", "food4thought"); } catch (twittere

What is the difference between Class actions and Instance actions in AngularJs? -

from docs : class actions return empty instance (with additional properties below). instance actions return promise of action the documentations doesn't differentiate between class actions , instance actions. please point out differences example if possible? when create new resource type, supply list of actions can performed. default, these get , save , query , delete , , remove (i think remove alias of delete). can add own, says in docs. the thing class vs instance in regard convenience of use. "class actions" refers calling action off resource class create itself, kinda static or shared methods in other languages. useful entry point getting, querying, or saving instance of resource when don't have instance. get , query clearest example of this. if have car resource, , need retrieve it, start? class action, of course, such get . now, when resource class retrieves existing instance, or create new instance, $resource extend instance acti

animation - Animated circle using canvas with numbers counting up -

the following jsfiddle http://jsfiddle.net/qsmvn/6/ has animated circles , percentage showing how of circle has been filled. aim have percentages animated move along line right next end of it. can't figure out how that. code of jsfiddle: // requestanimationframe shim (function() { var requestanimationframe = window.requestanimationframe || window.mozrequestanimationframe || window.webkitrequestanimationframe || window.msrequestanimationframe; window.requestanimationframe = requestanimationframe; })(); var canvas = document.getelementbyid('mycanvas'); var context = canvas.getcontext('2d'); var x = canvas.width / 2; var y = canvas.height / 2; var radius = 75; var endpercent = 85; var curperc = 0; var counterclockwise = false; var circ = math.pi * 2; var quart = math.pi / 2; context.linewidth = 10; context.strokestyle = '#ad2323'; context.shadowoffsetx = 0; context.shadowoffsety = 0; context.shadow

java - How to send mail throw BPMN 2.0 with Camunda? -

i try send mail bpmn 2.0 , not delegatetask or listener. i tried : <bpmn2:servicetask id="servicetask_1" name="mailservice" camunda:type="mail"> <bpmn2:extensionelements> <camunda:field name="to" stringvalue="test@test.com" /> <camunda:field name="subject" expression="hello" /> <camunda:field name="html" expression="hello" /> </bpmn2:extensionelements> </bpmn2:servicetask> but fail : caused by: org.camunda.bpm.engine.classloadingexception: not load class: org.camunda.bpm.engine.impl.bpmn.behavior.mailactivitybehavior @ org.camunda.bpm.engine.impl.util.reflectutil.loadclass(reflectutil.java:85) @ org.camunda.bpm.engine.impl.util.reflectutil.instantiate(reflectutil.java:147) ... 43 more caused by: java.lang.noclassdeffounderror: org/apache/commons/mail/emailexception @ java.lang.class.forname0(native method) @

c++ - How to tell lcov to ignore lines in the source files -

i wondering if there possibility tell lcov ignore lines in source files, ie. not report them unvisited. looking solution can put in code itself, like: int some_method(char some_var, char some_other_var) { if(some_var == 'a') { if(some_other_var == 'b') { /* real stuff here */ } else { lcov_do_not_report_next_line // **<-- this?? ** not_implemented("a*") } } else { not_implemented("*") } and necessary background: a big piece of code 1 above being tested in series of unit tests, since code still under development there lot of not_implemented("a*") macros put message on screen line number/filename , exit application. there no tests not implemented branches, written when feature implemented. however lcov reports these not_implemented lines , ugly in coverage report (ie: make high ratio of red lin

android - Multiline notifications -

i need display few lines of text in notification. minimum android sdk 4.0.3. or level 15, "big notifications" available level 16. what can show lines in notification api level 15? i used this: .setstyle(new notificationcompat.bigtextstyle().bigtext(message)) i didn't test on android 4.0.3, not getting compiler- or lint-errors.

Check input of setter in C# arrays -

i made class "kleurencombinatie" , in class there array , set. byte[] combinatie; public byte[] combinatie { { return combinatie; } set { combinatie = value; } } i can chance values of array doing kleurencombinatie combo = new kleurencombinatie(); combo.combinatie[0]++; but problem creates overflow. idea validate input of setter. can modulo(%). dont know how in setter. example how wanted be: byte aantalkleuren; public byte aantalkleuren { { return aantalkleuren; } set { aantalkleuren = value % 7; } //the max value of 6 now. on 6 starts again @ 0 } a solution be, making function this. think possible in setter itself. any ideas how? thanks! if expose raw array through property that, cannot intercept writes elements in order validate values. however, instead write own class implements indexer : public sealed class rangecheckedbytearray { public rangecheckedbytearray(int size) { _data = new byte[size]; }

c# - Related to the oops concepts -

i having basic question can annoy comes in mind when in started reading visual c# e-book. they have mentioned that:: surprisingly, circle class of no practical use. default, when encapsulate methods , data inside class, class forms boundary outside world. fields (such radius) , methods (such area) defined in class can seen other methods inside class not outside world—they private class. so, although can create circle object in program, cannot access radius field or call area method, why class not of use—yet! however, can modify definition of field or method public and circle class given class circle { int radius; double area() { return math.pi * radius * radius; } } so, private fields not accessible when tried in console project , running successfully. have main function in class , that's why can private fields accesed object of program class? class program { int number; static void main(string[] args) {

java - Can I convert an artifactId to a classname prefix in my maven archetype? -

i'm creating maven archetype , in projects generated want class named after artifact id of generated project. the artifact id formatted like: the-project-name , class should named theprojectnamemain . i've tried in archetype-metadata.xml can't right. <archetype-descriptor> <requiredproperties> <requiredproperty key="classnameprefix"> <defaultvalue>${wordutils.capitalize(artifactid.replaceall("-", " ")).replaceall(" ", "")}</defaultvalue> </requiredproperty> </requiredproperties> </archetype-descriptor> as can see tried use wordutils (from apache-commons) i'm guessing not available because i'm getting error. error merging velocity templates:.... . tried different combinations of .replaceall couldn't right format. does know of way go a-hypenated-string camelcaseclassname in case? there no access ar

C++ copy constructor clear up on vector<Base*> of Derived* -

i have class uses class of base pointers derived objects, need have own desructor deleting vector's elements , custom copy , assignment funcitons. i'm not entirely sure preferred way of implementing structure below , writing right copy , assignment constructors , destructors it. may ask guide me? i've read lot , searched i'm still not sure. class base { public: base(); ~virtual base(); int a; int type; // derived1 or derived2 std::string b; ... } class derived1 : public base { public: derived1(); derived1(const base* a); virtual ~derived1(); } class derived1 { derived1::derived1(const base *a) : base(a) { } } class derived2 : public base { public: derived2(); derived2(const base* a); virtual ~derived2(); std::string d1; std::string d2; int d3; } class derived2 { derived2::derived2(const base *a) : base(a) { this->d1 = ((derived2*)a)->d1; this->d2 = ((deriv

java - Servlet - MySQL Error -

i'm trying enter data mysql database following code. appreciated can't work out why there exception. request parameters supplied html form , there don't appear issues @ all, data gets through fine. issue seems occurring after servlet done , somewhere in dao or connection manager. in advance! relevant servlet code: userregistrationbean user = new userregistrationbean(); user.setusername(request.getparameter("username")); user.setpassword(request.getparameter("password")); user.setemail(request.getparameter("email")); user = userdao.register(user); if (user.getexists() == true) { errormessage = "the user name entered has been registered!"; request.setattribute("errormessage", errormessage); request.getrequestdispatcher("/web-inf/register.jsp").forward(request, response);

javascript - div disappears when page refreshed -

can't figure out why below piece of code makes textfield disappear upon page refresh (when 'no' radio button selected). also, after page refreshed default radio button doesn't selected. forcing refresh, fixes problem, though. any ideas? <html> <body> <div class="editfield"> <div id="field_1"> <label> <input type="radio" checked="checked" name="radio-1" id="radio-1_id" value="yes" onclick="document.getelementbyid('divurl').style.display='none'">yes </label> <label> <input type="radio" name="radio-1" id="radio-2_id" value="no" onclick="document.getelementbyid('divurl').style.display='block'">no </label> </div> </div> <div class="editfield&quo

c++ - at() function to a new variable -

i put each char of string new string variable. how can that? #include <iostream> #include <string> using namespace std; int main () { string str = "hello"; string = str.at(0); string b = str.at(1); string c = str.at(2); string d = str.at(3); string e = str.at(4); return 0; } you can treat strings containers, may use following code: char = str[0]; char b = str[1]; and if you'd convert character string, use following code: string a(1, str[0]); string b(1, str[1]);

javascript - jquery auto complete not working -

i have jquery/js code: <script type="text/javascript"> $(function() { var availabletags = ["voip extension rental","voip extension rental","voip extension rental (leasing handsets)","voip extension rental","voip extension rental","voip extension rental","voip ivr rental","voip extension rental. handsets being leased 3 years.","multiple voip call diverts","voip extension rental","voip extension rental","voip extension rental","voip extension rental","voip extension rental","voip extension rental","voip extension rental","voip extension rental","voip extension rental","pstn phone line","pstn\/analogue phone line","pstn\/analogue phone line","pstn\/analogue phone line","pstn\/analogue phone line","pstn\/analogue phone line",&qu

java - Changing SplashScreen Image with SplashScreen.setImageURL(link); -

Image
i've found example in oracle docs splashscreen. problem in example link of image used here passed argument in command line. i'm trying change code link written inside , don't need use command line. methode setimageurl(url imageurl) should able work me, it's not accepting argument (parameter). i read url class, seems needs protocol! protocol http , ftp ? if that's case, how should url files in computer ? when try put link computer (ex: "c:\plash.gif" ) says illege excape character i tried use http link image give me error within url line: non-static method setimageurl(url) cannot referenced static context here's code: package misc; import java.awt.*; import java.awt.event.*; import java.net.url; public class splashdemo extends frame implements actionlistener { static void rendersplashframe(graphics2d g, int frame) { final string[] comps = {"foo", "bar", "baz"}; g.setcomposite(alphaco

sql - Does the LEN() function internally apply TRIM()? -

dooes sql len() function internally trim() data prior calculating length of string? example: declare @a varchar(max), @b varchar(max) set @a = '12345 ' set @b = '12345 7' select @a, len(@a) -- 12345 5 select @b, len(@b) -- 12345 7 7 both @a , @b have 7 characters. @a has 5 numeral characters , 2 spaces @ end. when copying both results results window, can see both variables have length of 7 chars. when trying find length of variables using len() differs. same thing happens while storing data in table varchar column. it excludes trailing blanks according len (transact-sql) " returns number of characters of specified string expression, excluding trailing blanks. " also similar questions why t-sql's len() function ignore trailing spaces? len function not including trailing spaces in sql server

javascript - jQuery code that doesn`t work on WordPress -

i have contact form submit via jquery. works on html/php/js template, when use on wordpress doesn't work fine. the form submited, jquery code inside submit function doesn't exit. doesn't retrieve error loader doesn`t appear , jquery validation doesn't occurs: <form method="post" action="<?php echo get_template_directory_uri() . '/templates/contact.php' ?>" name="contactform" id="contactform"> <div class="col-sm-6"> <fieldset> <input name="name" type="text" id="name" size="30" value="" placeholder="name" /> <br /> <input name="email" type="text" id="email" size="30" value="" placeholder="email" /> <br />

php - How I can save data in two tables simultaneously in laravel? -

Image
i have following data mode l detalle_servicio has many material_usado , material_usado belongs detalle_servicio when save values ​​in material_usado should know id detelle_servido, can not that. have following code route route::post('/upload', function(){ $path = public_path().'/servicios'; try{ $upload_success1 = input::file('foto1')->move($path,'1'); $upload_success2 = input::file('foto2')->move($path,'2'); $upload_success3 = input::file('foto3')->move($path,'3'); $upload_success4 = input::file('foto4')->move($path,'4'); }catch(exception $e) { $e->getmessage(); } $input = input::get('json'); $json = json_decode($input); if($upload_success1 && $upload_success2 && $upload_success3 && $upload_success4) { //db::insert("insert detalle_servicio (rutafoto1, rutafoto2, r

javascript - Using meteor and blaze how to convert template to string for an email body? -

and how can set value of now? ie in js? see how in handlebars. currently meteor not natively support server side rendering of templates, , since sending emails server creates issue. server side rendering on meteor roadmap, can use package. called "handlebars-server" , can found here: https://atmospherejs.com/package/handlebars-server with handlebars-server can compile handlebars templates strings use in emails. package's readme should started , show how set data context.

c# - Sending status message from one class to my Main method -

i have class lengthy foreach loop may take minute or more run, depending on number of records parsing , inserting, updating,etc.. so have 1 class this: public class filemaneger { public bool parsefile() { // ....stuff foreach(datarow row in rows) { // stuff } } } and in program.cs main method : filemanager manager = new filemanager(); console.writeline("parsing started..."); manager.parsefile(); console.writeline("parsing finished."); so thinking maybe in between of 2 messages can show few more feedback, example put counter in foreach loop , every 50 rows passes print console message "parsing rows 1 50 6500 rows", " parsing rows 51 100 6500 rows", etc... so think need write sort of event not experienced events, can part? here started. can use delegates. public class filemaneger { public action<string> trace {get;set;} public bool parsefile() {

Time array in javascript Ember JS -

i want create array of system time following format ["4:01pm","4:06pm","4:11pm","4:16pm","4:21pm","4:26pm"] assuming system current time 4:26pm how can create in javascript getting current system time var = 6, result = [], time = new date(); while (i--) { var hours = time.gethours(), minutes = time.getminutes(); result[i] = ((hours - 1) % 12 + 1) + ':' + (minutes < 10 ? '0' : '') + minutes + (hours < 12 ? 'am' : 'pm'); time = new date(time - 5 * 60 * 1000); } console.log(result); // ["8:59am", "9:04am", "9:09am", "9:14am", "9:19am", "9:24am"]

Python csv comparison using reader -

i tried script compare 2 csv files.. import csv file1 = open("1.csv", "r") reader1=csv.reader(file1) reader1.next() file2 = open("2.csv", "r") reader2=csv.reader(file2) reader2.next() file3 = open("file3.txt", "w") file4 = open("file4.txt", "w") file1.seek(0,0) file2.seek(0,0) list1 = file1.readlines() list2 = file2.readlines() in list1: j in list2: if == j: file3.write(i) file3.write(j) else : file4.write(i) file4.write(j) continue in output getting headers included , plus mismatched files repeating. eg:if 1.csv contains name salary 20000 b 15000 c 10000 2.csv contains name salary 40000 d 10000 b 15000 c 9000 output should be file3: b 15000 b 15000 file4: 20000 40000 c 10000 c 9000 ------(no d in 1.csv) d 10000 try 1 . work

localization - Work with the link with special character (e.g. traditional chinese , empty space) in android -

i working special character in url android however, encounter 2 problem 1) empty space if have query inside url e.g. test.php?test=aaa bbbb cccc then query not include bbbb , cccc, learnt should replace " " %20, however, instead of using replace(" ","%20") , how can in more standard way? 2) traditional chinese in url i have image url this: http://oshc.zizsoft.com/wp-content/uploads/2014/04/1-職安健資訊產品目錄2013-220x300.png if directly pass android, fail. if copy link desktop browser , change this, paste on android, works "http://oshc.zizsoft.com/wp-content/uploads/2014/04/1-%e8%81%b7%e5%ae%89%e5%81%a5%e8%b3%87%e8%a8%8a%e7%94%a2%e5%93%81%e7%9b%ae%e9%8c%842013-220x300.png"; what should encode this? thanks helping update: it change http%3a%2f%2foshc.zizsoft.com%2fwp-content%2fuploads%2f2013%2f12%2fsq1-351x300.jpg how can fix that? thanks 1) try trimming url, wil remove spaces url. guess bit more staanddard way