Posts

Showing posts from March, 2014

Elasticsearch date histogram aggregation on a duration of time -

the documents deal in elasticsearch have concept of duration represented start , end time, e.g. { issueid: 1, issuepriority: 3, timewindow: { start: "2015-10-14t17:00:00-07:00", end: "2015-10-14t18:00:00-07:00" } }, { issueid: 2, issuepriority: 1, timewindow: { start: "2015-10-14t16:50:00-07:00", end: "2015-10-14t17:50:00-07:00" } } my goal produce histogram number of issues , max priority aggregated 15 minute buckets. example above issue #1 bucketized 17:00 , 17:15 , 17:30 , , 17:45 buckets, no more, no less. i tried using date_histogram aggregation, e.g: aggs: { max_priority_over_time: { date_histogram: { field: "timewindow.start", interval: "15minute", }, aggs: { max_priority: ${top_hits_aggregation} } } } but bucketizing issue #1 17:00 bucket. if take timewindow.end account added 18:00 bucket. know how can accomplish using date_histo

c++ - I cannot build boost_regex code because of link erros -

i'm trying use boost_regex on ubuntu 12.04 (gcc 4.8.2). i've installed boost this. $ sudo apt-get install libboost-all-dev and i've confirmed boost_regex libraries installed on. $ ls /usr/lib/x86_64-linux-gnu | grep regex libboost_regex.a libboost_regex.so libboost_regex.so.1.54.0 then, i've tried build regex program code. faced link errors. should add link libraries? #include <boost/regex.hpp> #include <iostream> #include <string> int main() { std::string line; boost::regex pat( "^subject: (re: |aw: )*(.*)" ); while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } } $ g++ -wall -std=c++11 -o out test2.cc -lboost_regex /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libboost_regex.so: undefined reference `icu_52::locale::~locale()' /usr/lib/gcc/x86_64

mysql - Why don't CMS databases use Foreign Keys? -

why cms databases (e.g. wp , prestashop) not use foreign keys on tables? thought tables should have foreign keys prevent orphan rows. excerpted post (apparently wp staff) at wordpress.org wordpress › support » plugins , hacks » hacks the problem mysql few installations default innodb. use myisam tables because more "beginner friendly". because of wordpress, , pretty every other php-based cms i've seen out there, has think using lowest common denominator, myisam tables no references required can universal possible. i add wp system has been set use php code enforce integrity can. that's why it's best use built-in wordpress functions rather trying roll own. only mysql innodb storage engine enforces foreign key declaration. treated comments myisam storage engine, don't know why weren't declared anyway. posts "custom prestashop software solutions , shared , dedicated virtual hosting services" member at prestashop.c

c++ - Void pointer without type casting -

int main { void* i; printf("%d",i); return 0; } output : (garbage value) how void pointer determines data type without typecasting?? compilers not bother types of arguments passed function printf . the function declared following way int printf(const char * restrict format, ...); as see there first parameter has explicitly specified type. in general case compilers unable check whether other arguments valid. when function executed parses first parameter searching format specifies , according these format specifiers tries interpretate following arguments. in example format string has format specifier %d printf("%d",i); so function interpretates value of of type int . take account (c standard) if argument not correct type corresponding conversion specification, behavior undefined . among other things did not initialize variable i .

Regarding layout_column in android -

i have come across 1 small thing when use layout_column widget not move specified column position. please, 1 me , see needs change in following code. thank in advance guiding , helping me. <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:adroid="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".mainactivity"> <relativelayout android:layout_width="match_parent" android:layout_height="

javascript - js Uncaught RangeError: Maximum call stack size exceeded -

var = { fun:function(){ alert(1); } } a.fun = function(){ a.fun(); alert(2); } a.fun(); i want change function a.fun call origin one if looking override existing function , call original function overridden instance, need store reference old method like var = { fun: function() { snippet.log(1); } }; (function(a) { var old = a.fun; a.fun = function() { old.apply(this, arguments); snippet.log(2); } })(a); a.fun(); <!-- provides `snippet` object, see http://meta.stackexchange.com/a/242144/134069 --> <script src="http://tjcrowder.github.io/simple-snippets-console/snippet.js"></script>

ios - Quickblox chatroom did receive message is not calling -

i facing problem in not receiving messages while chatting in group type qbchatdialogtypepublicgroup. can see in logs message coming me. per explanation in quickblox official website following method should called when message received - (void)chatroomdidreceivemessage:(qbchatmessage )message fromdialogid:(nsstring )dialogid - (void)chatdidnotsendmessage:(qbchatmessage )message todialogid:(nsstring )dialogid error:(nserror *)error but none of above delegate calling. here steps have taken - for login:- [qbrequest loginwithuserlogin:[[appdelegate sharedappdelegate]getqbuserinstance].login password:[[appdelegate sharedappdelegate]getqbuserinstance].password successblock:^(qbresponse response, qbuuser user) { nslog(@"quickblox user id %lu", (unsigned long)user.id); [[nsuserdefaults standarduserdefaults] setvalue:[nsstring stringwithformat:@"%lu", (unsigned long)user.id]forkey:@"quickbloxuserid"]; [[appdelegate sharedappdelegate]g

ios - Caching or Core Data for semi-perminant image and video persistence? -

(note there tldr @ bottom if lot of text) i'm working on pulls , displays images , videos server. think of different folders pictures , videos behind them can view. each folder gets updated new pictures , videos consistently, able store many of these pictures , videos @ time minimize loading/requesting-from-database time preloading , saving few. let me preface saying can wrong write following line. why i'm asking. i'm not 100% clear on capabilities of each approach i'm going try organized possible here: reqs/usage: save large files (image , video data) quick access (populated server) quick rotation on saved data; updated files transient, don't want show expired information don't want keep reloading similar stuff every time need see it. needs able full store multiple folders worth of data, 8-12mb worth of files per folder on mid-high range (not useful if 1 instantly accessible , rest still have loaded database when viewed) efficient network u

node.js - Send prop to ReactJs from Express response (render) -

i have simple application node.js , express , passport , react-js . i have index.html includes client.js simple render of react-js : var react = require('react'); var react = require('react-dom'); var client = require('./client.jsx'); reactdom.render( react.createelement(client, null), document.getelementbyid('main') ); client real application. on server side ( routes.js ) have this: app.get('/login', function(req, res){ res.render('login'); }); app.get('/auth/google', passport.authenticate('google', { scope: ['profile', 'email'] }),function(req, res){}); app.get('/auth/google/callback',passport.authenticate('google', { failureredirect: '/login' }), function(req, res) { res.redirect('/'); }); app.get('/', ensureauthenticated ,function(req, res){ req.session.id = req.user._id; //from mongodb res.render('index&#

ios - App freezes when showing a UITextView with short text -

i have simple tab-bar application no code beyond template provided xcode when starting project. i add new uiviewcontroller , put uitextview inside of it, , change text in default short "console". (autolayout or not irrelevant.) when attempt run application (device or simulator - ios 9) after tapping tab uitextview freezes app. app doesn't crash, after long time, buttons become entirely unresponsive until quit. same happens simple single screen app uitextview not text. the amount of text tricky determine, it's around 11 characters, not based on length (different amounts of different letters not entirely based on visual length seems cause it: 11 a 's i 's or m 's crash it, aaaabbbbc , aaaabbbbcc not). the text must plain, attributed text never causes hang. appears stuck looping in objc_msgsend , best can tell goes instruction on line 1 below line 26 , line 01 forever (or few passes @ least) don't know how introspect assembly in xcode&#

java - Why is spring not injecting using generic qualifiers? -

this configuration class @configuration class factories { @bean collection<log> logs() { list<log> logs = new arraylist<>(); ( int = 0; < 10; i++ ) { // gross example code log log = new log(); log.setentry( randomstringutils.randomalphabetic( 10 ) ); logs.add( log ); } return logs; } } and here's how i'm trying autowire it @service @transactional public class logservice { private final logrepository repository; private final objectfactory<instant> now; private final collection<log> logs; @autowired logservice( final logrepository repository, final objectfactory<instant> now, final collection<log> logs ) { this.repository = repository; this.now = now; this.logs = logs; } but exception caused by: org.springframework.beans.factory.nosuchbeandefinitionexception: no qualifying bean of type [com.x

ios - show near by restaurants in Map View using user current location in map kit -

Image
in iphone app,i have show near restaurants in map view. but how can show nearby restaurants in 5000 meters of current location native mkmap view(i found out current location-lat&long) i learn how implement in below screen shot(by clicking annotations going detail too) you can use foursquare api 1 possibility. https://developer.foursquare.com/ fetch venues api var venues: array = fetchvenues() make annotation var venueannotation = mkpointannotation() venueannotation.coordinate = cllocationcoordinate2dmake(venue.latitude!, venue.longitude!) venueannotation.title = venue.name venueannotation.subtitle = venue.address add annotation mapview self?.mapview.addannotation(venueannotation) this site might helpful you. ios development: near me places- (foursquare api) http://prashantpatil26.blogspot.jp/2014/06/near-me-places-foursquare-api.html

amazon web services - Best practice for obtaining the credentials when executing a Redshift copy command -

what's best practice obtaining aws credentials needed executing redshift copy command s3? i'm automating ingestion process s3 redshift having machine trigger copy command. i know it's recommended use iam roles on ec2 hosts not need store aws credentials. how work though redshift copy command? not particularly want credentials in source code. hosts being provisioned chef , if wanted set credentials environment variables available in chef scripts. you need credentials use copy command, if question around, how credentials, host running program, can metadata of iam role , use access key, secret key , token. can parameterize on fly before copy command , use them in copy command. export accesskey= curl -s http://169.254.169.254/iamrole | grep '"accesskeyid" : *' | cut -f5 -d " " | cut -b2- | rev | cut -b3- | rev command extrct secret key , create parameter export secretkey= curl -s http://169.254.169.254/iamrole | grep '"s

ios - What's the difference between distance from CLLocationManager and CMPedometer -

i'm writing running app according online tutorial on http://www.raywenderlich.com/97944/make-app-like-runkeeper-swift-part-1 . in tutorial,the distance user has run since start calculated 2 latest recorded locations using "distancefromlocation" method in cllocation. in cmpedometer there's distance data can retrieved directly. 1 should use , why? thanks cmpedometer relies on motion tracking chips built modern iphones measure steps , distance travelled owner of device. able estimate number of steps taken using motion data, , extrapolate distance traveled user using step counts , estimated stride length. if distance estimate enough purposes, cmpedometer easy, power efficient solution tracking distance travelled. on other hand, if reported distance accurate possible, should use cllocation , calculate distance between each location user travels through on workout. requires more complex code , accurate gps signal. added benefit, you'll able use

android - Changing the item text size in navigation view -

i creating navigation drawer in android , have added items in menu_main.xml not able change size of menu items. below code menu_main.xml: <menu xmlns:android="http://schemas.android.com/apk/res/android"> <group android:checkablebehavior="single"> <item android:id="@+id/motel" android:title="motel"> </item> <item android:id="@+id/packages" android:title="packages"> </item> </group> </menu> create style , apply navigationview using app:theme <style name="navigationviewstyle"> <item name="android:textsize">20sp</item> <!-- menu item text size--> <item name="android:listpreferreditemheightsmall">40dp</item><!-- menu item height--> </style> and said, apply style navigationview using app:theme <android.support.design.

Python CSV, blank rows -

Image
i'm trying create csv file ping times. below have code ping time , put in csv file. unfortunately format in csv files little messed up. import subprocess sp import csv ip = "216.52.241.254" status,result = sp.getstatusoutput("ping -n 1 -w 1000 " + ip + ' | grep -o time=[0-9]* | grep -o [0-9]*') open('c:/pingdata/test.csv', 'a') csvfile: #result = int(result) cwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.quote_minimal) cwriter.writerow(result) the csv file code printing looks like: what should this: i'm looking solution/reason why there blank rows being printed, , why there spaces between numbers (i've tried passing them in integers no avail) writerow expects list, takes string list of characters. put in brackets treat list of single string: cwriter.writerow([result])

How to automatically discover and add users via LDAP in SonarQube? -

i guess question boils down misunderstanding have how sonarqube ldap plugin works in general. have integrated ldap plugin , our users authenticating against our corporate ldap server. when we want create new group , add users group new project, have assumed users must authenticate sonarqube first added user sonarqube. after that, able put them appropriate groups belong to. pain our administrators since people need added logging in @ differing times or forgetting log in @ all. nexus provides can lookup of user's account id, add them , place them appropriate group(s). in way, user not bothered having login first , administrator has give privileges , user logs out , logs in. misunderstanding on part? ask because when go users page , click on 'create new user' not asks user's id user's password don't know telling me local account. by default sonarqube's ldap plugin works think does. can configure ldap group mapping when user enrolls, he/she automat

How to clear the JFrame or JPanel? -

i planing develop quiz program in jframe , after first question want display second question , should clear first question display second question, in c know clrscr(); in java don' know 1 can me ? you should call getcontentpane().removeall(); removeall() has not been overridden add() or remove() forward contentpane necessary.

c++ - Where should the user-defined parameters of a framework be ? -

i kind of newbie , creating framework evolve objects in c++ evolutionary algorithm. evolutionary algorithm evolves objects , tests them best solution (for example, evolve weights neural network , test on sample data, in end network has accuracy, without having trained it). my problem there lots of parameters algorithm (type of selection/crossover/mutation, probabilities each of them...) , since framework, user should able access , modify them. current solution for now, created header file parameters.h of form: // don't change these parameters //mutation type #define flip 1 #define add_connection 2 #define rm_connection 3 // user defined static const int type_of_mutation = flip; the user modifies static variables type_of_mutation , mutation function tests value of type_of_mutation , calls right mutation function. this works well, has few drawbacks: when change parameter in header , call "make", no change taken account, have call "make clean&quo

JavaScript/jQuery hide divs one by one -

i'm playing jquery. want click "hide me now" button div elements fade out 1 after other. how do that? got fiddle here: https://jsfiddle.net/um7ctpnj/1/ index.html <!doctype html> <head> <title>button show</title> <link rel="stylesheet" href="stylesheet.css"> <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"> <script src="https://code.jquery.com/jquery-1.10.2.js"></script> </head> <body> <button id="show" type="button" class="btn btn-primary">click me!</button> <button id="hide" type="button" class="btn btn-primary">hide me now!</button> <div id="one">1</div> <div id="two">2</div> <div id="three">3</div> <sc

javascript - Gzip compress PDF files in Parse -

is there way compress (gzip) pdf files in parse? also, idea - checked gzipping text-based pdf file, , file size reduced around 30%. simplified code example -- <input type="file" id="pdffileupload"> var fileuploadcontrol = $("#pdffileupload")[0]; var file = fileuploadcontrol.files[0]; // compress file here var parsefile = new parse.file(name, file); // or compress parsefile here parsefile.save().then(function() { // file has been saved parse. }, function(error) { // file either not read, or not saved parse. }); here in case, can compress file object using gzip compression method? best way it? moreover, recommended way improve latency when uploading , downloading pdf files (~5 mb)? it appears want browser. best solution rely on client's browser, if can afford it, compress pdf file, upload parse, download compressed file parse , uncompress on other client's browser. can use javascript implementation of zlib pako in br

How to Write file in C#? -

string attachment = "attachment; filename=myfile.csv"; httpcontext.current.response.clear(); httpcontext.current.response.clearheaders(); httpcontext.current.response.clearcontent(); httpcontext.current.response.addheader("content-disposition", attachment); httpcontext.current.response.contenttype = "text/csv"; httpcontext.current.response.addheader("pragma", "public"); // logic goes here write file. // want copy above file file. string filepath = server.mappath("~/exportedfiles/") +"newfile.csv"; var excelfile = file.create(filepath); excelfile.close(); httpcontext.current.response.transmitfile(filepath); httpcontext.current.response.flush(); the above code not working, please suggest me. thanks. you need create virtual directory on iis , share virtual directory directory. csv should reside in virtual directory shared location. here referenced article: http://www.codeproject.com/tips/50

algorithm - Divisions of set with even number of elements -

this question has answer here: sets of disjoint pairs 2 answers is there effective way list divisions of set {1, ... , 2*n} n pairs? the easiest idea list permutations , permutation (a1, a2, ... , a8) means division {{a1,a2}, ... , {a7,a8}} . in situation there 2^n * n! permutations each division. o((2n)!) . can find more effective way? here's pencil , paper algorithm: f(set,result): if set empty: return result otherwise: pair 1 item set each of remaining items, calling f again pair added result , out of set 123456 12 34 56 35 46 36 45 13 24 56 25 46 26 45 14 23 56 25 36 26 35 ...

java - Split arraylist based on calculated value of each string -

i have arraylist of strings whereby on iteration, for(int =0; < arraylist.size(); i++) . each string taken .csv file, delimited commas. 1 of columns has unix timestamp, 1 string of data looks (i censored out irrelevant values): 1442759243, value, value, value so, iterate, extract unix time stamp find specific day, java.util.date time = new java.util.date((long) timestamp * 1000); // gives result of tue sep 15 22:38:04 sgt 2015 string date = string.valueof(time.getdate());; // gives result of "15" as iteration goes on (the list sorted time already, number e.g. 15, increases list goes), there come point next string date different value previous one. now, on each string iteration have set counter increments. when date changes, want counter reset , start count again. question is, how kind of "split" arraylist can reset counter start count again? just keep previous date, , compare current date previous 1 on each iteration: int counter = 0; st

VHDL Internal Signal Declaration gives Driver Error -

here simple code snipped problem compiler can not resolve multiple constant drivers net "led_int[0]". architecture bdf_type of test signal led_int : std_logic_vector(4 downto 0); component misc port ( reset_reset_n : in std_logic; userleds_external_connection_export : out std_logic_vector(4 downto 0) ); end component; begin b2v_m1 : misc port map ( reset_reset_n => nios_reset_n, userleds_external_connection_export => led_int ); led_int(0) <= '0'; userled <= led_int; end architecture; why same error message here error (10028): can't resolve multiple constant drivers net "led_int[0]" @ test.vhd(11) ? how can solve simple problem? you have 2 driver led_in(0) signal. led_int(0) <= '0'; pulling low , userleds_external_connection_export => led_int pulls either high or low depending on in misc module. you not al

optimization - Pandas Dataframe - faster apply? -

i've got following code: from dateutil import parser df.local_time = df.local_time.apply(lambda x: parser.parse(x)) it seems taking prohibitively long time. how can make faster? you should use pd.to_datetime faster datetime conversion. example, imagine have data: in [1]: import pandas pd dates = pd.date_range('2015', freq='min', periods=1000) dates = [d.strftime('%d %b %y %h:%m:%s') d in dates] dates[:5] out[1]: ['01 jan 2015 00:00:00', '01 jan 2015 00:01:00', '01 jan 2015 00:02:00', '01 jan 2015 00:03:00', '01 jan 2015 00:04:00'] you can datetime objects way: in [2]: pd.to_datetime(dates[:5]) out[2]: datetimeindex(['2015-01-01 00:00:00', '2015-01-01 00:01:00', '2015-01-01 00:02:00', '2015-01-01 00:03:00', '2015-01-01 00:04:00'], dtype='datetime64[ns]', freq=none) but still c

c# - Can I set different References for different configurations of a .NET build in VS 2010? -

Image
i have solution has built against different versions of dependency dlls. i'd configure solution have different configurations (targets) different 'versions' of target platform. (we're building libraries 3rd party framework , have target multiple versions) i thought relatively simple set references solution different each of target versions, have not been able successfully. suspect doing wrong. attached screen shot. as can see have made number of 'target' configurations , want target configurations able control version of dependencies resulting dll built against. we not have control on dlls , can not rebuild version call-forwarding differently. i have not tried this, try editing csproj file in text/xml editor, , adding condition references itemgroups, e.g., <itemgroup condition="'$(configuration)|$(platform)' == 'release|anycpu'"> <reference include="system"> <name>sys

javascript - jquery .animate() transform scale -

how can use transform: scale() css propriety in .animate() function in jquery? this, here, doesn't work $(document).ready(function(){ $('.circ1').animate({ transform: 'scale(1)' }, 830); });

visual studio - Check in TFS solution file which is checked out by another user -

i working on tfs solution multiple developers working on same project. 1 file checked out teammate , virtual machine on working has been deleted. want edit file checked out user vs showing me error file checked out user. there way check in file? use tfs sidekicks delete workspace using workspace sidekick. when delete work space, check-outs undone on server. use tf.exe delete workspace.

jquery - Existing functionality not working after dynamically loading the same dom element -

i have multiple rows, inside rows there functionality increase decrease values, checkbox, price etc..based on price sorting rows. generating after creating row internal functionality not working. html code(clicking on private): var categorysort = ["0 - 25", "25 - 50", "50 - 150", "150 , over"]; /images/up_arrow.png"> category jquery code: /* sort by:- private start */ $('.sort-by .private').on('click', function(){ var items = $(".rendereditem"); var privatestatus = "private"; $(".categorystatus").html(""); if(privatestatus = "private"){ var i

javascript - How to get the src of img tag using jquery -

i have html follow : <ul class="thumbnails"> <li><a class="thumbnail" href="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_1-500x500.jpg" title="canon eos 5d"><img src="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_1-228x228.jpg" title="canon eos 5d" alt="canon eos 5d"></a></li> <li class="image-additional"><a class="thumbnail" href="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_2-500x500.jpg" title="canon eos 5d"> <img src="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_2-74x74.jpg" title="canon eos 5d" alt="canon eos 5d"></a></li> <li class="image-additional"><a class="thumbnail" href="http://localhost/upload/image/cache/catalog/demo/canon_eos_5d_3-500x500.jpg" tit

html - My WAMP server doesn't show the edited file -

my wamp server doesn't show edited file still shows old 1 doesn't exist anymore. when open html file without wamp shows edited file. i've made sure opened correct file using correct path still nothing happens. when change directory, new folder name, , open in wamp show changes.

ubuntu 14.04 - I want to install PHP plugin at Netbeans -

Image
i want install php plugin @ netbeans . click on tool --> plugin --> available plugins there no plugin list available please tell me how install php plugin @ netbeans @ ubuntu 14.04 first of need internet connection while installing php plugins on netbeans. after connect internet need use following steps- steps 1. open netbeans , click on tools > plugins 2. plugins screen displayed 3. click on available plugins tab , choose php. 4.click next continue 5. tick on accept terms in of license agreements checkbox. 6. installing plugin 7. after finished, restart program 8. click file > new project , choose php project 9. define name , location of project 10. click finish proceed 11. php project has been created 12. write simple coding test project whether works or not 13. finish. enjoy

swipe actions in native apps using Appium-android -

i started learning appium few days back. well, question want swipe images in flipkart app , zoom image. have tried using below code , swipe action has been performed on same page i.e.,on same image moved right left x-axis , y-axis lines, zoom action has not been performed. can tell me please java code on how swipe images , zoom it. below code : driver.findelement(by.classname(properties.getproperty("cross_mark_classname"))).click(); system.out.println("clicked on cross mark"); driver.findelement(by.classname(properties.getproperty("home_menu_classname"))).click(); webelement mobile = driver.scrollto("mobiles"); system.out.println("scroll till mobiles in home slider menu"); mobile.click(); driver.scrollto("top offers!!").click(); driver.scrollto("honor 4x").click(); delay(4000); webelement honor = driver.findelementbyid("com.flipkart.android:id/product_list_product_ite

c++ - What does Visual Studio do with a deleted pointer and why? -

a c++ book have been reading states when pointer deleted using delete operator memory @ location pointing "freed" , can overwritten. states pointer continue point same location until reassigned or set null . in visual studio 2012 however; doesn't seem case! example: #include <iostream> using namespace std; int main() { int* ptr = new int; cout << "ptr = " << ptr << endl; delete ptr; cout << "ptr = " << ptr << endl; system("pause"); return 0; } when compile , run program following output: ptr = 0050bc10 ptr = 00008123 press key continue.... clearly address pointer pointing changes when delete called! why happening? have visual studio specifically? and if delete can change address pointing anyways, why wouldn't delete automatically set pointer null instead of random address? i noticed address stored in ptr being overwritten 00008123 ...

c# - Grouping with specific attribute in Listview -

guys have asp:listview item.i want read data database , want categorize them below. http://prntscr.com/8rhpcb codelike below: <asp:listview id="listview1" runat="server" datakeynames="id" datasourceid="sqldatasource1" itemplaceholderid="iph" > <itemtemplate> <table id="item_table" border="1"> <tr style="background-color: #e0ffff;color: #333333;"> <td> <asp:label id="idlabel" runat="server" text='<%# eval("id") %>' /> </td> <td> <asp:label id="namelabel" runat="server" text='<%# eval("name") %>' /> </td> &l

javascript - Wrap part of text into new element tag -

i have text <span> tag. want wrap part of text element tag id not in base html code. since cannot modify base html code, i'm forced use javascript/jquery so. i have html code: <span id="my_span">john<input type="hidden" name="firstname" value="john" id="my_input1"> <br>smith<input type="hidden" name="lastname" value="smith" id="my_input2"> </span> i want add <a> tag id texts within span. text want wrap dynamic cannot use value inside such search , target it. hmtl code should shown below after javascript/jquery code applied: <span id="my_span"><a id="added_a_tag1">john</a><input type="hidden" name="firstname" value="john" id="my_input1"> <br> <a id="added_a_tag2">smith</a><input type="hidden" name="lastname&qu

replace - change URL format in PMWIKI -

hello guys wondering if can me have fresh install of pmwiki 2.2.80 (latest now) . want change way pm wiki links pages , in default , converts words ucase . if link "my work" "www.blablabla.com/wiki/pmwiki.php?site.mywork" ok latin languages when want use script rtl languages arabic or persian , becase there no uppercase version of letters , links joint word has no mean or non sense seo . want change way links pages instead of "site.mywork" create link "site.my_work" underline instead of spaces . ideas on ? you should have @ page naming category of cookbook recipes see if fit needs. anyway, in pmwiki provide title , description page, , use them in links .

google app engine - iOS GCM error code 501 -

recently start error code whenever try use gcm apis in ios app: error domain=com.google.gcm code=501 "(null)" i couldn't find meaning of anywhere? http-status code, meaning not implemented? i'm getting error first @ line of code: gcmservice.sharedinstance().connectwithhandler() { error in if(error != nil) { print(error) } } calling method prints message : gcm | gcm registration not ready auth credentials and error error domain=com.google.gcm code=501 "(null)" the error occurred because calling gcmservice.sharedinstance().connectwithhandler() { error in if(error != nil) { print(error) } } before had received registration token, or had failed refresh token. "error domain=com.google.gcm code=501 "(null)" " bad error message.

c# - Roslyn - CodeDom: HowTo dynamically compile Code to Universal-Windows-Library -

i generating .net dll dynamically containing wrapper classes wpf project. doing system.codedom.compiler.codedomprovider class. now have create wrapper class universal-windows-dll. since system.codedom.compiler.codedomprovider class still uses old .net compiler had switch new roslyn compiler (by adding nuget package microsoft.codedom.providers.dotnetcompilerplatform ). replaced instantiation of code-dom-provider new csharpcodeprovider . new microsoft.codedom.providers.dotnetcompilerplatform.csharpcodeprovider(); the code compiles fine found no way set targetframework / compilerversion. old codedomprovider had compileroptions able specify compilerversion ect. new roslyn not have option (or stupid find it). the result compiles dll normal .net 4.x dll. need universal-windows dll since used in universal-project. browsing internet found many different ways use roslyn compiler. of them seem old beta-versions of compiler, therefore none of them works. roslyn.compilers names

VBA Outlook 2013 AppointmentItem.Link property? -

i use vba macro in outlook save linked contacts of appointmentitem in database. no problem in outlook 2007, upgraded outlook 2013. i tried search appointmentitem.link property in msdn documentation, found 2007 , 2010: outlook 2007 link outlook 2010 link so question property depreciated or renamed or something? atm following error on code: run time error 91: object variable or block variable not set for = 1 item.links.count ..... next microsoft deprecated links property - returns null. can still access existing data on binary level using appointmentitem.propertyaccessor.getproperty , you'd need parse data - take @ blob in outlookspy (click imessage). if using redemption option (can used in version of outlook), still supports links property: set rsession = createobject("redemption.rdosession") set ritem = rsession.getrdoobjectfromoutlookobject(item) = 1 ritem.links.count ..... next

javascript - Angular directives recognized as html form elements -

i have made own directive act input element contenteditable attribute. problem element not recognized jquery element. if $('form').serialize() or document.getelementbyid("form").elements my element not show in both functions. know why ? , how fix ? the serialize method of jquery not include contenteditable elements. can't read element this. many wysiwyg html editor use trick hidden textarea . synchronize content of contenteditable inner html content of textarea . serialize jquery method see textarea , use it. since using angular, it's pretty easy synchronise 2 elements same model.

Load content of an url into a dialog doesn't work JQuery -

i have code: why not working? i've tried in several ways it's not working either. can me please? not feel capable find error in code. <html> <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js"></script> <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/humanity/jquery-ui.css" type="text/css" /> </head> <body> <div id="contingut"> </div> <a class="enllac_dialog" href="http://mon.uvic.cat/ajutcampus/category/configuracions/dispositius-mobils/ios/">ios</a> <a class="enllac_dialog" href="http://www.google.com">android</a> function s

hibernate - Grails with Criteria -

i want use nvl function in grails criteria orderby clause. how shall used? have tried multiple approach. can me out ? sql query converted grails criteria : select * forom domain_table order nvl(field1,field2) asc tried approach 1: domain.createcriteria().list(max:10,offset:10){ order(field1,'asc') order(field2,'asc') } working properly, generating sql query select * forom domain_table order field1 asc,field2 asc which not satisfying requirement approach 2 : domain.createcriteria().list(max:10,offset:10){ order(nvl(field1,field2),'asc') } error : nvl not property of domain class approach 3 : domain.createcriteria().list(max:10,offset:10){ projections{ addprojectiontolist(projections.sqlprojection("nvl(field1,field2) description", ['description'] string[], [hibernate.string] type[]), 'description')) order('description,'asc') } problem : getting record base