Posts

Showing posts from July, 2014

rtmp - What's the default value of timeout for rtmpproto.c in ffmpeg? -

i made rtmp streaming android app using ffmpeg. want know timeout while streaming network offline. checked rtmpproto.c implementation: {"timeout", "maximum timeout (in seconds) wait incoming connections. -1 infinite. implies -rtmp_listen 1", offset(listen_timeout), av_opt_type_int, {.i64 = -1}, int_min, int_max, dec, "rtmp_listen" }, i think timeout option want. didn't find default value of it. what's default value of timeout option ? the default value {.i64 = -1} meaning infinite, according code quoted.

Jenkins and Maven Integration: Environment Variables are NULL -

i trying inject environment variable in maven build process can use them in test scripts various purposes. below maven dependency: <dependency> <groupid>org.seleniumhq.selenium</groupid> <artifactid>selenium-firefox-driver</artifactid> <version>2.46.0</version> </dependency> </dependencies> <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-surefire-plugin</artifactid> <configuration> <environmentvariables> <jenkins.package>${env.v_package}</jenkins.package> <jenkins.release>${env.v_release}</jenkins.release> </environmentvariables> </configuration> </plugin> </plugins> </build> with in test scripts trying read these build parameters getting null values, can please me how fixed? in test scripts string vansah_package...

c# - How to select a row in datagrid from ViewModel in MVVM? -

i'm trying validate user input in datagrid, way i'm doing like: i) allow user add row ii) allow user fill cells iii)when endedit() event happens, update model iv) if model not updated (for example when user didn't supply notnull values), error raised. v) here tricky part! want stay on faulty row of datagrid, high lightened row change despite fact i've set selectedindex , selectedvalue correctly. here xaml: <datagrid x:name="gd_contacts" selecteditem="{binding selectedcontact,converter={staticresource newplaceconverter}}" selectedindex="{binding selecteditemindex}" margin="0,5,1,0" itemssource="{binding contactcollection, mode=twoway}" canuseraddrows="true" canuserdeleterows="false" autogeneratecolumns="false" grid.column="1"> here viewmodel: private observablecollection<actionenabledcontacts> fcont...

php - Files from folder with ignored content is deleted when pushing to Herku -

i have php site pushed heroku through git. app saves pictures folder contains .gitignore: * !.gitignore the folder pushed server , managed save pictures in it. folder gets empty every time push new changes herku dynos have ephemeral filesystem doesn't persist across deploys (by design). if intend save files @ saving them amazon s3 using background process.

python - Paypal Single Payout - Sender Insufficient funds error -

i'm trying paypal payout in live environment real bank account. code works in development environment. the problem paypal returning following error: insufficient_funds: sender has insufficient funds i'm using rest api calling https://api.paypal.com/v1/payments/payouts?sync_mode=true [post] i'm using python sdk , sending post message values: { "sender_batch_header": { "email_subject": "paypal payout" }, "items": [{ "recipient_type": "email", "amount": {"value": "1", "currency": "usd"}, "receiver": "test@gmail.com", "note": "123 payout", "sender_item_id": 123456 }] }) i've contacted paypal phone , ask error, , said need manually put funds in paypal account. first question is: can api? (i can't find out how) they said, problems bec...

php - How to pass a variable to routing defaults in Symfony? -

i have symfony2 project multiple brandings (subdomains). each subdomain should use same site functions , same routes (with different hostname). therefor want make subdomain in route path variable. looks like: mybundle_route: resource: "@myprojectbundle/controller/" type: annotation prefix: / host: "{subdomain}.%base_host%" requirements: subdomain: sub1|sub2 and routing works. if try generate routes (e.g. in twig), following error because no subdomain variable set: some mandatory parameters missing ("subdomain") generate url route "company_route". i don't want add parameter each path() function in project. works perfekt 1 subdomain if add defaults this: defaults: subdomain: sub1 but routes wrong other subdomains. doesn't work defaults: subdomain: "%subdomain%" all need pass %subdomain% variable defaults or set somewhere in controller constructor. can't fin...

ios - How to reduce the itunes app size? -

when submitting app apple, noticed though app bundle 60 mb, actual app shows on itunes 54 mb. however, when making ad hoc build, ipa 30 mb. my understanding due drm apple has: https://developer.apple.com/library/ios/qa/qa1795/_index.html however, there better way bypass drm apple puts? apple came solution if add resources (images, videos, etc) called assets catalog file and configure each file according device type being used then can dramatically reduce app size. think it! have 3 copies of every image: img.png img@2x.png , img@3x.png why need have non-retina set of images on retina device? and answers why see lower app size when build. xcode automatically, can fine tune in assets catalog. here how: https://developer.apple.com/library/mac/recipes/xcode_help-image_catalog-1.0/chapters/customizingimagesetsforsizeclasses.html#//apple_ref/doc/uid/tp40013303-ch10-sw1 oh yeah, not app size reduces! apple made seamless integration make appstore downloadable app sma...

javascript - Meteor: Uncaught TypeError: Cannot read property 'events' of undefined -

Image
i working on meteortips' your second meteor application tutorial, , @ end of chapter 5: routing, part 2 . when go http://localhost:3000/ following screen: and when check chrome console, following error: uncaught typeerror: cannot read property 'events' of undefined todos.js:85 here content of todos.js file: todos = new meteor.collection('todos'); lists = new meteor.collection('lists'); if(meteor.isclient){ // client code goes here template.todos.helpers({ 'todo': function(){ var currentlist = this._id; return todos.find({ listid: currentlist }, {sort: {createdat: -1}}) } }); template.addtodo.events({ 'submit form': function(event){ event.preventdefault(); var todoname = $('[name="todoname"]').val(); var currentlist = this._id; todos.insert({ name: todoname, completed: false, createdat...

tsql - Why SELECT can have SIU lock (SQL Server 2012)? -

Image
today troubleshooting deadlock case , discovered quite strange case (at least seemed strange me). had 2 concurrent statements ( update , select ) , led deadlock scenario. no question there. below deadlock graph depicts case: what bothers me type of lock select holds. why siu (share intern update), not s (shared) or is (intent shared) lock? i found post on msdn forum, explains quite similar case: profiler shows current cumulative lock sessions. after exported deadlock event xdl-file , opened in text editor found process selects data has s lock , process updates data has iu lock (and wants ix lock). , resource siu-locked (s+iu). for me sounds (and doesn't make sense): select has siu lock, because other session has intent update can anybody, please, explain me why select holds siu lock? update: select statement autogenerated ef 6.1.2; update statement stored procedure. i think turn out there dml executing under same transaction. know state...

Opening images using tkinter on python 3 -

i made following (and short) code on python 3: from tkinter import * pil import image, imagetk image = image.open("trollface.jpg") photo = imagetk.photoimage(image) canvas.create_image(0, 0, image = photo) when run it, following error: traceback (most recent call last): file "<stdin>", line 1, in <module> file "c:\winpython-64bit-3.4.3.4\python-3.4.3.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 685, in runfile execfile(filename, namespace) file "c:\winpython-64bit-3.4.3.4\python-3.4.3.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 85, in execfile exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace) file "c:/comp sci/usb_virus/trollface_puzzle_picture.py", line 12, in <module> photo = imagetk.photoimage(image) file "c:\winpython-64bit-3.4.3.4\python-3.4.3.amd64\lib\site-packages\pi...

php - Why are my session lifetimes not expiring when they're supposed to? -

when users login, want set amount of time before session expires. i've accomplished setting lifetime in session_set_cookie_params . when @ cookie's expiration date says: saturday, december 8, 3296 @ 11:45:08 am but when come after hour cookie there site won't recognize it. why won't site recognize or use cookie? cookie contains session identifier. data stored on server side. php periodically deletes expired sessions. when you're returning after 1 hour, session data lost , session id cookie can't match anything. chck out session.gc_maxlifetime ( http://php.net/manual/en/session.configuration.php#ini.session.gc-maxlifetime ) more info.

selenium webdriver - Can not accept javascript alert after latest google chrome updates -

i use webdriver ui tests. after latest google chrome updates 44.0.2403.107 have problems accepting alerts: use driver.switchto().alert().accept(); when confirm javascript alert, exception: no alert open . looks alert opens later try accept it. else have same problem after latest google chrome updates? i use latest version chromedriver - 2.16. did tried include wait alert shown below: new webdriverwait(driver,60).until(expectedconditions.alertispresent()); driver.switchto().alert().accept(); if still facing issue please raise issue @ below url sample test code , html file included: https://code.google.com/p/chromedriver/issues/list

php - How to send email through MailChimp 3.0 api? -

i'm trying send email through mailchimp api version 3.0 in php, have no luck. code: $poststring = '{ "message": { "html": "this emails html content", "text": "this emails text content", "subject": "this subject", "from_email": "xxx@dyyy.sk", "from_name": "john", "to_email": "aaa.bbb@gmail.com", "to_name": "anton", "track_opens": false, "track_clicks": false }}'; $ch = curl_init(); curl_setopt($ch, curlopt_url, $this->api_endpoint); curl_setopt($ch, curlopt_httpauth, curlauth_basic); curl_setopt($ch, curlopt_userpwd, 'drewm:'.$this->api_key); curl_setopt($ch, curlopt_httpheader, array('accept: application/vnd.api+json...

javascript - Error with java script while retrieving documents from mongodb -

basically idea documents calling function mongodb using javascript (not node.js) var mongo = require('mongodb'); mongo.mongoclient.connect('mongodb://localhost:27017/database',function(err,db) { var result = []; result = db.eval('getcontacts("_id")',function(error, result) { console.log("error is:" +error); console.log("result is:"+result); console.log("working till here"); }) // db.close(); }); note: getconatcts db function contact related details. error: error is:null result is: working till here

javascript - AngularJS ngInfiniteScroll keeps firing as I scroll up -

my upwards scrolling triggers infinitesubjects() . should trigger while scrolling downward. i've looked many posts haven't figured out solution. i've tried messing around infinite-scroll-disabled . tried sticking 1003px height <div> in different places @ bottom take space. no dice. :/ <div ng-app="mainapp" ng-controller="gridcontroller" class="container"> <div class="row" infinite-scroll="infinitesubjects()" infinite-scroll-distance="0" > <div ng-repeat="subject in (filteredsubjects = (allsubjects | orderby:subjectorder | limitto:subjectlimit))"> <div class="col-md-2 subject-card"> {{ subject.name }} ..more divs in here.. </div> </div> <div style="clear:both; height:1003px;"> </div> </div> </div> inside controller: $scope.infinit...

python - Installing PyGMO on Mac OS X Yosemite - missing boost-python3? -

i've been trying install pygmo on mac os x 10.10. i'm using anaconda python 2.3 , comes python 3.4 . i followed instructions on http://esa.github.io/pygmo/install.html , did try build boost manually didn't have luck building boost-python ... instructions find on official website limited... while using ccmake run build file in pagmo/build directory, complained did not find boost-python3 ... so reverted using brew install boost . info found on page: http://ryanclouser.com/2015/07/16/mac-osx-build-boost-python-with-python3-support/ now have both boost , boost-python installed, still ccmake process pygmo complains not being able find boost-python3 . are there environment variables need set? in ccmake config screen need set boost_python3_library_release or boost_python3_library_debug ? latest edit: sha256 below mis-match resolved. turned out caused source forge site being down when ran commands... better error messages have helped. however, when tried b...

python - HTTPS on Elastic Beanstalk Flask application -

i have been trying ssl enabled on aws elastic beanstalk(eb) application not luck far. after following documentation configuring https access on eb , created self-signed certificate believe enough if 1 wants encryption. i created eb environment used load balancer , after uploading certificate, able use , pick secure listening port (8443). on ec2 load balancer, created listener https 8443 http 80 <cert file> i gave load balancer , eb instance security group had rule: custom tcp rule tcp 8443 0.0.0.0/0 i included config in .ebextensions pointing documentation told me: resources: sslsecuritygroupingress: type: aws::ec2::securitygroupingress properties: groupname: {ref : <security_group_name>} ipprotocol: tcp toport: 8443 fromport: 8443 cidrip: 0.0.0.0/8443 then in flask application application had these parameters: from openssl import ssl flask_sslify import sslify context = ssl.context(ssl.tl...

android - Error "COMPILE_SDK_VERSION" not found when adding a GPUImage Library to the Project -

previously worked on eclipse android development, have moved android studio specific project , wanted hang of android studio. i created new project. , imported new module add library "gpuimage" "project explorer". library got added, when compiled project, got error : "error:(4, 0) not find property 'compile_sdk_version' on com.android.build.gradle.libraryextension_decorated@171c6271." tried follow tutorials haven't been able find thing. must related editing gradle files of app or library not sure. need help. thanks! if import module, should download released version: https://github.com/cyberagent/android-gpuimage/releases in opinion, add gradle better repositories { mavencentral() } dependencies { compile 'jp.co.cyberagent.android.gpuimage:gpuimage-library:1.3.0' }

Install service with delphi? -

i want small executable install service usual path\servicename /install i've tried running simple shellexecute in program elevated rights, shellexecute(0, nil, 'cmd.exe','/c servicepath\servicename.exe /install', nil, sw_hide); but service doesn't install. not wiz shellex suspect have gotten wrong; kindly show me errors of ways , possibly supply correct shellexecute line the proper way install service code call service control manager (scm) api. /install parameter supplied delphi service "standard" call scm not best 1 services. today, few services, example, should run localsystem privileges because it's powerful.

python - SQLAlchemy Writing Nested Query -

i have 2 tables: table id | values and table b id | foreign key | datestamp | val2 given list of id s a , how joined result of a , b rows b have earliest datestamp each matched a . for example table b have: 1 | 2 | 1/10/2015 1 | 2 | 1/2/2015 1 | 2 | 1/3/2015 i interested in row id_a | id_b | 1/2/2015 | values | val2 to understanding in sql, can like where timestamp = (select min(timestamp) b.x x.id = b.id) however, how nest select inside sqlalchemy query? for example, believe can't use .filter(b.timestamp == (query(func.min(b.timestamp)).filter(a.id == b.foreign_key_to_a))) actually, can use: b2 = aliased(b, name='b2') s = session.query(func.min(b2.datestamp)).filter(b2.a_id == a.id) q = (session .query(a.id, b.id, b.datestamp, a.values, b.val2) .join(b) .filter(b.datestamp == s) )

if statement - javascript prompt failing after one try -

i creating simple bootstrap page when first open page page asks prefer dark theme or light theme (the theme changes based on answer.) additionally want have if user types other dark or light prompt keeps asking until chose or b. unfortunately, happens prompt asks user , type else in , asks again, if type else 2 answers gives , resorts default background. there way prevent this? here code.... var background_image = prompt("do prefer light background or dark background?") if (background_image == 'light') { $('body').css('background-image', 'url("assets/background.jpg")') } else if (background_image == 'dark'){ $('body').css('background-image', 'url("assets/dark.jpg")') } else { var background_image = prompt("do prefer light background or dark background?") } body{ background-image: url("../assets/grey.jpg"); } also, if type or b first time try co...

dynamics crm 2011 - CRM - Get entity name by object type code (C#) -

Image
how can name of entity knowing objecttypecode ? is possible? thanks. download xrmtoolbox open metadatabrowser you'll need connect organizion. sort typecode , find entity name.

Can one VBA code execute commands in excel and access? -

is possible 1 vba code execute commands in both excel , access? each day have 15 queries need copy/pasted specific sheets , places in excel workbook. information in queries updated everyday. i'm hoping write code insert results of these queries specific locations in excel. would possible write 1 code of this? yes, access maintains spreadsheet output capabilities including: transferspreadsheet identify query exported , outputted specific workbook , range: docmd.transferspreadsheet acexport, acspreadsheettypeexcel12, "qryname", "c:\path\to\excelspread\sheet.xlsx" true, "!worksheetname" copyfromrecordset declare queries in dao or ado recordsets in vba , output resultset worksheet range: ws.range("a2").copyfromrecordset rst do note never need run queries in access except if action queries (append, update, delete). select queries, anytime in use (exported, called, or opened) query runs.

c# - How to handle json that returns both a string and a string array? -

this question has answer here: how handle both single item , array same property using json.net 5 answers i'm using yahoo fantasy sports api. i'm getting result this: "player": [ { ... "eligible_positions": { "position": "qb" }, ... }, { ... "eligible_positions": { "position": [ "wr", "w/r/t" ] }, ... }, how can deserialize this? my code looks this: var json = new javascriptserializer(); if (response != null) { jsonresponse jsonresponseobject = json.deserialize<jsonresponse>(response); return jsonresponseobject; } and in jsonresponse.cs file: public class player { public string player_key { get; set; } ...

android - Direction specific geofence - matching user's bearing to a range of degrees for a waypoint -

we building driving tour app works - tour audio triggered when user enters geofence of tour location (waypoint) in direction. if user enters direction, geofence event not become registered. we can user's bearing (android), or course (ios) device, output specific, say, 191 degrees true north. there way assign each tour location (waypoint) range of degrees, say, 160-200 degrees, , if user's bearing/ course falls range geofence event become registered? if not in range, not registered? this not specific scout sdk - can try app level implementation based on bearing , previous position: get direction android app user headed on entering geofence

javascript - immutable.js & react.js setState clears prototype of the object -

i have following code in component: constructor() { this.state = immutable.fromjs({ user : { waschanged : false, firstname : false, lastname : false, address : { street : false, } } }); } onedit({target: {dataset: {target}}}, value) { this.setstate(function (prevstate) { return prevstate.setin(['user', target], value); }); } render() { var user = this.state.get('user').tojs(); ... } the problem when try update value in onedit see prevstate has different prototype set. don't understand why or doing wrong. see in console > object.getprototypeof(this.state) src_map__map {@@__immutable_map__@@: true} > object.getprototypeof(prevstate) object {} after state has been changed goes render of course can't find get function or immutable using react addons 0.13.3. put key o...

javascript - Creating if for dblclick td -

hello stackoverflow people, ive got problem. im trying put premisions. how can make if user id equal task creator id, let user use onclick functions, if not dont. ive tried doing usernow user, , userown creator: if (usernow == userown) { function editcellvalue(cellelement) { but ddnt worked, think should in this: $s .= ('<td class="select0" id="start_'.$currenttasken.'" nowrap="nowrap" align="center" ondblclick="mousecords(event);editcellvalue(this)" style="' . $style . '; border: none;" title="'.$appui->_('double click edit date').'">' . $newstartdata . '</td> for example: ondblclick="if(usernow == userown) { mousecords(event);editcellvalue(this) }" but dont know how write correctly. question, how can make if dblclick? you must remove ondblclick attribute on html. $s .= ('<td class="sele...

ios - AVPlayer/AVAudioMix fade-in effect clicks in the beginning -

i'm trying implement fade-in effect based on avplayer + avaudiomix + avaudiomixinputparameters. works except when playing audio first time after starting app there click in beginning. subsequent plays work perfect though, first-time glitch pretty stable , reproducible. my play button enabled after avplayeritem's status set ready, it's impossible fire play method while player not ready. in fact doesn't matter how long wait after loading audio file , constructing objects. this happens on os x, haven't tested on ios (yet). note test need audio file starts sound , not silence. here stripped down code without gui part ( testfadein entry point): static avplayer* player; static void* playeritemstatusobservercontext = &playeritemstatusobservercontext; - (void)testfadein { avurlasset* asset = [avurlasset.alloc initwithurl:[nsurl fileurlwithpath:@"helicopter.m4a"] options:@{avurlassetpreferprecisedurationandtimingkey: @yes}]; avplayeritem*...

javascript - while loop not giving correct results -

Image
i newbie js. trying code script when buy mobile price deducted credit card price. here code // total money in credit card var totalmoneyforcredit=150; // current billing shop var moneyspent=0; // prices of phones var samsungprice=33; var sonyprice=22; var nokiaprice=22; // asseorices mobile var charger=5; var headset=10; // ask user purchasing mobies while(totalmoneyforcredit>0){ var order=prompt("please enter mobile want purchase"); if (order==='sam') { moneyspent=moneyspent+samsungprice; totalmoneyforcredit=totalmoneyforcredit-moneyspent; } else if (order==='nokia') { moneyspent=moneyspent+nokiaprice; totalmoneyforcredit=totalmoneyforcredit-moneyspent; } else if (order==='sony') { moneyspent=moneyspent+sonyprice; totalmoneyforcredit=totalmoneyforcredit-moneyspent; } document.write( '<b>' + ' spent ' + moneyspent + ...

asp.net mvc 4 - model passed to dictionary is of type .Data.Entity.Infrastructure.DbQuery , but it requires a model of type 'System.Collections.Generic.IEnumerable -

what trying userroles: public class userrolescontroller : controller { private hmsentities db = new hmsentities(); // // get: /userroles/ public actionresult index() { user user = (user)session["user"]; var usr = db.users.find(user.id); viewbag.id = usr.id; viewbag.firstname = usr.firstname; if (session["user"] != null) { var role = db.roles.where(u => u.id == user.roleid); } return view(usr); } index.cshtml @model ienumerable<hms.models.user> @using hms.models; in project when user logs in user can view details , perform crud operations on roles of user, getting error: the model item passed dictionary of type 'system.data.entity.infrastructure.dbquery 1[hms.models.role]', dictionary requires model item of type 'system.collections.generic.ienumerable 1[hms.models.user]'. my models are: role.cs public partial c...

c# - Office add-in pinvoking SetWinEventHook -

i need pinvoke setwineventhook function ( https://msdn.microsoft.com/en-us/library/windows/desktop/dd373640%28v=vs.85%29.aspx ) c# vsto (visual studio tools office) add-in. in limited testing, seems work ok when pass winevent_outofcontext flag setwineventhook, since vsto add-in supposedly runs in same process office application (ie outlook), i'm wondering whether bad practice. if outofcontext merely adds additional marshalling overhead safe, can deal small performance hit, if there other issues, better use in process flag (winevent_incontext) , if so, how obtain hmodwineventproc parameter setwineventhook?

How to create operating system using Java? -

this question has answer here: is possible make operating system using java? 7 answers is there anyway create operating system using java? there anyway embed windows java library develop os things jframe, jfilechooser, jtextarea, etc? or better off in long run learning c or c++? yes, can. many options available so: jni provides communication of java code native code. can develop boot loader in native code, ui in java java processor: implementation of jvm in hardware java optimized processors embedded java picojava and on.. there's nothing can stop developing os in java. can find many oses written in java: cisco nasa... however, creating tiny os requires lot of effort.

ios - How can I adjust UILabel height to fit the size? -

Image
i know io7 , later , boundingrectwithsize can work. in order fit ios version. use sizethatfits calculate.following code: self.detaillabel.text=@"visit bbc news up-to-the-minute news, breaking news, video, audio , feature stories. bbc news provides trusted"; self.detaillabel.linebreakmode = nslinebreakbywordwrapping; cgsize size =[self.detaillabel sizethatfits:cgsizemake(287, maxfloat)]; //287 label's width set in storyboard [self.detaillabel setframe:cgrectmake(self.detaillabel.frame.origin.x, self.detaillabel.frame.origin.y, self.detaillabel.frame.size.width, size.height)]; self.detaillabel.layer.bordercolor=[[uicolor blackcolor] cgcolor]; self.detaillabel.layer.borderwidth=1; and result is: the last 2 word "provides trusted" missing!!!!!! how ever when append word self.detaillabel.text=@"visit bbc news up-to-the-minute news, breaking news, video, audio , feature stories. bbc news provides trusted world and"; ...

css3 - How to select a text (without tag) in a div using CSS selector? -

i have : <div class="foo"> <h3>title</h3> text want select using css selector. <div class="subfoo">some other text</div> </div> is possible select "some text want retrieve using css selector" using single expression of css selectors ? it's not possible in clean manner pure css. as vangel suggested recommend setting styling in .foo selector apply overrides other elements: .foo{ //some text styles } .foo *{ //overriding styles } however best option make changes html place text in own element can styled in isolation: <div class="foo"> <h3>title</h3> <span>some text</span> <div class="subfoo">some other text</div> </div> .foo span { //some text styling }

python - What does this if .. and not statement mean? -

what following code mean: if next == "taunt bear" , not bear_moved bear_moved filled value of false. i've read post: what "if" statement mean? explains , 'and' operator tests truth on both sides. if so, code say, if next equal "taunt bear" , bear_moved not true? it's checking see if next equal "taunt bear" , checking if bear_moved falsey (a falsey value means evaluates false, truthy means evaluate true). long next equal "taunt bear" , bear_moved if not truthy, if statement succeed.

Console is still shown with WinMain entry point in C++ using Netbeans -

this question has answer here: win32 programming hiding console window 7 answers i'm trying make small application starts application depending on command line parameters. i using winmain entry point this: bool winmain(hinstance hinstance, hinstance hprevinstance, lpstr commandline, int ncmdshow) { ... } but still see console window. how can make sure no console window ever drawn when running application? how configure netbeans in order so? do have change abovementioned code? if yes, must changed or added? ps: can hide console window showwindow(getconsolewindow(), sw_hide) , still see console window fraction of second. want make sure console window never shown. the code fine. compiler flag -mwindows trick. to set compiler flag following: right-click project, click properties click on c++ compiler in category build add -mwindo...

vb.net - line break in CSV -

Image
what character or combination of characters have insert csv file if enable line breaks in excel text correctly breaked @ point? private sub removehtmltags(byref text string) dim htmltagregex new regex("<[^>]*>") dim linebreakhtmltagregex new regex("(<p>)|(<br>)|(</br>)|(</p>)") text = linebreakhtmltagregex.replace(text, chr(10)) text = htmltagregex.replace(text, " ") text = text.trim end sub instead of chr(10) tried vbnewline, vbcrlf, vbcr every time same result: when file opened excel signs interpreted normal line breaks, leads split of rows in excel that's should like: this like: how need achieve style in second screenshot if want load csv file double-clickling it, not on import dialogue remark: not vba, need on external vb.net console application opens excel after csv file created. if want include cr , lf control characters need wrap field in double quotes. if sugge...

android - Mapbox GL using external maps -

i want use mapbox gl in android application. service going released , have tricky question using renderer. i renderer itself, want use own maps data in application (not data, offered mapbox , paid). instance, want parse openstreetmaps data on own, customise somehow , put inside of renderer show in application. and question: possible use own maps data while using mapbox gl? or can used mapbox data? thank in advance help. maybe know other well-done solutions problem? thing is, want have vector tiles, not raster ones. , project planned developed ios later.. you can use mapbox open-source sdk own tiles. mapbox native renderer android, ios or node.js can used directly tiles hosted outside of mapbox.com platform. see sample mobile app "osm2vectortiles" loading vector tiles custom server or locally embedded mbtiles. android: https://play.google.com/store/apps/details?id=com.klokantech.osm2vectortiles ios: https://itunes.apple.com/us/app/osm2vectortiles/id108...

scala - Final URL when using `withFollowRequests` -

using play ws api , , following simple example documentation: ws.url(url).withfollowredirects(true).get().map { response => ... } is there way recover, response or elsewhere, final url reached after following redirections?

ruby on rails - Noob error: No route matches [POST] "/users/1/edit" -

sooo... i'm noob , haven't found answer gets me through yet. i've been struggling through , know it's simple question, i'm not experienced enough know how solve one. i'm receiving error: no route matches [post] "/users/1/edit" here routes issue: (simple, know) rails.application.routes.draw resources :users here controller: class userscontroller < applicationcontroller def new @user=user.new end def create @user = user.new(user_params) if @user.save redirect_to users_path else render 'new' end end def edit @user = user.find(params[:id]) end def update @user = user.find(params[:id]) if @user.update_attributes(user_params) redirect_to @user else render 'edit' end end def delete @user = user.find(params[:id]) end def destroy @user = user.find(params[:id]) @user.destroy redirect_to(:action => 'index') en...

html - Dynamically change the class of a div nested in a gridview item template from code behind c# -

i need change class of div nested inside gridview item template, have given runat="server" tag , id div. how can change class of particular div upon gridview databind based on each row conditions. aspx <asp:gridview id="gv" runat="server" onrowdatabound="gv_onrowdatabound"> <columns> <asp:templatefield> <itemtemplate> <div id="yourdiv" runat="server"></div> </itemtemplate> </asp:templatefield> </columns> </asp:gridview> code-behind protected void gv_rowdatabound(object sender, gridviewroweventargs e) { if (e.row.rowtype == datacontrolrowtype.datarow) { htmlgenericcontrol div = (htmlgenericcontrol)e.row.findcontrol("yourdiv"); div.attributes.add("class", "classyouwanttoadd"); } }

R. Same command gives different plots. Variable vs. Character string -

Image
i lied. aren't quite same commands. don't see how different. i made function sales.deriv. it's definition @ bottom of page. function finds derivative of sales data given dataframe , plots it. (they're plenty of inefficiencies in how coded it. feel free comment on them cleaning them not focus here.) command one, > sales.deriv(trans.df=subset(trans, week < 27 & week > 8 & day == "wednesday")) returns plot one: command two, > day <- "wednesday" > sales.deriv(trans.df=subset(trans, week < 27 & week > 8 & day == day)) returns plot two: as can see, plots different — noticeably in number of relative peaks before 11. defining day <- "wednesday" , though, seems me commands should identical. what's going on here? function definition: sales.deriv <- function(trans.df, plot=true, xmin=7, xmax=18, ymin=0, ymax=150, title = "rate of revenue", pch=1, col="black...

How to add dynamic tabs and dynamic expandable list view inside it in android? -

i want create tabs dynamically according number category available.inside each tab need create number of expandable list views dynamically inside each tab.(example: got 4 categories education,sports,science,aerospace.) need create 4 tabs on run time, change according number categories getting(one or twenty or more). inside each tab need create number of expandable list views(dynamically). after long surfing found related links here1 here2 here3 , more.but prefer go proper , efficient method not aware of. need help,thanks in advance. you need consider this tab2 = tab3 = tab1 = fragement---- in can expandable listview defined in layout reference of tab's need update expandable listview. for dynamic tabview can should specify tabspec either specifying the id of view, or tabhost.tabcontentfactory creates view content code both! change code 1 of following: for (int i=1; i<=n; i++){ final string tabname = "tab" + integer.tostring(i); fin...

VB.net how to serialize list / array of json objects -

i have problem, want serialize list of objects (the objects listed in 'list', , call 'items') json, don't know classes / structures need make following newtonsoft.json serializer: { "list": [ { "name": "item1" }, { "name": "item2" }, { "name": "item3" } ], "property1": "value", "property2": "value" } can know solution problem? lot! this class nested json serialize. i think examplen public class maincatlist public property categorylist() list(of maincategory) end class imports newtonsoft.json imports system imports system.runtime.compilerservices <jsonobject(memberserialization.optin)> public class maincategory <jsonproperty(propertyname:="ana katagori kodu")> public property anakatagorikodu() string <jsonprope...

excel - Run-time error when using the 'Run' method of the 'WScript.Shell' object -

i'm trying run command prompt via vba execute couple of commands, have run in error. run-time error '-214702894(80070002)': method 'run' of object 'iwshshell3' failed i have tried wrapping file paths in quotes (as below), error persists ever method use. shell.run "cd """ & mydocumentspath & """", 1, true shell.run "cd " & chr(34) & mydocumentspath & "chr(34)", 1, true i tried directly type file path (with no spaces), failed too. shell.run "cd ""c:\users\gardd""", 1, true is able spot issues? here full code - dim shell object ' instance of 'shell' object set shell = vba.createobject("wscript.shell") dim mydocumentspath string ' path current users 'my documents' folder mydocumentspath = getmydocumentspath shell.run "cd " & mydocumentspath, 1, true ' change shell start loc...

php - Call to member function getClientRegistrationMode on a non object osticket -

i using codeigniter , trying integrate os-ticket it. reason moving codeigniter user login work os-ticket log in. hence created codeigniter library , trying load 'view.php' library. class lib_support { protected $ci; /** * __construct * * @return void * @author **/ public function __construct() { $this->ci =& get_instance(); $this->ci->load->library('session'); $this->ci->load->database(); $this->ci->load->helper('date'); $this->ci->load->helper('url'); $ci=& get_instance(); if (! isset($_session)) { session_start(); } } public function view() { require('support/view.php'); } } that's got message. i placed osticket files inside ../application/libraries/support/ folder. , calling require('support/view.php'); can let me know went wrong here or steps(config values) need take care while changing/moving...

php - Change menu active state on different pages -

i using bootstrap pagination menu on website navigate 1 page page. i copied pagination menu : http://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_pagination_active&stacked=h , added pages of website . it's works fine , can set active status using: <li class="active"> <a href="pages/1.php">1</a></li> according page link code is. for reasons ,i want have 1 menu file , include pages . is there way automatically add ".active" class links in included menu? menu.php <ul class="pagination"> <li><a href="pages/1.php">1</a></li> <li><a href="pages"pages/2.php">2</a></li> <li><a href="pages/3.php">3</a></li> <li><a href="pages/4.php">4</a></li> </ul> please help! you can depending on setup. in javascript, using jquery example: ...

mobile - Xamarin IOS: Change tint color in share window -

i using code sharing in xamarin ios: public void share(string title, string content) { if (uiapplication.sharedapplication.keywindow == null || uiapplication.sharedapplication.keywindow.rootviewcontroller == null) return; if (string.isnullorempty(title) || string.isnullorempty(content)) return; var rootcontroller = uiapplication.sharedapplication.keywindow.rootviewcontroller; var imagetoshare = uiimage.frombundle("icon_120.png"); var itemstoshare = new nsobject[] { new nsstring(content), imagetoshare }; var sharestatuscontroller = new uiactivityviewcontroller(itemstoshare, null) { title = title }; //sharestatuscontroller.navigationcontroller.navigationbar.tintcolor = uicolor.black; //rootcontroller.navigationcontroller.navigationbar.tintcolor = uicolor.black; //sharestatuscontroller.navigationbar.tintcolor = uicolor.fromrgb(0, 122, 255); ...