Posts

Showing posts from 2010

Spring Data Rest (SDR) error: PersistentEntity must not be null -

i'm working expose spring data repositories via sdr. when navigate rest url ( http://localhost:8080/trxes ), error: {"cause":null,"message":"persistententity must not null!"} on closer inspection of spring data source, see getrepositoryfactoryinfofor() method returns empty repository information i.e. private repositoryfactoryinformation<object, serializable> getrepositoryfactoryinfofor(class<?> domainclass) { assert.notnull(domainclass, "domain class must not null!"); repositoryfactoryinformation<object, serializable> repositoryinfo = repositoryfactoryinfos.get(classutils .getuserclass(domainclass)); return repositoryinfo == null ? empty_repository_factory_info : repositoryinfo; } the probable reason problem persistent entities inherit single base class, , i'm using single table strategy follows: there trx table in database matching trx class. variableincome, variableexpense, fixedin

Php cant write to xml with 7000 Lines -

this question has answer here: php warning: unknown: input variables exceeded 1000 3 answers i have php script in can add text in fields. php script adds text in fields in 2 xml files. working good, if xml getting big (7000 lines xml), can't write anymore. i changed php.ini this max_execution_time = 300 max_input_time = 900 ;max_input_nesting_level = 64 ; maximum input variable nesting level memory_limit = 512m so problem caused php.ini or in php file. script work when delete piece of xml code. here php ini_set('default_charset', 'utf-8'); if(isset($_post['post']) && $_post['post']=='true') {$file1content = '<?xml version="1.0"?> <channels>'; for($j=0; $j < $_post['total1']; $j++) {if(isset($_post['checkbox1'.$j]) && $_post['checkbox

html - Provide link to open in different browser -

i have webapp running in browsers, i'm still trying work out few bugs preventing working correctly in ios facebook's in-app browser. until i've got these sorted, i'd provide message give users option open link in safari. the solution have use javascript detect browser's user agent ( similar question ), , if it's facebook in-app browser, provide message webapp optimised safari , give instructions copy , paste link safari. my question this: there way make <a> tag open in particular browser? have seen questions like one seem point using target="_system" cordova apps, there method html only? there isn't way safari (using html, anyway). other browsers have custom url schemes, it. example, chrome have link point googlechrome://www.website.com.

android studio - Phonegap (Cordova) - some basic questions -

it's been 3 years since i've last used phonegap. recently, wanted develop app android (in windows 8 os) , changed. have few specific questions, regarding phonegap. firstly, far understand, phonegap , cordova same? phonegap instance of cordova? if that's case, what's difference in command-line interface if use phonegap create ... or cordova create ... ? there additional features? secondly, since using cli, can in cmd. need eclipse or android studio? can emulate app cordova emulate android , build cordova build . reason why should use android studio can use console.log . there additional perks? thirdly, , speaking of android studio, when imported project in android studio, there no www folder... have imported porject incorrectly or suppose without www folder? if so, possible build application in android studio? or have rebuild after every change in cmd? thank answers! answer questions : phonegap built on apache cordova. on time, phonegap may co

sockets - Send or receive an notification through TCP in java -

here main method of client program write outputstream server , wait server send response. public static void main(string[] args) throws ioexception { scanner input = new scanner(system.in); inetaddress server_addr = inetaddress.getbyname(auctionserver_ip_address); socket client = new socket(server_addr, buyer_port); user = ""; outputstream out = client.getoutputstream(); inputstream in = client.getinputstream(); while (true) { string = input.nextline(); //read command user out.write(a.getbytes()); //send command server byte[] data = new byte[10000]; in.read(data, 0, 10000); //receive output } } the server program can accept multiple buyer @ same time , start each thread below the run() method each thread server create public void run() { try { outputstream out = this.socket.getoutputstream(); inputstream in = this.socket.getinputstream(); while

javascript - Autocomplete in google maps places throws error TypeError: undefined is not a function (evaluating 'a[zG]("placeholder")') -

i struggling more should. i creating simple search map feature, autocomplete throws me not-so-descriptive error: typeerror: undefined not function (evaluating 'azg') i initialising map in bootstrap modal on modal.s.shown event. here javascript: $('#map-modal').on('shown.bs.modal', function (e) { //picking data attributes image initialised modal var image = $(e.relatedtarget); map_lat = $(image).data('lat'); map_lng = $(image).data('lng'); //passing data initialise map function initialisemodalmap(map_lat,map_lng); //add autocomplete var input = $('#start-point'); var options = { types: ['geocode'] }; var autocomplete = new google.maps.places.autocomplete(input, options); autocomplete.bindto('bounds', map); google.maps.event.addlistener(autocomplete, 'place_changed', function() { console.log('changed'); }); }); but event sh

Array of Key->Value array -

i starting d language (d2) , trying following: string[int] slice1 = [ 0:"zero", 1:"one", 2:"two", 3:"three", 4:"four" ]; string[int] slice2 = [ 0:"zero", 1:"one", 2:"two"]; alias myslice = string[int]; myslice[] list; list[] =slice1; list[]=slice2; writeln(list); it compiles list stays empty. did miss? list[] = slice1; i guess you're expecting append slice1 list, in php. meaning in d is: "assign slice1 each of elements in list." list has no elements, nothing being changed. for appending, use ~= operator: list ~= slice1;

asp.net mvc 4 - Oauth with Box SDK (C# MVC .NET) -

i trying build login mvc web app, using box sdk .net. cannot life of me wrap head around oauth login process though. feel have down close, actual post action confusing me. here process trying follow: https://developers.box.com/oauth/ i'm getting stuck on "the first leg" part. i pass in uri , data attributes post intended var data = new list<keyvaluepair<string, string>> { new keyvaluepair<string, string>("response_type", "code"), new keyvaluepair<string, string>("client_id", client_id), new keyvaluepair<string, string>("box_login", account_email) }; httpresponsemessage values = await post("https://app.box.com/api/oauth2/authorize", data); with custom post() method wrapper: public static async task<httpresponsemessage> post(string uri, list<keyvaluepair<string, string>> pairs) { using (htt

ruby on rails - How do I create a seed file based on my development database? -

i want assemble data , settings of rails application offline , push production. ideal scenario if set application state offline locally , have exact same data , application code state in server in production. is there way automatically generate seed file based on data in current development database? there couple of gems provide you're looking e.g. seed_dump, https://github.com/rroblak/seed_dump . question may - create seed file data in database

ios - UIViewController - alloc and init vs. instantiate? -

what difference between following 2 ways of instantiating view controllers? myviewcontroller *vc = [[myviewcontroller alloc] init]; // present vc... vs. [[uistoryboard storyboardwithname:@"main" bundle:nil] instantiateviewcontrollerwithidentifier:@"myviewcontrollerscene"] it seems alloc init can magically identify proper scene in storyboard; how happen? invoking instantiateviewcontrollerwithidentifier: under hood? preferred way of instantiating view controller? first way result in memory leak or extraneous view controller instances? [[myobject alloc] init] creates new object. it's not retrieving object storyboard, allocating memory , instantiating it. instantiateviewcontrollerwithidentifier: creates new view controller (if identifier exists in storyboard) , configures according how view controller configured object in storyboard file. both cases create new instance each call. if have configured view controller in storyboard (for

java - How to go to the specified breakpoint in MyEclipse? -

in web project controller have 2 breakpoint called breakpointa,breakpointb .when debug project,if code running in breakpointb,how can return breakpointa? in visual studio can drag breakpointb breakpointa easily.but in myeclipse how that?do has shortcut keys? i don't think there way eclipse debug perspective has " drop frame " capability take start of method. standard eclipse functionality, not specific myeclipse.

java - How to keep JComponents always centered even after being shrunk? -

Image
objective i making jpanel 3 jcomponents on it: wide custom jcomponent, , 2 custom abstractbuttons in turn extends jcomponent. i'd organize jpanel 2 rows , 2 columns, wide jcomponent spanning 2 columns. there plenty of space around abstractbuttons. diagram drew of trying achieve: problem basically, when user clicks on 1 of abstractbuttons, shrinks. i'd them centered in cells when clicked upon. not case in code when used gridbaglayout however; buttons become off-centered , top-left hand corners stay wherever before. code this code below display (the red buttons shrink after being pressed): import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.border.*; public class example { public static void main(string[] args) { // instantiate components needed. jframe frame = new jframe(); jpanel panel = new jpanel(); frame.add(panel); button b1 = new button(); button b2 = new but

android - Using image in RadioButton instead of text -

Image
in android , want use radiobutton , not want check plain text. how can display in first image instead of second image? using radiogroup , radiobutton . nothing special do.. add drawable in this: <radiobutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:drawableleft="@drawable/ic_launcher"/> for effect this: radiobutton contains textview default.. can operations present textview . bonus : if want change circular dot shows check status, update android:button tag refer own drawable .

How do I find Google DEV-SCRIPT-ID and PUB-SCRIPT-ID -

some time ago user mogsdad posted answer describing how post data directly google spreadsheet in how post google docs form directly . in post (or within script, commented out) provides format test url follows: https://script.google.com/macros/s/--dev-script-id--/dev?col1=1&col2='pizza' https://script.google.com/macros/s/--pub-script-id--/exec?col1=1&col2='pizza' how find --dev-script-id-- or --pub-script-id-- ? and can confirm in script line var id = '--sheet-id---'; // spreadsheet id responses he means id displayed in spreadsheet url (typically) shown here as” xxxxxxxxx” https://docs.google.com/spreadsheets/d/ xxxxxxxxx /edit#gid=0 greatly appreciate can clear me.

function - Hide Cursor script doesn't work correctly in Unity 5 -

i've simple hide cursor script attached in "firstpersoncharacter" gameobject , doesn't work correctly. #pragma strict var blocked = false; function start () { blockcursor (false); } function blockcursor (blocked) { this.blocked = blocked; screen.lockcursor = blocked; cursor.visible = !blocked; } function update () { if (input.getkeydown("e")) { blockcursor(!blocked); } } this script works in unity 4.6, in unity 5 when press "e" cursor moves center , doesn't hide. what i'm doing bad? :( to lock cursor center it, have change blockcursor function to: function blockcursor (blocked) { this.blocked = blocked; cursor.visible = !blocked; cursor.lockstate = blocked ? cursorlockmode.locked : cursorlockmode.none; } this should solve problems.

mysql - Which unit is `distance` returning in this SQL query -

i'm messing latitude/longitude related code in google maps api provides me following sql statement select id, ( 3959 * acos( cos( radians(37) ) * cos( radians( lat ) ) * cos( radians( lng ) - radians(-122) ) + sin( radians(37) ) * sin( radians( lat ) ) ) ) distance marker having distance < 25 order distance limit 0 , 20; link google maps example here: https://developers.google.com/maps/articles/phpsqlsearch_v3 however distance returned on 7,000, while know of entries in database within 50 miles of each other. i've verified using http://www.movable-type.co.uk/scripts/latlong.html goes on haversine formula. so i'm curious i'm doing wrong provided query, returns: (image) http://gyazo.com/ece247747616c5a412edd40c82c4b0ce -- (failed upload image, format not accepted???). all points compared from long: 39.410870 lat: -107.102180 here's full query: select id,`user_long`,`user_lat`, ( 3959 * acos( cos( radians(39.410870) ) * cos( ra

Angularjs directive, call same directive from within itself -

i building generic angularjs directive support editing of json object. have json data , admin data have details original data. following code details using build generic directive. please refer plunker running code. http://plnkr.co/edit/x2lqhjyq48gwxw7oyyeq?p=preview directive code: app.directive("objecteditor", [function () { return { restrict: "e", templateurl: "objecteditor.html", replace: true, scope: { object: '=', objectadmin: '=' }, link: function (scope, element, attrs) { //method initialize scope.init = function () { }; //call init() initialze loading. scope.init(); } }; }]); directive template: <div> <h4 data-ng-bind-template="{{objectadmin.displayname}}"></h4>

iOS Swift: Find index for CKRecord in array -

i'm trying use find function index of ckrecord in array. i'm running problem don't understand. i have 2 arrays: notes , allnotes . notes subset of allnotes . have item notes , i'm trying find index within allnotes . can see output exists in both arrays, being found in notes array. func removenoteatindexpath(indexpath: nsindexpath) { let note = tableviewcontroller.notes[indexpath.row] if let index = find(allnotes, note) { println("found in allnotes") } else { println("not found in allnotes") } if let index = find(tableviewcontroller.notes, note) { println("found in notes") } else { println("not found in notes") } println(tableviewcontroller.notes[0]) println(allnotes[0]) } console output not found in allnotes found in notes <ckrecord: 0x7fb49ad37120; recordtype=note, recordid=e6bd60a1-ab15-4952-84a3-81bdb4dfc961:(_defaultzone:__defaultowner__

r - Binning longitude/latitude labeled data by census block ID -

i have 2 data sets, 1 crime in chicago, labeled longitude , latitude coords , shapefile of census blocks in chicago. possible in r aggregate crimes within census blocks, given these 2 files? purpose able map out crimes census block. location download of chicago census tract data: https://data.cityofchicago.org/facilities-geographic-boundaries/boundaries-census-blocks-2000/uktd-fzhd location download of crime data: https://data.cityofchicago.org/public-safety/crimes-2001-to-present/ijzp-q8t2 some code have pruned down project. when through there spatial object census tract information , dataframe containing crime data, including lon/lat coords: library(rgdal) library(dplyr) #helper function reduce crime data single year , limit variables of interest yearreduce <- function(rawdata=null,year=null) { datout <- data.frame(year = numeric(0), community = numeric(0), type = numeric(0), arrest = numeric(0), latitude = numeric(0), longitud

ios - Finding the current Accelerometer values -

i'm trying label rotate based on tit of device in app i'm making in swift. given should fine rotating label, know how find current accelerometer values of iphone? example, getting print x, y , z values once every second or so. thanks in advance. sample code: add framework add following code in appropriate places import coremotion var motionmanager = cmmotionmanager() var accelx: cgfloat = 0 // setup accelemeter detection if motionmanager.accelerometeravailable == true { motionmanager.startaccelerometerupdatestoqueue(nsoperationqueue(), withhandler: { (data, error) -> void in self.outputaccelertiondata(data.acceleration) }) } func outputaccelertiondata (acceleration: cmacceleration) { accelx = 0 if fabs(cgfloat(acceleration.x)) > fabs(accelx) { accelx = cgfloat(acceleration.x) } }

php - Mysql Unable to make a query -

i trying put data in mysql table using php. i'm retrieving data variable database. let is: $data = "some variable"; but problem in place of some variable have data this $data = $row['some data']; i don't know fetching may time may hyper links may time may junk data. problem arises when try put data mysql table. i tried echo out query suppose query $query = "insert table values(0, '$data')"; the output was: insert table values(0,'donatted book:'25 ways improve life'); here there upper quotation after donated book. can't change because data comes on here database. how make insert command work. here how code working <?php $query = "select*from table id=$content_id"; $data = mysqli_query($dbc, $query); $row = mysqli_fetch_array($data); $data = $row['col']; $query2 = "insert table values(0, $data)"; mysqli_query($query2); ?> since using

python - I can't make my elif statement work after using input -

so i'm making quick text based application , made guess @ doing this. want program accept input user , create different outcomes when user inputs direction. going if no matter type. took shot in dark , code. print ("would go left or right?") input() if ("left"): print ("welcome cleanliness room *squeak!*.") print ("would go forward,or backwards?") elif ("right"): print ("inhale dong enragement child.") print ("game over") input() returns result, ignored , nothing happened it. if ("left"): asks if string "left" not empty. indeed not empty. store return value of input() in new variable, test variable equality == : print ("would go left or right?") answer = input() if answer == "left": print("welcome cleanliness room *squeak!*.") print("would go forward,or backwards?") elif answer == "right": pri

mongodb - Specify Return Format -

is there way in mongo me specify format of how want data returned? i able return items array if possible. lets @ basic example: { color: red }, { color: white }, { color: blue } so example above documents array: { colors: [red, white, blue] } is there way specify how return items? know can specify columns get, have loop through them build array. hoping mongodb has built in, can faster node, php, java, etc. use aggregation framework . aggregation pipeline have $group operation $addtoset operator adds values array. instance, collection has sample documents: /* 1 */ { "_id" : objectid("553c0101dddf8dcf96bdcdea"), "color" : "red" } /* 2 */ { "_id" : objectid("553c0101dddf8dcf96bdcdeb"), "color" : "white" } /* 3 */ { "_id" : objectid("553c0101dddf8dcf96bdcdec"), "color" : "blue" } the following aggregat

speech synthesis - Can't Chrome's speechSynthesis work offline? -

i playing chrome's speechsynthesis msg = new speechsynthesisutterance("some text"); msg.lang = "fr-fr" ; window.speechsynthesis.speak(msg); when discovered strange issue : can't speak anymore if device offline. searched web did not find explanation. can't work offline ? (if know reason why needs online, please tell me in comments.) speech synthesis voices either local on device or come remote speech synthesizer services. if voice remote service, browser able use if online , can connect it. you don't environment on, google français voice used fr-fr on windows , os x remote service, doesn't work offline. you can check voices available on device calling speechsynthesis.getvoices() , checking localservice property each voice.

itunesconnect - deleting rejected app without deleting current version -

itunes rejected new version of app. when click delete rejected version warning: "the app deleted itunes connect , won’t able use app name or sku again." how delete rejected version without deleting current version? i guess want re-upload new binary review since rejected, right? you not have that. in xcode, upload new binary , submit 1 review. go. hope helps :)

javascript - Gray Area On Google Map Canvas with error "Uncaught TypeError: Cannot set property 'position' of undefined" -

am getting weird problem working google maps; when initialize map, gray area in map canvas , error message uncaught typeerror: cannot set property 'position' of undefined here code $(window).on("load", function () { var c = 'jumbo-map'; function respondcanvas(canvas) { $(canvas).attr('width', $(canvas).parent().width()); $(canvas).attr('height', $(canvas).parent().prev().height()); initialize_map(canvas); } function initialize_map(canvas) { var map = new google.maps.map(canvas, { center: new google.maps.latlng(2.778304, 32.301328), streetviewcontrol: false, maptypecontrol: true, pancontrol: true, zoomcontrol: true, zoom: 17 }); } respondcanvas(document.getelementbyid(c)); }); i've seen these without luck: google maps request returning "cannot set property 'position' of u

Access IIf statement using same-query value as determinant -

i'm trying create query in access yes/no determined greater than/less relationship of 2 other values in same query. example, if currentstock < maxhold, yes/no should equal false. if equal, should true. this current effort, taken query design: stocked: iif([current stock] (is greater than) [max_hold],false,true). this different related questions in others detail inverse, i.e. how use yes/no determine value. issue i'm not sure how use input value of "currentstock" determinant yes/no, however. or directly: stocked: [current stock]>[max_hold] or, if prefer: stocked: cbool([current stock]>[max_hold])

git - How should I add new files when I already have multiple branches -

we have started using git , has worked out well, hits bumps don't know how best solve. right have multiple branches. master, develop , lots of feature branches (one or more per developer). now want add directory script-files, , these files needed developers (immediately). how should best perform this? thinking maybe adding new branch (from develop), add files there , let else merge it? or there better, cleaner, more git'ish way this? just add central branch (normally dev or develop ) , ask git merge or git rebase it, meant doing regularly anyway.

c# - Handle control events differently depending on the state of the system -

Image
i have trying build simulator of ingenico pos terminal (iwl220). main screen have combo-box. once user enter id , password combo-box load 6 menus. if user click btn1 combo-box clear menu , add set of menu. if user click btn1 new loaded menu again combo-box cleared , load set of menu on. my problem each button click (btn1, btn2, btn3, btn4, btn5) have code lot of if else statement. example; first menu (on combo-box) has 6 sector. 1.sectora 2.sectorb 3.sectorc 4.sectord 5.sectore 6.sectorf if user choose 1.sectora user click btn1. btn1 clear combo-box , loads set of menu. time menu (on combo-box) has 3 companies. 1.companya 2.companyb 3.companyc this time user choose 1.companya user click again btn1. btn1 clear combo-box , loads set of menu. time menu (on combo-box) has 2 payment option. 1.fullpayment 2.paritalpayment now time if user click btn1 or btn2 combo-box visible become false , in main screen there label , text box. text box allows user enter su

python - Ball-Line Segment Collision on End-Point of Line -

so have program ball subject gravity bounces off of lines created user mouse clicks. these lines sloped. collision bounces work except in case ball approximately this: ->o ------ my code works finding normal vector of line such scalar product of incident velocity vec of ball , normal of line negative (this means vector have opposite directions). decompose velocity terms parallel , perpendicular normal, , reverse direction of parallel component. during edge case described above ball moves along line. how can account this? advice?> possible solutions: instead of using single 1d 'line', construct 2d rectangle (that want/need be) --- composed of 4 separate 'lines'. i.e. can have collisions of 4 faces of rectangle object. work? do sort of corner collision -- if ball 'hits' start or end of line, have bounce off appropriately. think way done follows: i. collision occurs if corner falls within radius of ball. ii. define line between

permutation - Is there an efficient way of generating numbers with repeated digits in Python? -

i trying generate 5 digit numbers out of {1,2,3,4,5,6,7,8,9} such digit can repeated @ twice. is, numbers 12345, 11267, 11226 allowed 11134 or 11115 not allowed. i can write code multiple loops perhaps, wondering if there shorter, more elegant methods available. example, itertools.product('123456789', repeat=5) generate such 5 tuples ( 9^5 in total) or itertools.permutations(''123456789',5) generate 5 tuples no repetitions ( 9x8x7x6x5 in total). wondering there way use these tools generate numbers of form 11235 , 11224 nothing else without going through multiple loops , like. unless i've misunderstood question, using itertools.permutations('112233445566778899',5) should trick. edit: included repeats, since had 2 of each digit. wrapping in set seems solve that: set(itertools.permutations('112233445566778899',5))

c# mysql AddWithValue unicode -

i'm working c# , mysql now. i've tried search around internet day find out why can't use addwithvalue method add unicode characters because when manually add in mysql, works! in c# code mysql connector .net doesn't work. other unicode characters fine. cmd.commandtext = "insert tb_osm values (@id, @timestamp, @user)"; cmd.parameters.addwithvalue("@id", osmobj.id); cmd.parameters.addwithvalue("@timestamp", osmobj.timestamp); cmd.parameters.addwithvalue("@user", osmobj.user); cmd.executenonquery(); for example: osmbj.user = "ສະບາຍດີ", "???????" in database. please t^t does link you? read/write unicode data in mysql basically says, should append connection string chatset=utf8; like so: id=my_user;password=my_password;database=some_db123;charset=utf8;

Spark distributed matrix multiply and pseudo-inverse calculating -

i new in apache spark scala. can me operations? i have 2 distributed matrix h , y in spark scala. i want compute pseudo-inverse of h , multiply h , y. how can this? here implementation inverse. import org.apache.spark.mllib.linalg.{vectors,vector,matrix,singularvaluedecomposition,densematrix,densevector} import org.apache.spark.mllib.linalg.distributed.rowmatrix def computeinverse(x: rowmatrix): densematrix = { val ncoef = x.numcols.toint val svd = x.computesvd(ncoef, computeu = true) if (svd.s.size < ncoef) { sys.error(s"rowmatrix.computeinverse called on singular matrix.") } // create inv diagonal matrix s val invs = densematrix.diag(new densevector(svd.s.toarray.map(x => math.pow(x,-1)))) // u cannot rowmatrix val u = new densematrix(svd.u.numrows().toint,svd.u.numcols().toint,svd.u.rows.collect.flatmap(x => x.toarray)) // if make v distributed, may better. alreadly local...so maybe fine. val v = svd.v // inv(x

c++ - Logical operations in OpenCV from Java -

in opencv's c++ api, 1 can elementwise boolean operations (and, or, xor, not) using syntax this: mat a, b; mat c = & b; and others. know there no operator overloading in java; i'm looking how java api exposes same functionality exposed in c++ in form. i've found core.bitwise_* functions already, per bit, not per matrix element. this operator overloading. in java operator overloading not supported. if require can introduce method this. for example - mat a, b; mat c; c = mat.dooperation(a, b); where dooperation() static method in mat - public static dooperation(mat a, mat b){ //do whatever want }

ruby on rails - NoMethodError: undefined method reset_sent_at hartle tutorial -

i'm doing chapter 10 of enter link description here . got same error mentioned in enter link description here passwordresetstest#test_password_resets: nomethoderror: undefined method `reset_sent_at=' #<user:0xccd47c0> app/models/user.rb:66:in `create_reset_digest' app/controllers/password_resets_controller.rb:12:in `create' test/integration/password_resets_test.rb:17:in `block in <class:passwordresetstest>' i try mentioned in answer. first thing did was: rails generate migration add_reset_to_users reset_digest:string reset_sent_at:datetime and answer was: another migration named add_reset_to_users: so i'm sure did migration before. _add_reset_to_users.rb file in migrate folder. class addresettousers < activerecord::migration def change add_column :users, :reset_digest, :string end end then try restart rails server.(i'm not sure if i'm doing right) using rails server and shutting down server.

Android default photo gallery events -

is there way listen photo gallery events via background service open selected photo in activity. share photo mechanism seems. there hundreds, perhaps thousands, of "photo gallery" applications. none should letting third party apps know image(s) user looking at, except @ user request, such via sort of "share" option. app did disclose information has privacy flaw need fixed. if feel share option insufficient, can write own photo gallery app , take actions user browses photos within own gallery.

vb.net - How can I display the contents windows Form in a DotNetBar SuperTabControl tab page? -

i've been working dotnetbar objects , controls redesign web browser's ui , functionality in vb.net. (i've been using visual studio 2012 in case that's pertinent or helpful.) wanted use supertabcontrol tab control because allows placement of buttons inside tab bar new tab buttons found in major web browsers such google chrome, mozilla firefox, internet explorer , many others. went code button create new supertabitem , not difficult; supertabcontrol1.tabs.add(new supertabitem) the problem have trying create new supertabitem contains same content windows form in project. i've been abel normal windows tabcontrol , dotnetbar tabcontrol supertabcontrol not render objects in supertabcontrolpanel. code i've been trying use; dim t baseitem = supertabcontrol1.createtab("new tab") dim panel supertabcontrolpanel = directcast(t.containercontrol, supertabcontrolpanel) dim newtab new tab newtab.show() newtab.toplevel = false

asp.net mvc - MVC 5.0 <Format Exception> -

in mvc application "twentyfifth", model : public class student { public string studentname { get; set; } public int studentid { get; set; } public string fathername { get; set; } } a method support-class in same project : public void editsupport(int id, student std2) { sqlconnection con = new sqlconnection("data source=my;initial catalog=db;integrated security=true"); sqlcommand com = new sqlcommand("update studentt set studentname='"+ std2.studentname + "', fathername='" + std2.fathername + "' studentid=" + id + "", con); con.open(); com.executenonquery(); } and finally, controller goes : [httppost] [actionname("edit")] public actionresult edit_post(int id, formcollection formcollector) { student std = new student(); std.studentid =

c# - MVC5 - How to validate compound checks? -

i working on mvc razor project needs more complex input validations. using viewmodels remove access data model controller without going through logic layer. need solve how following types of validations: user selected date after date value: // read user public datetime startdate { get; set; } // must after startdate public datetime occurredat { get; set; } sum of user inputs n (variable) fields not exceed value of field. // read user public double startingamount { get; set; } // sum of these fields must less starting amount public double amounttransfered { get; set; } public double amountlosses { get; set; } public double amountsampled { get; set; } // validation check if (startingamount - (amounttransfered + amountlosses + amountsampled) > 0) isvalid = true; i new mvc, , validation things find on google 2010 , loaded javascript custom implementations. i hoping there newer mechanisms perform compound validation using attributes define fields related. suspect solut

html - How to save ONLY the CSS changes of Styles panel of Chrome Developer Tools? -

i've read interesting question here need different.. save patch file modified values of css. for example if page contains 2000 lines of css , modify 1 line want extract modified line.

c# - Sharepoint CAML query to select all items that user have shared with it -

i secure sharepoint list using share with, done sharepoint event receiver share current added item people interact item. works well, when use caml query in service, brings items. think happens because iis runs spprod_admin account has privileges see items. how can select items shared specific user using caml query ?

c - Code obfuscation do not understand -

i encountered following code #include <stdio.h> int main(void) { long long p = 1,e = 2,t = 5,a = 61,l = 251,n = 3659,r = 271173410,g = 1479296389, x[] = { g * r * e * e * t , p * l * * n * e * t }; puts((char*)x); return 0; } the case not quite understand how works,it confusing me. can please explain in detail? edit: 1 more thing, how print "hola mundo!" ("hello world" in spanish) analogically? oh, 1 fun. declare many long long variables, , 1 long long array of 2 cells. array therefore made of 16 bytes. given each byte 1 ascii character, array represents 16 characters (while last 1 zero). can see that: g * r * e * e * t = 1479296389 * 271173410 * 2 *2 * 5 = 8022916924116329800 = 0x6f57206f6c6c6548 p * l * * n * e * t = 1 * 251 * 61 * 3659 * 2 * 5 = 560229490 = 0x21646c72 given processor little endian , array's in-memory representation is: 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 00 00 00 00 which he

testing - any way to test my programs on other windows versions [without VB] -

ok created programs , , instead of sharing them receiving replies it's not working, i'd prefer test them first ! said it's gonna useful if doesn't require installing on computer virtualbox... perhaps online . , did researches on stackover , didn't find results , last post talking same problem closed "too broad" , appreciate efforts , , thank reading this, i'll more thankful if don't close or downvote no reason :d

How can we hide ActionBar Tabs in Android? -

Image
i'm developing app in i've used tabs swipes enabled, , wanted know can hide actionbar tabs in layout? want hide tab 0 title, tab 1 title, tab 2 title, etc...is possible? gladly appreciated, thanks! instead of using tabs, should using viewpager . can find google's example here

java - How to deploy my RESTful application to Apache server? -

i built java restful application in eclipse jersey , couple other libraries. question is, how deploy tomcat server? export war file? need deploy libraries used or packaged in war file? server running on ubuntu machine can access on ssh. got server running "apt-get install tomcat7". folder should put in? configuration needed? should web.xml file? in advance. you wouldn't use apache directly serve jersey web application apache not java application server. served java server such tomcat instead. if wish serve jersey application if located on apache server, still have tomcat server running , set reverse proxy tomcat server . use server such wildfly or tomee implements full javaee profile , means less run errors. java application servers have capability of serving static content unless need apache features, not need go trouble of running apache. with each 1 of these servers need .war file , deploy it, either through appropriate maven plugin, web manager or pl

c# - OnClick not firing in UserControl when button is clicked -

i have master page. in master page have usercontrol footer. in footer have button not firing onclick. during debugging see function being called onclick, btnsignup_click, not getting hit. can't seem figure out mistake in code is. wanted note validation functionality working correctly. master.master <%@ master language="c#" autoeventwireup="true" inherits="master" codebehind="master.master.cs" %> <%@ register tagprefix="xyz" tagname="footer" src="~/controls/footer.ascx" %> <xyz:footer id="footer" runat="server" /> footer.ascx <%@ control language="c#" autoeventwireup="true" inherits="footer" codebehind="footer.ascx.cs" %> <div> <asp:textbox id="fname" runat="server"></asp:textbox> <asp:requiredfieldvalidator id="requiredfieldvalidatorfname" validati

tomcat - Getting a blank file when accessing JIRA on SSL -

i'm stuck on ssl problem jira. i've followed instructions setup jira+ssl on ubuntu getting blank file when accessing http://domain.com:8443/ in blank file can see these 1503 0300 0202 0a i'm not sure can catalina logs don't report problems. how add ssl certificate secure jira installation: assumptions: jira running on port 8080 or other open port, on linux machine jira using tomcat server , indepedent apache http server you have valid ca signed root certificate , certificate chain, after generating csr , key. no reverse proxy setting enabled in apache http server configuration you see little bit similar configuration in /conf/server.xml <service name="catalina"> <!-- http connector values scheme, proxyname , proxyport --> <connector port="8080" acceptcount="100" scheme="http" maxthreads="150" minsparethr