Posts

Showing posts from March, 2014

acrobat - All fillable fields clear when I open a pdf -

in program load , edit .pdf files. these files print correct data in fillable fields fine. when save them file , open them fields contain data momentarily , cleared. i'm wondering if has insight why happening. tried looking javascript within files might causing , can't find any. tried recreating fields , altering reset button on form wouldn't clear anything, in case calling it. have researched of day , efforts have been fruitless. appreciated. the form secured. noodle around form, you'd have contact issuer , ask non-secured version. however, symptoms if has reset on open functionality. have not found using javascript, reset not done javascript, action. , actions can run pageopen event.

java - For loop printing invalid value? -

i new java programming. developed pizza class takes parameters , outputs description , cost. developed pizzaorderarray class stores pizza orders in array. have class containing main method also. i trying print out cost of order 4 , built-in error message claims pizza_size invalid , prints out value 0.0 . i not understand how value of order 4 's pizza_size printed above yet pizza_size becomes invalid. what missing? pizza.java import java.text.numberformat; import java.util.locale; public class pizza { public pizza(string size, int numcheesetop, int numpeptop, int numhamtop){ if(!setpizzasize(size)){ system.out.println(size + " invalid size." + "use small, medium or large."); } setnumcheese(numcheesetop); setnumpep(numpeptop); setnumham(numhamtop); } public pizza(string size, int numpeptop, int numhamtop){ if(!setpizzasize(size)){ system.out.println(...

Writing R functions to support vectors -

i have function: pcal.getperiodfordate <- function(date_) { dateobject <- as.posixlt(date_) calendarstart <- pcal.getcalendarstart(dateobject$year + 1900) difference <- dateobject - calendarstart if(difference < 0) { calendarstart <- pcal.getcalendarstart(dateobject$year + 1899) difference <- dateobject - calendarstart } period <- difference / 28 week <- ifelse(period < 1, ceiling(period * 4), ceiling((period - floor(period)) * 4)) return(list(period = as.numeric(ceiling(period)), week = week)) } i have data frame following structure > str(sells) 'data.frame': 73738 obs. of 4 variables: $ loc_nbr: chr "2" "2" "2" "2" ... $ sls_dt : date, format: "2015-02-01" "2015-02-02" "2015-02-03" "2015-02-04" ... $ sales : num 1 2 3 4 5 ... i want able this: sells$pd <- pcal.getperiodfordate(sells$sls...

javascript - Cordova StatusBar plugin not working -

i have searched hours on website , others , can't find solution. using this plugin, need have status bar have styledefault on home page, , stylelightcontent on every other page. testing xcode simulator, can set style globally use of <preference name="statusbarstyle" value=“default" /> , when try set lightcontent javascript after leaving home page, doesn’t work. for example, in app.js following nothing: document.addeventlistener("deviceready", ondeviceready, false); function ondeviceready() { statusbar.hide(); } and calling statusbar.hide() or statusbar.styledefault() when i’m loading page breaks it. text-editor (brackets) suggests available properties/methods of statusbar when i’m typing it, when when testing browser says statusbar undefined. what problem?

vis.js - how to place item in center of graph -

i have tree structure next : id: 1 id: 2 id: 8 id: 9 id: 10 id: 11 id: 12 id: 3 id: 13 id: 4 id: 5 id: 6 id: 7 id: 8 and need show (as network graph, not tree) after page loading graph must centered on {id:1} item. how can make it?

python - Matplotlib Basemap Coastal Coordinates -

is there way query basemap extract coastal coordinates? user provides lat/lng , function returns true/false if coordinates within 1km coast? the best way coordinates drawcoastlines() using class attribute get_segments() . there example how can distance coast single point longitude ans latitude in decimal degrees. can adapt function use unique map calculate points in list. hope it's you. from mpl_toolkits.basemap import basemap import matplotlib.pyplot plt import numpy np def distance_from_coast(lon,lat,resolution='l',degree_in_km=111.12): plt.ioff() m = basemap(projection='robin',lon_0=0,resolution=resolution) coast = m.drawcoastlines() coordinates = np.vstack(coast.get_segments()) lons,lats = m(coordinates[:,0],coordinates[:,1],inverse=true) dists = np.sqrt((lons-lon)**2+(lats-lat)**2) if np.min(dists)*degree_in_km<1: return true else: return false another way it: from mpl_toolkits.basemap i...

swift - Simulating Pressing the Home button in xCode 7 UI Automation -

i've got down to: xcuidevice.pressbutton(noideawhatgoeshere) i've tried xcuidevicebuttonhome, home, home, 1 not sure how simulate pressing home button, have pointers? i'm new xcode/swift you need device instance first. simulate pressing home button: xcuidevice.shareddevice().pressbutton(xcuidevicebutton.home) should work (it me on physical device) thanks! mazen

bash - Update root crontab remotely for many systems by script -

i trying update crontab file of 1000+ systems using loop jump host. the below doesn't work. echo -e 'pass365\!\n' | sudo -s echo 'hello' >> /var/spool/cron/root -bash: /var/spool/cron/root: permission denied i have (all) in sudoers file. this solution; echo 'pass365\!' | sudo -s bash -c 'echo "hello">> /var/spool/cron/root'

c# - EF - Remove a relationship from parent entity -

let's have 2 classes in model: product , category . public class product { public product() { this.categories = new hashset<category>(); } [...] public virtual icollection<category> categories { get; set; } } public class category { public category() { this.products = new hashset<product>(); } [...] public virtual icollection<product> products { get; set; } } a product has many categories , categories apply many products. model relationship have following code in onmodelcreating method: modelbuilder.entity<product>() .hasmany( p => p.categories ) .withmany( p => p.products ) .map( m => { m.mapleftkey( "productid" ); m.maprightkey( "categoryid" ); m.totable( "categoriesperproduct" ); } ); modelbuilder.entity<category>() .hasmany( p => p.products ) .wit...

c# - can I pass a custom property to NLOG and output to file? -

edit 4: "from" seems reserved word in nlog. changing "fromid" worked. awesome way pass variables nlog , still keep code clean !!!! thank mike!!! edit 3. idea.: implemented helper class mike suggested below: public class nloghelper { // // class properties // private logger m_logger; private dictionary<string, object> m_properties; // // constructor // public nloghelper(logger logger) { m_logger = logger; m_properties = new dictionary<string, object>(); } // // setting logger properties per instancce // public void set(string key, object value) { m_properties.add(key, value); } // // loggers // public void debug(string format, params object[] args) { m_logger.debug() .message(format, args) .properties(m_properties) .write(); } and in main code, have: private nloghelper ...

c# - How to use a resource file in Visual Studio 2015 -

Image
i'm creating integration tests (web class library project) asp5 mvc6 application. want add resource file raw sql test project db preparation. i wanted use old resources (.resx). it's not available in add new item project's menu. i found this answer pointing github repo . guess reads file: using (var stream = fileprovider.getfileinfo("compiler/resources/layout.html").createreadstream()) using (var streamreader = new streamreader(stream)) { return streamreader.readtoend().replace("~", $"{basepath}/compiler/resources"); } i tried using system.io.file.readalltext("compiler/resources/my.sql") in test helper project in testhelper class. when used testhelper class in actual test project looking the file in test project directory. testproject/compiler/resources/my.sql insetad of testhelperproject/compiler/resources/my.sql i can figure out couple of wor...

javascript - MongoDB query on node.js express becomes very slow under load testing -

i started doing load testing on node.js/express web app running mongodb. have particular page loaded hitting end point this: app.get("/project/:pid", function(req, res) { // project.viewproject(db, req, res); project.viewprojectsimple(db, req, res); }); this in turn calls function show project page associated pid. have simplified as possible include single db query function still collapses under minor stress test. here function renders project: exports.viewprojectsimple = function(db, req, res) { console.time("project"); var pid = req.params["pid"]*1; console.time("1"); db.collection("projects").findone({pid:pid}, function(err, project) { console.timeend("1"); if( !project ) res.send("no such project..."); else { console.time("2"); project.user = {}; project.user.name = "test"; if( project.created ) project.nicecreateddate...

python - Intra-package imports do not always work -

i have django project structured so: appname/ models/ __init__.py a.py base.py c.py ... appname/models/__init__.py contains statements so: from appname.models.base import base appname.models.a import appname.models.c import c ... , appname/models/base.py contains: import django.db.models class base(django.db.models.model): ... and appname/models/a.py contains: import appname.models models class a(models.base): .... ...and appname/models/c.py, etc.. i quite happy structure of code, of course not work, because of circular imports. when appname/__init__.py run, appname/models/a.py run, module imports "appname.models", has not finished executing yet. classic circular import. so supposedly indicates code structured poorly , needs re-designed in order avoid circular dependency. what options that? some solutions can think of , why don't want use them: combine model code single file: having 20+ classes in same ...

jquery - Creating custom data attribute in Rails image_tag -

i trying add custom data attribute rails image_tag allow jquery function. first, starting image_tag so: <%= image_tag("randomv1.png", class: "icon js-icon") %> second, jquery, need image_tag trigger event, , want include data attribute 1 using button here: <button class="icon js-icon" data-icon-text="random">icon graphic</button> adding class attribute easy, need data-icon-text function attribute data displayed after .hover. based on this previous question , tried modify image_tag: <%= image_tag("randomv1.png", :class "icon js-icon" :data => { :icon-text => "random" }) %> since delivering error, can create custom attribute? try this: you have revised class need => . then, have change :icon-text string "icon-text" . <%= image_tag("randomv1.png", :class => "icon js-icon", :data => { "icon-text" => ...

How can i detect null value in excel? -

i have problem value detection in excel. when doesn't have value in cell want excel show me message warning rather 0 value , have code below. public function mysum(a range, b range) string if isnull(a) , isnull(b) mysum = "no value sir" else mysum = a.value + b.value end if end function here few ways validate parameters option explicit public function mysum(a range, b range) string dim itmsok boolean mysum = "no value" 'default return value, if or b not valid itmsok = (not nothing , not b nothing) 'validate range objects if itmsok itmsok = (not isnull(a.value2) , not isnull(b.value2)) 'db vals if itmsok itmsok = (len(trim(a.value2)) > 0 , len(trim(b.value2)) > 0) 'empty if itmsok itmsok = (isnumeric(a.value2) , isnumeric(b.value2)) 'numbers if itmsok mysum = val(a.value2) + val(b.value2) 'if both valid, perform math end function (c...

networking - Java EOFException While Reading Object From A Server (not a file) -

this question exact duplicate of: why objectinputstream readobject() throwing eof exception 1 answer so, write object client so: objectoutputstream out = new objectoutputstream(client.getoutputstream()); out.writeobject(args); out.close(); and receive object on client side so: objectinputstream in = new objectinputstream(connection.getinputstream()); object objin; while(true) { if((objin = in.readobject()) != null) { //work obj } } i never create output stream on client side or input stream on server side. also, object send serializable. thanks help! edit: "duplicate" of question doesn't me answer problem, 1 not duplicate. while(true) { if((objin = in.readobject()) != null) { //work obj } } q. why testing null ? planning on sending null ? because that's time you'll ever one. a. because th...

constraints - matlab - plot trendline with specific condition(e.g. slope at specific x value, must past through specific point,etc) -

good day. i got scatter plotted in matlab. want plot trendline of data on plot well. instead of normal quadratic curve fitting, want constrain trendline slope=0 when x=0. how achieve that? and out of curiosity, how constrain trendline must pass through specific point? setting intercept in excel? and can trendline have multiple constrain described above? thank you. you want fit quadratic, a*x^2+b*x+c data, want derivative 0 somewhere. constraint relate variables. derivative 2*a*x+b 0 @ x=0 , need b=0 . trying fit a*x^2+c data. not difficult, a=[x(:).^2 ones(size(x(:)))]; coeffs=a\y(:); fittedy=@(x) coeffs(1)*x.^2+coeffs(2) and fittedy(x) gives value of fitted curve @ x . if want fit have value, rather derivative somewhere, similar thing. want fit equal 1 @ x=1 . a+b+c=1 , set c=1-b-a , function fit a*x^2+b*x+1-b-a . you can use 3 such constraints, using 3 constraints (in general) uniquely determine quadratic function, there no parameters left fit with. ...

ios - Unable to find Cocoapod MotionKit framework Derived Data -

Image
i installed library pod. got following error when build app: error: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/otool: can't open file: \ /users/taiyuanz/library/developer \ /xcode/deriveddata/rollingball-gbmnblxxirswheemtfgncxsqywkj/build/\ products/debug-iphoneos/ballman.app/frameworks/motionkit (no such file or directory) this happens after upgraded xcode. how fix such error? xcode > window > projects > [project] > delete

regex - How to search for alphanumeric substring of specific length in Python? -

say have string "ldhjshjds hdajhdshj4 hdsshj4 kdskjdshjdsjds" i want search substrings (alphanumeric only) starting "h", if string between 10-20 characters. "hdajhdshj4" match. "hdsshj4" not. would such regex costly on cpu cycles? r"\bh[a-za-z0-9]{9,19}\b" looks precisely that.

php - doctrine 2 mapping - many to many thows exception when trying to persist owning side -

i'm new doctrine , got stuck. appreciated. created 2 entities: task , group many many relation group being owning side. tried persist them. task gets persisted, group trows sql exception. here code task.php : <?php namespace appbundle\entity; /** * task */ class task { /** * @var integer */ private $id; /** * @var string */ private $task; /** * @var \datetime */ private $duedate; /** * @var \doctrine\common\collections\collection */ private $groups; /** * constructor */ public function __construct() { $this->groups = new \doctrine\common\collections\arraycollection(); } /** * id * * @return integer */ public function getid() { return $this->id; } /** * set task * * @param string $task * * @return task */ public function settask($task) { $this->task = $task; return $this; } /** * task * * @return string */ public function gettask() { return $this->task; } /** * set duedate * * @param \datetime $duedat...

looping in Spring batch -

i have simple configuration in spring batch first step: <batch:job id="collaborationjob" > <batch:step id="collaborationjobstep1"> <batch:tasklet> <batch:chunk reader="collaborationalertreader" processor="writecollaborationpruningprocessor" writer="alertcollaborationpruningwriter" commit-interval="10"> </batch:chunk> </batch:tasklet> <batch:next on="*" to="collaborationjobstep2" /> <batch:next on="failed" to="collaborationjobstep4"/> </batch:step> if read number of rows < 10 in itemreader fine, if number of rows >= 10 enter in repeation loop: 2015-09-29 17:02:40,782 debug [org.springframework.batch.core.step.tasklet.taskletstep] - <saving step execution before commit: stepexecution: id=1332, version=878, name=collaborationjobstep1, stat...

Set crystal report textobject bold at runtime using C# -

i'm updating text objects in crystal report in c# code this, reportdocument rptdoc = new reportdocument(); rptdoc.load(environment.currentdirectory + @"\test.rpt"); textobject txttest = (textobject)rptdoc.reportdefinition.reportobjects["txttest"]; txttest.text = "test"; now want bold text in "txttest" text object. i'm looking this, txttest.font.bold = true; but unfortunately read-only. finally, have found solution. system.drawing.font font1 = new system.drawing.font("arial", 12, fontstyle.bold); txttest.applyfont(font1);

php - Codeigniter explode to html table -

i'm having issue explode html table. my controller public function idp_test() { $this->load->model('groups/groups_model'); $scholar_id = $this->session->userdata('scholar_id'); $groups = $this->groups_model->retrieve_groups_idp($this->scholar->level_id); $content = array( 'groups' => $groups, 'scholar' => $this->scholar, 'page_title' => 'my individual development plan', 'page_view' => 'scholar/activities/idp_test', 'page_scripts_view' => 'scholar/inc/_choose_activities_scripts', 'sidebar_menu' => 'idp test' ); $this->load->view("theme/base", $content); } my model public function retrieve_groups_idp($level_id) { $this->db->select("groups.*, levels.name levelname"); $this->db-...

New BigQuery pricing 'tiers' -

according pricing page , new tiered pricing model introduced bigquery on january 1st 2016. we'd able predict cost implications may have our applications. we've taken @ json response of our more complex queries see 'tier' has been assigned it. the billingtier tier visible in json response. 200 ok - show headers - { "kind": "bigquery#job", [...] "totalbytesprocessed": "45319172942", "query": { "totalbytesprocessed": "45319172942", "totalbytesbilled": "45319454720", "billingtier": 1, "cachehit": false } is default tier assigned (tier 1) until new pricing model kicks in on jan 1st 2016, or true indication of tier assigned query? the billingtier field true indicator of tier assigned query according our upcoming pricing structure. if field set 1, query billed @ current (tier 1) rates under new pricing structure. note billing t...

java - How do I go through the String to make sure it only contains numbers in certain places? -

i writing take user's input phone number , tell user if input valid or not based on 5 parameters: input 13 characters in length char @ index 0 '(' char @ index 4 ')' char @ index 8 '-' all other characters must 1 of digits: ’0’ through ’9’ inclusive. so far have down except 5th parameter. code goes followed if (number.contains("[0-9]+")) { ints = true; if (number.contains("[a-za-z]*\\d+.")) { ints = false; } } else { ints = false; } (side note: number string user's input, , ints boolean declared earlier in code). you can use following. if string correct print valid , otherwise print invalid . public void compare(){ string inputstring="(123)848-3452"; if(inputstring.matches("^\\([0-9]{3}\\)[0-9]{3}-[0-9]{4}")){ system.out.println("valid"); }else{ system.out.println(...

removing .html or .PHP URL extension using .htaccess not working -

can me remove .html or .php extension in url. i trying below code in php project, not working. have tried many .htaccess codes, nothing helps me.. rewriteengine on rewritecond %{request_filename} !-d rewritecond %{request_filename}\.html -f rewriterule ^([^/]+)/$ $1.php thanks in advance previously faced problem removing .html or .php extension form url. i have solution here options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / ## hide .php extension # externally redirect /dir/foo.php /dir/foo rewritecond %{the_request} ^[a-z]{3,}\s([^.]+)\.php [nc] rewriterule ^ %1 [r,l,nc] ## internally redirect /dir/foo /dir/foo.php rewritecond %{request_filename}.php -f rewriterule ^ %{request_uri}.php [l] put above code in .htaccess file, above code .php files. .html files go through below code options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase / ## hide .php extension # externally redirect /dir/f...

jsp - RequestDispatcher.forward() vs HttpServletResponse.sendRedirect() -

what conceptual difference between forward() , sendredirect() ? requestdispatcher - forward() method when use forward method, request transfer other resource within same server further processing. in case of forward, web container handle process internally , client or browser not involved. when forward called on requestdispatcher object pass request , response objects our old request object present on new resource going process our request. visually not able see forwarded address, transparent. using forward () method faster send redirect. when redirect using forward , want use same data in new resource can use request.setattribute () have request object available. sendredirect in case of sendredirect, request transfer resource different domain or different server further processing. when use sendredirect, container transfers request client or browser url given inside sendredirect method visible new request client. in c...

oracle sqldeveloper - Why the status failed while creating a new connection? -

i using oracle sql developer. when trying create new connection, getting following error. "status: failure-test failed: io error: network adapter not establish connection" but, succeeded in creating new connection editing properties of existing connection. why throws error while trying formal way?

c# - Is there an alternate to TemplatePartAttribute in UWP? -

it took me bit of time discover this, designer-specific attributes templatepart causing issues release build of uwp application. applying attribute controls using reflection. [templatepart(name = part_panel, type = typeof(panel))] public class myawesomecontrol : control { ... } and build output gives me this: warning : type 'windows.ui.xaml.controls.panel' not included in compilation, referenced in type 'myawesomecontrol'. there may have been missing assembly. if want build work, have exclude attribute. however, defeats purpose of control library. users of library not know panel name part_panel required in template of myawesomecontrol. is there solution this? have enable reflection type allow design-time attributes through? i aware of rd.xml file can embedded in project. however, if <type name="windows.ui.xaml.controls.panel" ... /> included, doesn't mean i'm telling compiler exclude panel .net native optimizatio...

c# - How to Dispose an object using Dispose method -

this question has answer here: proper use of idisposable interface 18 answers how dispose managed or unmanaged objects using dispose method? in application class implemented idisposable interface , gave overridden method dispose(). actual doubt how dispose managed or unmanaged code in dispose method. public override void dispose() { // should unmanaged objects? // can make object set 'null'? } the dispose method works using statement. automatically called if using block closed. class : idisposable { public void dispose() { // dispose } } using (a = new a()) { } you don't need override method, because defined in interface. in case using leaved, dispose called.

how to specify the extension target library with cocoapods -

Image
i have podfile this: target :'my app', :exclusive => true pod 'afnetworking' pod 'afdropdownnotification' end target :'my app extension', :exclusive => true pod 'afnetworking' end but after run 'pod update', , run extension target, shows error this.

eclipse - java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465 -

hello people of stackoverflow! i've been trying hands on javamail api // recipient's email id needs mentioned. string = "toaddrs@gmail.com";//change accordingly // sender's email id needs mentioned string = "fromaddrs@gmail.com";//change accordingly final string email = "emailaddrs@gmail.com";//change accordingly final string password = "xxxxxxxxx";//change accordingly // assuming sending email through relay.jangosmtp.net string host = "smtp.gmail.com"; properties props = new properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", host); props.put("mail.smtp.port", "465"); // session object. session session = session.getinstance(props, ...

xpath 2.0 - how to select an element in the list of elements using selenium? -

Image
i click on drop down list button.then coming mentioned picture. have click on item1. after have select xyz. way should follow? you can many ways. by using getfirstselectedoption() can select first element , using selectbyvisibletext("xyz") selenium click on xyz thing dom must contain select attribute dropdown there many other ways create dropdown option in html select dropdown = new select(driver.findelement(by.xpath("//img[@id='ext-gen7']"))); dropdown.getfirstselectedoption(); dropdown.selectbyvisibletext("xyz"); now if dom not using select creating dropdown can use .click() method directly. find elements , click on location directly using .click() . work many times. list<webelement> examples = driver.findelements(by.xpath("your xpath")); (webelement option: examples) { if(option.gettext().contains("item2") ) option.click(); else{ syso("i not wan...

spring jms - DefaultMessageListenerContainer ignore if queue is missing -

i have app deployed in tomcat. have activemq listener configured spring bean. on starting tomcat server, app able connect broker, reason queue missing. due reason tomcat server doesn't start up. there way skip listener-startup if queue missing? set autostartup false on dmlc. then, in application, try start() container , catch exceptions.

swift - iOS 9 Command failed due to signal: Segmentation fault: 11 -

i upgraded xcode 7. , code working fine on 6.3 , ios 8.4 not compile segmentation fault. i using stephencelis library of sqlite. seems causing problem. i appreciate help, ideas. below last part of error msg: while type-checking getter columnnames @ /users/luben/downloads/sqlite.swift-master/sqlite/query.swift:740:22 while type-checking declaration 0x7fbab3ee2d68 @ /users/luben/downloads/sqlite.swift-master/sqlite/query.swift:740:51 while type-checking expression @ [/users/luben/downloads/sqlite.swift-master/sqlite/query.swift:740:51 - line:774:7] rangetext="{ var (columnnames, idx) = (string: int, 0) column: each in self.query.columns ?? [expression(literal: "*")] { let pair = each.expression.sql.characters.split { $0 == "." }.map { string($0) } let (tablename, column) = (pair.count > 1 ? pair.first : nil, pair.last!) func expandglob(namespace: bool) -> query -> void { return { table in var...

meteor - How do you add values to AutoForm's form object without using a form? -

i've got form created through autoform. as far data sources, can fill in parts of form , use: autoform.getformvalues('form-id').insertdoc // returns contents of form when validate form can do: var formvalues = autoform.getformvalues('form-id').insertdoc; var isvalid = mycollection.simpleschema().namedcontext("mycontext").validate(formvalues); // if isvalid returns true, enable submit button instead of filling in parts of form, want manually add information whatever object autoform uses validation , submission collection. for example, there data fields in schema don't need appear in form itself. take shopping cart: shoppingcartschema = { totalprice: { type: number, optional: false }, itemsselected: { type: [object], optional: false } }; the data itemsselected provided through user input on form. the data totalprice should not form input. it's generated in code. but totalprice still needs valida...

Java program that will ask the height and width of a rectangle and display the rectangle using "*" and "+" -

i having trouble program , quite frustrating! ive been trying solve cant pls need help.all can import java.util.*; public class main { public static void main(string[] args) { scanner s=new scanner(system.in); system.out.print("enter height: "); int h = s.nextint(); system.out.print("enter width: "); int w = s.nextint(); (int i=1; i<=h; i++) { (int j=1; j<=w; j++) { system.out.print("*"); } system.out.println(); } } } the output of program is: enter height: 4 enter width: 4 **** **** **** **** and desired output should be: enter height: 4 enter with: 4 ++++ **** ++++ **** another thing write program same different output be: enter height: 3 enter width: 10 +*+*+*+*+* +*+*+*+*+* +*+*+*+*+* thanks in advance help. ] 1 for first solution, put code inside inner loop if(i%2==1) syst...

html - Changing file encoding in Exchanger XML editor -

i have been searching hours file encoding settings exhanger xml editor, though no success. please me? for changing encoding of existing file: xml menu -> set xml declaration... not intuitive, think :)

php - CodeIgniter - Message: mkdir(): Permission denied on Ubuntu -

i'd please. have php script inside post_model constructor $dir = fcpath . 'uploads' . directory_separator . 'posts'; if (!is_dir($dir)) { mkdir($dir, 0755, true); } which shows me error: severity: warning message: mkdir(): permission denied the main idea project has ability create users , these users can upload images, or create folders-albums stored in uploads folder. i've been struggling fix error last days , can't find solution. have tried code , on windows , works great, not on linux (ubuntu 14.04) even had same problem , tried umask, worked. can this, $old = umask(0); mkdir($dir, 0755, true); umask($old);

ios - ViewController allocation and deallocation problems -

Image
i have 2 "loops" in app between viewcontroller. first loop game-loop. @ first vc level displayed. second vc game screen , if game finished, third vc appear bonus point, stars, , on. the second "loop" 3 vc swiping. ok, problem? have problems deallocations. example, overtime swipe, locations going in sínstruments, curve getting higher , higher... also game loop. can't deallocate vc before. i think didn't understand correctly how [self dismissviewcontrolleranimated:no completion:nil]; works. is right, method sent parent vc, , parent vc deallocate vc execute method? is parent vc initial vc? how can dismiss , deallocate view controllers correctly in "loops"? now, allocing curve in instruments getting higher , higher @ each level, , level 18-21 app crashing, think because of allocations. can tell me hoe can solve problems? to begin questions: is right method sent parent vc, , parent vc deallocate vc execute method? ...

git - Why should I have conflict after push->amend->amend->amend->push->pull? -

in question git prevents pushing after amending commit been mentioned that: this should case if you're amending already-pushed commit but did steps below: pushed bunch of code commit --amend commit --amend commit --amend pushed pull (conflict (content)) this conflict can happend in future too, don't understand why did conflict happen! shed light on process? in step 4: $ git commit --amend [dev cf0f21d] blahhh(blah) added date: wed sep 30 08:39:28 2015 +0330 5 files changed, 168 insertions(+), 1 deletion(-) in step 5: $ git push origin dev repo:~/something ! [rejected] dev -> dev (non-fast-forward) error: failed push refs 'repo:~/something' hint: updates rejected because tip of current branch behind hint: remote counterpart. integrate remote changes (e.g. hint: 'git pull ...') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details. in steps 2, 3, 4 amending co...

Not able to access bootstrap modal dialog in Selenium Webdriver -

i want access content of model dialog box open, , want access buttons (yes,no). here html code looks like <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"><div class="bootstrap-dialog-header"> <div class="bootstrap-dialog-close-button" style="display: none;"> <button class="close">×</button> </div> <div class="bootstrap-dialog-title" id="e6adf6aa-dcbf-4fb8-9935-c083762f2812_title"> inactivate user </div> </div> </div> <div class="modal-body"> <div class="bootstrap-dialog-body"> <div class="bootstrap-dialog-message"> sure want inactivate user? </div> </div> </div> <div class="modal-footer"> <div class="boo...

c# - Is it possible to have a static list of Styles in Xaml -

i have static list of styles in xaml so far have tried: <local:styles xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:myapp.core;assembly=myapp.core"> <style x:key="labelstyle" targettype="label"> <setter property="textcolor" value="green" /> </style> </local:styles> code behind public partial class styles : list<style> { public styles() { } } but when do var styles = new styles(); the class empty. as aside can't use application resources or resourcedictionary you can place styles in resourcedictionary (add -> new item -> resource dictionary): <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml...

ios - Transfer App option not available iTunes Connect -

Image
i have created app long time ago on itunes account , transfer on different itunes account. after googling found transfer app available @ under app information > additional information > transfer app like here unable find transfer app option on account like here . have read criteria transferring app. please let me know can do. your app not published . thats why cannot transfer other account the app status can 1 of following , assuming there @ least 1 approved version of app

python - Any big projects using Pypy? -

i have large heterogeneous python codebase uses django front-end. codebase deployed alongside several servers beginning show strain , we're looking ways speed things while re-architect codebase, , keep new code running fast. we're looking @ pypy seems bit iffy. has many limitations , requires refactoring lot of code (can't concatenate strings "+"?). does have experience it? there large scale websites using it? migration cpython pypy last thing should consider when thinking web site performance (after architecture, database, caching, distributed queues, etc.). , if absolutely need code-level optimizations (as shown thorough profiling), consider going straight c/c++ ultimate speed. pypy mostly compatible cpython on language , standard library level, it's incompatible many cpython c extensions (and compatible ones may work slower ). if site pure python , has proper test coverage, can check if works pypy , if it's considerably faster or not...

php - Symfony2 i18n: Is there a way to use the country code instead of the language in the route? -

working on app in symfony 2 , looking @ internationalisation/localisation. default behaviour routing use language works fine i18n not l10n. i.e. content site different uk content route /en. we use /en_gb in route, nicer if use /gb (or better yet, /uk) is there way of doing doesn't involve inventing our own way of handling locales?

excel - Audit local accounts status, name, fullname, group membership & description -

i need export result column-based excel file or comma separated file (csv) able process result in sql server 2008 r2. i in need local user account's names, full names, group membership , description. i have been googling quiet bit , found out status in way using adsi, presented in following modified script: clear get-content "c:\scripts\servers.txt" | foreach-object { $comp = $_ if (test-connection -computername $comp -count 1 -quiet) { ([adsi]"winnt://$comp").children | ? {$_.schemaclassname -eq 'user'} | % { $groups = $_.groups() | % {$_.gettype().invokemember("name", 'getproperty', $null, $_, $null)} $_ | select @{n='användarnamn:';e={$_.name}}, @{n='fullständigt namn:';e={$_.fullname}}, @{n='senast använt:';e={$_.lastlogin}}, @{n='tillhör grupp(er):';e={$groups -join ';'}}, @{n='beskrivnin...