Posts

Showing posts from June, 2015

ios - Xcode 6 UIView set width to zero causes height equals zero as well -

ios - Xcode 6 UIView set width to zero causes height equals zero as well - i have next code below: - (ibaction)ontappedaddvalue:(id)sender { cgrect rect = self.progressview.frame; rect.size.width = rect.size.width + 1; self.progressview.frame = rect; nslog(@"%@", [nsvalue valuewithcgrect:self.progressview.frame]); } by pressing on button resize view, works if view has illustration rect (0, 0, 100, 10); but if set width 0 in storyboard , heigh 10 points, reason sdk thinks height should equal 0 after pressing button , invocation code above. please check video , sources if want see how works. when set uiview's width 0 in storyboard , seek increment pressing button, width incrementing reason height equal 0 in stroryboard has 10 pt. ios uiview uikit xcode6 cgrect

mariadb - Synchronous vs Asynchronous Clustering -

mariadb - Synchronous vs Asynchronous Clustering - i reading mariadd knowledge base of operations on galera cluster , came across this: the basic difference between synchronous , asynchronous replication "synchronous" guarantees if changes happened on 1 node of cluster, happened on other nodes "synchronously", or @ same time. "asynchronous" gives no guarantees delay between applying changes on "master" node , propagation of changes "slave" nodes. delay can short or long. implies if master node crashes, of latest changes may lost with lastly sentence, have understood though updates on slave in asynchronous cluster setup not performed @ same time, logs these updates bin log file updates beingness made on master. in case master crashes before info passed on slave, updates still go ahead when master restored since bin log file logged updates. can please tell me if understanding wrong , clarify on matter me please. thanks.

jquery - Is there a way to extract ID from autocomplete in Rails 3.2 app? -

jquery - Is there a way to extract ID from autocomplete in Rails 3.2 app? - the autocomplete implemented in bom model works fine. here autocomplete related code in bom model: belongs_to :part, :class_name => billofbasematerialx.part_class.to_s def part_name_autocomplete self.part.try(:name) end def part_name_autocomplete=(name) self.part = billofbasematerialx.part_class.find_by_name(name) if name.present? end after user selects part name generated autocomplete , save part id @part_id in controller , pass @part_id views farther processing. other part name in params[:bom][:part_name_autocomplete] , did not find object @part or related part id . can still retrieve part object name, prefer have part id instead. there way retrieve part id after autocomplete? jquery ruby-on-rails autocomplete

android - Google Map v2: to display multiple locations on Google Maps -

android - Google Map v2: to display multiple locations on Google Maps - i need point out 5 different locations on google maps. far got output successfully. there no errors in code. my problem points single location. have points different locations, example, 1 have point chennai , other have point delhi or else. mainactivity.java: public class mainactivity extends activity { // google map private googlemap googlemap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); seek { // loading map initilizemap(); googlemap.setmaptype(googlemap.map_type_normal); double latitude[] ={13.07891,13.11602,13.11355,13.12511,13.08367}; double longitude[] = {80.28215,80.23166,80.29613,80.29554,80.23961}; // lets place 10 random markers (int = 0; < 5; i++) {

java - Bootstrap class doesn't have method (String host, int port) -

java - Bootstrap class doesn't have method (String host, int port) - trying create test client - server application , faced problem this channel channel = bootstrap.connect(host, port).sync().channel(); bootstrap's class doesn't have method connect arg types string, int. how can obtain channel? public class chatclient { private final string host; private final int port; public static void main(string[] args) throws exception{ new chatclient("localhost", 8080).run(); } public chatclient(string host, int port) { this.host = host; this.port = port; } public void run() throws exception { eventloopgroup grouping = new nioeventloopgroup(); try{ bootstrap bootstrap = new bootstrap() .group(group) .channel(niosocketchannel.class) .handler(new chatclientinitializer()); channel channel = bootstrap.connect(host, por

How to Get Last Modified Date of excel file from Sharepoint using VBA? -

How to Get Last Modified Date of excel file from Sharepoint using VBA? - i need lastly modified info of excel file variable share point. i have excel file in sharepoint updated weekly. need lats modified date in variable proceed macro. please help. thanks in advance!!! check this solution exceluser.com: public function lastsavetime() string application.volatile lastsavetime = thisworkbook.builtindocumentproperties("last save time") end function this should work workbook stored in sharepoint library - tested sharepoint 2010 edit grab info sharepoint list: check link - there explained how able read list info excel. with link able listname , viewname. with 2 combined easiest way create new view list , add together alter column view - when info has been imported excel can read info , drop added table again. hope helps in right direction. (tested , working sp2010 list) excel-vba sharepoint

c++ - How to create a simple MFC uniform color HICON icon by code? -

c++ - How to create a simple MFC uniform color HICON icon by code? - this simple: have application uses clistctr in study mode , want assign icons entries. icons should simple square uniformly coloured icons 16x16. i know ( - i think know - ) how handle clistctr , cimagelist , challenge have following: the icon colour created code , arbitrary colorref the icons not created files in resources should created code also. if need be, there can 1 'template' icon in specific color replaced colorref above. essentially, want 'abuse' images kind of status-light in clistctr arbitrary colour. can give me short illustration code snipped for: creating hicon element 16x16 uniformly filled bitmap of colorref specified colour? try this: cdc dc; dc.createcompatibledc(null); m_bitmap.createbitmap(16, 16, dc.getdevicecaps(planes), dc.getdevicecaps(bitspixel), null); m_imagelist.create(16, 16, ilc_colorddb, 0, 1); hgdiobj hold = dc.selectobject(m_bitmap); dc

apache - Error on my htaccess What's wrong -

apache - Error on my htaccess What's wrong - guys why have error 500 instead of error 404 ?!! my .htaccess : <ifmodule mod_rewrite.c> options -multiviews rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewriterule \.(jpeg|jpg|gif|png)$ /public/404.php [nc,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> errordocument 404 /errors/404/404.htm apache .htaccess setting

c++ - undefined behaviour somewhere in boost::spirit::qi::phrase_parse -

c++ - undefined behaviour somewhere in boost::spirit::qi::phrase_parse - i learning utilize boost::spirit library. took illustration http://www.boost.org/doc/libs/1_56_0/libs/spirit/example/qi/num_list1.cpp , compiled on computer - works fine. however if modify little - if initialize parser itself auto parser = qi::double_ >> *(',' >> qi::double_); somewhere global variable , pass phrase_parse, goes crazy. here finish modified code (only 1 line modified , 1 added) - http://pastebin.com/5rws3pmt if run original code , pass "3.14, 3.15" stdin, says parsing succeeded, modified version fails. tried lot of modifications of same type - assigning parser global variable - in variants on compilers segfaults. i don't understand why , how so. here another, simpler version prints true , segfaults on clang++ , segfaults on g++ #include <boost/spirit/include/qi.hpp> #include <iostream> #include <string> namespace qi = boost

php - Codeigniter multi-dimensional array return only the first row -

php - Codeigniter multi-dimensional array return only the first row - one day i'm on problem , cant find solution. goal homecoming list of links id (the father). want childs. in view, have on result (the 1st one...). i have in controller : $data['list_link'] = $this->menumanager->list_link(); in model : function list_link($fatherid=0){ $r = array(); $ssql = 'select * categories fatherid = ' . $fatherid . ' , siteid = ' . my_siteid_default . ' order name'; $query = $this->db->query($ssql); // stock results in array $r[] = $query->result_array(); foreach ($query->result() $row) { // let's find childs $this->list_link($row->id,$loop); } homecoming $r; } if "for each" $r here, looks good. so, $data['list_link'] shoud have rows. in view : foreach ($list_link $link){ foreach ($link $row){ echo $row['name']; } } bu

java - How do I implement a JOptionpane List Option? -

java - How do I implement a JOptionpane List Option? - github link total download https://github.com/jamiex304/chess-game i developing chess game , have ran problem currently when pawn reaches end of other side of board changes white queen default i want allow user decide changes (hence rules of chess) toying around joption pane having problem getting work can run our errors nil me in terms of chaging pieces looking help implementation, the queen code snipet (didnt include total code here because long files found on github link if wish run file yourselfs) if(!validmove){ int location=0; if(starty ==0){ location = startx; } else{ location = (starty*8)+startx; } string piecelocation = piecename+".png"; pieces = new jlabel( new imageicon(piecelocation) );

linux - Bash: Read commands from file -

linux - Bash: Read commands from file - i'm using minimal netinstall image of debian. here script start user processes , daemons @ first login. reads file consisting of commands line line, checks if running , launches them, if not: #!/bin/bash ## script reads list of user startup daemons , launches them after first login stat=`who | grep "$user" | wc -l` ## login count if [ "$stat" -eq 1 ] ; ## if login shell while ifs=' ' read line ## first effort separate fields fails cmd=`echo "$line" | grep -v ^\#` ## utilize non comment lines if [ -n "$cmd" ] ; eval set "$cmd" ## actual field separation appid=$(pgrep "$1")&& ## check if process $1 of $cmd active , launch if not (echo "$1 active "$appid) || ("$@" 1>/dev/null&& echo "started $1 $(pgrep "$1")") fi done < ~/.scripts/daemons echo "start-daemons: fi

php - Find a 4-digit number which, when multiplied by 4 yields the same number in reverse? -

php - Find a 4-digit number which, when multiplied by 4 yields the same number in reverse? - i trying write simple programme in php cannot understand going wrong - here i've tried far: function multipliedbyreverseorder() { ($i = 1000; $i <=9999; $i++) { $value_a = $i; $value_b = $i*4; $new_value_a=$value_a; $new_value_b=$value_b; if($new_value_a==$value_a||$new_value_b==$value_b){ } } $exact_value_a=$value_a*$new_value_a; $exact_value_a=$new_value_b; if ($exact_value_a == $exact_value_b) { echo $exact_value_a . "the result is:"; } } you can reverse string using strrev function. function multipliedbyreverseorder() { ($i = 1000; $i <=9999; $i++) { $a = $i; $b = $i*4; $c = strrev($b);

java - Hibernate: failed to lazily initialize a collection -

java - Hibernate: failed to lazily initialize a collection - i getting below error: when trying save data. org.hibernate.lazyinitializationexception: failed lazily initialize collection of role: com.test.model.user.userrole, not initialize proxy - no session i have listed classes have used. a user.java: import java.util.hashset; import java.util.set; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.fetchtype; import javax.persistence.id; import javax.persistence.onetomany; import javax.persistence.table; @entity @table(name = "users", catalog = "test") public class user { private string username; private string password; private boolean enabled; private set<userrole> userrole = new hashset<userrole>(0); public user() { } public user(string username, string password, boolean enabled) { this.username = username; this.password = password; this.enabled = enabled; } public user(s

JavaFX ListView with touch events for scrolling up and down -

JavaFX ListView with touch events for scrolling up and down - i implement scrollable listview gestures, in mobiles , tablets, scroll , downwards list finger. current list selects item click downwards on list. how can accomplish this? couldn't find illustration @ oracle tutorials. private observablelist<document> items = fxcollections.observablearraylist(); @fxml listview<document> listview; { ... listview.setitems(items); listview.getstylesheets().add("style/listview.css"); listview.setstyle("-fx-background-insets: 0 ;"); // remove 1px border of listview container listview.setcellfactory(new callback<listview<document>, listcell<document>>() { @override public listcell<document> call(listview<document> listview) { homecoming new documentarrayadapter(); } }); ... } public void loadlistview(list<document> ldoc){ if (!ldoc.isempty(

ios - Video Ads from Vungle in Sprite kit Scene -

ios - Video Ads from Vungle in Sprite kit Scene - i trying add together vungle video ads in sprite kit skscene. have sprite node when clicked, should load ad. guide provided vungle https://github.com/vungle/vungle-resources/blob/master/ios-resources/ios-dev-guide.md shows how place advertisement through view controller. vunglesdk* sdk = [vunglesdk sharedsdk]; [sdk playad:self]; i have different skscene , want play advertisement in scene rather view controller. how can accomplish it. following skscene code user clicking skspritenode , want advertisement load. - (void)touchesbegan:(nsset *)touches withevent:(uievent *)event { (uitouch *touch in touches) { sknode *n = [self nodeatpoint:[touch locationinnode:self]]; if ( [n.name isequal: @"play"]) { [self levelselect]; } else if( [n.name isequal: @"coins"]){ vunglesdk* sdk = [vunglesdk sharedsdk]; [sdk playad:self.view]; //todo } } this gives error not

android - Index 2 requested with size of 2 -

android - Index 2 requested with size of 2 - i newbie android development , here first project of gridview database. show error "index 2 requested size of 2" i using sqlite database db file here code please help me!!!!! public class mainactivity extends activity { sqlitedatabase mydb; gridview data; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); info = (gridview) findviewbyid(r.id.gridview1); list<string> li = new arraylist<string>(); arrayadapter<string> dataadapter = new arrayadapter<string>( getapplicationcontext(), android.r.layout.simple_spinner_dropdown_item, li); dataadapter.setdropdownviewresource(r.layout.activity_main); seek { mydb = openorcreatedatabase(getstring(r.string._sdcard_sales_db), mode_private, null); cursor cr = mydb.rawquery("select * users", null

javascript - find objects in a database by range -

javascript - find objects in a database by range - im trying find objects in database, can't work if utilize range query. have pointer of how can find documents between date values? if skip range document in database wrong query, mondodb query db.collection('insights').find({'date': {$gt: '10000000', $lt: '90000000000000'}}).toarray(function (err, items){ res.json(items); console.log(items) }); database {"_id":"5450b2889d96472e67c99691","username":"josef","date":"'1414574728436'"} javascript node.js mongodb

copy - MSBuild RecursiveDir is empty -

copy - MSBuild RecursiveDir is empty - i'm trying create custom msbuild script build solutions in our repository: <project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> <sourcehome condition=" '$(sourcehome)'=='' ">..\</sourcehome> <toolshome condition=" '$(toolshome)'=='' ">.\tools\</toolshome> <configuration condition=" '$(configuration)'=='' ">release</configuration> <destfolder condition=" '$(destfolder)'=='' ">.\$(configuration)\</destfolder> </propertygroup> <itemgroup> <allsolutions include="$(sourcehome)**\*.sln"/> </itemgroup> <target name="default" dependsontargets="clean;build;assemble"/> <target name="clean"> &l

ruby on rails - Does AngularJS make Turbolinks pointless? -

ruby on rails - Does AngularJS make Turbolinks pointless? - from turbolinks page: turbolinks makes next links in web application faster. instead of letting browser recompile javascript , css between each page change, keeps current page instance live , replaces body , title in head if want build rich client-side application angularjs, framework create pointless turbolinks? the reply no. both work differently , and main goal different. turbolinks work on rails webapp responds html. angular js or other js frameworks makes utilize of json api backend. there not coding required utilize turbolinks. turbolinks way of making pages load faster minimizing content beingness transferred. replacing html body tag with js framework, have build entire front-end application. particularly useful same backend can used develop mobile apps ruby-on-rails angularjs turbolinks

How can i apply Multiple In clause in a single MySQL query -

How can i apply Multiple In clause in a single MySQL query - i have list of ids , corresponding creation dates exmple : 1 2014-05-01 2 2014-07-01 3 2014-08-01 need suggestion regarding writing mysql select statement gives id details after corresponding creation date. select id,count(*) id_details id in(1,2,3) resolved_at >(2014-05-01,2014-07-01,2014-08-01) grouping id the date status resolved_at column not correct. again, if have 2 where clause in query, not correct. can's specify > status in in clause trying. query should like select id,count(*) id_details id in (1,2,3) , (resolved_at >= '2014-05-01' , resolved_at <= '2014-08-01') grouping id i think trying utilize in operator resolved_at column like select id, count(*) id_details id in (1,2,3) , resolved_at in ('2014-05-01','2014-07-01','2014-08-01') grouping id mysql

Android xml add shadow using a drawable behind solid color shape -

Android xml add shadow using a drawable behind solid color shape - i have .png image circular shape , shadow. have imagebutton has image it's android:src property. it's background can have xml file in drawable file. want have shadow image png go behind solid shape -> android:shape="oval". <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/shadowimg" /> <item> <shape android:shape="oval"> <solid android:color="#d63a33"/> <size android:width="70dp" android:height="70dp"/> </shape> </item> </layer-list> as see in code adding item shadow image android:drawable property. not allow shadow show. shows reddish circle shape. w

arrays - Using foreach() and php form and custom fucntion -

arrays - Using foreach() and php form and custom fucntion - i have function returns items have been inputted, works well. in input class: public static function get($item){ if(isset($_post[$item])){ homecoming $_post[$item]; } else if(isset($_get[$item])){ homecoming $_get[$item]; } homecoming ''; } now trying utilize in foreach loop , having problem - think because not returning array? here form snippet: <tr> <td><input type="text" class="form-control" name="inventory_item_id[]"></td> <td><input type="text" class="form-control" name="inventory_record_amount[]"></td> <td><input type="text" class="form-control" name="inventory_record_orders[]"></td> <td><input type="text" class="form-control" name="inventory_record_sales[]&qu

How do you get out of the code of the main storyboard in swift? -

How do you get out of the code of the main storyboard in swift? - on story board in swift, instead of showing visual representation of storyboard, shows me code behind storyboard (not view controller) know how visual representation? right click story board in leftmost file panel, open -> interface builder - storyboard. swift storyboard apple main

android - Saving user_id responce from JSON to sharepreferance -

android - Saving user_id responce from JSON to sharepreferance - can 1 help me out need solution, have search on so, not success ! i want store auto generated user_id receiving server json response in share preference , 1 time again share preference other activity , send parameter server here login activity receiving unique user id in json response when sending username , pass server public void connect(string useremail, string userpassword) throws jsonexception, ioexception { restclient1 client = new restclient1(constants.serverpath + constants.loginmethod); client.addparam("email", useremail); client.addparam("password", userpassword); client.addheader("content-type", "application/json"); seek { string response = client.executepost(); jsonobject jsonresponse = new jsonobject(response); string jsondata = jsonresponse.getstring("code"); string jdata = jsonresponse.getstring("responsestatus"); jsdata = jda

node.js - Why do my express.js sessions not save in Safari? -

node.js - Why do my express.js sessions not save in Safari? - we're working on sails.js web app want session persist indefinitely. (as far know, in sails that's if don't create settings.) the session persists (that is, user automatically logged in) in every browser except safari (both ios , osx). i tried changing sails session settings 24-hour session follows: cookie: { maxage: 24 * 60 * 60 * 1000 }, but still user name disappears web page in safari, persists everywhere else. we going display html in ios app; there setting made in app environment maybe? thanks! node.js cookies express safari sails.js

objective c - determinant algorithm of a 4x4 matrix -

objective c - determinant algorithm of a 4x4 matrix - i pick first row , multiply each element cofactor, in cases method returning nan . example, 1 0 0 1 0 2 0 0 0 0 3 0 0 0 0 4 in case method returns nan . does know did wrong? getdet3 returns determinant of 3x3 matrix , works fine. -(double) getdet4:(double[4][4])mat { double det = 0; double small[3][3]; int i, j, k; int i_ = 1, j_; ( i=0; i<4; i++ ){ if (mat[0][i] == 0) continue; // little matrix here ( j=0; j<3; j++ ){ j_ = 0; ( k=0; k<3; k++ ){ if ( == j_ ) j_++; small[j][k] = mat[i_][j_]; j_++; } i_++; } det += mat[0][i] * [self getdet3:small] * pow(-1, i+j); } homecoming det; } well, there few mistakes in code. 1) initialization of i_ = 1 should done before j loop, otherwise maintain old value. 2) computation of pow(-

I have created my own mediaplayer in android -

I have created my own mediaplayer in android - my problem when device mediaplayer playing song mediaplayer not stopping.both mediaplayer playing song together. when application needs output sound such music or notification, should request sound focus. 1 time has focus, can utilize sound output freely, should hear focus changes. use audiomanager request sound focus , implement audiomanager.onaudiofocuschangelistener respond sound focus changes. so hear audiofocus changes , modify app accordingly. see hyperlink more information. android

Famo.us/Angular Sticky Background Position ScrollView Sync -

Famo.us/Angular Sticky Background Position ScrollView Sync - i'm trying create functionality similar websites these days. the concept 3 sections size of browser, background images supposed fixed positioned , revealed div scrolling , down. we need function beautifully on mobile on desktop, , looks famous/angular solution. here pen. http://codepen.io/lazzam2/pen/xjrwbo i'm using famous' scroll.sync, firing javascript positions background image on every start / update / end. scrollobject.sync.on("update", function (event) { console.log('update'); test(event); }); here function positioning backgrounds. function test(data){ var scroller = document.getelementsbyclassname('famous-group'); styles = window.getcomputedstyle(scroller[0], null); tr = styles.getpropertyvalue("-webkit-transform").replace('matrix(1, 0, 0, 1, 0,','').replace(')',''); var distancetop = -(par

php - When im NOT on VPN -- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at -

php - When im NOT on VPN -- Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at - if vpn'd company network ssl external website (https://mysite.company.com) works fine node/socket.io once log off vpn , access site, gives error below in browser console: cross-origin request blocked: same origin policy disallows reading remote resource @ https://mysite.company.com:8080/socket.io/?eio=3&transport=polling& t=1415132537790-0. can fixed moving resource same domain or enabling cors. i don't know why happens when i'm off vpn...there no requests other mysite.company.com ... have tried many different methods resolve researching known error....nothing has worked, i'm hoping can support...please! i have in .htaccess file: header set access-control-allow-origin "*" header set access-control-allow-methods "post, get, options, delete, put" header set access-control-max-age "1000" header

javascript - How to pass a variable to config file in AngularJS -

javascript - How to pass a variable to config file in AngularJS - in app.js file have .config has states navigation urls. want pass variable container.html file config file, state base of operations url follows: // setup abstract state tabs directive .state('tab', { url: "/tab", abstract: true, templateurl: "templates/container.html" }) i want pass variable called partition have value either "agriculture" or "construction" , based on variable want farther operations. can help me pretty new angularjs. additional info: working on cordova, angularjs, taffy mobile app. in advance. want url /tab/:division or templates/container.html/division later able utilize in container.html file. try this // setup abstract state tabs directive .state('tab', { url: "/tab/:division", abstract: true, templateurl: "templates/container.h

javafx - How to draw a line using the equation: y=mx + c in java -

javafx - How to draw a line using the equation: y=mx + c in java - this question has reply here: how draw line using y = mx +b in java? 3 answers i draw line using equation of line gives slope/gradient , y intercept "c" i've tried draw line using 2 points using public void paint(graphics g) { g.drawline(x1,y1,x2,y2); } but draw line using equation instead. any help appreciated. just assume values of x - xa , xb . plug equation calculate y them, e.g. g.drawline(xa, m*xa + c, xb, m*xb + c) java javafx jframe line

AutoCAD DXF File Format and layer name -

AutoCAD DXF File Format and layer name - i'm reading dxf display information. see floorplan have duplicated layer names, these: myroomlayer myroomlayer @ 0.1 where myroomlayer official one, 1 see in autocad. where "@ 0.1" comes from? there no documentation on autodesk help: http://www.autodesk.com/techpubs/autocad/acad2000/dxf/ layer autocad autodesk dxf dwg

cordova - How to use Meteor-PhoneGap Plugin -

cordova - How to use Meteor-PhoneGap Plugin - i getting started using phonegap integration meteor , having problem getting plugin work. please provide steps below how utilize photographic camera plugin. running on simulator. code below. give thanks in advance. i added photographic camera plugin this: meteor add together cordova:org.apache.cordova.camera@0.3.1 then utilize have next code: if (meteor.isclient) { template.hello.events({ 'click button': function () { // increment counter when button clicked navigator.camera.getpicture( function(data){ session.set("picture", res); }, function(err){ console.log(err); }, { quality: 50, destinationtype: camera.destinationtype.data_url } ); } }); } if (meteor.isserver) { meteor.startup(function () { // code run on server @ startup }); } when click on button error: i20141006-21:58:33.174(-7)? (ios) camera.

jquery - base64 clear cache? - javascript -

jquery - base64 clear cache? - javascript - i have page created base64 image file input selection, creates canvas image , allows user upload parse. it works perfect first time user goes upload, howeve,r if seek , upload image.. keeps re-create of lastly base64 image , uploads well. is possible clear base64 url page? i'm bit new working base64. thanks help. javascript jquery base64

delete operator - Deleting objects in c++; -

delete operator - Deleting objects in c++; - this question has reply here: calling delete on variable allocated on stack 11 answers in c have free memory has been allocated program. same go objects in c++? class mutual { //some function declarations } void example() { mutual obj; //do stuff obj delete obj; } how of import delete obj; here if asume function example() called 1 time only? you have not delete local object of function allocated on stack. have delete objects allocated using operator new . moreover, delete operator applied pointers. code snippet not compile. c++ delete-operator

icalendar - ical event from php starting at 08:00 regardless of argument -

icalendar - ical event from php starting at 08:00 regardless of argument - i using php send ics calendar invite using great function: function sendicalemail($firstname,$lastname,$email,$meeting_date,$meeting_name,$meeting_duration,$address,$details) { $from_name = "jason"; $from_address = "abc@email.com"; $subject = "showing"; //doubles email subject , meeting subject in calendar $meeting_description = $details; $meeting_location = $address; //where meeting take place $message=''; //convert mysql datetime , build ical start, end , issue dates $meetingstamp = strtotime($meeting_date . " utc"); $dtstart= gmdate("ymd\this\z",$meetingstamp); $dtend= gmdate("ymd\this\z",$meetingstamp+$meeting_duration); $todaystamp = gmdate("ymd\this\z"); echo 'start:'.$dtstart.'<br><br>'; e

c# - Re-defne a Paragraph Range to Include a Subset of Words in the Paragraph -

c# - Re-defne a Paragraph Range to Include a Subset of Words in the Paragraph - i'm using microsoft.interop.word / c# programmatically create word document. in given paragraph, need alter color of words occur between brackets "[" , "]" the words variable. as understand it, need range object in order set colors. i'm using next code, not work: // add together paragraph. microsoft.office.interop.word.paragraph pgf = document.paragraphs.add(); // insert text paragraph. pgf.range.insertbefore("jira issue: " + jiraissueid + " [" + statusname + "]"); //get start , end locations of brackets. //these define location of words apply colors. int startpos = pgf.range.text.indexof("[") + 1; int endpos = pgf.range.text.indexof("]") - 1; /* effort alter range start , end positions, range contains words between brackets. i've tried 2 methods. */ // next line not work. p

c - read() and write() functions do not collaborate -

c - read() and write() functions do not collaborate - the task re-create sentence 1 file , reverse meanwhile. there no errors while compiling, original file contains sentence reverse 1 not save in sec file. thanks in advance help. here code: #include <stdio.h> #include <fcntl.h> #include <errno.h> int main(int argc, char* argv[]) { int file1 = open("a.txt", o_creat | o_rdwr | o_trunc, 0777); write(file1, "how you?", 12); lseek(file1, -1, seek_end); //////////////////////////////// char c; int file2 = open("b.txt", o_creat | o_rdwr | o_trunc, 0777); while( read(file1, &c, 1) ) { write(file2, c, 1); lseek(file1, -1, seek_cur); } //////////////////////////////// close(file1); close(file2); homecoming 0; } i changed while loop this: int = 0; while( read(file1, &c, 1) ) { i++; write(file2, &c, 1); lseek(

javascript - Angularjs Entity Framework -

javascript - Angularjs Entity Framework - i have 2 models : public class usermodel { public long userid { get; set; } public string name { get; set; } public ienumerable<numbermodel> numbers { get; set; } } public class numbermodel { public long numberid { get; set; } public string num { get; set; } public long userid { get; set; } public usermodel user { get; set; } } relationship between tables 1 many, how can display info using entity framework , angularjs using foreign keys , : |name| number|. this code 1 table : controler: public ihttpactionresult getusers() { using (contactentities ocontext = new contactentities()) { var query = in ocontext.user select a; ilist<usermodel> list = query.select(x => new usermodel { name=x.name, userid=x.userid

Delphi change the assembly code of a running process -

Delphi change the assembly code of a running process - i'm trying alter address 00741fa5 has push test.009e721c . alter push test.009e71c8 . procedure callback; asm force $9e71c8 end; procedure tform2.btn1click(sender: tobject); var ppid :dword; pprocess : cardinal; begin getwindowthreadprocessid(findwindow(nil,pchar('test')), @ppid); pprocess := openprocess(process_all_access, false, ppid); injectasm(pprocess, $741fa5, 10, integer(@callback), 0); end; here injectasm function (with error checking) function injectasm(process: longword; injectaddress, injectsize, codeaddress, codesize : integer): pointer; var csize, rsize : integer; replaced : array of byte; jmp : array [0..4] of byte; jmpaddress : integer; nopv : byte; : integer; nbr: ulong_ptr; begin //injectsize must equal or greater 5, because need space our //(far) jmp wwxxyyzz instruction //if there's no space, inject in place of few instructions if injectsize &

c# - UIScreen.MainScreen.Bounds.Height and UIScreen.MainScreen.Bounds.Width are both 0 -

c# - UIScreen.MainScreen.Bounds.Height and UIScreen.MainScreen.Bounds.Width are both 0 - i did , update xamarin ios project , utilize able phone call next code retrieve screen width , height: if (orientation == uiinterfaceorientation.landscapeleft || orientation == uiinterfaceorientation.landscaperight) homecoming new rectanglef(uiscreen.mainscreen.bounds.x, uiscreen.mainscreen.bounds.y, uiscreen.mainscreen.bounds.height, uiscreen.mainscreen.bounds.width); however update bounds set using cgrect code has changed this: if (orientation == uiinterfaceorientation.landscapeleft || orientation == uiinterfaceorientation.landscaperight) homecoming new cgrect(uiscreen.mainscreen.bounds.x, uiscreen.mainscreen.bounds.y, uiscreen.mainscreen.bounds.height, uiscreen.mainscreen.bounds.width); now when seek height , width returns 0. i've tried create new project , seek same thing run same problem. how can retrieve width , height of main screen? this looks it&#

git - Should I gitignore my .gitignore? -

git - Should I gitignore my .gitignore? - my concern since of projects on github, if else forks 1 of projects , utilize different ide me, want add together of ide-specific project files .gitignore . have decide if want force changes repository or not, , if don't, every time pull, modified .gitignore might have conflicts. am worrying much little things? best practice? worth track changes in .gitignore or not? don't ignore .gitignore file - developer-specific ignore rules, there 2 options: repository-specific ignore rules: can set ignore rules in .git/info/exclude file. works same .gitignore file, it's not part of version controlled code. per-machine, global rules: can create global git config file has ignore rules ide-specific configuration. create file anywhere on machine , tell git utilize global ignore file: git config --global core.excludesfile /path/to/ignorefile there's more thorough documentation on github: https://help.github.com/arti

web scraping - Fetch source code of web page using java? -

web scraping - Fetch source code of web page using java? - i have url this , next method public static void savecontent( string weburl )throws exception { url website = new url(weburl); urlconnection connection = website.openconnection(); bufferedreader in = new bufferedreader( new inputstreamreader( connection.getinputstream())); stringbuilder response = new stringbuilder(); string inputline; while ((inputline = in.readline()) != null) response.append(inputline); in.close(); system.out.println(response.tostring()); } however, when want print web content, fetches source code of main page(www.google.com). how can solve problem ? help. i copied yours code netbeans , seems work correctly. think problem lead on content in method argument "weburl". seek run app on debug mode , you've got there. java web-scraping

user interface - How do I get my JTextFields to line up correctly under a title? -

user interface - How do I get my JTextFields to line up correctly under a title? - this should like import java.awt.*; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.*; public class ui extends jframe { private static final long serialversionuid = 1l; private jpanel toppanel; private jpanel mainpanel; private jpanel botpanel; private jlabel message; private jtextfield total, total1, total2, total3, total4, total5; private jtextfield score, score1, score2, score3, score4,score5; private final int width = 650; private final int height = 400; public ui() { settitle("desert soccer league"); setsize(width,height); setdefaultcloseoperation(jframe.exit_on_close); buildtop(); add(toppanel, borderlayout.north); buildmain(); add(mainpanel, borderlayout.center); buildbot(); add(botpanel, borderlayout.south); } private void buildtop() { toppanel

RubaXa jquery.fileapi setting preview el class -

RubaXa jquery.fileapi setting preview el class - it possible set dynamically class of element contain preview of file based of file type? illustration image file have: preview:{"width":100,"height":100,"el":".image-div-class"}... and txt file have preview:{"width":100,"height":100,"el":".text-div-class"}... thank you to append not image files type different div need use: preview:{"width":100,"height":100,"el":".image-div-class""get": function ($el, file) { $el.appendto(".file-type-'+file.name.split('.').pop()+'").append("<p>"+file.name+"</p>");; }} jquery fileapi

progress bar - Change drawables on Android ProgressBar -

progress bar - Change drawables on Android ProgressBar - i've got progress_incomplete.xml , progress_complete.xml both files (i removed gradients , stroke info save room not important). basically incomplete.xml has yellowish colours , finish has greenish colours. <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> ... </shape> </item> <item android:id="@android:id/secondaryprogress"> <clip> <shape> ... </shape> </clip> </item> <item android:id="@android:id/progress" > <clip> <shape> ... </shape> </clip> </item> </layer-list> in java file, have this: if (percentage == 100)

how to call a c++ function from php? -

how to call a c++ function from php? - i have c++ programme has homecoming string. since main method in c++ cannot homecoming string, returning string through user-defined function. how can invoke function php script. know exec() command can phone call c++ programme there way can phone call specific function? scenario: int main() { string myfunc(){ .... homecoming string; } homecoming 0; } how can phone call myfunc() php? you can utilize c++ php bridge library. check link http://www.php-cpp.com/ and extension zend, check link http://devzone.zend.com/1435/wrapping-c-classes-in-a-php-extension/ this help you php c++ exec

c# - MVC Partial View and Models -

c# - MVC Partial View and Models - i have homecontroller code: public actionresult index() { indexmodel m = new indexmodel(); m.test = "somestring"; m.loginmodel = new viewloginmodel(); m.loginmodel.test = "fromlogin"; homecoming view("login", m); } and in index.cshtml, have this: @model indexmodel //bunch of html @html.partial("_login", model.loginmodel) and in _login.cshtml, this: @model viewloginmodel //bunch of html @html.labelfor(model => model.test) basically, want have separate model partial window (login) in home page, , model can or not kid of viewindexmodel (ideally shouldn't exist). i'm trying access variables , write/use them in partial view, doesn't work - displays property's name instead. in partial view "_login", intellisense doesn't work reason (vs2013), although @html.beginform , stuff working, can't access model's properties. what doi

ios8 - iOS custom keyboard - preserve state between appearances -

ios8 - iOS custom keyboard - preserve state between appearances - i'm having performance problems custom keyboard i'm working on. loading words in spell correction tree takes quite bit of time. seems done each time keyboard appears - there way preserve state of keyboard? apps can suspend / resume etc - can't find documentation on how extensions, or if there's mechanism doing att all. thanks! you loading dictionary net or disk? first case nsuserdefaults, encoding (nscopying) options store info. can load in background. according docs, os typically kills extension process, so, think there no way prevent keyboard objects deallocation (you may utilize nskeydarchiver). ios8 ios-app-extension custom-keyboard

c# 4.0 - in which file request blocking iis rules get added in asp.net -

c# 4.0 - in which file request blocking iis rules get added in asp.net - i have added request blocking rules in url rewrite of iis. checked these rules in web.config , in app config file. did not find. in file these changes made? these rules added in folder level web.config file asp.net c#-4.0 iis-7.5

php - Using wamp server error in connecting between pages -

php - Using wamp server error in connecting between pages - i have installed wamp e drive. when utilize projects in www directory localhost disappears addressbar , when write localhost works can't send info between pages (especially in dreamweaver(i defined site , testing server)) , can't link pages(the links not working). shoud do? tried solutions in other answers uninstall services doesn't work. thanks. the same thing happened me before, after installing newer version of wamp server, suggest install lower version of wamp server hope help. php hyperlink wamp

cocoa touch - How to use iOS's In-App purchase to buy user generated digital goods? -

cocoa touch - How to use iOS's In-App purchase to buy user generated digital goods? - in ios app, photographers can upload photos , other people can purchase digital re-create of photo. after researching, discovered buyers must utilize in-app purchase rather apple pay because in-app purchase digital goods, while apple pay physical goods. i've run problem using in-app purchase purchase user generated content. documentation says: for each app, can create up 1000 separate in-app purchase products. every product want offer in store must configured in itunes connect. my community of photographers creating more 1000 photos. i, app developer, must go itunes website submit each individual product. not scalable user generated app. the documentation of in-app purchase makes appear can set little static list of products. if has experience letting users purchase on one thousand user-generated digital goods, please allow me know. possible solution i'm t

why is autowired null? use spring jersey integration -

why is autowired null? use spring jersey integration - i have application controller method getapplication(). method returns applicationjson objekt client. in method phone call on application builder. the application builder mill , generate special application builder object. in special application builders used mapper , services, services used daos. all services , daos sind beans , confirgure in applicationcontext.xml , servicebeans.xml. when calling method getapplication() exception in eclipse java console. the problem occurs in class mobileapplicationbuilder , method buildpagenavidata() class applicationcontroller: package core.application.controller; import javax.ws.rs.get; import javax.ws.rs.path; import javax.ws.rs.produces; import javax.ws.rs.core.mediatype; import org.springframework.beans.factory.annotation.autowired; import org.springframework.beans.factory.annotation.qualifier; import org.springframework.context.annotation.scope; import org.springframew