Posts

Showing posts from August, 2013

animation - wpf usercontrol states, modifying height -

i little bit confused of states , animations in wpf. i make usercontrol. usercontrol contains (inside main grid) 2 grid. 1 of them header , second 1 content. if user click on header, content expand, otherwise collapsed. , animation expanding (slide down content header). basicaly states (for future purpose). problem is, if add states , using slide efect transformation, content of grid (content grid) transformed well. use states modifying height of element. if u modify element, no animation appear , change height @ once. the hierarchy looks like: --- wrapper grid ------ header grid --------- content of header ------ content grid --------- content of content grid (like buttons, labels, etc) the visualstates looks like: <visualstatemanager.visualstategroups> <visualstategroup x:name="visualstategroup"> <visualstategroup.transitions> <visualtransition generatedduration="0:0:1"/>

html5 - remove arrow in chrome for input with attribute "list" -

Image
i have code: <input list="browsers"> <datalist id="browsers"> <option value="internet explorer"> <option value="firefox"> <option value="google chrome"> <option value="opera"> <option value="safari"> </datalist> in chrome little black down arrow in right corner is there way remove or hide that? jsfiddle update: i know can wrap it, , close psuedo-element show in jsfiddle but need solution that, there other way? the following work: input::-webkit-calendar-picker-indicator { display: none; } jsfiddle here

how to use relative import within python spyder IDE -

i got anaconda python , using spyder ide. i'm trying figure out how can use relative import run bottom or f5. suppose have pkg/a/foo1.py, pkg/a/foo2/py, , foo1.py has "from . import foo2", if hit run report relative import error. i know how in command line environment can type, e.g. "python -m pkg.a.foo1". how can in spyder ide? thanks jq if there pkg/a/__init__.py file i.e., if pkg.a python package from . import foo2 correct. doesn't matter write code in spyder ide, notepad, or emacs; code same. the remaining question how run python scripts in spyder ide. don’t directly run modules inside packages i.e., don't run python pkg/a/foo1.py . leads python modules being available under different names. see traps unwary . run python -m pkg.a.foo1 project directory instead. configure command run on f5 if spyder ide allows it.

php - Installing Tomcat along with WAMP -

i have been using wamp develop websites long time. have .jar file want include in website , use it's functions. did reading , ended php/java bridge. problem requires tomcat. as i've mentioned, i'm using wamp , of web files there (this wamp i'm using: http://www.wampserver.com/en/ ). according php/java bridge have install tomcat tomcat apache server conflicts wamp( http://php-java-bridge.sourceforge.net/doc/tomcat6.php ). is there way can install tomcat , make work current wamp? can use kind of connector?

listener - Android - basic gesture detection in TableLayout -

i new android development, please excuse naivety of post. have table layout in dynamically adding text view each cell. wish add swipe detection on cells , perform action on basis of cell swiped. tried adding onswipetouchlistener on each of cell. textview txtviewcell = new textview(getactivity()); tablerow.layoutparams paramsexample = new tablerow.layoutparams(60, 60); txtviewcell.setbackgroundcolor(0xfffaf8ef); txtviewcell.setgravity(gravity.center); paramsexample.setmargins(5, 5, 5, 5); txtviewcell.setlayoutparams(paramsexample); final int currrow = i; final int currcol = j; txtviewcell.setontouchlistener(new onswipetouchlistener( getactivity()) { public void onswipetop() { handleswipe(currrow, currcol); } public void onswiperight() { handleswipe(currrow, currcol); } public void onswipeleft() { handleswipe(currrow, currcol); } public void onswipebottom() { handleswipe(currrow, currcol); } public bool

angularjs - How to get ensureLoggedIn working with routeProvider -

i'm working on node.js application, using angular.js, passport , connect-ensure-login. only on refresh (f5), redirect in ensureloggedin seem work , login page, otherwise think routeprovider one-page app takes on normal click , localhost:3000/users still 500 error '/api/users'. how can connect-ensure-login (ensureloggedin) working both direct path , click-through? app.get('/users', ensureloggedin('/login')) for apis, i'm using app.get('/api/users', passport.authenticate('bearer'), ... routeprovider snippet application: .config(function($routeprovider, $locationprovider) { $routeprovider .when('/', { templateurl: 'views/home.html' }) ... references: https://www.npmjs.org/package/connect-ensure-login http://passportjs.org/ you may want go solving issue making use of $httpprovider.interceptors . in case catch 500 error co

listview - Delete a list view Row Titanium -

i want delete row in list view. when user clicks row want open dialog showing message 'sure want delete'. when user clicks ok row should deleted. listview.addeventlistener('itemclick', function(e){ var section = e.section; var itenindex = e.itemindex; var dialog = ti.ui.createalertdialog({ title : 'do want delete row?', buttonnames : ['yes','no'] }); dialog.addeventlistener('click', function(e){ if(e.index == 0){ section.deleteitemsat(itenindex,1); } }); dialog.show(); });

How to send multiple emails from sql server database using sp_send_dbmail procedure -

i have procedure results data table contains 3 columns emails,proposal_type,count(matchestoemail) matches based on proposal_type. have send notification mails 'emails' stating have these many number of matches based on proposal_type. procedure output data this. emails prop_type matches abc@gmail.com 1 3 abc@gmail.com 2 4 def@gmail.com 3 2 i want mails recipient , remaining 2 columns in body of email additional text. plz me. thanks edited this should work create proc [dbo].[sendproposalreport] declare rscursor cursor read_only select emails, prop_type, count(matches) matches proposals group emails, prop_type declare @emails nvarchar (100) declare @prop_type int declare @maches int open rscursor fetch next rscursor @emails,@prop_type,@maches while @@fetch_status=0 begin exec msdb.dbo.sp_send_dbmail @recipients = @emails,

android - Cannot get acces to file in google drive (Id must be provided) -

i making code based on android google drive demo. think i've copied setings propeerly can create files , folder , make queries; when tring doenload file recieve error saing id must provided. how code works: @ firs making query id's of files name interested. , following: 04-21 11:36:51.374: d/folder id(6468): driveid:caeshdbcdzhlowswmlprblvnrxn4vud0nk5iqxphrmsyhgggmnuw1qxr 04-21 11:36:51.374: d/folder name(6468): gdgatheredtext.txt 04-21 11:36:51.374: d/folder id(6468): driveid:caeshdbcdzhlowswmlprblvkamr1vfhwngntcg9nbgsy_gcgmnuw1qxr 04-21 11:36:51.374: d/folder name(6468): gdgatheredtext.txt 04-21 11:36:51.374: d/folder id(6468): driveid:caeshdbcdzhlowswmlprblvlwe5swm10t1rxwxhzaley9acgmnuw1qxr 04-21 11:36:51.374: d/folder name(6468): gdgatheredtext.txt i take id of last file caeshdbcdzhlowswmlprblvlwe5swm10t1rxwxhzaley9acgmnuw1qxr , pass uumodefied code apidemo. error fierd @ line drivefile file = drive.driveapi.getfile(getgoogleapiclient(), par

node.js - Including concatenated scripts asynchronously with gulp.js -

i'm trying following: gulp.src('js/*.js') .pipe(concat('_temp.js')) .pipe(gulp.dest('js/')); gulp.src('build/js/app.js') .pipe(replace('// includes', fs.readfilesync('js/_temp.js'))) .pipe(uglify()) .pipe(rename('app.min.js')) .pipe(gulp.dest('build/js')); so, i'm concatenating .js files in js/ . concatenated file named _temp.js ; after that, i'm reading app.js , try replace // includes string concatenated _temp.js file. doesn't work node says file doesn't exist. exist though, second time run task, works. this has asynchronisity, i'm unable see how differently? you can split task 2 , make 1 of tasks run after using gulp's dependency resolution system. gulp.task('task1', function () { ... }); gulp.task('task2', ['task1'], function () { ... });

mySQL Ranks Ties To Next Higher Number -

rank ties works correctly except first record missing, no matter how it's fetched. trying rank low high. select x.*, count(*) myrank mytablename x join mytablename y on x.number > y.number group id order myrank pleased say, after long battle, the following revision works intended! select x.*, count(y.id)+1 myrank mytablename x left join mytablename y on (x.number > y.number) group x.id order myrank result: id # rank -50 1 b -40 2 c -40 2 d -30 4 e -30 4 adding "=" to... on x.number >= y.number ...gets ranking ties right, except tied records rank next higher number. id # rank -50 1 b -40 3 c -40 3 d -30 5 e -30 5 ranking high-to-low on x.number <= y.number same thing. here's version without self-join rather using variables. it's faster: select id, points, rank ( select t.*, @rownum := @rownum + 1, @rank := if(@prev_points = points, @rank, @rownum) rank, @prev_points := points test t

regex - Regular Expression to remove all numbers and all dots -

i have code in vb.net : messagebox.show(regex.replace("example 4.12.0.12", "\d", "")) it removes/extracts numbers i want remove dots so tried messagebox.show(regex.replace("example 4.12.0.12", "\d\.", "")) but keeps numbers. how remove both (numbers & dots) string ? thanks. try using character group: messagebox.show(regex.replace("example 4.12.0.12", "[\d\.]", "")) i'll elaborate since inadvertently posted same answer steven. given input "example 4.12.0.12" "\d" matches digits, replacement gives "example ..." "\d\." matches digit followed dot, replacement gives "example 112" "[\d.]" matches digit or dot. steven said, it's not necessary escape dot inside character group.

php - How to get the Last data from Database using Laravel -

i trying column of last data in database far, getting data in database in array. this code; public function newid(){ $adminid=auth::user()->admin_id;//cooperative id $newid = member::select('member_id')->where('admin_id', '=',$adminid)->get(); return view::make('admin.member.addmember') ->with('newid', $newid); } i have updated code base on suggestions; public function newid(){ $adminid=auth::user()->admin_id;//cooperative id $newid = member::select('member_id')->where('admin_id', '=',$adminid)->orderby('id', 'desc')->first(); return view::make('admin.member.addmember') ->with('newid', $newid); } and using for loop display data on view @foreach ($newid $newids) {{$newids->member_id}} @endforeach my error errorexception:trying property of non-object answer i got work i u

python - str object not callable when converting int variable to using str function -

i'm sorry if asked have been sifting through past questions , cannot seem find answer. new @ python too. what trying write word , r , c variable output file formatted space between word , variable (the format being longest word of list - word looking at). i have tried this, yet comes "str object not callable" row_variable = str(r) here traceback when tried it: traceback (most recent call last): file "c:\cs303e\wordsearch.py", line 106, in <module> main () file "c:\cs303e\wordsearch.py", line 84, in main output.write(list_of_words[i]+spaces+str(row_variable)+str(column_variable)) typeerror: 'str' object not callable here code: # find longest word in list of words max_length = 0 in list_of_words: if len(i) > max_length: max_length = len(i) # open output file found.txt output = open('found.txt','w') # check list of words in range(len(list_of_words)): flag = false j in range(len(rows)):

c# - How to bind an ObservableCollection to an sql table? -

i want bind observablecollection sql table, thought of adding event handlers collection , keeping track of event types handle sql delete , insert operations such as someobservablecollection.collectionchanged += (s, e) => { if (e.action == system.collections.specialized.notifycollectionchangedaction.add) { //generate sql insert command e.newitems using reflection } if (e.action == system.collections.specialized.notifycollectionchangedaction.remove) { //generate sql delete command e.olditems } }; and updates have add event handlers selected object in viewmodel my question on right track , has been done before or have scratch? here solution first crated 2 simple attributes sqlcolumn holds sql column name , if primarykey , column type [attributeusage(attributetargets

javascript - Can't remove hashtag from url after click event -

i tried every solution found website , other no success. doing rotating button using css3 animation. doing having button linked(using "a" element) , enabling animation using pseudo element :target(almost equal onclick event works in case). my problem when click button @ first time hash-tag(#btnq1 in case) being added url. now, actual problem, cannot remove hash-tag when reload whole page or if want click button 1 more time , re-run animation. tried solutions stackoverflow questions this or this didn't got result. see below code: you can ignore initial phase of animation named q1. html code: <header> <div id="title"> title </div> </header> <main> not important text <div id="q1"> <div class="q1once"> <a href="#btnq1"><button type="button" name="" value="" id="btnq1">click rotate</button></a> </div> </div

html - Bootstrap inline form's submit button not in the same line -

Image
i tried use bootstrap's inline form oddly submit button can't put on same line other input items. had been searching solutions didn't find 1 yet. here html code: <form class="form-inline" role="form" method="post" action=""> <div class="form-group"> <input type="text" class="input-small" id="startdate" placeholder="start date" name="startdate"> </div> <div class="form-group"> <input type="text" class="input-small" id="enddate" placeholder="end date" name="enddate"> </div> <div class="form-group"> <input type="text" class="input-small"" id="number" placeholder="number" name="number"> </div> <div class="form-group"> status: <select class="selectpic

Tizen SDK installation - the installmanager.conf or Package file cannot be saved -

trying install tizen sdk on mac os x mavericks thru package server , thru sdk image (zip). in both instances gives error "the installmanager.conf or package file cannot saved" error towards end. tried doing 'chown -r $user ~/tmp' , 'sudo chown -r $user ~/tmp' did not work. is there work around or doing wrong?thanks guess, found solution: if installation folder not have permission throws weird errors. install sdk on folder has full permissions user.

is Sharepoint and AnalysisServices required in BI Semantic Model? -

im new reportmodels. i'm planning test on our new ssrs2012 , found out microsoft depreciated feature. furthur reading, replaced bi semantic model. long story short, can seem confirm if need setup sharepoint work. 1.) shareportservices required bism work? 2.) need analysis services bism work too? thanks perhaps this white paper you. bism refers couple of related technologies/tools, answers questions not simple yes/no. usual, depends... bi semantic models can in form of individual power pivot models inside of excel, shared in same manner share excel file. can refer power pivot models inside of sharepoint. or can refer ssas tabular model, can consumed power view inside of sharepoint or power view in excel (or base excel, or matter ssrs). so if using power pivot in sharepoint or using power view in sharepoint, need sharepoint services. if going use ssas tabular, need ssas. if using power pivot in sharepoint, need install ssas power pivot , configure power

machine learning - valid kernel functions for SVM -

i implementing svm following kernel functions: assume , b scalars: k(a,b) = (a-b)^4 k(a,b) = alpha * ab, alpha >=0 k(a,b) = (ab+1)^4 are these valid kernels? thanks help! :) 2 , 3 specific polyonmial kernels k(a,b)=(alpha*<a,b>+c)^p while first 1 not valid scalar product k(a,a)=0 imply each x , phi(x)=0 , imply a,b,c,d , k(a,b)=k(c,d) (in other words, kernel constant , not true, contradiction).

python - adding QProgress bar within QLineEdit in PyQt or PySide -

hi want add qprogressbar behind qlineedit, in safari browser or ie, here starting point how can hook progressbar , mylineedit when user done entering path progress bar should show progress while path opened !!! from pyqt4 import qtgui, qtcore import sys class progressbar(qtgui.qprogressbar): """ docstring progressbar """ def __init__(self, parent=none): super(progressbar, self).__init__(parent) self.timer = qtcore.qbasictimer() self.step = 0 self.doaction() def timerevent(self, e): if self.step >= 100: self.timer.stop() return self.step = self.step + 15 self.setvalue(self.step) def doaction(self): if self.timer.isactive(): self.timer.stop() else: self.timer.start(100, self) class mylineedit(qtgui.qlineedit): """ docstring mylineedit """ def __init__(self, pa

android - Removing ActionBar (Tittle) splash screen with icon -

just started developing action bar. having problem. have customized action bar wanted ( sort of, still cant position buttons on left :)). have removed icons, button, tittle action bar. problem is, when i'm launching application tittle bar (with icon , tittle) flashes second, before customized action bar appear... how can stop splash? i have saw answers include removing tittlebar android theme, because tittlebar , actionbar same thing, removing tittlebar causes actionbar dissapear. if want remove actionbar in 1 activity in particular, best way deal use theme. in androidmanifest, declare application theme of app, , can declare activity 1 theme in particular : <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme"> <activity android:name="splashactivity" android:theme="@style/appthemenotitle" android:label=&

php - Get XML code count using XMLReader -

i trying parse product feed provided google merchant. thing want more interactive using function convert xml array , show percentage user how products updated. have read xmlreader more efficient other parsing techniques. how can make xmlreader more effective. can number of nodes using xmlreader. or how can iterate on xml can more responsive. converting xml array wrong idea. mean build data structure in memory. have data structure, converting array mean loose data , features. read xml directly , use it. here several ways archive want. if feed small can use dom directly. allows use xpaths count() function. the google product-feed bases on rss 2.0 or atom 1.0. atom better format let's use that. // create dom document , load xml $dom = new domdocument(); $dom->loadxml($xml); // create xpath object , register prefixes 2 namespaces $xpath = new domxpath($dom); $xpath->registernamespace('atom', 'http://www.w3.org/2005/atom'); $xpath->reg

jquery - Bootstrap popover to appear on hover and remain for a second -

i popover appear on hover, remain if user interacting (it contains links) if not, should disappear after 500ms. javascript $(document).ready(function(){ $('[data-toggle="tooltip"]').popover({ title: 'look! bird!', html:true, delay: { show: 100, hide: 1000 } }); }); php <button type="button" class="badge btn btn-default" data-trigger="click" data-toggle="tooltip" data-placement="top" data-html=true data-content="@foreach($tag->tracks $track) <a href='/tracks/{{ $track->mdbid }}'>{{ $track->title }}</a> @endforeach">{{ $tag->tracks->count() }}</button> ignore funny code inside brackets (it laravel blade syntax) jsfiddle i have created jsfiddle although doesn't work (it on machine). have got delay working. however, if mouse within popover, still disappears. how can prevent , make disappear when mouse outside popover? this

Speed up a loop in R -

i using following function estimate kernel density of data kdens = function(x,h,n) { fx = matrix(0,n,1) kx = ak(x,h,n) (i in 1:n) { fx[i] = sum(kx[i,], na.rm=t)/n } return(fx) } i know not first question speeding loop. checked around in site, found using apply function faster, not case if manage correctly set loop. in above code, every "not needed thing" left out of loop, - if understood correctly - suggested speed computation. however, made comparison between above kdens function , density function implemented in r default. well, density needs 1 or 2 seconds, while kdens needs ~30 on machine. trywiththis <- rnorm(4800) x = trywiththis n = length(trywiththis) h = 1.059*sd(trywiththis , na.rm=t)*(n^(-0.2)) edit: information provided not complete kerf = function(x){ return(dnorm(x)) } ker = function(x,x0,h){ temp = kerf((x-x0)/h)/h return(temp) } ak = function(x,h,n) { k =

ios7 AVFoundation performance issues (memory leak) -

i using avfoundation capture qr codes in app. in ios 7.0 seeing major issues regards video capture. capture takes longer , longer each time it, leading app crash due memory leak issues. it works fine ios 7.1 . known issue? to fix this, had add following code when stopping capturesession [_capturesession removeinput:self.captureinput]; i not sure why didn't present issue on ios 7.1 though.

java - AWS S3 - Listing all objects inside a folder without the prefix -

i'm having problems retrieving objects(filenames) inside folder in aws s3. here's code: listobjectsrequest listobjectsrequest = new listobjectsrequest() .withbucketname(bucket) .withprefix(foldername + "/") .withmarker(foldername + "/") objectlisting objectlisting = amazonwebservice.s3.listobjects(listobjectsrequest) (s3objectsummary summary : objectlisting.getobjectsummaries()) { print summary.getkey() } it returns correct object prefix in it, e.g. foldename/filename i know can use java perhaps substring exclude prefix wanted know if there method in aws sdk. there not. linked list of methods available. reason behind s3 design. s3 not have "subfolders". instead list of files, filename "prefix" plus filename desire. gui shows data similar windows stored in "folders", there not folder logic present in s3. http://docs.aws.amazon.com/awsjavasdk/latest/jav

Using Servicestacks c# redis client how do I set the URN? -

i have code like: public vehicle neworupdate(vehicle vehicle) { try { redismanager.execas<vehicle>(r => { r.store(vehicle); //save new or update }); } catch (exception ex) { errormessage = ex.tostring(); haserror = true; throw; } return vehicle; } how can set urn item being added? see createurn extension on object don't see way set explicitly. default creates urn of "urn:vehicle:id". id have urn "urn:vehicles-{myspecialid}:id" possible control this? or way ask this... can make own urn objects store? vehicle v = new vehicle(); v.createurn = "urn:mine"; redismanager.execas<vehicle>(r => { r.store(v); }); it looks it's not hard, if know look. create list urn want: string urn = string.format("urn:dealer:{0}:vehicles", dealer.dealerid); var vehicleclient

android - How to display decimal numbers in Java? -

this question has answer here: how round number n decimal places in java 28 answers i'm using float display decimal numbers, doesn't display correct result. for example, 6.2/1000 result 0.0061999997. i know why happening, wonder there way display correct result, in case, 0.0062? edit: how round number n decimal places in java not answer question, why did marked question been answered in other place? numbers wrote example. in app user can enter number , divide / multiply number other number, result maybe won't have decimal points, maybe have 4 decimals, maybe have 7 decimals,... first, need understand isn't display issue - if want avoid displaying incorrect values, helps have right values start with. you should use bigdecimal instead of float . stores value integer scaled factor of 10 exp rather 2 exp used double , float . i

c# - Trying to filter data in grid, receiving "Cannot create an instance of the static class" error -

i attempting filter items populated in grid in code behind. when try call adapter data access layer, receiving following error: cannot create instance of static class 'sftip.dataaccesslayer.inventoryadapter' the filter meant display items in grid related user role ( assetownershipprogramids ). the error in segment new inventoryadapter() of line: filteredlist = new inventoryadapter().getallbyfilter(inventoryfilter); here code filter trying build: public list<inventory> bindgrid() { list<inventory> filteredlist = new list<inventory>(); searchfilterinventory inventoryfilter = new searchfilterinventory(); user currentuser; currentuser = (session["currentuser"] == null) ? (user)session["currentuser"] : new user(); if (currentuser.adminprograms.count > 0) { inventoryfilter.assetownershipprogramids.add(currentuser.adminprograms[0].referenceid); filteredlist = new inventoryadapter().geta

oracle - Best Practices for Separating Database Security from Application Tier -

in oracle documentation, repeatedly mentioned preferable users of application database users instead of records in kind of 'user' table numerous reasons. example, @ docs.oracle.com/cd/b28359_01/network.111/b28531/… -- "where possible, should build applications in application users database users. in way, can leverage intrinsic security mechanisms of database." i reasonably familiar call 1 big application user pattern, have been suitably convinced not best way. however, seems creating database user every web user not particularly possible either, question is, best practices keeping security definition of data separate application accesses it? some ideas: a secure interface in between database , application. application never knows database. create views utilize application context automatically filter out rows application user cannot read, , grant application user access view. similarly create procedures utilize application context allow authorized data ac

java - Error in taking multiple picture in one second on Android -

i want use android take multiple images in 1 second. basic idea use timer @ fps trigger camera capture images. the problem when want trigger camera more 1 times in 1 second, every 500ms, there error in startpreview. java.lang.runtimeexception: startpreview failed how can fixed this?. thanks. you should call startpreview() in onpicturetaken() callback, , nothing guarantees callback activated @ frame rate expected. many cameras provide burst-shot mode, there no common api yet. hopefully, api will arrive .

regex - Split a word with regexp in matlab; startIndex for 'split'? -

my aim generate phonetic transcription word according set of rules. first, want split words syllables. example, want algorithm find 'ch' in word , separate shown below: input: 'aachbutcher' output: 'a' 'a' 'ch' 'b' 'u' 't' 'ch' 'e' 'r' i have come far: check=regexp('aachbutcher','ch'); if (isempty(check{1,1})==0) % returns 0, when 'ch' found. [match split startindex endindex] = regexp('aachbutcher','ch','match','split') %now split 'aa', 'but' , 'er' single characters: = 1:length(split) singleletters{i} = regexp(split{1,i},'.','match'); end end my problem is: how put cells together, such formatted desired output? have starting indexes match parts ('ch') not split parts ('aa', 'but','er'). any ideas? you don't need

IllegalStateException when trying to use facebook android API -

i'm trying use facebooks api android make login function in app.... i've followed tutorial http://javatechig.com/android/using-facebook-sdk-in-android-example and copied exact same code... took me time discover there wasn't nothing wrong code... but, whenever click login button exception , login performs when app returned session not opened. in logcat got this. 04-22 22:11:15.570 31114-31122/com.myapppackage.app e/system﹕ uncaught exception thrown finalizer 04-22 22:11:15.570 31114-31122/com.myapppackage.app e/system﹕ java.lang.illegalstateexception: binder has been finalized! @ android.os.binderproxy.transact(native method) @ android.database.bulkcursorproxy.close(bulkcursornative.java:288) @ android.database.bulkcursortocursoradaptor.close(bulkcursortocursoradaptor.java:133) @ android.database.cursorwrapper.close(cursorwrapper.java:49) @ android.content.contentresolver$cursorwrapperinner.close(con

ruby - Can't resolve rubygems.org (too many redirects) -

for reason vagrant vm cannot resolve rubygems.org . working fine yesterday, today made no changes , no longer works: fresh unbuntu install vagrant -v # 1.5.3 vagrant init hashicorp/precise64 # ubuntu vagrant vagrant ssh installing ruby gems (fails) sudo apt-get update sudo apt-get install rubygems -y # here comes failure... sudo gem install librarian-puppet "error: not find valid gem 'librarian-puppet' (>= 0) in repository error: while executing gem ... (gem::remotefetcher::fetcherror) many redirects (http://www1.dlinksearch.com/?..." can't resolve rubygems.org wget rubygems.org "resolving rubygems.org (rubygems.org)... ::ffff:67.215.65.145, 54.245.255.174 connecting rubygems.org (rubygems.org)|::ffff:67.215.65.145|:80... connected. http request sent, awaiting response... 303 see other location: http://www1.dlinksearch.com/?url=rubygems%2eorg [following] --2014-04-23 02:28:15-- http://www1.dlinksearch.com/?url=rubygems%2eorg resolvin

c# - Uploading a BitmapImage as JSON post for Windows Runtime apps -

i've got bitmapimage defined as: bitmapimage bitmapimage = new bitmapimage(new uri("http://link.com/image.jpg")); now, need encode image base64 , post json . haven't found many guides on this, , when do, uses silverlight or .net libraries aren't available windows store development, think uses winrt. appreciated. depending on scenario might able use urisource bitmapimage read image again , convert base64 string: bitmapimage bitmapimage = new bitmapimage(new uri("http://i.stack.imgur.com/830ke.jpg?s=128&g=1")); randomaccessstreamreference rasr = randomaccessstreamreference.createfromuri(bitmapimage.urisource); var streamwithcontent = await rasr.openreadasync(); byte[] buffer = new byte[streamwithcontent.size]; await streamwithcontent.readasync(buffer.asbuffer(), (uint)streamwithcontent.size, inputstreamoptions.none); string base64string = convert.tobase64string(buffer); it seems if doing windows store app prior windows 8.1

oracle - How can I insert a long XML string into a blob in pl/sql? -

i have xml string has more 5000 characters. have store xml string in oracle db having blob data type shown toad. how can stored? try insert tabblename values(utl_raw.cast_to_raw(varchar2data)); varchar2 has size 4000 column , 32767 variable.

ruby on rails - Model association that spans across parent app and engine -

i'm making rails engine makes reference current_user in controller so: require_dependency "lesson_notes/application_controller" module lessonnotes class notescontroller < applicationcontroller def index if current_user @notes = note.where(student: current_user) if current_user.user_type.name == "student" @notes = note.where(teacher: current_user) if current_user.user_type.name == "teacher" end end end end this quite verbose , seem instead: require_dependency "lesson_notes/application_controller" module lessonnotes class notescontroller < applicationcontroller def index @notes = current_user.notes if current_user end end end however, the user model exists in parent app, not engine . in note model have define belongs_to association: module lessonnotes class note < activerecord::base belongs_to :student, class_name: "::user" belongs_to

javascript - showModalDialog - Is it possible to Dynamically Resize? -

i'm using showmodaldialog opening dialog inside dialog, although dialog have more fields depending on information required. possible make resize dynamically rather giving fixed size? showmodaldialog( v_location, '', 'dialogheight:260px; dialogwidth:560px; edge: raised; center: yes; help: no; resizable: no; status: yes; scroll: yes' ); try one: showmodaldialog( v_location, '', 'dialogheight:260px; dialogwidth:560px; edge: raised; center: yes; help: no; resizable: yes; status: yes; scroll: yes'); that give window can resized user/visitor. , yes possible dynamically change size of windows based example on screen resolution, need replace 'dialogheight:260px; dialogwidth:560px;...' 'dialogheight:<%=windowsheight%>px; dialogwidth:<%=windowwidth%>px;...' specifics depend on needs are.

android - ActivityManager kills running process of system app -

we facing problem activitymanager kills our system app: "i/activitymanager( 831): killing 3267:de.oursystemapp.tsc/u0a199 (adj 15): empty #31" why happen? don't have ui parts system app, lives in background. after boot of device intentservices triggered app download data backend. don't understand why process considered empty? i don't have explanation right now, ideas help.

java - Print a set collection -

i'm studying collections right , learned saw set type of collection don't permit duplicate elements. ok, i've created class adds 3 int numbers collection. seems ok question is: how print collection? know override string method since elements integer type how that? expected output be: 2,3,2 4,5,6 the code (adding numbers) public class adaugarenumere { int c=0; int f=0; int r=0; adaugarenumere(int c, int f, int r){ this.c=c; this.f=f; this.r=r; } } main class: import java.util.*; public class executare { public static void main(string[] args) { adaugarenumere primulrand=new adaugarenumere(2,3,2); adaugarenumere aldoilearand=new adaugarenumere(2,3,2); adaugarenumere altreilearand=new adaugarenumere(4,5,6); set<adaugarenumere> lista=new hashset<adaugarenumere>(); lista.add(primulrand); lista.add(aldoilearand); lista.add(altreilearand); system.out.println("elementele listei: "+arrays.aslist(lista.tostring())

c# - Why does the new feature "binary literals" start with 0b instead of being suffixed? -

the next c# version planned ( april 2014 ) have binary literals can see in language features status of roslyn project . the example in page this: 0b00000100 so use this: var mybynaryliteral = 0b00000100; i want understand why choose prefix 0b instead of use letter in end did double , float , decimal , on. double = 1d; float b = 1f; decimal c = 1m; integer literals possess 2 varying properties: types, can specified suffixes l or ul , , radices (called "forms" in documentation ), can specified prefixes 0x , 0b . specifying type done through suffix, , specifying radix done through prefix, makes sense keep same convention. in addition, can combine both specifiers. for instance: 0b00101010ul would denote literal 42 , stored unsigned long, , expressed in radix 2.

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .