Posts

Showing posts from April, 2013

php - smarty not display text with double quotes -

i using smarty template. fetching 1 issue rendering. have 1 variable value of variable this text" data but when print value in tpl file prints this text except this text" data why happening? please in advance in smarty can escape data using {$variable|escape:'format'} in case format of html should trick {$variable|escape:html} ref: http://smarty.net/docsv2/en/language.modifier.escape.tpl

How to get ProcessStartInfo with arguments from a java process By using C#? -

i trying java process object using c#. thing have several java processes running on computer. following way chose processes: process[] processes = process.getprocessesbyname("java"); foreach(process proc in processes){ //i need filter here correct process. } the java process controlled c# program below: processstartinfo startinfo = new processstartinfo(); startinfo.filename = javahome + "\\bin\\java.exe"; startinfo.arguments = "-jar example.jar port=88888"; startinfo.workingdirectory = "\\testfolder"; startinfo.useshellexecute = false; startinfo.createnowindow = true; process proc = new process(); proc.startinfo = startinfo; proc.start(); what want go through array of process check 1 has same arguments process object started in program. problem when did this: console.writeline(proc.startinfo.arguments); i found there nothing in it, know process started in program. confused me lot. does know issue? you ca...

java - session replication and clustering in tomcat? -

i have configured httpserver2.2 achieve load balancing , clustering for java application. but load balancing works fine , clustering(session replication) not works . my worker.properties in httpserver , workers.java_home=c:/program files/java/jdk1.6.0_25 #worker.list=worker1,worker2 worker.list=balancer worker.worker1.port=8009 worker.worker1.host=localhost worker.worker1.type=ajp13 worker.worker1.lbfactor=1 worker.worker2.port=8019 worker.worker2.host=192.168.100.84 worker.worker2.type=ajp13 worker.worker2.lbfactor=1 worker.balancer.type=lb worker.balancer.balance_workers=worker1,worker2 worker.balancer.method=b # specifies whether requests session id's # should routed same #tomcat worker. worker.balancer.sticky_session =true and httpd.conf be, <ifmodule jk_module> jkworkersfile conf/workers.properties jklogfile logs/mod_jk.log jkloglevel info jkmount /customerchat_v1.02.00 balancer jkmount /customerchat_v1.02.00/* balance </ifmodule> in ...

BizTalk ESB 2.1 - Right message, wrong message type -

i have request/response itinerary made of orchestration extenders. works fine including message sent web service. in receive port there outbound map never gets fired. have tracked down fact message, although correct, has wrong message type context. infact has context of message few steps in itinerary. why , how can solve issue? btw have tried changing context in pipeline component followed esb transform component no avail. not particularly satisfactory solution in end took maps out of receive port. colleague had suggested best practice have layer of abstraction in fact relevant 'classic' biztalk. the issue in particular case appears have 2 identical schemas different namespaces. reason being if external schema changed map internal in port without changing else. again useful classic biztalk negates changes orchestration not relevant esb.

JSON File Parse Python -

[{"cat1":136803,"cat2":"1.4545","cat3":"0.0885","cat4":"112969"}, {"cat1":1564654,"cat2":"2.5448","cat3":"0.0568","cat4":"5468489"}, {"cat1":5484654,"cat2":"1.8948","cat3":"0.0478","cat4":"898489"}] i have json structure looks 1 above. my code: import json pprint import pprint open('file/path') data_file: data = json.load(data_file) data["cat1"] give me error list indicies must integers not, str how can parse return want, "cat1"? my goal parse out want json file , write csv file. your json structure list of dictionary. so, have write: data[0]["cat1"]

iphone - Testing class method using OCMock release 2.1.1 -

i trying check if class method getting invoked using ocmock. have gathered ocmock website , other answers on new ocmock release (2.1) adds support stubbing class methods. i trying same: detailviewcontroller: +(bool)getboolval { return yes; } test case: -(void) testclassmethod { id detailmock = [ocmockobject mockforclass:[detailviewcontroller class]]; [[[detailmock stub] andreturnvalue:ocmock_value((bool){yes})] getboolval:nil]; } the test running , succeeding succeeds if return no instead of yes getboolval method in detailviewcontroller. on keeping breakpoint on method, test execution not stop indicating method not called. how check class method then? please help. edit just looked more closely @ latest version of ocmock , think you're correct in interpreting way mock class method you're directly testing, issue you're calling wrong signature? the answer below general case (so useful when method under test calls out class method). original ...

php - Is Cron the only method to run scheduled tasks? -

is cron(or derivatives) method run scheduled programming tasks? example: charge clients' credit card @ 3 days before x send e-mail 6 hours time x execute xyz command every hour is there resource/books teach how implement these features in clean way(python, ruby(or ror), python)? my current dirty method have wrapper script in crontab running every minute check if tasks should run. don't this. prefer method can programatically implement scheduled tasks. for python can use celery for example executing command every hour this: from celery.task.schedules import crontab celery.decorators import periodic_task @periodic_task(run_every=crontab(hour=3)) def every_three_hour(): print("this runs every 3 hour") and execting 3 hours look: from datetime import datetime yourtask.apply_async(args=[some, args, here], eta=datetime.now()+datetime.timedelta(hours=3))

parallel processing - Is there a limit on the number of slaves that R snow can create? -

i'm trying build snow cluster around 120 processes on 3 different hosts. these amd servers 48 cores each. after building approx first 90 slaves error: cl = makesockcluster(c(rep("localhost", 44), rep("host2", 46), rep("host3", 45))) error in socketconnection(port = port, server = true, blocking = true, : connections in use > traceback() 3: socketconnection(port = port, server = true, blocking = true, open = "a+b") 2: newsocknode(names[[i]], options = options, rank = i) 1: makesockcluster(c(rep("localhost", 44), rep("host2", 46), rep("host3", 45))) i checked system limits , don't see problem: # cat /proc/sys/fs/file-max 12897622 # grep "#define __fd_setsize" /usr/include/*.h /usr/include/*/*.h /usr/include/linux/posix_types.h:#define __fd_setsize 1024 # ulimit -a |grep open open files (-n) 65536 is there limit on number of processes snow can c...

c# - "EntityType has no key defined" exception although key is defined with HasKey -

using ef 5 (reverse engineered code first), model working fine until stopped. \tsystem.data.entity.edm.edmentitytype: : entitytype 'projectsdate' has no key defined. define key entitytype. \tsystem.data.entity.edm.edmentitytype: : entitytype 'projectsrisk' has no key defined. define key entitytype. i define key using fluent api rather attributes, here projectsdates classes. public partial class projectsdate { public string osprojectcode { get; set; } public nullable<system.datetime> targetstart { get; set; } public nullable<system.datetime> enddateoriginal { get; set; } public nullable<system.datetime> enddatechangecontrol { get; set; } public nullable<system.datetime> enddateactual { get; set; } public nullable<system.datetime> goliveagreed { get; set; } public nullable<system.datetime> goliveactual { get; set; } public virtual project project { get; set; } } public class projec...

How to return from a function completely in JQuery -

i have form, in contains number of input fields. when user click submit button, validate user input. because form (suppose it's alike resume) contains few similar field, such year, school, diploma, etc. use jquery attribute selector choose these similar fields , use jquery each function iterate them validation. code below. $("#submit_btn").click(function () { $('input[name="education_year[]"]').each(function(){ if (!$(this).val()) { alert("education year empty !"); return; } }); $('input[name="diploma[]"]').each(function(){ if (!$(this).val()) { alert("diploma field empty"); return; } }); }); because user may leave several fields empty, want code gives out 1 alert. however, in code above, return keyword doesn...

How to sort array by something in php? -

this question has answer here: sort array of objects object fields 12 answers i have data this array([0] => stdclass object ( [id] => 1 [title] => aaaa [sentence] => abcdefgh [rank] => 3 ) [1] => stdclass object ( [id] => 2 [title] => bbbb [sentence] => ijklmn [rank] => 1 ) [3] => stdclass object ( [id] => 3 [title] => ccc [sentence] => opqrstu [rank] => 2 )); show data: foreach($data $d) { $title = $d->title; $sentence = $d->sentence; $rank = $d->rank; echo $title. " | " .$sentence. " | " .$rank. "<br>"; } how sort 'rank'? help. you can use php's usort function uses objects' attribute rank criteria: function rank_compare($a, $b) { return $a->rank - $b->rank; } usort($data, 'rank_compare'); more info: htt...

gdal - Obtaining Latitude and Longitude with from Spatial objects in R -

i want obtain latitude , longitude shapefile. until now, know how read shapefile. library(rgdal) centroids.mp <- readogr(".","35dse250gc_sir") but how can extract latitude , longitude centroids.mp? there's few levels question. you ask longitude , latitude, may not coordinate system used object. can coordinates this coordinates(centroids.mp) note "centroids" of coordinates if spatialpointsdataframe, list of line coordinates if spatiallinesdataframe, , centroids if spatialpolygonsdataframe. the coordinates may longitude , latitude, object may not know that. use proj4string(centroids.mp) if "na", object not know (a). if includes "+proj=longlat", object know , longitude/latitude (b). if includes "+proj=" , other name (not "longlat") object know , it's not longitude/latitude (c). if (a) you'll have find out, or might obvious values. if (b) done (though should check as...

javascript - AngularJS routing configuration -

i new angularjs, trying build crud app it. my code http://jsfiddle.net/fpnna/1/ and using apache webserver, when turing on $locationprovider.html5mode(true); then getting uncaught typeerror: object #<ic> has no method 'html5mode' testapp when clicking "add new" path changing "/new" getting error 404 requested url /new not found on server. any idea doing wrong. i went through official manual, couldn't figure out. thanks in advance. you have couple issues, first in jsfiddle don't need body tags plus have multiple body tags. fiddle has 2 ng-apps, routes defined incorrectly (should /new instance), invalid ng-view closing tag, there should one. should include javascript no wrap in head , lastly html5mode capital m on mode , none of partials exist @ urls nor defined local scripts. i suggest use plunkr allows add other local files, ie partials don't exist in fiddle. i've cleaned of issues on plunkr: h...

android - how to add Runtime ImageViews into linearlayout -

i getting runtime imageviews,how can add imageviews 1 single linear layout. linearlayout linearlayout=new linearlayout(this); linearlayout.setorientation(linearlayout.horizontal); linearlayout.layoutparams vp=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); imageview imageview= new imageview(this); imageview.setimagebitmap(bitmap); imageview.setvisibility(view.visible); imageview.setbackgroundcolor(0xffff00ff); //linearlayout=linearlayout+imageview; linearlayout.layoutparams iv=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); linearlayout.setlayoutparams(iv); linearlayout.addview(imageview); setcontentview(linearlayout,vp); linearlayout linearlayout=new linearlayout(this); linearlayout.setorientation(linearlayout.horizontal); linearlayout.layoutparams vp=new linearlayout.layoutparams(layoutparams.wrap_content,layoutparams.wrap_content); imageview imsex...

ios - Set UIImageView size programatically withing a UICollectionView Cell -

i have uicolleciton view various cells, each cell has uiimageview within cell. each cell having different size set programatially using simple select case within below override vary size - (cgsize)collectionview:(uicollectionview *)collectionview layout:(uicollectionviewlayout*)collectionviewlayout sizeforitematindexpath:(nsindexpath *)indexpath however i'm trying set uiimageview's size match cell size @ same time (ideally setting x,y in same cell), there can within above method accompany or there override method required?

jQuery.load() in Dart -

is there equivalent function jquery.load() in dart? if not; how load parts of page ajax, alternative loading whole page again? seem people moving different page. thinking of doing httprequest, manipulating history history class . i'm missing spinning wheel in browser tab , refresh button becoming unavailable. how can achieve this? example : believe that's facebook doing, , maybe github. if understood correctly, want load html returned request dom element. in case, should work: httprequest.getstring(uri).then((data) => query("#container").innerhtml = data);

php - How to stop malicious automatic iFrame Form Input from other site? -

so there's guy putting code on site: <iframe name="frame" src="" frameborder="0" width="1" height="1" allowfullscreen style="width:1;height:1;"></iframe> <form name="form" method="post" action="http://mysite.com/vote.php" target="frame"> <input type="hidden" name="vote" value="1" /> <input type="hidden" name="id" value="1337" /> </form> <script type="text/javascript"> document.forms.form.submit(); </script> with little piece of code he's tricking users voting post (1337) in favor. how can stop this? ideas? i've tried following (.htaccess) doesn't stop it: # disable iframe header set x-frame-options deny header append x-frame-options sameorigin i'm assuming 2 things here: you've got mod_headers installed , enabled; ...

ios - Should your plist ever contain <string></string>? -

i see 3 occurrences of <string></string> in plist file. issue? started looking plist because i'm getting error: icon specified in info.plist not found under top level app wrapper so i'm curious point of <string></string> , can remove occurrences? a plist json can either dictionary or array. it has values in key value format. if have employee employeeid, name. in json { "employeeid": 1011, "name": "employee name" } same in plist <dict> <key>employeeid</key> <integer>1011</integer> <key>name</key> <string>employee name</string> </dict> you can see there <string>employee name</string> . means value of of key name employee name , it's type string. in case empty string

vba - Excel sheet comparison - any order -

i'm looking way compare 1 excel sheet another. there way compare whole records, without regard order of records? i think work... columns may have modified bit depending on width. private sub comparesheets() dim first_index integer dim last_index integer dim sheet1 worksheet dim sheet2 worksheet dim r1 integer dim r2 integer dim found boolean set sheet1 = worksheets(1) set sheet2 = worksheets(2) application.screenupdating = false first_index = 1 last_index = sheet1.range("a" & rows.count).end(xlup).row r2 = first_index last_index found = false r1 = first_index last_index if sheet1.cells(r1, 16) = sheet2.cells(r2, 9) ' found match. found = true exit end if next r1 if not found ' if if did not find it??? end if next r2 application.screenupdating = true end sub

c++ - What does "error: cannot use type 'void' as a range" actually mean? -

when compile in clang 3.2 for(auto x : {1, 1.2}){} i error this: error: cannot use type 'void' range what mean? you mixed types in initializer list. in case can pretty clear, don't forget std::string foo; for(auto x : {foo, "bar"}){} are 2 separate types. there of course plenty of other cases may expect work, types have match exactly.

css - huge div border rendering issue -

i have weird case borders , background image not rendered past point in huge divs. have included sample in following fiddle! http://jsfiddle.net/hg333/ <div class="lane"> <div class="label-container"> <span class="label">3 - 5</span> </div> in rendered example borders "clipped". see if scroll right lines stop @ 4th march div continues (approx. 12000px) in rendered context. any ideas anyone? your canvas container set 1200px, that's causing problem. try: #canvas-container { /* width: 1200px;*/ overflow: visible; } i tried on fiddle without width, , worked. that's why left comment marks " /* */ "

c# - Copy gridview rows in another gridview on a button_click -

i have textbox , search button fills first gridview. after second button copies first grid rows in second grid . after should able search again in first grid , attach other results second grid. error. thnx in advance. here code: public partial class grid: system.web.ui.page { datatable dt = new datatable(); private datatable dt1 { set { viewstate.add("dt1", value); } { return (datatable)viewstate["dt1"]; } } private void fill_grid() { string query = "select * table " + " field1 '" + textbox1.text + "' or filed2 '" +textbox1.text + "'"; sqlconnection cnn = new sqlconnection(...); sqlcommand cmm = new sqlcommand(query,cnn); cmm.commandtype = system.data.commandtype.text; sqldataadapter mydataadapter = new sqldataadapter(cmm); dataset ds = new dataset(); cnn.open(); mydataadapter.fill(ds, "client"); dt1 = ds.tables["klient"]; ...

scripting - Batch script network file -

i have batch script trying open file (powershell script on network location). if put path local c:\test.ps1 works fine cant seem work network file structure. @echo off (set/p adminuser=enter admin account: ) runas /user:%userdomain%\%adminuser% "powershell "\\server\share$\it support\test\test share\test.ps1"" any ideas? thanks. try this: @echo off (set/p adminuser=enter admin account: ) runas /user:%userdomain%\%adminuser% "powershell -noexit & '\\server\share$\it support\test\test share\test.ps1'"

memory - UART to SD Card -

i'm trying implement method write data sd card dspic33f. can transmit data via uart bluetooth , usb, can't find online in regards writing sd card via uart; seems spi. i would use spi, i'm using i2c , seems difficult use both spi , i2c on same pic, due them sharing pins. so, can suggest information on writing data sd card via uart, or maybe way use both spi , i2c concurrently? all want form of storage method, if can suggest method, maybe eeprom or usb flash drive, i'm ears. need @ least 2gb of storage, more better. most sd cards natively support spi communication not uart direct uart connection isn't possible. recommend against usb flash drive there lot of overhead there complicates things. , eeprom use spi or i2c you're still left problem of having 1 set of peripheral pins in use. your best option given chip using use peripheral pin select feature map available pins 4 spi pins need. section 11.6 of datasheet has explanation of how remap...

Trying to get a specific layout in HTML with CSS -

this scenario: i have fixed-positioned div element (lets call 'wrap'). must not overflow margins of 100px window's edges. inside div reside 3 other divs ('first', 'second', , 'third'). only 'third' div has fixed height , should positioned @ bottom of containing 'wrap' div. the issue want 'wrap' div occupy less possible height of screen. want shrink height if 'first' , 'second' shown, , scroll 'second' if don't. i find kind of hard explain, hope can idea. ask me if need clarifications. i've created pen on codepen can fork , play with. i can't succeed in achieving without js. i'll appreciate help... thanks. you can create custom styles varying screen sizes using @media in style sheet like @media screen , (max-width: 800px) { #wrapper { width: 90%; min-width: 0; } #column-main { margin-left: 0; } #column-sidebar { width: auto; f...

javascript - Use GeometryUtils.merge on several Line objects in THREE.js -

i want merge several thousands of line objects single geometry geometryutils.merge reduce lag, doesn't seem work on line objects. possible? technical mind says need redefine line is. yes. have manually. three.js r.58

parsing - Parse a simple text file with dos cmd line -

i have text file (vernum.txt) containing 1 line: at revision 2. how use dos cmd line read in line , save variable number? "at revision ####." by using command such this: @echo off set /p myvar=<vernum.txt echo myvar=%myvar% /f "tokens=3* delims=.\ " %%k in ( "%myvar%" ) ( set /a result=%%k ) echo number is: %result% pause

regex - How can I remove '[' and ']' from an awk string? -

i have regexp control characters need removed awk string. how can replace "[mystring]" "mystring", if possible without using first,last index of original string? using gsub() function gsub(/[][]/,"",s) s string replacement, may want use $0 replacemnt on whole line or $i i th field. $ echo '[mystring]' | awk '{gsub(/[][]/,"",$0)}1' mystring

java - setCharAt a for JLabel -

i'm trying replace setcharat can used jlabel... i've been on oracle doc's looking solution. don't know if i'm looking wrong thing or doesn't exists.. if doesn't exists how work around that? understand naming convention off , changing them possible... import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.util.arraylist; import java.util.arrays; import java.util.collections; import javax.swing.*; public class hangmanpanel extends jpanel { static boolean found; private static final long serialversionuid = -5793357804828609325l; public static string answerkey() { //get random array element string array[] = new string[10]; array[0] = "hamlet"; array[1] = "mysts of avalon"; array[2] = "the iliad"; array[3] = "tales edger allan poe"; array[4] = "the children of hurin"; array[5] = "the red b...

visual studio - WebEssentials compiles from IDE, doesn't compile from CLI -

i have several bundles of javascript files, want minify , concatenate during build. project has several *.js.bundle files, somehow processed webessentials when issue build command gui (pressing button or hitting hotkey). however, when i'm trying build project, webessentials doesn't thing. have added logging project file make sure build runs , date - good, can see own messages being printed. webessentials doesn't appear anywhere in build log :( this visual studio 2012 rc2. one more, related thing is: i'd have more control on how files bundled. if @ possible, i'd use msbuild (project) file determine bundled, , should output result. if happen know documentation, or... can hope, source code of webessentials? - me understand did there. the files being compiled/updated when save changes in source code files. take @ options withing visual studio (options > webessentials) , post feature requests developers. http://webessentials.uservoice.com/forum...

Read Only Google+ Share -

i able use google+ sign in our site , able populate share dialog using google's documentation. project working on, being told legal department wants shares uneditable. have ideas or resources point me how accomplish this? i know guidelines social sites frowned upon. showing them preview of share before posting wall , share user initiated. there no attempt @ deception on our end. thanks help! on google+ user has full control on sharing, includes decisions on whether or not want disable comments on posts share. cannot programmatically disable ability. it interesting know use case more, if can, report issue , use case in detail on google+ issue tracker.

sorting - How do I link back to a paginated and sorted list if that list is implemented using AJAX. I'm using Rails 3.2 -

i have list of items paginated using will_paginate , works great. implemented ajax following instructions railscast , works charm. however, now, when navigate item's page, , click "back" link, page , sorting lost. for example, in list of books, if sort them via title , go second page, click on book, works fine. when click "back", taken first page of list without sorting. understand because url no longer updated ajax call. how maintain pagination , sorting links ajax in rails app? this code use implement ajax: results.js.erb: $("#search_results").html("<%= escape_javascript(render :partial => "layouts/search_results_list").html_safe %>"); pagination.js: $(function() { $("#search_results").on("click", ".sort a, .pagination a", function() { $.getscript(this.href); return false; }); }); from book page, use: request.referer to go list. after lots of sear...

google app engine - GAE datastore transaction with multiple ancestors entity groups -

it not clear me, documentation, ancestor boundary transaction. closest one, or root one? i have root entity (a) , has few descendants (b1, b2 ... bn) , can have many ancestors (c1, c2...). make transactions on c entities (cs), ancestor query based on b entity. question is, change in cs under b1 throw concurrentmodificationexception if transaction changes cs under b2 in same time? do cs belong same entity group under grandparent or entity groups divided in smaller "sub - entity groups" i.e. every group of cs under b has own entity group? the boundary root. from https://developers.google.com/appengine/docs/python/datastore/transactions : all datastore operations in transaction must operate on entities in same entity group and each root entity belongs separate entity group , single transaction cannot create or operate on more 1 root entity so under 1 entity group.

Syntax meaning of '< >' in Java -

this question has answer here: java generics: list, list<object>, list<?> 12 answers i manipulating code , unfortunately cannot understand part of it: public class inmemorytreestatemanager<t> implements treestatemanager<t> what meaning of <t> . in code? it generics, takes time getting familiar with. can read more here: http://en.wikipedia.org/wiki/generics_in_java

android - Change image dynamically into a ListView from JSON -

i have following code retrivieng data url in json format , updating listview. code working perfectly. in xml layout, have 2 textview , 1 imageview. how can update imageview dinamically? i'm not getting images url, images stored inside project (res/drawable folder). var tag_icon has name of image exact same name of image inside project. example: response json: tag_icon = lamp01 name of image: lamp01.png this main class: public class devicelist extends listactivity { private static string url = "http://192.168.10.2/myhome/get_all_devices.php"; // hashmap listview arraylist<hashmap<string, string>> devicelist = new arraylist<hashmap<string, string>>(); // class json jsonparser jparser = new jsonparser(); // criar json nodes private static final string tag_devices = "devices"; private static final string tag_id = "id"; private static fina...

database - flyway - a way to do distributed? -

i've been impressed amount of time flyway saves me doing basic things: creating schema scratch, , updating particular version. i've been bit frustrated whenever out of ordinary happens: have customer-specific view needs applied schemas; have branch version has scripts base version not; i'd run same flyway installation on multiple schemas. in of these cases, find myself manually moving .sql files around try different things; error-prone, , flyway has no forgiveness @ changing in history of schema. (this makes me bit antsy using flyway production schemas, that's topic). it seems database-versioning has caught code versioning @ about, say, 2000: can have 1 single line of changes, , works great. in same way dvcs expanded experimentation , branching, there need in database versioning move in way. is flyway thinking about, working on, or has ways i'm missing? can't maintain 1 view implement feature toggling instead each customer? way maintain...

How to add a where clause to fetchAll in Zend -

i'm trying return array of objects used in codeigniter, i'm using zend framework. i'm new @ it. want add clause fetchall() . tried: $objdocs = new studyclub_meetings_docs(); $this->view->arrdocs = $objdocs->fetchall(array('meeting_id' => $intmeetingid)); but returns array of arrays. how return array of objects? i'm using zf 1.x. zend_db_adapter_abstract::fetchall() appears variant of fetchall() using accepts third argument: $fetchmode you need adjust code specify fetch mode prefer: $objdocs = new studyclub_meetings_docs(); $this->view->arrdocs = $objdocs->fetchall(array('meeting_id' => $intmeetingid), zend_db::fetch_obj); good luck!

c++ - Unexpected conversion in regular initialization -

clang 3.2 reports error in following code, , not understand why there problem. error occurs in template function, , if braces used initialization. other 2 initializations work expected. struct foo { foo() { }; ~foo() = default; // deleted foo(const foo& rhs) = delete; foo(foo&& rhs) noexcept = delete; auto operator=(const foo& rhs) -> foo& = delete; auto operator=(foo&& rhs) noexcept -> foo& = delete; }; template <typename type> void bar() { foo a; // ok foo b{}; // error } int main() { foo c{}; // ok bar<int>(); } if compile code clang++ -wall -std=c++11 -c , clang prints following error message: bug.cpp:14:9: error: conversion function 'foo' 'foo' invokes deleted function foo b{}; // error ^ bug.cpp:19:5: note: in instantiation of function template specialization 'bar<int>' requested here bar<int>(); ^ bug.cpp:6:5: not...

visual studio 2010 - In what file is the event-handler wiring stored in VS2010 WPF application -

in visual studio 2010 designer, if press [f4] while wpf mainwindow has focus, properties view. if click on events tab, , double-click "loaded", handler window's loaded event automatically created in mainwindow.xaml.cs : private void window_loaded(object sender, routedeventargs e) { } but "wiring" code attaches handler event? you notice in mainwindow.xaml there loaded attribute on window node points event handling method: <window ... loaded="window_loaded"> ... </window> that how xaml parser knows method wire up

ruby - PostgreSQL management on Ubuntu -

i'm looking database management tool postgresql host on ruby. nice see , manage whole database , data on ubuntu vps. is there tools this? maybe there similar phpmyadmin? maybe gem rails? thanks! squirrel use manage jdbc-compatible database client pc. both remote , local instances supported. alternatively, postgres command-line application works fine queries.

php - base64_decode creates corrupted image when run in a loop -

this code works fine (but concerned fail large input files). example 1 reads whole file , not loop, example 2 reads 3k chunks , loops until eof. $in = fopen("in.b64", 'r'); $out = fopen("out.png", 'wb'); if ((!$in) || (!$out)) die ("convert: i/o error in base64 convert"); $first = true; while (!feof($in)) { $b64 = fread($in,filesize($in_fn)); // strip content tag start of stream if ($first) { $b64 = substr($b64,strpos($b64,',')+1); $first = false; } $bin = base64_decode($b64); if (!fwrite($out,$bin)) die("convert write error in base64 convert"); } fclose($in); fclose($out); while code produces corrupt image : $in = fopen("in.b64", 'r'); $out = fopen("out.png", 'wb'); if ((!$in) || (!$out)) die ("convert: i/o error in base64 convert"); $first = true; while (!feof($in)) { $b64 = fread($in,3072); // st...

jquery - JQM back button loses data of previous page -

i have issue jquery mobile , button feature. i have page run ajax request on remote server when displayed. ajax launched through pagebeforeshow event. event attached div [data-role="page"] attribute i'm using multiple html file: <div data-role="page" data-theme="b" id="favorites"> <div data-role="content" data-theme="b"> <div id="ajax"> display ajax result containing link other html page </div> </div> </div> here javascript: $('#favorites').on('pagebeforeshow', function(event) { launchajax(); }); this working fine when page displayed first time. ajax results contain link page user can follows. when user follow link display button (generated jquery mobile) in order him came @ intiale page containing ajax result. however when clicking button, initiale page displayed blank. have last resulted generated aja...

java - activitythread.performlaunchactivity(activitythread$activityclientrecord intent) source not found -

then when press f8 : zygoteinit$methodandargscaller.run() source not found <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.copyup" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="17" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.copyup.mainactivity" android:label="copy up" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </inte...

bash - shell script grep to grep a string -

the output blank fr below script. missing? trying grep string #!/bin/ksh file=$abc_def_app_13.4.5.2 if grep -q abc_def_app $file; echo "file found" else echo "file not found" fi in bash , use <<< redirection string (a 'here string' ): if grep -q abc_def_app <<< $file in other shells, may need use: if echo $file | grep -q abc_def_app i put then on next line; if want then on same line, add ; then after wrote. note assignment: file=$abc_def_app_13.4.5.2 is pretty odd; takes value of environment variable ${abc_def_app_13} , adds .4.5.2 end (it must env var since can see start of script). intended write: file=abc_def_app_13.4.5.2 in general, should enclose references variables holding file names in double quotes avoid problems spaces etc in file names. not critical here, practices practices: if grep -q abc_def_app <<< "$file" if echo "$file" | grep -q abc_def_app...

jQuery slider and background image works in Firefox but not Chrome -

i uploaded wordpress site live server, , i'm seeing background image , slider not working in chrome. have no idea wrong jquery loading correctly. able see obvious may have missed? here site: https://learnmarimba.com your website uses https (secure) protocol , using resources called using http. chrome not mix of https , http. can see warnings in crome console. omit protocol. instead of <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=1.7.1'></script> use <script type='text/javascript' src='//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=1.7.1'></script> also have @ post on protocol relative urls . as side note, google analytics inclusion snippet checks protocol current webpage called , uses in url include javascript file. ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + ...

How to create Radial Menu in WPF -

Image
can give suggestion how create radial menu in wpf,if give sample helpfull, i highly suggest take @ i've done here wpf radialmenu to sum how works first, radial menu : created custom contentcontrol radialmenu , can have children of type radialmenuitem , in method arrangeoverride of radial menu give each children index position in radial menu , total count of children. secondly, items of radial menu : each radialmenuitem custom button custom template, knowing index position inside total count of children, item able create pieshape (with trigonometry) template. finally, central item of radial menu: radialmenucentralitem custom button custom template, template elipse shape, item placed in radial menu, through centralitem property of radial menu. then trigger , animation , binding , dependencyproperty , able that

Firebug debugging parsing error? -

i getting wierdness firebug debugger. have screenshots explain problem: http://www.tqis.com/pen/eloquency/images/tmp/before.png as screenshot demonstrates, line numbers after 885 not colored green, means firebug not recognize these statements executable code. after confounding hour or so, got these results http://www.tqis.com/pen/eloquency/images/tmp/after.png the difference between files in editor commented blank line. this seems unreliable workaround. can share more helpful? thanks! there firebug bugs related this: issue 4646 : incorrect marking of lines executable issue 5081 : not stop on breakpoints also note else asked because of similar problem lately. the firebug working group working on moving new debugger api , should (hopefully) fix such problems.

ibm mobilefirst - WorkLight SQL Adapter : Upload an image using SQL Adapter -

i need upload image database blob type using sql adapter , need know how blob data sql adapter.will please me inserting , retrieving blob data through sql adapter. taken an old forum post : here think of. write servlet or whatever equivalent in app server. in servlet, fetch image db. encode image binary contents according base64. return base64 string of image. write http adapter visit servlet write. in client application, can insert image setting "src" attribute value "data:charset=some_charset, ". example, "data:image/gif;base64,". message mingzhehuang .

facebook - iOS requestAccessToAccountsWithType is Not Showing Permission Prompt / NSAlert -

it understanding when invoke [acaccountstore requestaccesstoaccountswithtype:options:completion] , user supposed see uialert asks them if grant permission app. when run code, there never prompt , granted variable "false" -(void)myfunction { if (!_accountstore) _accountstore = [[acaccountstore alloc] init]; acaccounttype *fbacttype = [_accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifierfacebook]; nsdictionary *options = [[nsdictionary alloc] initwithobjectsandkeys: (nsstring *)acfacebookappidkey, @"##########", (nsstring *)acfacebookpermissionskey, [nsarray arraywithobject:@"email"], nil]; [_accountstore requestaccesstoaccountswithtype:fbacttype options:options completion:^(bool granted, nserror *error) { nslog(@"home.m - getfbdetails - check 2"); ...

asp.net mvc - Workflow with MVC 4 - EF 5 - SimpleMembershipProvider -

so want build application mvc 4 , entity framework 5. i've build simple applications before, need security around current effort... have confusion / questions hoping answer; first... using mvc 4 internet application template implements simplemembershipprovider. have read every primary article modification, implementation... however, uses code-first implementation... problem: have existing database import scheme edmx database first approach... how implement mvc 4 simple membership provider when database ties tightly , directly user table (userid)?... know can use own user table long designate userid , username fields documented... affect provider, or existing "accountcontroller" code? these need modified? second, looking workflow architecture... "old school" database first approach... project huge wip (work in progress). have foundation, need expand needed... can provide insight database first vs other approaches when there quite bit of change management...

how to modify parent class variable with the child class and use in another child class in java -

i have class test has variable count 0. test class extended classes , b. set count in 50. want access count in b, should return value 50, i'm getting 0 in b. i'm new java , dont know how works :( can 1 me how implement this? :( public class extend { public int count =0; } public class extends extend { this.count = 50; } public class b extends extend { system.out.println ( " count " + count); } each instance of extend (including instances of class extends it) gets own copy of count . values not shared between instances. you can change b extend class a instead of class extend . instance of b see whatever initialization done when a constructor executed. if want same count shared instances of class or subclasses, need make field static : public class extend { public static int count = 0; } in subclasses, refer field name without this. qualifier. note code posted not legal java. first 2 classes should public clas...

sharepoint - Automatically or easily updating my database -

i have available me report generated in microsoft sharepoint, , holds quantities items. reports can exported excel documents, if possible avoid that. in access database have same items additional data concerning special requests , item identification in item's respective documentation folders. i looking way have select few columns represent quantities , other factors, automatically updated in database. how can go this? there specific terminology attempting do, unable find on google? so clarify ... have item data exported sharepoint , item data in access , ideally you'd merge both , store results in access. or maybe way of putting it, compliment data in access data sharepoint. if database powered sharepoint report ran in access well, word looking replication . want automatically replicate data 1 server/database another. unfortunately don't know of software replicates data access. your best bet write program scheduled running of sharepoint report ...

java - Only want to print specific pages using livecycle designer ES3 -

i creating letter front end interface users complete. when clicking print button not want front end page print, second page onwards. there script or there way of making work? thanks you can add following code click event of button. second argument says page start printing (it 0 based), third 1 says last page. xfa.host.print(1, "1", (xfa.host.numpages -1).tostring(), 0, 0, 0, 0, 0);

c# - Unit Testing WCF Service is launching -

i'm new wcf. i've created basic service , engineer tested debugger , wcftestclient. i've never written own wcf client. need build unit tests service. my classes: ixservice cxservice cservicelauncher (yes, know c prefix not meet current standards, required client's standards.) my service functionality can tested directly against xservice , need test cservicelauncher well. want connect uri , discover if there service running there , methods offers. other questions read: addressaccessdeniedexception "your process not have access rights namespace" when unit testing wcf service - starts service host in unit test wcf unit test - recommends hosting service in unit test, makes vague reference connecting service via http wcf msmq unit testing - references msmq, more detailed need unit test wcf method - never knew auto generate tests, system isn't smart enough know assert. test outline: public void startuitest() { ...

ffmpeg - mediastreamsegmenter stops sending id3 metadata using HLS -

i using combination of ffmpeg and apple's mediastreamsegmenter , id3taggenerator create hls stream metadata (id3) embedded in it. have of applications running , able retrieve metadata out of stream on client side, issue after seems random amount of time, client stops receiving metadata on stream. here have working now: this ffmpeg , mediastreamsegmenter part: ffmpeg -i udp://@:5010 -c:v libx264 -crf:v 22 -b:v 500k -preset:v veryfast -c:a libfdk_aac -b:a 64k -f mpegts - | mediastreamsegmenter -b http://localhost/stream -f /usr/local/nginx/html/stream/ -t 10 -s 4 -s 1 -d -y id3 -m -m 4242 -l log.txt this taking udp stream on localhost on port 5010 , encoding video , audio h.264 , aac, respectively. pipping mpeg-2 transport stream segments mediastreamsegmenter , in turn generating .m3u8 file , associated .ts files , placing them on nginx webserver. mediastreamsegmenter listening on port 4242 tcp traffic id3taggenerator show how using now: id3taggenerator -te...

dart - async Future StreamSubscription Error -

could please explain what's wrong following code. i'm making 2 calls function finputdata. first works ok, second results in error : "unhandled exception" "bad state: stream has subscriber" i need write test console program inputs multiple parameters. import "dart:async" async; import "dart:io"; void main() { finputdata ("enter nr of iterations : ") .then((string sresult){ int iiters; try { iiters = int.parse(sresult); if (iiters < 0) throw new exception("invalid"); } catch (oerror) { print ("invalid entry"); exit(1); } print ("in main : iterations selected = ${iiters}"); finputdata("continue processing? (y/n) : ") // call bombs .then((string sinput){ if (sinput != "y" && sinput != "y") exit(1); fprocessdata(iiters); print ("main completed"); }); }...

Flesch Program c++ -

i'm trying write program calculates score of text file (flesch) counting words, sentences, , syllables in program , right i'm having trouble having bool functions declared after write code each one. here's got:  #include <iostream> #include <fstream> #include <cctype> using namespace std; int numsentences, numwords, numsyllables; //for alphabet a-z, a-z....unexpected unqualified0id before 'int' int isalpha(char iswordstarting); bool insentence, inword, insyllable;// insyllable(char issyllablestarting);{//error: expected constructor, destructor, or type conversion before ; token.... if (numsyllables = 'a','e','i','o','u'){//error: unqualified id before '{' token => insyllable function return true;} insyllable(char issyllableending);{ else { return false; } inword(char iswordstarting);{ if(numwords = isalpha(char iswordstarting)){ return true;} inword(char iswordending);...