Posts

Showing posts from May, 2013

Android -OutofMemory error- bitmap factory -

my code.. mimageview_photos.setimagebitmap(bitmapfactory.decodefile(picturepath)); my logcat.. 11-27 10:51:56.325: e/androidruntime(3879): fatal exception: main 11-27 10:51:56.325: e/androidruntime(3879): process: com.virtualmaze.golfelite, pid: 3879 11-27 10:51:56.325: e/androidruntime(3879): java.lang.outofmemoryerror 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.nativedecodestream(native method) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodestreaminternal(bitmapfactory.java:620) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodestream(bitmapfactory.java:596) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodefile(bitmapfactory.java:376) 11-27 10:51:56.325: e/androidruntime(3879): @ android.graphics.bitmapfactory.decodefile(bitmapfactory.java:402) 11-27 10:51:56.325: e/androidruntime(3879): @ com.virtualmaze.golfelite.h...

c++ - Correcting a segmentation fault -

#include <iostream> #include <stdio.h> #include <math.h> #include <stdlib.h> using namespace std; int main(){ int i=0,n,h,k; k = (int)pow(10,5); int c[k]; scanf("%d%d",&n,&h); if((n>=1 && n<=(int)pow(10,5)) && (h>=1 && h<=(int)pow(10,8))){ int arr[n]; do{ scanf("%d",&arr[i]); if(arr[i] > h){ cout<<"error !"; exit(1); } i++; }while(i!=(n-1)); i=0; do{ /*the fault occurs somewhere here, probably*/ scanf("%d",&c[i]); i++; }while(c[i]!=0); if(i>(int)pow(10,5)){ cerr<<"error !"; exit(0); } } return 0; } i'm trying accept few numbers console on different lines using scanf() (with constraints on upper , lower limits of numbers) - problem ...

node.js - More than 2 levels of population with mongoose -

i trying use mongoose populate ability return 1 composite document. categories , questions expanded fine. answers array in questions not expanded. here's have been doing summaryschema.statics.loadfull = function(options, callback){ var self = this; self.findone(options).populate([{ path: 'categories' }]) .exec(function(err, res){ if(err || !res) return callback(err, res); self.populate(res, [{ path: 'categories.questions', model: 'question' }], function(err, res){ if(err || !res || !res.length) return callback(err, res); self.populate(res, [{ path : 'categories.questions.answers', model: 'answer' }], function(err, res){ callback(err, res); }); }); }); }; is there obvious mistake making or mongoose not support more 2 levels of population. fyi, structure s...

xslt 2.0 - match uncaught though declared in XSL -

i've below xml. <para indent="no"> <star.page>18</star.page> further same. </para> and when run below xslt. <xsl:template match="para"> <xsl:value-of select="./node()[1][self::star.page]|./label/node()[1][self::star.page]"/> <div> <xsl:choose> <xsl:when test="./@align"> <xsl:attribute name="class"><xsl:text>para align-</xsl:text><xsl:value-of select="./@align"/></xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class"><xsl:text>para</xsl:text></xsl:attribute> </xsl:otherwise> </xsl:choose> <xsl:apply-templates/> </div> </xsl:template> when run this, instead of printing <div class="para">18</div> , pr...

javascript - Unsubscribe in Observable KnockOutJS -

im using knockout js , conducted research when observable notified fire function function functiontosubscribe() { } var testobservable = ko.observablearray([]); testobservable.subscribe(functiontosubscribe); i subscribing functiontosubscribe in event im thinking there way unsubscribe it? in c#? when unsubscribing events have idea regarding this??? the subscribe function returns "subscription" object has dispose method can use unsubscribe: var testobservable = ko.observablearray([]); var subscription = testobservable.subscribe(functiontosubscribe); //call dispose when want unsubscribe subscription.dispose(); see in documentation: explicitly subscribing observables

Guava - disk backed large collections -

do guava's collection implementations flow data disk beyond size? i didn't find simple reference on this, though sounds natural/simple way of supporting large datasets... we can use other libraries map db of course...or more comprehensive setups voldemort...but wondering why guava doesn't have it... is architecture point of view, if 1 needs use such large dataset, better off splitting out data separate data store instance instead of putting in same jvm...? nope; guava sticks on-heap collections, ones in java.util. on-disk collections more or less out of scope guava.

(2002) Error:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (46) -

please help.. i using yahoo small business web hosting. have uploaded files server , database also. had given host name 'mysql'. still cant access site. with yahoo webservices mysql seems run on different machine code, need connect host mysql instead of localhost : see yahoo " why can't access database? "

replace two values of a row with one in R dataframe -

it may simple task having trouble in doing this. sorry if silly question asking here after many attempts. i have 399 files named prediction1, prediction2, ..... on, , each file containing 2 values like in file predition1 0.1234 -1.2345 in file prediction2 -1.5443 0.34436 ..... on these files imported in r using filelist = list.files(pattern = "pred*") myfiles = lapply(filelist, read.table) and list object "myfiles" converted dataframe using: myfiles2 = as.data.frame(myfiles) now myfiles2 contains: > myfiles2[1] v1 1 -1 2 -1 up 399 times. now have apply conditions if(myfiles2[1][1,]>0 & myfiles2[1][2,]<0) then replace values numeric "1001" and if(myfiles2[1][1,]<0 & myfiles2[1][2,]>0)` replace values numeric "0110".. can suggest me right way this, able print values in r console not getting values in object can merge make 1 matrix. i hope discussed problem better previous. for(i in 1:3...

Read XML from a string in C++ / Unix -

i'm looking simple way read xml contained in string variable in c++ unix systems. have found lot of solutions xml files not lot xml contained in string variable. do have use functions such find(), etc. or there library missed job me ? edit: if have following xml in string, how can read ? (with pugixml example) string xml = "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"; xml += "<people><person><name>toto</name><age>20</age></person>"; xml += "<person><name>john</name><age>42</age></person></people>"; i recommend use tinyxml2 library. xmldocument::parse - best catch ( http://grinninglizard.com/tinyxml2docs/classtinyxml2_1_1_x_m_l_document.html#a1819bd34f540a7304c105a6232d25a1f ) and after loading string in xmldocument - can navigate via tinyxml2 tools further. exact example in documentation -> http://ww...

.htaccess - 301 Redirect a folder to a single page -

i have folder on website has been superceded , want redirect attempt access file in folder current home page. i have read many questions here none seem this. i have tried various things in .htaccess seems append filename redirect address. redirect 301 old/$ www.example.com/index.html redirect 301 old/ www.example.com/index.html redirect 301 ^old/ www.example.com/index.html i have seen various mentions of rewriterule. need use that? you can use code in /old/.htaccess file: rewriteengine on rewriterule ^ http://www.example.com/index.html [l] or root .htaccess use: rewriteengine on rewriterule ^old(/.*)?$ http://www.example.com/index.html [l,nc]

Append query string in every request using Java/Java Spring web MVC / any other way -

i want append query string every request through out application in java or java spring using session filter or other way. please me out driving me madly . in advance. :-) . example : " http://www.using.com/gaor/trackurl.do?15 " here 15 query string , but need add query string next request in below. " http://www.using.com/gaor/registrationrequesttostep1.do?15 " , go on until submit. please me. in advance.

slider - simple responsive gallery for different aspect ratios -

i'm pulling hair out looking way display scale-able images different aspect ratios. found jssor slider, might complex slider i've ever seen. appreciated! please use $fillmode option. reference: http://www.jssor.com/development/reference-options.html

java - Dynamic URL special characters : @PathVariable -

i using spring , hibernate in project. is there way handle dynamic url(i.e. hyperlink populated dynamically depending on searchresult) through modelattribute i.e. using variable , passing same controller passing input bean?? i using @pathvariable handling dynamic url action jsp controller. during same if dynamic url contains combination of special characters ./ url getting truncated. please help.

SAPUI5 Multimodel Binding -

i have problem multimodel binding. in init function of controller set json model in ui.core var omodel = new sap.ui.model.json.jsonmodel(data1); sap.ui.getcore().setmodel(omodel, "model1"); in view have template of columnlistitem , bind in table var template = new sap.m.columnlistitem({ id: "first_template", type: "navigation", type : sap.m.listtype.active, visible: true, selected: true, cells: [ new sap.m.label({ text: "{name}" }) ], press: [ocontroller.presslistmethod] }); otable.binditems("model1>/events", template, null, null); opage.addcontent(otable); with simple model work's rigth in multimodel table gets number of items not properties of model. solution ? you need use model name in template, too: var template = new sap.m.columnlistitem({ id: "first_template...

java - How to handle Connection pool size established by EntityManger through a Spring Application -

we have web application implementing spring mvc 3.2 using jpa framework orm. problem entitymanager creating lot of open connections database. want handle in such way every query connection should established , closed after completion. as per spring implementation entitymanager created once. problem here in way want handle client connections entitymanager creating querying database. whenever query completed in database, connection goes sleep, instead want close once query returns result. db type: mysql my configuration jpa : <tx:annotation-driven transaction-manager="transactionmanager" /> <bean id="transactionmanager" class="org.springframework.orm.jpa.jpatransactionmanager"> <property name="entitymanagerfactory" ref="entitymanagerfactory" /> </bean> <bean class="org.springframework.orm.jpa.support.persistenceannotationbeanpostprocessor" /> <bean id="entitymanagerfa...

mongodb - Migrating customer logins with encrypted passwords -

i have lot of accounts older version of website need migrate new version. passwords encrypted bcrypt , don't know salt was, library, or that. have data database. best way allow people still use accounts? 1 thought first time try login, send them email getting them update password. other thoughts appreciated. project running on mean stack if matters. update: is there chance work? tried account knew password for, , seems work. bcrypt magic unaware of? so reading following question's answer learned how bcrypt works , since using same algorithm ie. "2a" , same power ie. "10" works since salt stored in data. got 2 of passwords accounts, , tested them. both worked perfectly. how can bcrypt have built-in salts?

android - What is the use of hit api in async task? -

can use httpget/httppost without async?? httpclient client = new defaulthttpclient(); httpget request = new httpget("http://www.example.com"); if using without async, gives threat error. this exception occurs due heavy task performed on main thread. if performing task takes time may comes error.to handle have use thread run type of code. there no need of run code inside asynctask network operation should inside thread this.but asynctask better option type of operations suggest that. thread thread = new thread(new runnable(){ @override public void run() { try { //your code goes here } catch (exception e) { e.printstacktrace(); } } }); thread.start(); also can change default behavior using following strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy);

debugging - How to disable Inline variables view in WebStorm 9? -

Image
here mean inline variables view: see variable values next usages inline variables view, new debugging feature integrates variables view right in editor. see https://www.jetbrains.com/webstorm/whatsnew/#inline is possible disable feature? how do that?

qt - How to embed QML toolbar and menubar into QMainWindow -

i using qwt library plot data. seems not possible embed qwidget qml quick 2 . so, decided create qmainwindow main window , create toolbar , menubar using quick controls . how should embed qml toolbar , menubar qmainwindow ? you should create qml applicationwindow qml menubar , toolbar main.qml applicationwindow { visible: false menubar: menubar { menu { title: "edit" menuitem { text: "cut" } } } toolbar: toolbar { row { anchors.fill: parent toolbutton { iconsource: "1.png" } } } } main.cpp qapplication app(argc, argv); qqmlapplicationengine engine; engine.load(qurl(qstringliteral("qrc:///main.qml"))); then pointer applicationwindow qwindow *qmlwindow = qobject_cast<qwindow*>(engine.rootobjects().at(0)); create window container, using qwidget::createwindowco...

extract XML data using attributes from a URL php -

i have url response xml data <account account="ihs" timezone="gmt+05:30"> <description>the indian heights school</description> <device id="09647"> <description>dl1pd0228</description> <eventdata device="09647"> <timestamp epoch="1416968997">2014/11/26 07:59:57 gmt+05:30</timestamp> <statuscode code="0xf401">ignition_on</statuscode> <gpspoint>28.56262,77.05264</gpspoint> <speed units="km/h">0.0</speed> <odometer units="km">4390.1</odometer> <geozone index="0">tihs</geozone> <address>the indian heights school</address> </eventdata> </device> <device id="8786"> <description>dl1vc1750</description> <eventdata device="8786"> <timestamp epoch="1416989072">2014/11/26 13:34:32 gmt+05:30</timestamp>...

java - Path of folder in webapps in apache tomcat -

how find path of folder,for example: image present in webapps folder of apache tomcat in java project. to find path of folder right click on folder name --> select properties --> select resource on left side --> third option location. that indicate file location in disk.

selenium ide: how to verify value from external css file -

myi know if possible check values external css file selenium ide? my html: <div id="myblock"> my css style: #myblock { background: none repeat scroll 0 0 #ffffff; margin: 0; padding: 0; } i need verify background-color. tryed use verifyattribute // [@id="myblock"]@background or // [@id="myblock"]@style, attribute not found. correct way it? a combination of storeeval , javascript's getcomputedstyle has worked in past. of course, you'll have enable javascript in browser! the below, when run in selenium ide against html, should return rgb code of hex code. <tr> <td>storeeval</td> <td>window.document.defaultview.getcomputedstyle(window.document.getelementsbyclassname('myblock')[0]).getpropertyvalue('background-color')</td> <td>storedcolorvariable</td> </tr> the variable storedcolorvariable contain background color rgb(255, 255, 25...

list - To sort the contents of a file using comparator in java -

i have added contents of file through arraylist , need sort contents , put them on file. how can it? package training; import java.io.*; import java.util.collections; /* method create file, store contents of list , write read them */ public class filecreation implements serializable { public void filespatient(person p) throws classnotfoundexception { string filename = "patientdetails.txt"; try { objectoutputstream os = new objectoutputstream( new fileoutputstream(filename)); os.writeobject(p); os.close(); } catch (exception e) { } system.out.println("done writing"); try { objectinputstream = new objectinputstream(new fileinputstream( filename)); person l = (person) is.readobject(); system.out.println("*****************patient details*************"); system.out.println("...

Javascript, How to show two value into same input type text field? -

i want show 10 20 in single input type text, below option not working. can 1 me javascript:- var = 10; var b = 20; document.getelementbyid("current").value = , b; html:- <input type="text" id="current"> you can this: document.getelementbyid("current").value = + " " + b;

c# - Does casting null to string cause boxing? -

imagine code this: var str = (string)null; does differs from: string str; or: string str = null; does first code cause boxing of null value, or rather resolved @ compiler time string? let's take question , pick apart. will code in question cause boxing? no, not. this not because of 3 statements operate differently (there differences though, more below), boxing not concept occurs when using strings. boxing occurs when take value type , wrap object . string reference type , , there never boxing involved it. so boxing out, rest, 3 statements equal? these 2 same: var str = (string)null; string str = null; the third 1 (second 1 in order of question though) different in sense declares str identifier of type string , not initialize null . however , if field declaration of class, same since fields initialized defaults / zeroes when object constructed, , initialized null anyway. if, on other hand, local variable, have uninitialized variable. ...

machine learning - Distance measure for categorical attributes for k-Nearest Neighbor -

for class project, working on kaggle competition - don't kicked the project classify test data good/bad buy cars. there 34 features , data highly skewed. made following choices: since data highly skewed, out of 73,000 instances, 64,000 instances bad buy , 9,000 instances buy. since building decision tree overfit data, chose use knn - k nearest neighbors. after trying out knn, plan try out perceptron , svm techniques , if knn doesn't yield results. understanding overfitting correct? since features numeric, can directly use euclid distance measure, there other attributes categorical. aptly use these features, need come own distance measure. read hamming distance , still unclear on how merge 2 distance measures each feature gets equal weight. is there way find approximate value of k? understand depends lot on use-case , varies per problem. but, if taking simple vote each neighbor, how should set value of k? i'm trying out various values, such 2,3,10 etc. i rese...

websphere - Bundle cache was not change to new version after restart server -

in websphere 8.5, have deployed new version of bundle(in internal bundle repository , delete old one) shared in many bundles(asset). after restart server found still used old one(see in bundle cache). question why it's not uses new 1 , how solve problem? don't want re-install bundles. thanks, anurak

c++ - Understanding glTexCoord2f(), glVertex3f() in OpenGL -

i'm trying build in oculusrift support our car simulator software @ our institute. due way simulator software setup decided fix distortion due lenses client side build display list opengl run first tests. basically i'm struggly bit understanding how opengl drawing (for display list). used info different tutorials , if understand correctly following for-loop select coordinates tex 0,1,2 vignetting , bind each vetice. glbegin(gl_triangles) automatically draw triangles out of vertices. the coordinates of vertices stored in struct address ov pointing to. additionally have offsets each color channel. is following code snipped opengl viewpoint correct? ovrhmd_createdistortionmesh(phmd, eyerenderdesc[eyenum].eye, eyerenderdesc[eyenum].fov, ovrdistortioncap_chromatic | ovrdistortioncap_vignette, &meshdata); ovrdistortionvertex * ov = meshdata.pvertexdata; // new compiled distortion-rendering display list glnewlist(drlist, gl_compile); // make triangles out of verti...

google spreadsheet - Access Rights: Copying Sheets with inserted images between accounts -

if have google sheets document has inserted images/drawings in 1 google drive account , use api copy google drive account, how ensure new account has access inserted items? at moment appears first time user opens newly copied document, image content isn't displayed , when try edit embedded images/drawings warning don't have access items. second time open google sheet can see items , have access edit them. is issue google drive whole? there can work around it? narrowed things down bit without using api... create sheet , insert new drawing. copy sheet. share copy else. they don't have permission see drawing. if share original can see drawing in original. this appears issue google sheets itself, since replicated problem using ui well. best place report product issues google docs forum .

How to rescue by passing a block in Ruby? -

i have defined own method authorize_user in 1 of controllers, as: def authorize_user if !((current_user.has_role? :admin, @operator) || (current_user.has_role? :super_admin)) raise cancan::accessdenied end end i want rescue cancan exception (or other exception matter). have used rolify in app. how rescue , redirect root_url of app custom message? i have tried following options, none of them worked: try 1: rescue cancan::accessdenied |exception| redirect_to root_url, :alert => exception.message end error in case: syntax error, unexpected keyword_do, expecting '(' try 2: rescue cancan::accessdenied redirect_to root_url, :alert => "unauthorized access" error in case: render and/or redirect called multiple times in action how solve issue? this controller code: class cabscontroller < applicationcontroller before_action :set_cab, only: [:show, :edit, :update, :destroy] before_action :authenticate...

excel - Getting java.lang.NullPointerException while writing into workbook WorkBook.write(out) Apache POI -

i getting java.lang.nullpointerexception while writing in output stream: workbook.write(new fileoutputstream("test1.xslx")); the exception is: exception: java.lang.nullpointerexception @ org.apache.poi.poixmldocument.write(poixmldocument.java:201) @ excelcompare.writeoutputintoexcel.addrow(writeexcel.java:124) @ excelcompare.compareexcel.main(mainclassexcelcompare.java:113) here have 2 class: compareexcel class , writeoutputintoexcel i want compare 2 excel sheets excel1.xslx , excel2.xslx , put result in result.xslx . i don't want put in result.xslx , want put rows don't match in both excel1 , excel2. here main class package excelcompare; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.ioexception; import java.util.iterator; import org.apache.poi.ss.usermodel.cell; import org.apache.poi.ss.usermodel.cellstyle; import org.apache.poi.ss.usermodel.indexedcolors; impo...

c - Recursive code for searching max height of binary tree -

i've created tree using code (this outdated @ bottom, problem updated): struct node* buildtree() { struct node* root = null; root = insert(root, 2); root = insert(root, 4); root = insert(root, 10); return(root); } then tried find max depth of (functions max , insert work properly), using this: int maxheight(struct node* p) { if(p == null) {return 0;} else{ int leftdepth = 1 + maxheight(p->left); int rightdepth = 1 + maxheight(p->right); return(max(leftdepth, rightdepth)); } } and shows me error max depth 3; i've compiled in c99 standard. i've found , similar code in several places in internet, here doesn't work, ideas what's wrong? thanks.. as suggested adding insert code: struct node* insert(struct node* node, int data) { if (node == null) { return(newnode(data)); } else { if (data <= node->data) node->left = insert(node->left, data); else node->right = insert(node->right, data);...

html - PHP form not receiving email -

i wanted add php form sends message name , email of 1 sent it, current html, btw use bootstrap: <div class="row" id="contact-padding"> <div class="col-md-12 text-center" id="contact-form1"> <form action="mail.php" method="post"> <p></p><br><input type="text" name="name" placeholder="Име" id="forminput"> <p></p><br><input type="text" name="email" placeholder="Поща" id="forminput"> <p></p><br><input type="text" name="phone" placeholder="Телефон" id="forminput"> <p></p><br> <textarea name="message" rows="6" cols="25" placeholder="Запишете съобщението, кое...

informatica powercenter - what is difference between creating & running the workflow in client and server? -

am new informatica . can tell me difference between creating & running workflow in client , server. in advance. the workflows executed on server runs integration service. the powercenter client tools (designer, workflow manager, workflow monitor, repository manager) cannot run workflows themselves. can used develop mappings, sessions , workflows. workflow manager , workflow monitor can used start , workflow execution.

Wordpress: Put name and email into input type -

i use contact form 7 , need point:- when user login site , need contact me site, put page this. need when user open page, put name , email input type how can that you can pass user_display_name , user_email default [text* your-name default:user_display_name] [email* your-email default:user_email]

c++ - Is libjpeg always installed with Android? -

im writing entire android project in ndk c/c++, , want open jpg files. ive read lot people suggesting compiling libjpeg or libjpeg-turbo use ndk, others suggesting libjpeg in android true? i'd rather use existing lib dont want rely on if units not there. i use libjpeg-turbo, statically linked other libs, works fine. don't think libjpeg installed on android.

c# - Web API 2 - restful service - URL encoded -

i have created restful service using web api 2. have following route return information stock item : http://localhost/api/stockitems/{stockcode} i.e. http://localhost/api/stockitems/bomtest1 i have stock codes in system contain forward slashes i.e. ca/base/sng/beech. naturally can't request details using standard convention due slashes. http://localhost/api/stockitems/ca/base/sng/beech i have tried url encoding it's not hitting controller http://localhost/api/stockitems/ca%2fbase%2fsng%2fbeech i keep getting 404 how handle in web api? you need change webapiconfig. if don't use ids in more place can add wildcard ({*id}) in part of config: config.routes.maphttproute( name: "default", routetemplate: "api/{controller}/{*id}", defaults: new { id = routeparameter.optional } ); i'd recommend creating specific route case tho (assuming scenario need allow slashes): config.routes.maphttproute( name: "stoc...

Yii Widgets CGridView show data -

i have 2 tables in db: t_product , t_user . t_user '***************************************************************************' '* cod_arm * descrição * username * password * salt * tipo *' '***************************************************************************' '* 000 * 000 - admin * admin * 123 * asdfgh * *' '* 001 * 001 - medicina 1 * p01 * 123 * asdf * u *' '* 021 * 021 - urologia * p21 * 123 * asdfg * u *' ****************************************************************************' t_product '*********************************************************************************************' '* id_prod * cod_art * designacao * unidade * data_validade * cod_loc *' '*********************************************************************************************' '* 1 * 210110300 * adesivo comum...

java - ActionBarDrawerToggle() icon cannot be set to the ActionBar in Android SDK 5 -

i have simple problem initializing icon action bar. using android sdk 5 , since android.support.v4.app.actionbardrawertoggle; deprecated imported v7 support , replaced import following: android.support.v7.app.actionbardrawertoggle; i.e. same package v7. now when initialize actionbardrawertoggle object associate drawerlayout object imported from: import android.support.v4.widget.drawerlayout; forced remove 1 argument, seems ok (have no idea why though!). icon not go in actionbar. here initialization actionbardrawertoggle object: mactionbardrawertoggle = new actionbardrawertoggle(this, drawerlayout, r.drawable.ic_drawer, r.string.drawer_open) { /** called when drawer has settled in closed state. */ @override public void ondrawerclosed(view view) { super.ondrawerclosed(view); invalidateoptionsmenu(); // creates call onprepareoptionsmenu() } /** called when drawer has settled in open state. */ ...

Git commit ignore line endings -

is there way make git commit ignore line endings? i managed figure out how make git diff ignore line endings git diff --ignore-space-at-eol this way got diff display lines edited. but problem git diff default considers file changed in whole, , commits change accordingly. also tried git config --system core.autocrlf true git config --system core.autocrlf false none of these solved problem! it seems there no way make git commit ignore line endings default!! just beware of merging tools! i figured out teams setting line endings ok, merging tool spoiled several files during merging branch, , on have nightmare of eol!! :)

mysql - Merging 2 queries in Select COUNT(*) per day -

i have 2 tables logs , tracks each 1 holds timestamp different name try logs per day given shop , on same time number of tracks per day in tracks table select date(clicktime), count(shop) log shop = "shop01" , (clicktime > date_sub(now(), interval 30 day)) group date(clicktime); this query gathers entries in log table per day , result looks like -------------------------------- clicktime | clicks -------------------------------- 2014-12-25 | 342 -------------------------------- 2014-12-24 | 232 -------------------------------- i sales per day on second table following select date(last_change) saletime, count(shop) sale tracks shop = "dd01" , (last_change > date_sub(now(), interval 30 day)) , relevant = 1 group date(last_change) outputs -------------------------------- saletime | sales -------------------------------- 2014-12-25 | 42 -------------------------------- 2014-12-24 ...

Background Bluetooth with iOS device -

i working on developing bluetooth peripheral work ios device. need make ios app receive data whilst it's in background , process data comes. looking through apple's corebluetooth framework, can see how background execution modes can used. save power, want ios device connect bluetooth peripheral @ time (without need of user interaction). i've looked through local notifications on ios , has limited functionality , don't think provides need. so there anyway wake app @ 6pm , ask application start scanning bluetooth devices? , execute other code once device connected? without user interaction. any suggestions appreciated! thanks! you can't schedule operations occur @ specific time in ios (aside local notification, said isn't need). you can use background fetch mode periodically allow app check new data. can set interval (although guideline ios, not strict schedule) how app woken. when ios calls app delegate performfetchwithcompletionhandler m...

r - Select rows from data.frame using vector of names -

i keep ~1200 rows data.frame remove rest of rows have use vector of "gene names" can found in data.frame . my data (just couple of rows): > tbl_ready2 gene.name x1_1 x1_2 x1_3 x1_4 x1_5 x1_6 x1_7 x1_8 x1_9 x1_10 x1_11 x1_12 x1_13 x1_14 x1_15 x1_16 x1_17 1 at1g01050 0 0 0.000000 0.000000 0.0000000 0.0000000 0.7137613 0.0000000 1.1431194 0.0000 0.0000000 0 0.000000 0.0000000 0 0.0000000 0.000000 2 at1g01080 0 0 1.912532 1.263598 0.9972625 0.8363335 0.9984333 1.0027375 0.7207666 0.0000 0.7155959 0 0.000000 0.0000000 0 0.0000000 0.000000 3 at1g01090 0 0 0.000000 0.000000 0.0000000 0.1864505 0.0000000 0.1057995 0.7634527 0.9794 1.1207689 1 1.276209 0.9701439 0 0.8552922 0.000000 4 at1g01220 0 0 0.000000 0.000000 0.0000000 0.0000000 0.0000000 0.0000000 1.0000000 0.0000 0.0000000 0 0.000000 0.0000000 0 0.0000000 0.000000 5 at1g01320 0 0 0.000000 0.000000 0....

c++ - How to validate Internet Printing Protocol (IPP)? -

i want validate ipp port instance has ipp http://xxx.xxx.xxx.xxx:631/ipp , similar way want validate https://xxx.xxx.xxx.xxx/ipp .are there api's exist validate ipp , ipp-ssl if exists please let me know. if there no native api's kindly let me know other way of doing this.

python - Pygame not working on Mac when calling 'pygame.display.set_mode' -

i have tried long time solve problem, found similar topics in stackoverflow, nothing me. i'm trying install pygame on macbook pro os x 10.9.4: installation went fine, it’s enough me digit on terminal following lines receive error: >>>import pygame >>>pygame.init() (6,0) >>>pygame.display.set_mode((640, 480)) the error following: * terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'error (1000) creating cgswindow on line 263' * first throw call stack: ( 0 corefoundation 0x00007fff929eb25c __exceptionpreprocess + 172 1 libobjc.a.dylib 0x00007fff94491e75 objc_exception_throw + 43 2 corefoundation 0x00007fff929eb10c +[nsexception raise:format:] + 204 3 appkit 0x00007fff8b20ce95 _nscreatewindowwithopaqueshape2 + 1403 4 appkit 0x00007fff8b20ba21 ...

java - cursor.getString returns null with a valid uri -

all of sudden program has stopped working. i have uri: " content://com.android.providers.media.documents/document/image%3a13 ", file path image. the path uri chosen so: protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); if(resultcode == result_ok) { try { // bit here bitmap bitmap = getpath(data.getdata()); log.i("bitmap", "bmp: " + data.getdata()); }catch (exception e){ log.e("error", "error setting image."); e.printstacktrace(); } } } so, getpath() called, putting data in uri (uri correct, log shows that) in getpath() : private bitmap getpath(uri uri) { string[] projection = { mediastore.images.media.data }; cursor cursor = getcontentresolver().query(uri, projection, null, n...

I'm trying to Rename a File using Java But It is Not Working for Some Reason -

file oldfile = new file("c:\\newtext document.txt"); file newfile = new file("c:\\hello buddy.txt"); if (oldfile.renameto(newfile)) { system.out.println("rename succesful"); } else { system.out.println("rename failed"); } i'm planning on developing file normalizer, want done first. i've tried using absolute path, makes no difference. returning "rename failed". use move method of files class. worked me ;) java doc

ruby on rails - Devise invalid forgot password URL -

i have model user. , models cabase < user lauser < user both models has: devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable lauser- users have access admin area. cabase - users has access front-end. when click on forgot password on cabase login form, mails me link like: site_name/admin/password/edit?reset_password_token=gtwswqk8hh2-6p4chp but need to site_name/password/edit?reset_password_token=gtwswqk8hh2-6p4chp also have actions in applicationcontroller def after_sign_in_path_for(resource) if resource.is_a?(lauser) admin_root_path else dashboard_index_path end end def after_sending_reset_password_instructions_path_for(resource) if resource.is_a?(lauser) admin_root_path else dashboard_index_path end end what can it? upd1: get 'dashboard/index' activeadmin.routes(self) devise_for :la_users, activeadmin::devise.config devise_for :ca_base, pa...

angularjs - javascript does't convert angular ui datepicker date to UTC correctly -

Image
i'm using angular ui datepicker in project(asp.net web api + angularjs). works fine when i'm trying save date db doesn't convert utc format correctly , substructs 1 day(actually few hours affects day too). for example when choose 01/11/2014 in datepicker: angularjs object: sat nov 01 2014 00:00:00 gmt+0200 (fle standard time) in request: 2014-10-31t22:00:00.000z in asp.net api controller: {31-oct-14 10:00:00 pm} datepicker controller: app.controller('datepickerctrl', function ($scope) { $scope.today = function () { $scope.dt = new date(); }; $scope.today(); $scope.clear = function () { $scope.dt = null; }; $scope.open = function ($event) { $event.preventdefault(); $event.stoppropagation(); $scope.opened = true; }; $scope.format = 'dd/mm/yyyy'; $scope.dateoptions = { 'starting-day': 1 }; }); hnml: <div class="form-group inputgroupcontain...

OAuth2 Google Api java/eclipse -

Image
im new java pelase bare me.. im looking @ example: https://developers.google.com/admin-sdk/directory/v1/quickstart/quickstart-java but don't want use url copy/paste version auth iv'e read should use serviceaccount. i downloaded p12 key , placed in source folder. , im rebuilding google example code found on stackoverflow so here's how far get: public class directorycommandline { httptransport httptransport = new nethttptransport(); jacksonfactory jsonfactory = new jacksonfactory(); // build service account credential. googlecredential credential = new googlecredential.builder().settransport(httptransport) .setjsonfactory(jsonfactory) .setserviceaccountid("......82p@developer.gserviceaccount.com") .setserviceaccountscopes(directoryscopes.all()) .setserviceaccountprivatekeyfromp12file(new java.io.file("eclipsejava-d6675et3ab71.p12")) .build(); // create new authorized api client ...