Posts

Showing posts from August, 2015

c++ - Unable to stop a windows service with net stop command -

i have created windows service running fine doing following. sc_handle hservice = ::createservice(*m_serviceconfig, // scm database name.c_str(), // name of service displayname.c_str(), // service name display service_all_access, // desired access service_win32_own_process | service_interactive_process, // service type (interactive debug) service_auto_start, // start type service_error_normal, // error control type path.c_str(), // path service's binary nullptr, // no load ordering group

asp.net mvc - Http Request Timeouts on Azure Web Apps -

we have collection of mvc 5 websites running on azure cloud hosting platform. have several different versions of environment these websites run (development, staging, production), , experiencing difficult troubleshoot issue. seems that, intermittently, when request made production environment, request rejected, or file served point of server timing out , aborting request. seems occur in production environment, , not appear happen in development or staging. given our websites started receiving traffic, production environment lesser used in case, not matter of machine being out of resources. also, have capability monitor resources of machine through web ui, , not see issues here. when configuring these systems, not have ton of control on how set up. end, it's unlikely there configuration difference between them, setup (presumably) image, , configured through web ui. settings on these systems same between them far can tell. ensure not issue of configuration of machine, have mi

Can spring data couchbase be used to access reduced views -

i know there way access reduced view results using couchbase java sdk. unable use spring-data access reduced view. possible? view: view byidgetdatestats = defaultview.create("byidgetdatestats", "function (doc, meta) {" + "if(doc.doctype == \"com.bd.idm.model.daylog\"){" + " emit(doc.userid, doc.date)" +" }}" ,"_stats" ); when attempt use spring-data access view this: query query = new query(); query.setkey(complexkey.of(userid)).setreduce(true).setgroup(true); viewresult result = repo.findbyidgetdatestats(query); error message java.lang.illegalstateexception: failed execute commandlinerunner ... caused by: java.lang.runtimeexception: failed access view ... caused by: java.util.concurrent.executionexception: operationexception: server: query_parse_error reason: invalid url parameter 'group' or 'group_level'

Capture Screen in libGdx -

i want capture screen in libgdx . use code problem. on desktop work . when run on android , can't find image capture screen. how can fix it? reading question. public class screenshotfactory { private static int counter = 1; public static void savescreenshot() { try { filehandle fh; { if (gdx.app.gettype() == applicationtype.desktop) infor.linkscreenshot = "d://chupngoc" + counter + ".png"; else infor.linkscreenshot = gdx.files.getexternalstoragepath() + counter + ".png"; infor.nameimage = counter + ".png"; fh = new filehandle(infor.linkscreenshot); counter++; } while (fh.exists()); pixmap pixmap = getscreenshot(0, 0, gdx.graphics.getwidth(), gdx.graphics.getheight(), true); pixmapio.writepng(fh, pixmap); pixmap.dispose(); } catch (exception e) {

excel vba object required error when copying from one workbook to another -

does know why: set wb = workbooks.open(url) worksheets("mf in rates").range("c8:p8").copy destination:=workbooks("dashboard_final.xlsm").worksheets("hist cof").range(cells(current.row, 4), cells(current.row, 17)) would give me object required error? url valid , mf in rates valid sheet in opened spreadsheet. have give more specific filepath dashboard_final.xlsm though macro in work book?? for troubleshooting long references this, break them down individual lines , step through it. if write code this, able determine error is: dim obook workbook dim osheet worksheet dim orange range dim vcell1 variant dim vcell2 variant vcell1 = cells(current.row, 4) vcell2 = cells(current.row, 17) set obook = workbooks(dashboard_final.xlsm) set osheet = obook.worksheets("hist cof") set orange = osheet.range(vcell1, vcell2)

html - CSS - Curved Corner after using border-left and border-bottom -

Image
i have used border-left , border-bottom create sort of 1 sided parallelogram shape bootstrap navbar, need right side curved while keeping left side transparent. current outcome: wanted outcome: i have tried using border-top-right-radius nothing happens: .navbar { position: relative; min-height: 50px; margin-bottom: 20px; border: 1px solid transparent; height: 20px; width: 100px; border-bottom: 50px solid rgba(58, 162, 178, 0.5); border-left: 50px solid transparent; /* tried */ border-top-right-radius: 2em; } i have made jsfiddle here: http://jsfiddle.net/6qfbhxty/ in example blue bar bottom border. won't work because can't give "end" of border curved look. you try apply blue color background , use :before create triangle. please notice apply same color background , border! body { background-image: url("http://lorempixel.com/800/800/abstract"); background-attachment: fixed;

python - Does precondition assertion testing replace assumptions in a function specification or vice versa? -

i'm confused when use assertion testing in python functions. if specify assumptions regarding input arguments function, should assume correct input being fed function or should use assertions check conditions on input args enumerated in specification? if you're writing "public" function, believe pythonic way check arguments (using if , not assert ), and, if they're invalid, raise exception type , info / message designed provide info possible. if you're writing function designed internal use, using assert check arguments seems idea me.

bash - How do I pass the tail of a log file to a command? -

i have quite few long-running processes , use command text me @ various points throughout script , let me know when has completed: curl http://textbelt.com/text -d number=<phone number> -d "message=doneskiiz" instead of basic message include tail of log file in message can see last few lines know if successful , peek @ result. if possible i'd current time included (or in second message). steps: a) execute "date" retrieve current date b) execute "tail -n nnn" retrieve "nnn" last lines of log file c) execute "curl" "--data-binary @file" or "--data-binary @-" or "-f field=@filename" post previous information. you can see similar example @ curl: pass named parameter stdin : tail -n 20 my.log | curl -d date="$(date)" -d number="555123" -f log=@- "http://somewhere"

jquery - BlueImp silently fails on file upload -

when try upload using blueimp, fllowing error when open console: uncaught typeerror: cannot read property 'parsemetadata' of undefined accompanied stack trace. seems calling upload logic without file. there way can more information? make sure including js script https://blueimp.github.io/javascript-load-image/js/load-image.all.min.js before of file upload scripts. file needed parsemetadata function. <script> includes should in following order, taken directly example found @ https://blueimp.github.io/jquery-file-upload/ . <!-- load image plugin included preview images , image resizing functionality --> <script src="//blueimp.github.io/javascript-load-image/js/load-image.all.min.js"></script> <!-- canvas blob plugin included image resizing functionality --> <script src="//blueimp.github.io/javascript-canvas-to-blob/js/canvas-to-blob.min.js"></script> <!-- iframe transport required browsers wi

Passing context to qweb report for managing table visibility - odoo -

how can pass context value qweb report can control visibility of tables. have qweb report lot of tables. depending on selection list, want control view of these tables in qweb report. option control using context. didn't find way pass context. if there other opinion, please share. create parser class first import time openerp.osv import osv openerp.report import report_sxw class sale_quotation_report(report_sxw.rml_parse): def __init__(self, cr, uid, name, context): super(sale_quotation_report, self).__init__(cr, uid, name, context=context) self.localcontext.update({ ‘key’: value, ‘function_name’: self.function_name, }) def function_name(self): ### add code if required.. then define class class report_saleorderqweb(osv.abstractmodel): _name = ‘module_name.report_sale_order_qweb’ _inherit = ‘report.abstract_report’ _template = ‘module_name.report_sale_order_qweb

How to remove/adjust Title in the Home.aspx with SharePoint 2010 -

Image
i looking way modify title in home page (/siteassets/home.aspx) removing "new" word sharepoint 2010. have edited in v4.master page. however, did not affect home page. besides that, cannot find file has code. please take @ image below. please let me know if miss change. <td style="color:#185591;font-size:2.0em;font-family:verdana,arial,sans-serif"> <marquee> welcome portal </marquee> </td> go site settings (click cog in top right hand corner , site settings) , click title, description , logo under look , feel . title you're trying change in there.

voltrb - Use ruby classes in Volt Framework -

i wondering best way include ruby classes in volt framework. want use socket class find ip address of visitor of site. want use in controller, putting: require 'socket' at top of file not work. suggestions? well, don't think can use socket class on client-side since volt uses opalrb run ruby on client, , unfortunately don't think opal can support socket class since that's kind of hard in browser. can, however, run code on server side , pass desired results on client. can using volt's tasks . can create them so: require 'socket' class sockettask < volt::task def use_sockets # thing sockets here... end end and can use them elsewhere, e.g., in controller this: class controller < volt::modelcontroller def some_action sockettask.use_sockets # can use #then method of returned promise result of call. # can use #fail method on promise thrown errors. # following can run code on client. sockettask.use

c# - How to modify properties of the incoming object without creating a new instance? -

i modify properties of incoming object. how without creating new instance? i have class public class report : ireport<reportitem> { public report() { items = new reportitemscollection(); } public report(ienumerable<reportitem> items) { items = new reportitemscollection(items); } [datamember(name = "items")] public reportitemscollection items { get; private set; } ienumerable<reportitem> ireport<reportitem>.items { { return items; } } } and 2 methods private static report convertreportitems(report report) { var reportdata = report.items.select(backwardcompatibilityconverter.fromold); return new report(reportdata); } public static reportitem fromold(reportitem reportitem) { reportitem.agentids = new list<guid> { reportitem.agentid }; reportitem.agentnames = new list<string> { reportitem.agent }; return reportitem; } it sounds you&

ubuntu - java.lang.SecurityException: Expecting a sun.rmi.server.UnicastRef2 remote reference in stub -

Image
i trying connect remote java process running on different machine using jconsole tool on ubuntu machine. this how running java program in remote machine: sudo java -dcom.sun.management.jmxremote.port=51082 -dcom.sun.management.jmxremote.authenticate=false -dcom.sun.management.jmxremote.ssl=false -jar myfile.jar i running jconsole command on machine this: jconsole -debug -j-djava.util.logging.config.file=logging.properties this logging.properties file: handlers = java.util.logging.consolehandler sun.rmi.level=finest .level = info java.util.logging.consolehandler.level = finest java.util.logging.consolehandler.formatter = \ java.util.logging.simpleformatter // use finer or finest javax.management.remote.level - finest // verbose... javax.management.level = finest javax.management.remote.level = finer now on jconsle ui have given below properties: when click on connect button getting exception saying: finer: [javax.management.remote.rmi.rmic

applet - Java Card to send data without get data APDU -

i'm new field, forgive me if question naive. i want issue java card has auto-select applet , apdus going handled in applet. need applet send data cad not using usual format in java card standard (i.e. without sending 0x61 0xbytestoread , waiting 0x00 0xc0 ). example i'd send 0x23 bytes in answer 0xa0a40000027f20 select command wrong first byte! so possible this? , if it's possible please tell me how. thanks. yes, possible. aim goal, have 2 steps below : you must make applet default selected. you must return data on reception of command, and/or reception of select apdu command. for first step, answered here : it depends on cards - not of them seem support making applet default after installation. can use open source globalplatform tool java has --make-default option: java -jar gp.jar --make-default a000100201100001 iirc jcop 1 of cards supported it. and second step, answered here : i guess "good practice" of "if select

node.js - Getting Error message "No "concat" targets found" when running grunt-usemin -

my grunt file shown below: module.exports = function(grunt) { // project configuration. grunt.initconfig({ pkg: grunt.file.readjson('package.json'), uglify: { options: { banner: '/*! <%= pkg.name %> <%= grunt.template.today("yyyy-mm-dd") %> */\n' }, build: { src: 'src/**/*.js', dest: 'dist/<%= pkg.name %>.min.js' } }, watch: { js: { files: ['src/**/*.js'], options: { livereload: '<%= connect.options.livereload %>' } }, livereload: { options: { livereload: '<%= connect.options.livereload %>' }, files: [ 'src/**/*.html', 'src/**/*.cs

C# Entity Model won't correctly save changes to SQL database -

here's brief summary of code - written long time ago , there on 50 properties written way, yet when added new one, both in model , within viewmodel, refuses save changes: from view have: @html.editorfor(m => m.phonenumber ) from viewmodel have: public string registration {get;set;} from controller have: public async task<actionresult> savevehicleinfo(vehicleviewmodel vm){ vehicle vehicle = mapper.map<vehicleviewmodel, vehicle>(vm); (automapper library) var changes = false; vehicle dbvehicle = await context.vehicles.findasync(vehicle.id) //a load more properties etc string phonenumberchange = ""; if (dbvehicle.phonenumber != vehicle.phonenumber) { phonenumberchange = " - phone number changed " + vehicle.phonenumber + " " + dbvehicle.phonenumber; dbvehicle.phonenumber = vehicle.phonenumber; changes = true; } //at end: _db.vehicles.attach(dbvehicle); _d

javascript - localstorage changes with Angular -

so code looks like: if (condition) { $scope.item = localstorage.getitem('item'); } else { $scope.item = default; } depending on condition item update. want trigger $scope.item updated on query later in code, how can watch / best way do?

php - imap_open(): Couldn't open stream -

i trying access gmail inbox using imap. have applied possible solutions available here , in google. facing same issue. below code : $hostname = "{imap.gmail.com:993/imap/ssl/novalidate-cert}"; $mailbox = imap_open($hostname, 'my gmail account', 'my gmail password'); if ($mailbox) { echo 'if'; } else { echo 'else'; } exit; when run code in local system give me message : warning: imap_open(): couldn't open stream {imap.gmail.com:993/imap/ssl/novalidate-cert} in d:\xampp\htdocs\php-imap-mailboxes\test-mail.php on line 4 else notice: unknown: [alert] please log in via web browser: https://support.google.com/mail/accounts/answer/78754 (failure) (errflg=1) in unknown on line 0 notice: unknown: [alert] please log in via web browser: https://support.google.com/mail/accounts/answer/78754 (failure) (errflg=1) in unknown on line 0 notice: unknown: [alert] please lo

android - Fragment with AsyncTask and Navigation Drawer - Best practice -

i write question because know best way manage context: have mainactivity navigation drawer , whenever select item in navigation drawer, create new fragment , through fragmenttransaction replace previous fragment new one. now, in every fragment have asynctask performs task (eg download data web or perform query on local sqlite database). my question is: how can avoid recreate every time fragment , restart asynctask when press element in navigation drawer? best way manage situation? this method use in mainactivity display fragment when press item in navigation drawer: private void displayview(int index) { fragment f = null; switch(index) { case 1: f = fragment1.newinstance(); break; case 2: f = fragment2.newinstance(); break; } if(f != null) { fragmenttransaction ft = getsupportfragmentmanager().begintransaction(); ft.replace(r.id.container, f); ft.commit(); } }

javascript - JS validation on form -

i have form trying validate js. problem life of me can’t work. can tell me i’m going wrong? in example below rying validate email field. regards, marc function validateemail() { var x = document.forms["myform"]["email"].value; if (x == null || x == "") { alert("name must filled out"); return false; } } #contact-area { width: 500px; max-height:200px; margin-top: 0px; float:left; } #contact-area input, #contact-area textarea { padding: 3px; width: 520px; font-family:'lato', sans-serif; font-size: 14px; margin: 0px 0px 0px 0px; border: 1px solid #ccc; } #contact-area textarea { height: 90px; } #contact-area textarea:focus, #contact-area input:focus { border: 1px solid #ffc423; } #contact-area input.submit-button { width: 100px; float: left; background-color:#ffc423; color:black; margin-top:13px; cursor:pointer; } #contact-area inp

rails YAML: NOT NULL constraint failed in joining table -

rails 4.2 have set role model , permission model relate many-to-many each other through model rolespermission use has_many :through relate models. rolespermission has table name of permissions_roles because of rails convention renamed roles_permissions migration, , put in model class: self.table_name = "permissions_roles" i set fixtures testing in roles.yml have admin: name: admin permissions: create_user and in permissions.yml have create_user: name: create_user description: create new user edit_user: name: edit_user description: edit user details view_all_users: name: view_all_users description: view users now when run rake test every test gets error: activerecord::statementinvalid: activerecord::statementinvalid: sqlite3::constraintexception: not null constraint failed: permissions_roles.created_at: insert "permissions_roles" ("role_id", "permission_id") values (135138680, 204622624) wh

Mongodb - Use a regex search to match embedded documents -

i have mongo collection : db.scriteria.insert({criteria : {a:"1",b:"2",c:"3"}}) db.scriteria.insert({criteria : {a:"1",d:"2",e:"3"}}) the properties of embedded document "criteria" can vary lot chose index whole object : db.scriteria.ensureindex({criteria : 1}) and queries against entire object use index. ex : db.scriteria.find({criteria : {a:"1",b:"2",c:"3"}}).count() 1 db.scriteria.find({criteria : {a:"1",b:"2"}}).count() 0 what want able use regex property. example : db.scriteria.find({criteria : {a:"1",b:"2",c:/3/}}).count() this gives 0 results is there way , use index? your query may not return document if querying subdocument because field order matter .the best thing create coumpound indexes , use dot notation . db.scriteria.count({ "criteria.a": "1", "criteria.b": "2&q

javascript - Why am I getting a ParseError? -

i trying use domparser method .parsefromstring convert strings have in array containing html in dom elements. some of strings getting following parse errors , can't figure out why. this loop i'm using parse strings , create dom elements (thanks stackoverflow post: converting html string dom elements? ) var x = 0; while (x < stringsarray.length) { var parser = new domparser(); var doc = parser.parsefromstring(stringsarray[x].html, "text/xml"); outputdomelements[x] = doc.firstchild; x++; } this example of string parsed: "<div class="instagrampost"><span>siamak amini</span><p>#usa</p><span>posted 1 month ago</span><a href="https://instagram.com/p/3zg3kdgee8/"><img src="https://scontent.cdninstagram.com/hphotos-xaf1/t51.2885-15/s320x320/e15/11377935_1114448771906000_731563461_n.jpg" /></a></div>" this example of string has parse error: &

c# - create a list Using combination of two types -

i need create list in each member combination of 2 types , b. possible? example, assuming , b: class { int a1; string a2; } class b { int b1; string b2; } i want create: list<a&b> samplelist; in way a&b contains following properties: int a1; string a2; int b1; string b2; try tuples: https://msdn.microsoft.com/en-us/library/dd268536(v=vs.110).aspx then can use: var list = new list<tuple<int, string>>(); list.add(new tuple(2, "some text)); and read values like: console.writeline(list[0].item1); // writes 2 console.writeline(list[0].item2); // writes "some text"

html - Why hover is not working in JQuery -

i'm trying follow demo web application somehow don't obtain results get. i text changes colour when mouse over. here have done until now. html code looks like: <body> <div id="menu"> <ul> <a href="#"><li>aaa</li></a> <a href="#"><li>bbb</li></a> <a href="#"><li>ccc</li></a> <a href="#"><li>ddd</li></a> </ul> </div> </body> my jquery code: $(function(){ $('li').hover(function(){ $(this).addclass('highlight'); }, function(){ $(this).removeclass('highlight'); }); }); my css code: .highlight{ color:green; } any idea? my fiddle. the issue because html invalid - a element must inside li : <ul> <li><a href="#">

vbscript - How to open outlook using javaScript on client machine? -

i have java code open outlook in server . want opent outlook on client machine , fill body html content . possible using javascript , vbscript or other technology . public static void main(string[] args) { // system.setproperty("java.library.path", "/path/to/library"); display display = display.getcurrent(); shell shell = new shell(display); oleframe frame = new oleframe(shell, swt.none); // should start outlook if not running yet oleclientsite site = new oleclientsite(frame, swt.none, "ovctl.ovctl"); site.doverb(ole.oleiverb_inplaceactivate); // outlook application oleclientsite site2 = new oleclientsite(frame, swt.none, "outlook.application"); oleautomation outlook = new oleautomation(site2); // oleautomation mail = invoke(outlook, "createitem", 0 /* mail item */) .getautomation(); setproperty(mail, "to", "testto@gmail.com"); /*

oracle - PL SQL Function -

i have below error: failure occurred in bl9stackablepromotionmodule::createpromoperiodmap. duplicate promotions found subscriber id 123 , offer id=123, offer instance 123, charge code=abc, effective date=20150707 now want fetch subscriber, offer id, offer instance, charge code, effective date only. for have created below function: create or replace functiongetdyna1 ( att in varchar, attname in varchar ) return varchar start_index integer := 0; end_index integer := 0; retval varchar(100); tmpatt varchar( 4000 ); tmpattname varchar( 4000 ); begin tmpatt := upper( att ) ; tmpattname := upper( attname ); start_index := instr( tmpatt , tmpattname ); if( start_index = 0 ) return 'notfound'; end if; start_index := start_index + length( tmpattname ); end_index := instr ( tmpatt , '#' , start_index ) ; retval := substr( att, start_index + 1, end_index - start_index - 1 )

Nginx config remove .aspx extension in rewrite rule -

i ensure below rewrite removes .aspx extensions well. rewrite ^/cn/(.*)$ $scheme://www.domain.cn/$1 permanent; i have this, want add , remove .aspx file extensions. anyone suggest how can this, documentation seems little lacking?

html - Java Http Request that only returns certain elements I want -

is there method in java make http request webpage response specific elements want instead of whole document? for example, if request <div> called "example" , response element , not rest of fluff exists on page, not need. most methods looked at, involve getting entire html page , parsing it. want @ page , pluck out div want , have response. pages dealing contain lot of advert content want ignore. http has nothing content of page, protocol governs server requests , responses. i understand want do, you've asked wrong question. don't worry http, protocol governs server requests , responses (get, put, post, head, options). the problem describing can handled after retrieval of content completed. need working document object model (dom) foundation of xml , xhtml . means need familiarize dom , , maybe xpath , xsl well. the functionality asking can implemented in many ways, boils down sequence of non-trivial operations: retrieve page conten

seo - Can I have <loc> element & <sitemapindex> element within the same XML for Sitemap? -

<?xml version="1.0" encoding="utf-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> <url> <loc>http://www.example.com/foo.html</loc> </url> <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> <sitemap> <loc>http://www.example.com/sitemap1.xml.gz</loc> <lastmod>2004-10-01t18:23:17+00:00</lastmod> </sitemap> <sitemap> <loc>http://www.example.com/sitemap2.xml.gz</loc> <lastmod>2005-01-01</lastmod> </sitemap> </sitemapindex> </urlset> can have url , sitemapindex within same sitemap xml file? have around 300k plus pages in website. there close 50 static html pages. want add these static urls di

php - Javascript: Uncaught Type error Autocomplete is not a function -

i'm aware question has been posted lot have been going through every answer trying find solution has not worked code. i'm trying call autocomplete function using jquery-ui on search bar, every time load page type error saying autocomplete not function. i've removed every instance of loading javascript ui , placed in seperate file in javascript folder called "jquery-ui-src.php", looks this <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> which called in files need use jquery-ui. file error being caught think in "header.php" file acts header whole site <?php session_start(); include("assets/js/jquery-ui-src.php"); ?> <header id="header" class="website-header

Attask task history- Is there a way to get updated log or history Of a task? -

does task/issue contain reference history, in partcilar field added @ particular time ? or there log maintained updates in task ? you can customize update feed on task/issue display when field changed or not. can within setup > interface > update feeds. you can setup example log when particular field edited.

jquery - How can i detach elements and then show then with fadeIn / fadeOut on click -

i put fadein fadeout (instead of show/hide) , when tried content jumps prev element residing , , not want use position absolute content. how can use animate in same manner following ? detach them on , undo detach on click ? http://jsfiddle.net/zm9dl/514/ $('.menu>li').on('click',function(e){ $('.container>.'+ e.target.classlist[0]).show().siblings().hide(); }); html <ul class="menu"> <li class="toggle1">one</li> <li class="toggle2">two</li> <li class="toggle3">three</li> <li class="toggle4">four</li> <li class="toggle5">five</li> </ul> <div class="container"> <div class="toggle1">here contents of 1..</div> <div class="toggle2" style="display:none;">here contents of 2..</div> <div class="toggle3" s

javascript - firing event on DOM attribute change -

is there way trigger event (may custom) on attribute change? let's say, when img src changed or div's innerhtml? note: of 2012, mutation events have been removed standard , deprecated. see other answers or documentation how use replacement, mutationobserver . you referring dom mutation events . there poor (but improving) browser support these events. mutation events plugin jquery might of way.

ios - How can I prevent the unbalanced calls method during a container transition? -

i'm getting "unbalanced calls begin/end appearance transitions " when transition between child view controllers. i'm pretty sure it's because add child view controller , transitionfromviewcontroller methods adds again. but need add subview setup constraints auto layout. @ibaction func flipaction(sender: anyobject) { var nextviewcontroller = self.currentviewcontroller == self.frontviewcontroller ? self.backviewcontroller : self.frontviewcontroller self.currentviewcontroller.willmovetoparentviewcontroller(nil) self.addchildviewcontroller(nextviewcontroller) nextviewcontroller.view.frame = self.containerview.frame self.containerview.addsubview(nextviewcontroller.view) nextviewcontroller.view.settranslatesautoresizingmaskintoconstraints(false) self.containerview.addconstraints(nslayoutconstraint.constraintswithvisualformat("h:|-[back]-|", options: nslayoutformatoptions.allzeros, metrics: nil, views: ["back"

sitecore7 - Sitecore Log File Repeated Error -

i have sitecore 7.2 site , upgraded 6.6, ideas cause following error appears many times in log file: managedpoolthread #3 2015:07:14 10:03:48 error exception occurred in retryer scope : @ system.environment.getstacktrace(exception e, boolean needfileinfo) @ system.environment.get_stacktrace() @ sitecore.data.dataproviders.retryer.executenoresult(action action, action recover) @ sitecore.analytics.automation.data.sql.sqlautomationprovider.getduestates(automationstatesdatatable datatable, int32 maxentries) @ sitecore.analytics.automation.automationworker.getduestates(automationstatesdatatable datatable) @ sitecore.analytics.automation.automationworker.process() @ sitecore.analytics.automation.automationworker.<wakeup>b__4(object state) @ sitecore.threading.managedthreadpool.processqueueditems() @ system.threading.executioncontext.runinternal(executioncontext executioncontext, contextcallback callback, object state, boolean preservesyncctx) @ syst

c# - WebClient().DownloadString() returning old data -

this question has answer here: c# webclient disable cache 12 answers i using code return string url webclient.encoding = encoding.utf8; response = webclient.downloadstring("http://somesite.com/code.php"); console.write(response); the code.php looks this <?php $data = file_get_contents('code.txt'); echo $data; ?> the problem when change contents of code.txt file, webclient.downloadstring() method returns old contents of code.txt file. when open url http://somesite.com/code.php in browser works fine. any solutions appreciated! my question seems duplicated don't understand said here: c# webclient disable cache if explain , provide example code great! try disabling cache on webclient webclient.cachepolicy = new system.net.cache.requestcachepolicy(system.net.cache.requestcachelevel.nocachenostore); msdn docu

objective c - How to move four image from one location to another location horizontally in ios -

i have 1 query. try develop 1 game abacus in ios. want move 4 images, in sequence , 1 location location horizontally in ios. can me please how in ios. refer link how move object 1 place other using animation in iphone applications using able move 1 image horizontally want move 4 image how this. here's i've tried: -(void)touchesmoved:(nsset *)touches withevent:(uievent *)event { uitouch * touch = [touches anyobject]; cgpoint loc = [touch locationinview:self.view]; [uiview beginanimations:nil context:null]; [uiview setanimationduration:2.0]; cgrect rect = cgrectmake(loc.x, _img.frame.origin.y, _img.frame.size.height, _img.frame.size.width); [_img setframe:rect]; [uiview commitanimations]; } put images in view (lets container view) , move container view

javascript - sounds keep on playing over each other -

i using mysound play sound depending on whether condition met. having problem sounds play on each other when conditions not met. here code ideas? game.countanimals = function(playergo) { var count = {bulls:0, cows:0}; game.counter = 1; (var = 0; < playergo.length; i++) { var digpresent = playergo.indexof(game.score[i]); if (playergo[i] == game.score[i]) { count.bulls++; } else if (digpresent>=0) { count.cows++; } game.counter++ if (count.bulls === playergo.length && game.counter < 7){ mysound2 = new audio("sounds/freedom%20tastes%20good.mp3"); mysound2.play(); } else if (count.bulls !== playergo.length && game.counter < 7) { mysound1 = new audio("sounds/ass%20is%20dead.mp3"); mysound1.play(); } else if (game.counter > 7 ){ mysound = new audio("sounds/kill%20you%20dog.mp3"); mysound.play(); } you should st

mysql - how do i count the number of data in a column for each month using a start and end date -

i have table similar information , want extract data when user selects start date '2015-01-22' , end date '2015-07-31' . result should this. month total quantity january: 8 february: 6 march: 0 april: 0 may: 2 june: 18 july: 6 here's sample query , fiddle create table orders ( id int primary key auto_increment, order_date date, product_id int, quantity int, customer_id int ); insert orders (order_date, product_id, quantity, customer_id) values ('2015-01-01', 1, 2, 123), ('2015-01-06', 3, 6, 123), ('2015-02-14', 2, 4, 123), ('2015-02-15', 2, 2, 123), ('2015-05-16', 1, 1, 456), ('2015-05-17', 1, 1, 456), ('2015-06-18', 1, 5, 789), ('2015-06-18', 3, 7, 123), ('2015-06-10', 3, 6, 123), ('2015-07-13', 1, 5, 456), ('2015-07-14', 1, 1, 456); http://sqlfiddle.com/#!2/01ac19/1 the results should total number of quantity of orders

android - Samsung S3 mini NFC Service has Stopped (4.1.2) -

i working nfc in application , have tested on samsung s4, nexus 4, xperia z3 , worked perfectly. however, testing on s3 mini callback seems loop , popup occurs saying nfc service has stopped working. i worried may code causing issue, however, outside app, tried send across photo , same issue occurred. s3 mini running 4.1.2. has com across before, i've encountered few cases online , i'm wondering if it's 4.1.2 issue?

sql - Concatenate values in one column depending on other column s value -

i need concatenate col2 values depending on col1 value. table looks below: col1 col2 ---------------- 1 10520.72 1 10520.71 2 10520.81 2 10520.82 3 10520.91 3 10520.92 i need query displays below: col1 col2 ------------------------- 1 10520.71-10520.72 2 10520.81-10520.82 3 10520.91-10520.92 i work toad, wm_concat , group_concat , array_to_string won't work me. please let me know how it. reena this might work you select col1, cast(min(col2) varchar)+'-'+cast(max(col2) varchar) col2 t_table group col1

change each option value javascript/jQuery -

i need grab each select option value in dropdown , use them generate image attribute each option. example, if value of option first image data-img-src value path image folder/first-image.png the below code works fine generates data-img-src first option only. need return data-img-src each option in dropdown. how can this? jquery(document).ready(function($){ $(".selector option").attr('data-img-src', function() { var file = this.value + '.png'; var img = file.tolowercase().replace(/ /g, '-'); var path = 'path folder'; return path + img }); }); thanks in advance , have day. you can use each() iterate , update attribute of options. $(".selector option").each(function(){ $(this).attr('data-img-src', function() { var file = this.value + '.png'; var img = file.tolowercase().replace(/ /g, '-'); var path = 'path folde

java - Android Studio App Play Sound -

i´m running out of ideas how make running. here code hope guys can me. main activity: package com.example.work.button; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.view.view; import android.view.menu; import android.view.menuitem; import android.widget.button; import android.widget.textview; import android.media.mediaplayer; import android.app.activity; public class mainactivity extends actionbaractivity { /*mediaplayer mp = null; string sound1="sound1"; string sound2="sound2"; protected void soundmgr(string text) { if (mp != null) { mp.reset(); mp.release(); } if (text == "sound1") mp = mediaplayer.create(this, r.raw.ireland_ouch); else if (text == "sound2") mp = mediaplayer.create(this, r.raw.dice_problem); else mp = mediaplayer.create(this, r.raw.ll_cool_j_ya_know); mp.start(); }*/ publi