Posts

Showing posts from August, 2014

javascript - How can I project a cube onto an axis in a quick manner? -

i going projection of cube onto axis. basically, doing dot product of every vertex of cube axis , compare results find out smallest , greatest values. @ end of day, these 2 values tell me point of axis projected starts , ends. have written following function that; however, thing there lot of comparisons in , because going call function thousands of time whole code runs slow. looking optimization make code faster. function has lot of comparisons , wondering if there way can minimize amount of comparisons in it. ideas? the code written in javascript considering doing on c++ , opengl open suggestions on different programming languages. function projectcube (axis, cube) { pro = dotprodcut(axis, cube.vertex0); minpro = pro; maxpro = pro; pro = dotprodcut(axis, cube.vertex1); if (pro < minpro) { minpro = pro; } if (pro > maxpro) { maxpro = pro; } pro = dotprodcut(axis, cube.vertex2); if (pro < minpro) { minpro = pro; } if (pro > maxp

matlab - unsure of fullfile command syntax for path location -

here's piece of code i'm working on, based on example previous comment. in first line, make path? extend way macintosh hd/users/..../documents/matlab (matlab folder in path ascii files i'm analyzing stored) or start @ point? i'm not sure replace 'path', 'to', 'folder' in below example. i'm more confused because current dir showing in matlab window correct 1 files i'm working stored. in case, do fullfile line? i'm trying display contents of newly truncated files. how do that? thanks! folder = fullfile('path', 'to', 'folder'); f = dir(fullfile(folder, '*.asc')); matrices = struct(); ii = 1 : numel(f) name = fullfile(folder, f(ii).name); o = dlmread(name); matrices.(f(ii).name) = o(1:80,:); end as documentation says, fullfile allows construct filename it's parts without having worry whether use / or \ file separators , without doing things messy

image - Easy way to extract EXIF data in PowerShell? -

i've been looking @ various methods can extract exif data using powershell, have far seen quite convoluted. here , here . i looking (relatively) simple method extract basic exif data using powershell, can use natively. in particular, particularly interested in date taken property , trying find method can run through get-date , , customise formatting own needs. like: $exifdatetaken = $mypicture.'date taken' | get-date -format yyyymmdd-hhmmss does know if there way natively in powershell?

Javascript : How to not confuse regex with BB code -

please note i find several questions&answers end result came : dont use regex. posting question find solution problem. , maybe alternative regex. base on several similar question: replace multiple strings @ once replace() regexp on array elements bb-code-regex in javascript credit to: user2182349 sor resolving this. see answer below. i'm trying replace bbcode. use function take answer still not working me. i want replace things that: var find = ["[b]", "[/b]", "[i]","[/i]","[u]","[/u]","[n]","[/n]","[c]","[/c]","[li]","[/li]"]; var rep = ["<b>", "</b>", "<i>","</i>","<u>","</u>","<div class='editnote'>","</div>","<center>","</center>","<

groovy - Why is Grapes grabbing a jar I didn't ask for? -

i want write simple groovy script uses apache httpclient 4.1 , since don't have jar, want grab grapes. have far in script is.. @grab(group='org.apache.httpcomponents', module='httpclient', version='4.0') import org.apache.http.impl.client.defaulthttpclient; but when run exception.. java.lang.runtimeexception: error grabbing grapes -- [download failed: commons-logging#commons-logging;1.1.1!commons-logging.jar] why grapes getting commons logging when asked http client? if because latter needs former, need explicitly grab of dependent jars of http client myself? how know are? there way tell grapes on own? this happening because commons-logging transitive dependency i.e. dependency of org.apache.httpcomponents:httpclient. you presumably having problem because local maven repo doesn't have commons-logging , doesn't know how (or isn't configured) it.

sql - How to migrate WordPress from live to local? -

its common find explanations on how migrate wordpress sites local live, opposite? have live website , run in xampp, how can download database , upload locally? lot! this broad question i'm sure googling answer it's opposite of uploading. if hosting company uses cpanel. go cpanel , find phpmyadmin. phpmyadmin can download db clicking on db wordpress site uses. click on export , export sql. next go wordpress site , export theme settings if theme has them. export wordpress site zip file same way import. once have db, theme settings , wordpress site exported can upload them local setup uploading them live server. also there plenty of backup plugins backup in zip including yor wordpress db. can unzip , upload files localhost xampp. anything not sure of i'm sure can find more info on google going through steps i've listed.

ruby on rails - find_by() in json data -

i using ahoy gem analytics. in ahoy_events table, have properties column of json data type. want find specific data based on column. suppose have {"tag":"a","class":"bigyapan-6","page":"/client/dashboard","text":"","href":"http://www.google.com"} this data , want find_by class. in rails c ran ahoy::event.find_by(properties[:class]: "bigyapan-6") , gave me err ahoy::event.find_by(properties["class"]: "bigyapan-6") syntaxerror: unexpected ')', expecting end-of-input this syntax error since properties[:class] not valid hash key in ruby. query postgres json columns need provide query string: ahoy::event.find_by("properties ->> 'class' = 'bigyapan-6'") activerecord not take nested hash in case association. doubt activerecord ever support since rbdms specific , type coercion thing ( -> vs

Need help setting up Time Sensitive push notifications iOS swift -

i have set push notifications parse , can send 1 parse , receive on device. now, in app have expiring objects. send users notification that object expiring in x amount of days. have written following code in appdelegate.swift , didfinishlaunchingwithoptions method: let today = nsdate() let sevendays:double = (7*60*60*24) let fourteendays:double = (14*60*60*24) let tomorrow:double = (2*60*60*24) if today.timeintervalsincedate(expirationdate) == sevendays { print("expiring in 7 days") let channels = [newvacstring] let push = pfpush() let data = ["alert" : "uh oh! \(dogname)'s \(newvacstring) dogument expiring in 7 days!", "badge" : "increment", "vaccine" : newvacstring, "dogname" : dogname, "dogobject" : dogobject] push.setchannels(channels) push.setdata(data) push.sendpushinbackground() } after attempting debug this, doesn't run code on if statements (i've tried shorter inc

sql - SparkSQL Fetch rows before and after from dataframe after grouping -

given dataframe df +-----------+--------------------+-------------+-------+ |custnumb | purchasedate| price| activeflag| +-----------+--------------------+-------------+-------+ | 3|2013-07-17 00:00:...| 17.9| 0| | 3|2013-08-27 00:00:...| 61.13| 0| | 3|2013-08-28 00:00:...| 25.07| 1| | 3|2013-08-29 00:00:...| 24.23| 0| | 3|2013-09-06 00:00:...| 3.94| 0| | 20|2013-02-28 00:00:...| 354.64| 0| | 20|2013-04-07 00:00:...| 15.0| 0| | 20|2013-05-10 00:00:...| 545.0| 0| | 28|2013-02-17 00:00:...| 190.0| 0| | 28|2013-04-08 00:00:...| 20.0| 0| | 28|2013-04-16 00:00:...| 89.0| 0| | 28|2013-05-18 00:00:...| 260.0| 0| | 28|2013-06-06 00:00:...| 586.57| 1| | 28|2013-06-09 00:00:...| 250.0| 0| i result returns average of p

javascript - Check if YouTube video is live or uploaded -

i have youtube live event. able play video using youtube iframe player api. want know if there way can find if video live event video or regular uploaded video. need information designing controls. the way can (currently) youtube backend api . data video based on id , in response have property snippet.livebroadcastcontent either live, none, or upcoming .

ember.js - what is the role of router in a single page application -

i new ember-js, going through blog entries , saw video of ember-js introduction tom dale. to summarize router api newly introduced , best thing happened ember-js,router api used manage state of application , each state identified url, single page application in use 1 url, role of router, there 1 routeing entry mapped '/'(index)? if yes, lose advantage provided router api right? now single page application in use 1 url, role of router, there 1 routeing entry mapped '/'(index)? typically single page application still use url. example watch url change when using gmail. in case single page application means browser doesn't fetch new page url changes. gmail, typical ember single-page application change url user navigates various parts of application. ember router takes care of automatically. if yes, lose advantage provided router api right? if decide not use url, , want stay "/" whole time, can still use router. set router's loc

WPF/XAML: Binding expression error I don't understand -

value produced bindingexpression not valid target property. value='d' target property 'text' (type 'string') "d" enum value within data class wrote. i've overridden classes tostring() return enum values string , seems work. don't right now. how 'd' not valid string property?

Spring boot AMQP and Spring Hadoop together ends up with missing EmbeddedServletContainerFactory bean -

i have 2 small apps, 1 uses spring-boot-starter-amqp , other uses spring-data-hadoop-boot . can run them separately without problems. when join them together, app start fails exception: org.springframework.context.applicationcontextexception: unable start embeddedwebapplicationcontext due missing embeddedservletcontainerfactory bean . my main class pretty generic , works fine both of them separately: @propertysource("file:conf/app.properties") @springbootapplication public class job { public static void main(string[] args) throws exception { springapplication.run(job.class, args); } } i @ lost here. afaik @springbootapplication contains annotations needed, including auto configuration , components scanning. i've had no need configure web environment not using it. why need when both dependencies in class path, , how fix it? update i dug little bit in spring boot code. main problem springapplication.deducewebenvironment() automatically dete

c# - Debug blackbox DbContext.SaveChanges() when it doesn't -

i have simple sample program begin grips reality of entity framework 5. have read fair amount of theory , seems run problem saving database. the problem have dbcontext.savechanges() neither throwing exception (which expected) nor saving data. heres code: public class physicaladdresstype { [key] public long addresstypeindexcode { get; set; } public string tname { get; set; } public long clientid { get; set; } public guid userid { get; set; } public datetime lastmodified { get; set; } } public class testcontext : dbcontext { public testcontext() : base("name=basd.contactmanagement") { } public dbset<physicaladdresstype> addresses { get; set; } } static void main(string[] args) { try { using (var ctx = new testcontext()) {

what does single colon mean in cmd script except for using as a label? -

as know, single colon ":" can used label , referred "goto" statement, in following code don't know ":" mean here, can me :) set "str=!str:mode_1=%_mode%!" 2>nul thank you! from set /? message: environment variable substitution has been enhanced follows: %path:str1=str2% would expand path environment variable, substituting each occurrence of "str1" in expanded result "str2". "str2" can empty string delete occurrences of "str1" expanded output. "str1" can begin asterisk, in case match beginning of expanded output first occurrence of remaining portion of str1. so !str:mode_1=%_mode%! replace instance of "mode_1" in str value of variable %_mode% . (the exclamation marks being used delayed expansion of str )

AngularJS 1.4, bootstrap multi level Accordion sample -

i want build menu below not finding appropriate sample utilising angularjs 1.4, bootstrap & accordion. accordion must. please advise. menu1 menu2 submenu2.1 submenu2.2 sub-submenu2.2.1 sub-submenu2.2.2 menu3 i have added code below. style sheet bootstrap.css. custom stylesheet used in project. accordion menu elements should have different colours @ each level of menu. 1 selected should displayed in different color. when hover on elements should display different color. per below implementation have 2 main level elements in menu. first element displaying proper accordion behaviour. second element open. no stylesheet getting applied either of menu elements. please advise. html: <script type="text/ng-template" id="menutree"> <uib-accordion-group is-open="firstmenuitemstatus.isfirstopen" is-disabled="firstmenuitemstatus.isfirstdisabled"> <uib-accordion-heading ng-if="c.pdtos"

Finding items in a group [android] -

when click menu item want able un-check other items contained in same group can create radiobutton effect. object need cast item.getgroupid() to- able siblings , uncheck them? here code int groupid = item.getgroupid(); if (item.ischecked() == false) { item.seticon(android.r.drawable.checkbox_off_background); item.setchecked(true); } else { item.seticon(android.r.drawable.checkbox_off_background); item.setchecked(false); } here xml general structure <menu> <group id = "mygroup" <item/> </group> </menu> thanks lot. if knows how make icon begin on right instead of left of each item awesome, im new android , lot in xml menu, set group attribute android:checkablebehavior single described in documentation .

winapi - C# Call win api in external process -

i'm trying call win api function in external process. basic rundown: get base address of user32.dll putty.exe (or 32 bit proc) get base address of messageboxa user32.dll populate messageboxa struct data, , allocate data locally. allocate struct in putty write struct putty. createremotethread execute messageboxa. all winapi calls succeed, , no error thrown, nor putty process crash. not show messagebox. any appreciated. thanks! using system; using system.collections.generic; using system.diagnostics; using system.linq; using system.runtime.interopservices; using system.text; namespace remote_api_call { class program { #region api [dllimport("kernel32.dll", charset = charset.auto)] public static extern intptr getmodulehandle(string lpmodulename); [dllimport("kernel32", charset = charset.ansi, exactspelling = true, setlasterror = true)] static extern intptr getprocaddress(intptr hmodule,

javascript - Angular Charts with some especial requirements -

Image
i using angular charts in order achieve want, yesterday did it, client wants changes, here data receiving: { "12-15-2015": { "55f6de98f0a50c25f7be4db0": { "conversions": { "total": 0, "amount": 0 }, "clicks": { "total": 8, "real": 1 } } }, "12-16-2015": { "55f6de98f0a50c25f7be4db0": { "conversions": { "total": 0, "amount": 0 }, "clicks": { "total": 18, "real": 1 } } }, "12-17-2015": { "55f6de98f0a50c25f7be4db0": { "conversions": { "total": 1, "amount": 22 }, "clicks": { "total": 12, "real": 1 } } }, "12-18-2015": { "55f6de

startup - How to speed up python starting up and/or reduce file search while loading libraries? -

i have framework composed of different tools written in python in multi-user environment. the first time log system , start 1 command takes 6 seconds show few line of help. if issue same command again takes 0.1s. after couple of minutes gets 6s. (proof of short-lived cache) the system sits on gpfs disk throughput should ok, though access might low because of amount of files in system. strace -e open python tool | wc -l shows 2154 files being accessed when starting tool. strace -e open python tool | grep enoent | wc -l shows 1945 missing files being looked for. (a bad hit/miss ratio ask me :-) i have hunch excessive time involved in loading tool consumed querying gpfs files, , these cached next call (at either system or gpfs level), though don't know how test/prove it. have no root access system , can write gpfs , /tmp. is possible improve python quest missing files ? any idea on how test in simple way? (reinstalling on /tmp not simple, there many packages invo

c - Change the value of spin button -

i'm making gtk2 application scratch using glade3 , own main c file. scenario this. there's collection of 3 spin buttons. need change value of 3rd spin button in real time when value in spin button 1 or 2 changes. with glade3 i've made 3 spin buttons , know how read values when changing following handler. void value_calc(gtkspinbutton *o, gpointer d) { gdouble x = gtk_spin_button_get_value (o); printf("spin-button1-vlaue: %f\n", x); } i connected "change value" signal of 1st spin button above value_calc handler. printing changed values. i've done same thing 2nd spin button. have 2 values , need update value of 3rd spin button. void set_values (gdouble value_to_be_added) { gtkspinbutton *spinbuton_3; gtk_spin_button_set_value (spinbuton_3, value_to_be_added); } when compiling above no errors , warnings. when run program , changing values of spin buttons, error throws command line. gtk-critical **: ia__gtk_spin_button_

How to show a popup on datagrid button click in wpf c#? -

i have common popup in wpf window , have button in datagrid well. want open popup when button clicked. popup should independent each button click. example, let's have 2 rows in datagrid. when click on first button popup should appear,then changes popup , close it. click second button should open new popup instead of changes made before. i'm using common popup this. please tell me possible handle requirement common popup window? xaml <popup x:name="popupserver" isopen="false" placement="mousepoint" > <border background="#ffeff2f3" borderbrush="black" borderthickness="1" width="229" height="145"> <stackpanel orientation="horizontal" margin="0,0,0,-17"> <grid width="227" margin="0,0,0,10"> <groupbox header=&qu

validation - Can two or more conditional statements placed inside a function in javascript? -

i newbie in javascript. can't find answer this. not sure whether relevant. have registration form 2 fields.on submit, should validated. here in code, first written if condition works. if first if statement commented, second if condition works. html code : <body> <div align="center"> <h1>registration</h1> <form action="" method="post" name="reg"> <table> <tr> <td><label> enter full name : </label></td> <td><input type="text" id="id1" name="username" placeholder="minimum 6 charactors"></td> </tr> <tr><td></td><td><label style="color:red;" id="label1"></label></td&g

javascript - Edit table row on button click meteor.js -

i adding details form inside table getting issue while click edit button update selected row. i want edit row such row becomes textbox while clicking edit button. here template: <template name="empform"> <div class="container"> <form> <div class="row" style="margin-left:330px;"> <div class="form-group col-sm-2"> <label for="name">name:</label> <input type="text" class="form-control" name="empname" style="height:40px;"> </div> <div class="form-group col-sm-2"> <label for="email">email:</label> <input type="email" class="form-control" name="email" style="height:40px;"> </di

swift - Why is the slider not updating the label when I make the slider programmatically? -

i made slider , label programmatically . wanted label display value of slider, label displays value assigned. code: var num: cgfloat = 9 override func viewdidload() { let label = uilabel(frame: cgrectmake(0, 0, 60, 40)) label.text = "\(num)" self.view.addsubview(label) let slider = uislider(frame:cgrectmake(0, 0, 60, 30)) slider.value = float(num) slider.addtarget(self, action: "changedslidervalue:", forcontrolevents: .valuechanged) self.view.addsubview(slider) } func changedslidervalue(sender: uislider!){ num = cgfloat(sender.value) label.text = "\(num)" } when did print(label.text!) , showed me label.text changing changed slider value. then, why doesn't label change on view controller? you have create ibaction slider shown in below code: @ibaction func slidervaluechanged(sender: uislider) { num = sender.value label.text = "\(num)" } for more info refer this tutoria

php - Symfony2 Doctrine2 - generate Many-To-Many annotation from existing database by doctrine:mapping:import -

i want generate entities existing database using doctrine tools reverse engineering you can ask doctrine import schema , build related entity classes executing following 2 commands. 1 $ php app/console doctrine:mapping:import acmeblogbundle annotation 2 $ php app/console doctrine:generate:entities acmeblogbundle but doctrine detect manytoone relation in many side "providercountry" table if need add manytomany relation have add annotation hand adding follwing annotation in country.php add /** * * @var provider $provider * * @orm\manytomany(targetentity="provider") * @orm\jointable(name="provider_country", * joincolumns={@orm\joincolumn(name="countryid", referencedcolumnname="id")}, * inversejoincolumns={@orm\joincolumn(name="providerid", referencedcolumnname="id")} * ) * */ private $providers; in provider.php add /** * @var country $country * * @orm\m

python - Scrapy LinkExtractor cannot extract links with href of mailto: -

i'm using linkextractor class extract links page for link in linkextractor(allow=()).extract_links(response): print link.url this prints urls page. can't seem links have href equal mailto: link. example: <a href="mailto:example@gmail.com">mail</a> do need pass argument linkextractor make grab links mailto: ? you don't need use linkextractor urls need, use xpath response object. all_links = response.xpath('//a/@href').extract() linkextractor focuses on getting links follow, that's why avoids mailto links default.

php - Class not found with Composer autoload and PSR-0 -

i'm trying use psr-0 instead of classmap in composer having difficulty. appears json file correct yet class i'm trying access not being picked up. can please have , see if can spot i'm going wrong: here have in composer.json: "autoload": { "psr-0": { "martynbiz\\slim3controller\\": "src/" } }, below folder structure: $ tree . . |-- readme.md |-- composer.json |-- composer.lock |-- phpunit.xml |-- src | |-- controller.php | |-- http | | |-- request.php | | `-- response.php | `-- test | `-- phpunit | `-- testcase.php `-- tests |-- bootstrap.php `-- library `-- controllertest.php here controller class: <?php namespace martynbiz\slim3controller; abstract class controller { also, can confirm composer autoload script has been included. use psr-4 instead. psr-0 requires prefix included in document tree (i.e. src/martynbiz/slim3controller/controller.p

ios - How To Get Particular Values From JSON and Plot on Map view Using Objective C? -

i need particular values below json response, values have mentioned below reg no: (need show callout) lat : (need use drop pin on map) long : (need use drop pin on map) name : (need show callout) age : (need show callout) note : school of array values getting server increase based on , b , c categories. not static! { = { school = ( { reg_no = 1; latitude = "22.345"; longitude = "-12.4567"; student = ( { name = "akila"; age = "23"; } ); city = "<null>"; state = tn; }, { reg_no = 2; latitude = "22.345"; longitude = "-12.4567";

codeigniter - How to make Code Igniter Controller for multiple input form with type="file" -

i want ask, how make controller function in codeigniter view ? <form action="<?=base_url()?>posts/new_post" method="post" enctype="multipart/form-data"><br> <input type="file" name="before" id="before" ><br> <input type="file" name="after" id="after" ><br> <input type="text" class="form-control" id="title" name="title" placeholder="enter name"><br> <textarea class="form-control" id="description" name="description" placeholder="enter name"></textarea><br> <input type="submit" value="submit profile picture" name="submit" class="btn btn-primary "> </form> thank you

asp.net - HtmlEditor causes unwanted breaklines -

Image
i not using ajaxcontroltoolkit's htmleditor because not have direct button insert images, why searched editor , found winthusiasm editor. everything seems work fine, doesn't. let's see step step. in example demonstrating use of subscript, behavior same improvement of text (bold, italic, ...): 1 - use htmleditor insert enhanced text database. have developed page works controlpanel , page shows existing items stored in database listview : 2 - if click on "edit" button can edit content htmleditor: 3 - far good. issue occurs on end-user page, page in content going showed regular users of page: i researched on generated source code in last page can not find br declared. seems ok in code, lost. tried enter text in asp:literal , asp:label , result same. any ideas? lot. solved. figured out css issue because although chrome shows text in wrong way, internet explorer rendering fine, not code issue.

tsql - C# T-SQL create IN with array of strings -

maybe i'm not doing correctly, need create list of strings filter sql select query , can find answers escape single parameter value only. given array : string[] domains = new string[] { "sec", "krn", "op", "ip" }; i need create query select * user_domains name in ("sec", "krn", "op", "ip") note : not real query, illustrate point of question. a naïve solution create query as select * user_domains name in (@p1, @p2, @p3, @p4) and executing query params formatted as dictionary<string,string> interms = domains .select((t, i) => new { key = "p" + i, term = t }) .todictionary(item => item.key, item => item.term, stringcomparer.ordinalignorecase); is there approach? update would easy and faster perform simple string comparison (aka index of ) comma, or otherwise, separated string of terms? ex: select * user_domains cha

java - How to show a menu depending on what is selected? -

in swing, how show menu depending on selected menu. for example: select country drop down. followed state drop down, followed city. when particular country selected, show states country. also, when state selected, show cities in state. a jmenu can contain jmenuitem & jmenu instances. might have main menu contains menus countries. each country menu has menus states, each state has menu items city. otoh nicer user experience provided 3 jcombobox instances. first country, 2nd , third populated needed (on demand).

c++ - robust camera calibration -

i try , specific question, firstly doing project 3d image reconstruction using camera. have completed camera calibration not robust occlussions, such placing object on chessboard won't detect corners. there way of mopdifying program, or can use corners detected before placing object , how can use corners detect corners without occlussion. i thinking of using corners representing 4 corners of chessboard, display , can place object on chessboard. help appreciated in how can modify or use current camera calibration program deal occlusions i.e. placing object on chessboard. for robust object detection, write program can detect larger number of features, , test whether sufficiently high percentage of features present. for chessboard, try find 112 edges between squares, , see if line up. won't matter if miss few of 112.

Android: How to set android.support.design.widget.NavigationView open from right in android studio 1.5.1? -

i using android studio 1.5.1. version makes navigation drawer activity own: <?xml version="1.0" encoding="utf-8"?> <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" tools:opendrawer="start"> <include layout="@layout/app_bar_main" android:layout_width="match_parent" android:layout_height="match_parent" /> <android.support.design.widget.navigationview android:id="@+id/nav_view" android:layout_width="wrap_content" android:layout_height="match_pa

javascript - how to check if period sign(.) is removed from the word in textbox in jQuery? -

Image
i want know if possible hit event if period sign . removed textbox. example have textbox #quantity takes numeric values input period sign and have drop down control #unitvalue have 3 option i had hit event on period sign . key press follows $("#quantity").keypress(function(e) { if(e.which == 46) { //successfully disabled gram in unit } }); now want enable "gram" option in drop down if period sign . removed textbox. have idea don't if right so. idea is:- on key press add each letter array, on backspace key press, check if letter on array index period sign . or not if . sign enable "gram" any appreciated thank you js fiddle - updated - using .prop() instead // attach functionality on multi events $('#inpt').on('keypress input change', function() { var gram = $('#slct').children('[value="1"]'); // if indexof "." > -1, there's

c++11 - c++ 11 availablity for platforms that run java 7 -

at work develop software uses java7 , c++03, team replace c++03 , instead embrace c++11. can assure them every os runs java7 has gcc compiler c++11? i know relation make between java7 , c++11 weird, that's way of saying need support old oses, not old don't run java7. thanks it depends on whether follow sys specs java 7 or not. there might way force run on earlier versions of mentioned oss, not officially specified so. take @ requirements: java 7 & 8 sys req now, listed oss sure gcc 4.7.2 available (or can compiled). windows, ms provides support c++11 starting vs 2010 runs on win xp or newer (if don't cygwin). the problem depends on how many c++11 features need. instance, visual studio 2010 doesn't support c++11 features. take @ following table see supported in each compiler: c++ compiler support

c++ - Is there a way to put quotes in a cout? -

this question has answer here: rules c++ string literals escape character 5 answers i trying make simple calculator , display quotes in instruction when first run program. another solution use raw strings: #include <string> #include <iostream> int main() { std::cout << r"_(a raw string " inside (and \ well))_" << std::endl; return 0; } live example output: a raw string " inside (and \ well) quotes standard: according standard 2.14.5 [lex.string]: string-literal : encoding-prefix opt " s-char-sequence opt " encoding-prefix opt r raw-string encoding-prefix : u8 u u l s-char-sequence : s-char s-char-sequence s-char s-char : member of source character set except double-quote " , backslash \ , or new-line character esca