Posts

Showing posts from March, 2011

c# - How to get the type of data from a URL -

c# - How to get the type of data from a URL - after implementing basic version of simple downloader, have spent few hours googling know how type of url .mp3,.mp4 etc.for sites such daily motion etc who's url don't have appended @ end.this because downloader works these types link without specific types makes download kb's file having nil play. here code determine content-type decide *.extension downloading: webclient mywebclient = new webclient(); string datastring = mywebclient.downloadstring("http://www.dailymotion.com/video/x1viyeu_pakistani-actress-meera-reema-saima-dance-on-faisal-ahmed-music-album-launch_news"); namevaluecollection headers = mywebclient.responseheaders; foreach (string key in headers.allkeys) { console.writeline("header:{0},value:{1}", key, headers[key]); } it returned me list of outputs on console among line was: header:content-type,value:text/html;chars

sql - local-index and partition-key on same column of a table -

sql - local-index and partition-key on same column of a table - i had table having global index(b-tree) on date column. created range partition on improve retrieval performance. partition key used same column has indexes on it. later moved global indexes local dropping recreating local index on same date column. now have local index , partition key on same column.but after dataload table taking 3 times more of usual time what reason if partition key , local index on same column of table dataload takes more time? when checked explain plan , figured queries not using local indexes. why not utilize local index in case? there hidden inbuilt indexes attached partion key , oracle uses in place of local index? solution performance of dataload doesnot impacted? leads on highly appreciated. sql indexing oracle10g partitioning

c# - How can I use unsafe code in VB.Net? -

c# - How can I use unsafe code in VB.Net? - i know vb.net equivalent of next c# code: unsafe { byte* pstart = (byte*)(void*)writeablebitmap.backbuffer; int nl = writeablebitmap.backbufferstride; (int r = 0; r < 16; r++) { (int g = 0; g < 16; g++) { (int b = 0; b < 16; b++) { int nx = (g % 4) * 16 + b; int ny = r*4 + (int)(g/4); *(pstart + ny*nl + nx*3 + 0) = (byte)(b * 17); *(pstart + ny*nl + nx*3 + 1) = (byte)(g * 17); *(pstart + ny*nl + nx*3 + 2) = (byte)(r * 17); } } } } looks it's not possible. from this post vb.net more restrictive c# in respect. not permit utilize of unsafe code under circumstances. c# vb.net unsafe

ios - Project upgraded from Xcode 5 to 6 won't compile -

ios - Project upgraded from Xcode 5 to 6 won't compile - i upgraded xcode 5 6 , code won't compile. found similar issues 3 4 none newest version. here error i'm getting. ld: building ios simulator, linking against dylib built macosx file '/applications/xcode.app/contents/developer/library/frameworks/xctest.framework/xctest' architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) is there mutual prepare this? thanks help. i had similar problem fixed running clean (in menu under product/clean). ios objective-c xcode xcode6

gbm - R - Caret - Using ROC instead of accuracy in model training -

gbm - R - Caret - Using ROC instead of accuracy in model training - hi name abhi , using caret build gbm trees based model. instead of accuracy utilize roc metric here code have far mytunegrid <- expand.grid(n.trees = 500,interaction.depth = 11,shrinkage = 0.1) fitcontrol <- traincontrol(method = "repeatedcv", number = 7,repeats = 1, verboseiter = false,returnresamp = "all",classprobs = true) mymodel <- train(cover_type ~ .,data = modeldata,method = "gbm",trcontrol = fitcontrol,tunegrid = mytunegrid,metric='roc') however when run code warning warning message: in train.default(x, y, weights = w, ...) : metric "roc" not in result set. accuracy used instead. how forcefulness model utilize roc instead of accuracy. doing wrong here? here link github project source code? https://github.com/rseiter/practicalmlproject/blob/master/multiclasssummary.r r gbm

angularjs - Wrapper directive and class duplication -

angularjs - Wrapper directive and class duplication - i want create directive wrap element. i've tried one: .directive('wrap', function() { homecoming { restrict: 'a', replace: true, transclude: 'element', template: '<div class="wrapper" ng-transclude></div>' }; }); but when utilize it: <a class="my-class" wrap>hello</a> i'm getting my-class duplicated: <div class="my-class wrapper" ng-transclude="" wrap=""> <a class="my-class ng-scope" wrap="">hello</a> </div> what want without my-class in wrapper div: <div class="wrapper" ng-transclude="" wrap=""> <a class="my-class ng-scope" wrap="">hello</a> </div> is possible? you ca tranclude: true: app.directive('wrap', function() { homecom

java - Using multiple spinner(android) -

java - Using multiple spinner(android) - so im new world of android , im trying code basic stuff.i know whats code display , create multiple spinner works; far did error "the type new adapterview.onitemselectedlistener(){} must implement inherited abstract method adapterview.onitemselectedlistener.onnothingselected(adapterview)".heres xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.example.spinnertest.mainactivity" > <textview android:id="@+id/textview1" android:lay

python - psycopg2 unable to install in pycharm -

python - psycopg2 unable to install in pycharm - i have been trying install psycopg2 in pycharm unable so. read few posts , talked stickpeople psycopg2 installer link doesnt seem work. error message get downloading/unpacking psycopg2==2.4.5 cleaning up... exception: traceback (most recent phone call last): file "c:\python27\lib\site-packages\pip\basecommand.py", line 122, in main status = self.run(options, args) file "c:\python27\lib\site-packages\pip\commands\install.py", line 278, in run requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle) file "c:\python27\lib\site-packages\pip\req.py", line 1197, in prepare_files do_download, file "c:\python27\lib\site-packages\pip\req.py", line 1375, in unpack_url self.session,`enter code here` file "c:\python27\lib\site-packages\pip\download.py", line 591, in unpack_http_url os.rmdir(temp_dir) windowserror: [error 145] direct

How to make a list from a tabular text using VIM -

How to make a list from a tabular text using VIM - i have text this: uuu f cuu l auu guu v uuc f cuc l auc guc v uua l cua l aua gua v uug l cug l aug m gug v and want create this: 'uuu': 'f', 'cuu': 'l', 'auu': 'i', 'guu': 'v', 'uuc': 'f', 'cuc': 'l', 'auc': 'i', 'guc': 'v', 'uua': 'l', 'cua': 'l', 'aua': 'i', 'gua': 'v', 'uug': 'l', 'cug': 'l', 'aug': 'm', 'gug': 'v', what best way using vim? there lot of ways in vim. 1 way utilize substitution. :%s/\(\w\w\w\) \(\w\)\_s*/'\1': '\2',\r/g this looks 3 letters followed space followed letter , place first 3 letter in first capture grouping ( \1 ) , single letter sec capture gro

docker - Specifying the creation of a sudo user in a Dockerfile? -

docker - Specifying the creation of a sudo user in a Dockerfile? - i want docker image have non-root user can perform root/sudo commands. how specify in dockerfile? i found out myself: run useradd -m <username> run sudo usermod -a -g sudo <username> run echo "<username>:<password>"|chpasswd docker

javascript - Passing parameters to a callback function -

javascript - Passing parameters to a callback function - i'm trying wrap head around javascript callback functions. tried next piece of code: var callbacktester = function(callback) { var tryme = "are ready, "; callback(tryme); } var createmessagehandler = function(client) { this.client = client; this.result = function(foo){ console.log(foo + " "+ this.client); } }; (new createmessagehandler("john")).result(callbacktester); instead of "are ready, jason", entire callback function displayed followed name: function (callback) { var tryme = "are ready, "; callback(tryme); } john can help me understand how prepare this? your foo argument not string, it's callback need call. 1 of possible solutions is: var callbacktester = function (callback) { var tryme = "are ready, "; callback(tryme); }; var createmessagehandler = function (client) { this.client = client;

node.js - XMLHttpRequest cannot load http://127.0.0.1:1337/. No 'Access-Control-Allow-Origin' header is present on the requested resource -

node.js - XMLHttpRequest cannot load http://127.0.0.1:1337/. No 'Access-Control-Allow-Origin' header is present on the requested resource - i seek send , receive info html page angular.js , locally running node.js server class="snippet-code-js lang-js prettyprint-override"> app.controller("maincontroller", function maincontroller($scope, $http){ $scope.postit = function() { //alert("posting..."); $http.post('http://127.0.0.1:1337/', {msg:'hello angular.js!'}) .success(function onsuccess(response){ console.log(response); $scope.$apply(function(){ $scope.testdata = json.parse(response); console.log($scope.testdata); }); }).error(function onerror(){ console.log("ajax failed!"); }); }; }); class="snippet-code-html lang-html prettyprint-override"> <div id='content' ng-app=

Return a string on C -

Return a string on C - i'm getting core dump have no clue how solve. have searched other questions , googled problem can't figure out how solve this... here code: const char checkextension(const char *filename) { const char *point = filename; const char *newname = malloc(sizeof(filename-5)); if((point = strrchr(filename,'.palz')) != null ) { if(strstr(point,".palz") == 0) { strncpy(newname, filename, strlen(filename)-5); printf("%s\n",newname ); // name shows correctly homecoming newname; // segmentation fault (core dumped) } } homecoming point; } the function called char checkextensions(const char *filename) . added const due solutions have found online far haven't been able create work... give thanks in advance help! you have many problems code. here of them: your function returns char single character. need homeco

c# - WPF Canvas as a math graphing area -

c# - WPF Canvas as a math graphing area - in graphic calculator, using canvas plane on graphs of functions rendered. have noticed whenever input complex functions (i utilize bezier curves that, more complex function -> more points need render graph smooth-looking) gets quite laggy , overally doesn't perform well. which of these solutions to the lowest degree computationally costly / best approach? 1. (my current solution) using huge canvas within scrollviewer limits view area cons have found: the whole canvas rendered, non-visible part starts lag when there more 50k elements on canvas 2. using canvas not big, , management of panning / zooming through transformmatrix cons think there might (solution not tried): won't more laggy when have redraw , recalculate dynammically? 3. other solutions? any help appreciated. if can avoid it, don't want using discrete visuals represent things charts/graphs; heavy, , participating in input handling

mysql rows from select tag of html, option all of these -

mysql rows from select tag of html, option all of these - table this id_film | id_zaner 195 | 1 195 | 4 155 | 4 .... of 20 mil. rows my query select id_film csfd_zanre_odkazy id_zaner in (1,4) grouping id_film having count(*)=2 this select id_film = 195, have many rows , query slow , non effective. can help me try add together "distinct" after "select" on query. select distinct id_film csfd_zanre_odkazy id_zaner in (1,4) grouping id_film having count(*)=2 mysql

facebook like - Android LikeView error -

facebook like - Android LikeView error - i'm using facebook android sdk v3.19.1 in android app. seek utilize likeview, it's working users added facebook app settings in roles section developer or tester. if seek click button normal facebook user or test user it's appears , disappears , gives next error message: error_description: dialog available developers , testers. error: server_error error_reason: dialog_disabled my app pubilc , turned on single sign on , deep linking options. i'm using facebook loginbutton , inquire "publish_actions" permission before user click's button, it's still gives me error message. my problem can't create button working test users. submitted button review facebook, gives me next response: please confirm app working correctly , can publish likes test user. please help me solve this. thanks. i have same problem. found on facebook docs. test users cannot become fan of public facebook page or cr

OpenGL - C++: Free Camera in Opengl Development Cookbook -

OpenGL - C++: Free Camera in Opengl Development Cookbook - recently reviewed in next code create utilize of photographic camera fps style. code, function: onmousemove when capturing mouse movements , calculate difference between old motion , new split result 5 , insert new mouse coordinates in array can implement mouse filtering smooth. question is, why when calculating difference between mouse coordinates divided 5? since they're dividing 5, looks scaling factor made motion have desired speed. empirical tweaking of factor. c++ opengl mouse glut

c# - Lazy evaluation with buffers in AdoNetAppender in Log4Net -

c# - Lazy evaluation with buffers in AdoNetAppender in Log4Net - i'm using log4net custom properties add together environmental info logs. created utility class global accessible properties programme classes utilize store context info (order id, user id, etc) , lazy wrapper around them don't need alter log4net threadcontext time. this: public class loggerpropertyprovider { private readonly string _value; public loggerpropertyprovider(string value) { _value = value; } public override string tostring() { homecoming _value; } } whatever value want expose property log4net register using lazy evaluator @ start of application. threadcontext.properties["order_id"] = new loggerpropertyprovider(contextinformation.orderid); it works fine buffer-less appenders (such rolling file) or when buffer set 0 in adonetappender. however, when have buffer > 1 log4net defers evaluation of property until buffer flushed

camera - DSC-H300/DSC-H400 supported by Remote API beta -

camera - DSC-H300/DSC-H400 supported by Remote API beta - i know page containing supported devices photographic camera remote api beta. wonder if maybe possible utilize remote api beta dsc-h300/dsc-h400 well, though not declared supporting api. thanks help. cameras dsc-h300 & dsc-h400 not back upwards photographic camera remote api beta. both dsc-hx60 & dsc-hx400 long zoom cameras back upwards remote api. more info: https://developer.sony.com/devices/cameras/ best regards, prem, developer world camera sony

html5 - Image link to page -

html5 - Image link to page - i have logo in header of website , want logo direct home page when clicked. in code, anchor surrounding <img> tag, on website entire div clickable. how can create when hover on image clickable, not entire div . <div class="row"> <div class="col-sm-12"> <a href="@url.action("index", "home")"> <img class="img-responsive" src="~/content/img/stars.jpg" alt="stars" /> </a> </div> </div> i found answer. needed add together style display: inline-block <img> tag. html5 css3 asp.net-mvc-4

sorting - Sort by two columns rails, but prioritize one if a field is nil? -

sorting - Sort by two columns rails, but prioritize one if a field is nil? - so have table column priority_n. pretend there's 5 items in table. 2 nil priority_n, , other 3 have 1, 2, 3 in priority_n. so i'd where(priority_n: nil).order(published_at: :desc) combined where.not(priority_n: nil).order(priority_n: :asc). want nil ones @ origin of active record relations, , prioritized ones after them. there way this? i think trick: class mymodel scope :with_priority, -> { where.not(priority: nil).reorder(:priority) } scope :without_priority, -> { where(priority: nil).reorder(published_at: :desc) } def self.special_order without_priority.to_a + with_priority.to_a end end now, can call: mymodel.special_order returns array ordered ask. ruby-on-rails sorting activerecord

How to join tables from one database to another database -

How to join tables from one database to another database - i need help on this. i have databasea.tablea.columna , want bring together databaseb.tableb.columnb. my columnb null , need extract info columna , insert columnb. the status column c in databasea.tablea.columna same column c in databaseb.tableb.columnb what sql script be? thank =) database join

redmine - restore admin user after a db:reset -

redmine - restore admin user after a db:reset - i installed redmine locally practice configuring it. after while, ran bundle exec rake db:reset db:migrate rails_env=production to reset database , start over. if seek login, redmine no longer has default root user (user = admin, password = admin). default user created during initial install. should have used other way clear database have left me redmine admin user? how add together admin user redmine? can access mysql database using console. redmine

Getting started with Node.js and JavaScript -

Getting started with Node.js and JavaScript - i started learning programming couple weeks ago (currently working through javascript) , have no coding experience. i’m doing fine far language i’m confused how implement learning. these steps have taken far , confused. can help guide me? i’m on windows pc downloaded webstorm ide downloaded , installed console2 deed terminal followed instructions here (http://www.jhh.me/blog/2012/12/24/setting-up-http-server-on-windows-with-node-js/) download , install node.js. reads, installed http server , started server, using file path js , html files have created in webstorm opened localhost , see directory of files have created in webstorm my questions are: is console2 necessary? or covered webstorm? do ever need type in node itself? looks command prompt haven’t been able execute through it if stop server typing ctrl-c in console2 , selecting y terminate batch job, why able still see directory of files when go localhost? aren’t ac

php - getting Error converting result java.lang.NullPointerException & Error parsing data org.json.JSONException: End of input at character 0 of -

php - getting Error converting result java.lang.NullPointerException & Error parsing data org.json.JSONException: End of input at character 0 of - hello new android , developing simple login , registration android app using mysql, php , json. have created database , tables in xampp(local server). whenever tried register getting ton of errors. there similar questions answers didn't help me out. in advance. here code jsonparser import java.io.bufferedreader; import java.io.ioexception; import java.io.inputstream; import java.io.inputstreamreader; import java.io.unsupportedencodingexception; import java.util.list; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httpget; import org.apache.http.client.methods.httppost; import org.apache.http.client.utils.urle

sql server 2008 - How do i merge multiple rows data in one row in t-sql but string and numeric both -

sql server 2008 - How do i merge multiple rows data in one row in t-sql but string and numeric both - data next : code article amount paid balance 8001 black 8000 7000 1000 i want see this: 8001 (black) (1000) i think need. note : if want concatenate numeric datatype info varchar data first have convert numeric data varchar type else may conversion failed error. select convert(varchar(30), code) + ' (' + article + ') (' + convert(varchar(30), balance) + ')' new_column, article, amount, paid, balance <tablename> sql-server-2008 tsql

javascript - No result from callback function in Node.js -

javascript - No result from callback function in Node.js - i want execute callback function function recurring_end() { var sql= "select `bookmarks`.`id`,`bookmarks`.`bookmark_url` url bookmarks limit 0, 10"; connection.query(sql, function(err,bookmarks) { for(var = 0; i< bookmarks.length; i++){ (function(i) { parsearticle(i,function(err,result){ console.log("result "+json.stringify(result)); newparseartilce(result,function() { console.log("new parse artilce " +i); }); }); })(i); } }); } function newparseartilce(i,callback){ console.log("new article number is "+i); } function parsearticle(i,callback) { console.log("parse article number " +i); homecoming i; }; this code. executing parsearticle function first , want pass result newparsearticle not getting re

How to set up two-factor authentication with ASP.net Identity 2.0? -

How to set up two-factor authentication with ASP.net Identity 2.0? - so must missing super simple or i'm not understanding how two-factor authentication supposed work asp.net identity 2.0. my understanding two-factor authentication supposed work godaddy or google; when effort log in computer without valid sec factor cookie, email or sms sent auth code , presented sec form come in auth code in order finish sign in process. all of code appears nowadays in new mvc 5 project, except had implement sendasync function email service: public class emailservice : iidentitymessageservice { public task sendasync(identitymessage message) { // plug in email service here send email. smtpclient smtpclient = new smtpclient("127.0.0.1", 25); mailmessage mail service = new mailmessage("sender@domain.com", message.destination, message.subject, message.body); smtpclient.send(mail); homecoming task.fromresult(0);

recursion - Recursively updating statement in sql server -

recursion - Recursively updating statement in sql server - i have table ids varchar(10). possible values create table temp(id varchar(10)) insert id('01') insert id('011') insert id('0110') insert id('01110') insert id('011111') insert id('02') insert id('020') insert id('0222') and on .i.e lengths of 2 6. our new requirement says have have decimal after 2 numbers i.e 01 remains same; 011 becomes 011.1; 0110 01.10; 01110 01.11.0 ;011111 01.11.11 manually wrote update statements there 700 such distinct ids how can recursively apply update statement. thanks a quick set-based (non-looping) approach utilize case statement this: update dbo.temp set id = case when len(id) <= 2 id when len(id) between 3 , 4 left(id, 2) + '.' + substring(id, 3, 2) when len(id) between 5 , 6 left(id, 2) + '.' + substring(id, 3, 2) + '.' + substring(id, 6, 2) end;

dialog - How to stop opening documents and pdf files by default app in android programmatically? -

dialog - How to stop opening documents and pdf files by default app in android programmatically? - i have created app viewing documents , pdf files, when select file (for example:sample.pdf or sample.doc) in mobile, dialog box appear showing app , other apps available viewing options on below(just 1 time or always) or (set default). problem is, 1 time have clicked app these (always or set default) options in dialog box, next time when select file read, automatically opens app without showing other apps dialog box options. tried looking solution, can't ideas, can guys help me on fixing problem. i tried looking solution there no "solution", because there no problem. the user decided create app default operation. user's choice, not yours. if user wants alter that, user can go settings , (e.g., "clear defaults" on app's screen in list of installed apps). now, in cases app 1 starting other activity, , want forcefulness chooser, can

assembly - Simpler way to write the following instructions? -

assembly - Simpler way to write the following instructions? - hey guys next code: brbc 4, method brbs 2, method what easier , more mutual way of writing in avr assembly?! sreg t h s v n z c. so want branch if s cleared , or n set. s = n xor s, s cleared if n , v, or not n , not v. is, if result positive or zero. n set when result negative. so want branch always. jmp method assembly avr

ruby - Using a Jekyll for loop in a different directory -

ruby - Using a Jekyll for loop in a different directory - i building blog using jekyll, , planned utilize jekyll homepage. because of this, had created other non-changing html pages in respective directories, , work fine. however, i've been thinking making separate page list posts i've made far, , need reference "main" site's posts. my project's construction looks following: _includes/ footer.html header.html sidebar.html _layouts/ default.html posts.html _posts/ ... _site/ ... about/ index.html archive/ index.html css/ style.css resume/ index.html _config.yml index.html i list posts i've made in archive/index.html page. attempted doing following: ... <h2>the archive.</h2> {% post in site.posts %} <h4><a href="{{ post.url }}">{{ post.title }}</a></h4> <p><small>{{ post.date | date: "%b %e, %y" }}</small></p>

sequential CSS transforms don't match manually computed 3x3 matrix? -

sequential CSS transforms don't match manually computed 3x3 matrix? - when apply several sequential transformations element using css3's transform , don't same computed matrix when multiply transform matrices hand. different reason. why? here's demo: http://jsfiddle.net/dfqhw64q/7/ here's same demo larger diffs: http://jsfiddle.net/dfqhw64q/6/ thanks! figured out. the matrices using skew shear matrices expect linear values, not angles. after changing skewx , skewy math.tan(skewx) , math.tan(skewy) , aligned. works: http://jsfiddle.net/dfqhw64q/8/ css matrix transform

php - Warning: array_merge in admin side -

php - Warning: array_merge in admin side - i created custom module. & utilize below code language file. so, working fine in opencart 1.5.6.4. (admin\controller\module\custom.php) $language = $this->load->language('module/custom'); $this->data = array_merge($this->data, $language); but, not working in opencart 2.0. get below error in admin side module in opencart 2.0 warning: array_merge() [function.array-merge]: argument #1 not array how can prepare it? would appreciate help. i have remove $this->data our code & working fine. correct code. $data = array_merge($language); php opencart opencart2.x

php - Mongodb: read documents/arrays and delete them immediately -

php - Mongodb: read documents/arrays and delete them immediately - technical background: i'm using tokumx (support document level locking) , php. the document construction this { "accounts": [ { "username": "1", }, { "username": "2", } ], "site": "test.com" } situation: most of time, need first x accounts "accounts" array. the minutes these first x accounts retrieved, should deleted "accounts" array in document. compromise can make: extract out "accounts". { "username" : "1", "site": "test.com" }, { "username" : "2", "site": "test.com" } or switch mysql (last option). this comment, it's long comment more explaination , illustration given. not familiar tokumx ( in, have never used ), mongodb has way this, ,

c# - How to use callback string to mainform -

c# - How to use callback string to mainform - i have method written in c# class torrentdownload { private readonly thread _getstatethread; public sohadownload() { _getstatethread = new thread(getstate); _getstatethread.start(); } torrenthandle handle=null; public void start(addtorrentparams param) { var _session = new session(); if (_session == null) throw new argumentnullexception("sesion"); _session.listenon(6881, 6889); handle = _session.addtorrent(param); } public void getstate(){ while (true) { if (handle == null) { thread.sleep(1000); continue; } var status = handle.getstatus(); if (status.isseeding) { break; } string _state = status.state

java - Return to Fragment A from Fragment B with a value -

java - Return to Fragment A from Fragment B with a value - i know there have been many threads this, cant seem understand how nail it.. seek after button click in fragment b want homecoming fragment id value.. in backstack go fragment lead fragment b , when pressing button want go fragment value show. onclick listener in fragment b: //fragment b called fragment addbutton.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { if(value.gettext().tostring().trim().length() != 0) { string order = value.gettext().tostring(); //the value want in fragment b //return fragment } } in mainactivity tread fragment this: //fragmentmanager initialized in oncreate() ... private void selectitem(int position) { fragment fragment = null; string ftag = null; switch (position) { case 0: fragment = new fragmenta(); ftag = "fragment

ios - Core Data validation: from Objective-C to Swift -

ios - Core Data validation: from Objective-C to Swift - i'm building dummy ios project in order understand how implement validation in core info swift. core info model of project has 1 entity called person contains 2 attributes: firstname , lastname . project based on swift but, in order start it, i'm using objective-c define nsmanagedobject subclass: person.h @interface person : nsmanagedobject @property (nonatomic, retain) nsstring *firstname; @property (nonatomic, retain) nsstring *lastname; @end person.m @implementation person @dynamic firstname; @dynamic lastname; -(bool)validatefirstname:(id *)iovalue error:(nserror **)outerror { if (*iovalue == nil || [*iovalue isequaltostring: @""]) { if (outerror != null) { nsstring *errorstr = nslocalizedstringfromtable(@"first name can't empty", @"person", @"validation: first name error"); nsdictionary *userinfodict = @{ nsl

java - Read CSv Data and display total csv data in jsp page -

java - Read CSv Data and display total csv data in jsp page - i have csv page , want read columns contains csv file , display in jsp page using next code: br = new bufferedreader(new filereader(csvfile)); while ((line = br.readline()) != null) { string[] country = line.split(cvssplitby); wordlist = arrays.aslist(country); //system.out.println("data is"+wordlist.size()); } how display arraylist in jsp page using struts display tags. i not able write setter methods of properties because not know csv file contained how many columns in changes file file from have understood post have array list of strings , cannot display in jsp. want? quick solution can create new string list, , display string. java jsp

php - Remove hook in wordpress theme -

php - Remove hook in wordpress theme - there hook want remove, or stop working template using - * footer.php hooks */ // footer hook function copious_footer_hook() { do_action('copious_footer_hook'); } how can create void or stop it? remove_action( 'copious_footer_hook' ); for more info or options, check: http://codex.wordpress.org/function_reference/remove_action php wordpress hook footer

css - SASS rule reuse -

css - SASS rule reuse - i have set of icons different colors , each color used different status declared css classes. example, <span class="icon icon--app"><span> gives grayness app icon while <span class="icon icon--app icon__light icon__selected"><span> gives white app icon. the next code written in scss. span.icon { display: inline-block; width: 32px; height: 32px; &.icon--app { background: url(../images/app_gray.png); &.icon__selected { background: url(../images/app.png); } &.icon__light { background: url(../images/app_gray.png); &.icon__selected { background: url(../images/app_white.png); } } } &.icon--device { background: url(../images/device_gray.png); &.icon__selected { background: url(../images/device.png); } &.icon_

vb.net - How to SuggestAppend a ComboBox containing a string -

vb.net - How to SuggestAppend a ComboBox containing a string - goal i'd have combobox items suggest , append items when contained in them, not via startswith function. my combobox bound dataview contains clients [companyname], [address], [city] in long concatenation. i want users able type in city , still find records matches of fields above. know possible infragistics don't have package. search term: "sher" costco, 123 1st avenue, sherbrooke provigo, 344 ball street, sherbrooke sherbox, 93 7th street, montreal is possible in vb.net or should searching else? i did research , found next question: override winforms combobox autocomplete suggest rule in question reffer question: c# autocomplete let's quote best reply question the existing autocomplete functionality supports searching prefix. there doesn't seem decent way override behavior. some people have implemented own autocomplete functions overriding on

mysql - order by a certain character -

mysql - order by a certain character - let's suppose have table containing 'name' column next rows: 'a' 'k' '_c' '_b' is there way order alphabetically , placing names come underscore '_' first (alphabetically too) using order on mysql? output be: '_b' '_c' 'a' 'k' order case when substr(mystring, 0,1) = '_' 0 else 1 end , mystring (not tested, idea) i.e. first order on whether or not string starts character '_' or not, , on string itself. as others have pointed out, illustration renders unecessary, how in general. instance, order 5-character words first in similar way: order case when length(mystring) = 5 0 else 1 end , mystring mysql sql sql-order-by

javascript - owl carousel - not working online -

javascript - owl carousel - not working online - owl slider not working online, when seek in localhost working. please help! thanks. link http://mobile.best0709.cafe24.com/pls.html inserted korean cms shopping mall. <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>owl carousel - 1 slide</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="jquery responsive carousel - owl carusel"> <meta name="author" content="bartosz wojciechowski"> <!-- owl carousel assets --> <link href="/owl.carousel.css" rel="stylesheet"> <link href="/owl.theme.css" rel="stylesheet"> <script src="/jquery-1.9.1.min.js"></script> <script src="/owl.carousel.min.js&

ios - How to return to last view without pop -

ios - How to return to last view without pop - on didselectrowatindexpath want homecoming previous viewcontroller. i'm using code, @ moment: [self.navigationcontroller popviewcontrolleranimated:yes]; but, don't want pop navigationcontroller. because, when user "clicks" on button, want homecoming view. so, want previous controller without popping navigationcontroller. possible? thanks! try using [self presentviewcontroller:vc animated:yes completion:nil]; instead ios objective-c

javascript - Ajax not working for dynamic key in data parameter -

javascript - Ajax not working for dynamic key in data parameter - i trying create ajax function this: var vm=$.noconflict(); vm(document).ready(function(){ var loadmore=function(e) { var idd=vm(this).attr("id"); alert(e.data.recordid); //it homecoming blog_comment_id if provide static value info key var aaa=e.data.recordid; vm.ajax({ type:"post", url:"ajaxhtml.php", data:({e.data.recordid: idd}), cache:false, success:function(res) { alert(res); vm("#"+e.data.divid).html(res); } }); } and calling ajax function this, trying create dynamic provide div id , record id. vm(function() { vm(".view_more").click({

c++ - Does this class act in the same way of its parent? -

c++ - Does this class act in the same way of its parent? - i define template class this: template <typename a, typename b> class { ~~~ }; and want utilize something<x, y> . isn't neat, did this: typedef something<x, y> somenewthing; however, have problem yet. forwarding declaration of somenewthing form. class x; class y; template <typename a, typename b> class something; typedef something<x, y> someappropriatenewname; it inconvenient write in every header contains class. so, rather using of typedef, seek using inheritance. class someappropriatenewname : public something<x, y> {}; except inheritance, empty class. forwards declaration this. class someappropriatenewname; it seems should work correctly. does somenewthing deed in same way something<x, y> do? does class deed in same way of parent? isn't there difference? someappropriatenewname has few differences. of can fix. someap

android - Saving offer to Google Wallet -

android - Saving offer to Google Wallet - in app, need implement saving offer app google wallet. found tutorial: https://developers.google.com/wallet/objects/savetowalletnative#4_create_an_object , when tried implement it, encountered problem. there code page: offerwalletobject wob = offerwalletobject .newbuilder()... but environment says class doesn't have method. there nil written method in page: https://developer.android.com/reference/com/google/android/gms/wallet/offerwalletobject.html can help solve problem or other method save offer in google wallet. i have successful integrate google wallet, video. link public class mainactivity extends actionbaractivity implements googleapiclient.connectioncallbacks, googleapiclient.onconnectionfailedlistener{ private googleapiclient mgoogleapiclient; private supportwalletfragment mwalletfregment; private supportwalletfragment mxmlwalletfregment; private maskedwallet mmaskedwallet; private fullwallet m