Posts

Showing posts from April, 2013

jsf - How to disable the automatic insertion of <br> tag in p:editor? -

i use primefaces v4.0.24. there way disable automatic adding <br> in <p:editor> ? it's destroying markup , validation. you can customize class org.primefaces.component.editor based on requirement. can create own package org.primefaces.component.editor extracting class.just find out line of code can modified requirement can fulfill.

bluetooth lowenergy - Android notification when BLE device discovered -

we working on android app makes gatt connection ble devices , writes characteristics. our current approach scan devices (startlescan on android 4.3 , 4.4. devices , startscan on android 5.0+) every few seconds , connect device when discovered. this solution works drains lot of battery because need keep wake locks (or trigger alarm manager every few seconds) scanning work when phone in sleep. is there way android can notify app when ble device discovered instead of continuously scanning devices? ios app works great because ios wakes app in background when there ble device nearby, saves lot of battery. wondering there similar on android keep battery under acceptable limit. just reference, have tried alt-beacon library found internally usages alarm manager , if set alarm manager trigger every 5 seconds, consumes 7-8% battery every hour.

.net - How to add C# automatic calculations for a POCO entity in EF? -

i using db first ef 6.1.3 .net 4.5.1, t4 generated entities poco classes generated auto properties. calculations (a calculated int field actually) before saving db. i update trigger of course prefer c# algorithm. i've looked override in dbcontext , found nothing. closest bet validateentity(...) smells me use different name implies. (not talking seems not trivial how access entity instance) how , accomplish auto calculations before update or better: upon property set? you following, i.e. override savechanges. public partial class myentities : objectcontext { /// <summary> /// persists updates data source specified system.data.objects.saveoptions. /// </summary> /// <param name="saveoptions">a system.data.objects.saveoptions value determines behavior of operation.</param> /// <returns>the number of objects in system.data.entitystate.added, system.data.entitystate.modified, or /// system.data.entityst

android - Rendering problems using new TextInputLayout for EditText -

Image
i'm trying set new support.desing library provides lollipop visual effects old android versions. in case, i'm triying add floating labels edittext, done widget.textinputlayout: to have followed google's provided few indications: i have downloaded last support library (22.2.0) , included on graddle file. compile 'com.android.support:design:22.2.0' i have added textinputlayout in xml way: <android.support.design.widget.textinputlayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margintop="30dp" android:layout_marginleft="20dp"> <edittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:ems="12" android:hint="hint" android:inputtype="number" android:id="@+id/edt" /> </android.support.design.wi

jquery - Read JSON data in JavaScript -

i have method in controller returns json data. public jsonresult data() { return json(model, jsonrequestbehavior.allowget); } now how read , store above returned data using jquery? trying belwo $("#btn").click(function () { $.getjson("controller/data", function(result) { alert(result.name + " "); }); }); data returned it returns multiple list,which has multiple items eg : [0] {mylist} , has name,region etc [1] {mylist} , has name,region etc from of returned json, returning array of objects. access these can use index of object within array. example: $.getjson("controller/data", function(result) { console.log(result[0].name); }); alternatively, can loop through returned items: $.getjson("controller/data", function(result) { (var = 0; < result.length; i++) { console.log(result[i].name); } });

oracle11g - how to prevent duplicate values while using inner for loop in oracle plsql? -

i passing c1 value param c2,c3 cursor's , getting duplicate values , how write better code using plsql code? declare cursor cur1; cursor cur2 select * param=c1.param; cursor cur3 select * param=c1.param; begin c1 loop c2(c1.param) dbms_output(deptno||' '||dname); c3(c1.param) dbms_output(deptno||' '||dname); end loop; end loop; end loop; end; , getting duplicate values deptno dname 10 20 b 30 c 10 20 b 30 c expected output deptno dname 10 20 b 30 c can please me? sounds may want union: declare cursor cur1; cursor cur2 select * x param=c1.param union select * y param=c1.param; begin c1 loop c2(c1.param) dbms_output(deptno||' '||dname); end loop;

asp.net - how to do validation in sql bulk copy upload -

i created mvc4 application upload data using excel file store in database table called tbl_hei_student . [httppost] [acceptverbs(httpverbs.post)] public actionresult student(httppostedfilebase fileupload1) { try { string constring = string.empty; //upload , save file if (request.files["fileupload1"].contentlength > 1) { try { string excelpath = path.combine(httpcontext.server.mappath("~/content/"), path.getfilename(fileupload1.filename)); fileupload1.saveas(excelpath); string extension = path.getextension(fileupload1.filename); switch (extension) { case ".xls": //excel 97-03 constring = configurationmanager.connectionstrings["excel03constring"].connectionstring;

OpenGL : (graphic problems) vertical black lines appearing in all the screen -

Image
i've got blue screen error. i'm not sure if problems came after blue screen, think that's important notice it. here gif of problem : http://img110.xooimage.com/files/6/6/7/prob-4b77771.gif there litle black lines appearing without reason (i never had problem before). think there link graphic card, did updates , changed nothing. here informations computer (sorry french) : i'm programming opengl, ruby language, , gosu library. that wrong using of graphic process. default graphic process had been changed, had change it. (by right clicking on programm, select execute graphic process > change default graphic process)

javascript - AngularJS: TypeError: 'null' is not an object (evaluating 'this._element.attr') -

i using angularjs in project. users able add products order , after order put together, can view order overview. works great in chrome in safari unexpected error. typeerror: 'null' not object (evaluating 'this._element.attr') here can see code: angularjs $scope.order = []; $scope.search = ""; $scope.products = []; $scope.categories = []; //order overview checkout $scope.modal = function(){ modal.show(); }; $scope.modalhide = function(){ modal.hide(); } $scope.removeproduct = function(){ } //compose order add/remove/update $scope.productremove = function($event, pid){ $scope.productid = pid; if($scope.order.length > 0) { for(var b = 0; b<$scope.order.length;b++){ if($scope.order[b].prodid == pid) { if($s

java - HttpURLConnection.getInputStream() throws SocketTimeoutException -

i using httpurlconnection upload image , response. works on emulator , xiaomi device. however, sockettimeoutexception on sony device on line connection.getinputstream() . i've tried set timeouts large value 1 minute not work. public string uploadfile(file file, string requesturl) { if (file != null) { long filesize = file.length(); httpurlconnection.setfollowredirects(false); httpurlconnection connection = null; try { //config of connection connection = (httpurlconnection) new url(requesturl).openconnection(); connection.setconnecttimeout(10000); connection.setreadtimeout(10000); connection.setrequestmethod("put"); connection.setrequestproperty("content-type", "image/jpeg"); connection.setdooutput(true); connection.setrequestproperty("content-length"

android - ActionMode background not working on lollipop devices -

am trying change background color of contextual action bar. did in following manner v21/themes.xml & themes.xml <?xml version="1.0" encoding="utf-8"?> <resources> <style name="mytheme" parent="theme.appcompat.light.noactionbar"> <item name="windowactionmodeoverlay">true</item> <item name="actionmodestyle">@style/widget.actionmode</item> <item name="android:actionmodestyle">@style/widget.actionmode</item> </style> </resources> styles.xml <style name="widget.actionmode" parent="@style/widget.appcompat.actionmode"> <item name="background">@color/highlight_green</item> </style> the background color works fine in pre-lollipop devices. not work in lollipop. note: tried adding <item name="android:actionmodebackground">@color/high

sql - Query in light switch returns only one line? -

i have query called 2 parameters invoice number & company name. query returns 1 line in light switch. should returns more 1 line (depends on invoice number looking for). donot know why returning 1 line ? query connected view in sql server. tried test query in sql serve , correct lines. when call same query same parameters in light switch gives me 1 line result. idea why? usually caused when primary key(s) table have duplicate values in data returned. @ entity (in lightswitch entity designer in server project) lightswitch created when attached view , see thinks primary key(s) are. in order solve problem: have create or add anew primary key current keys in view. best regards, mohamed

c# - send mal with TLS / SSL -

after searching across web i'am still confused correct approach send secure email. i developing web email client interface send mails different configurable smtp email servers (for example: gmail.com, outlook.office365.com,...whatever) i use simple smtpclient enablessl = true, , works gmail , office365 (thought in gmail had configure https://www.google.com/settings/security/lesssecureapps make work). the question if enabling enablessl true action sending secure email net 4.5 (configuring user , password credentials too, of course), or if have make different configurations if smtp server uses tls or ssl?

winforms - which library is used for StreamWriter in C++ window forms? -

public ref class form : public system::windows::forms::form { public: form(void) { initializecomponent(); void save(string^ word); } //windows form generated code ... ... ... void save(string^ word) { streamwriter^ outfile = gcnew streamwriter("file.txt"); outfile->writeline(word); outfile->close(); } #pragma endregion private: system::void button00_click(system::object^ sender, system::eventargs^ e) { string^ word = "plow"; save(word); } }; } streamwriter resides in namespace system::io , implemented in mscorlib.dll. add line using namespace system::io to imports of code file , ready go.

ios - How Pocket put their saved message above Safari -

Image
my question how pocket put "saved" view above safari view. can see happen in this video . did have access put view in safari's view? or safari in charge of view? i talking it's done via app extension . safari passes information pocket, via share action sheet. pocket acts on it, , presents momentary view above safari, not within browser. safari has nothing pocket displays.

c# - Unity3d : object set to invisible for seconds -

i using coroutine alternate object visibility using renderer.enabled every 2 seconds, object doesn't wait 2 seconds change state, alternate between visible , non visible fast , randomly, it's looking unstable. here code : using unityengine; using system.collections; public class arrowcontroller : monobehaviour { gameobject arrow = null; void start () { arrow = gameobject.find ("arrow"); arrow.getcomponent<renderer> ().enabled = false; } void update () { startcoroutine(showdirection()); } ienumerator showdirection(){ while (true) { getcomponent<meshrenderer> ().enabled = true; getcomponent<renderer> ().enabled = true; yield return new waitforseconds (1); getcomponent<meshrenderer> ().enabled = false; getcomponent<renderer> ().enabled = false; yield return new waitforseconds (1); } } } that's because have startcoroutine

Follow nth anchor|href via javascript -

i'm trying embed pdf page maintain. problem: source filename changes every week , can not guessed (randomnumber.pdf). that's dead end. my next approach link on main source site. looks following: http://www.example.com/index.php?menuid=44&downloadid=190&reporeid=65 unfortunately "downloadid" not strictly ongoing. but sourcecode of website reveales href need 20th href on site. is there way open 20th href via javascript? i wasn't able find useful or figure out myself - trying help! here comment in answer form: i array of elements , take 19th out of it. when having use .click() on use it. var links = document.getelementsbytagname("a"); links[19].click(); <a href ="www.google.com">1</a> <a href ="www.google.com">2</a> <a href ="www.google.com">3</a> <a href ="www.google.com">4</a> <a href ="www.google.com">5

exception - Why does Java throw NullPointerException here? -

public class test { public int [] x; public test(int n) { int[] x = new int [n]; (int i=0;i<x.length;i++) { x[i]=i; stdout.println(x[i]); } } public static void main(string[] args) { string path = "/users/alekscooper/desktop/test.txt"; in reader = new in(path); int size=reader.readint(); stdout.println("size = "+size); test n = new test(size); stdout.println(n.x[3]); } /* add code here */ } hello guys. i'm learning java through reading robert sedgwick's book on algorithms , i'm using libraries such stdout, example. question java in general. don't understand why java here throws nullpointerexception. know means in general, don't know why here because here's think i'm doing: read integer number file - size of array in class test. in test example size=10, no out-of-bound type of thing happens.

Xcode command line build and archive error -

i trying build , archive project create .ipa via commandline using below command $ xcodebuild archive -project test.xcodeproj -scheme "test" -archivepath /build but gives below error ** archive failed ** following build commands failed: ld /users/user1/library/developer/xcode/deriveddata/test-gymccixkvyhthdhhxixgplbqdrhk/build/intermediates/archiveintermediates/test/intermediatebuildfilespath/test.build/release-iphoneos/test.build/objects-normal/arm64/test normal arm64 ld /users/user1/library/developer/xcode/deriveddata/test-gymccixkvyhthdhhxixgplbqdrhk/build/intermediates/archiveintermediates/test/intermediatebuildfilespath/test.build/release-iphoneos/test.build/objects-normal/armv7/test normal armv7 am missing something? we need more information. suspect however, /build not writeable directory. for example of how build scripts see project: https://github.com/calabash/ios-smoke-test-app/blob/master/calsmokeapp/makefile

cordova - How to change the position of the ionic side menu button? -

hi need change position of ionic side menu button in ionic sidemen app.i need change menu button forklift right how can that? for side menu defined : <ion-side-menu side="right"> you can have it's button defined : <a class="button button-icon button-clear fa fa-navicon fa-fw" ng-click="showmenu()"> </a>

jquery - datatable with html content -

i using jquery datatable , data input in json format. $('#newitembaskettab').datatable({ "aadata": result.itembasketdata, "aocolumns": [ {"mdataprop": "nic5dcodename"}, {"mdataprop": "asiccprodcodename"}, {"mdataprop": "unit_name"}, {"mdataprop": "prod_quantity"}, {"mdataprop": "prod_value"} ] }); now want place checkbox in first column of datatable , based on id field in json data, checkbox needs checked or unchecked . possible add html content datatable ? use mrender property - $('#newitembaskettab').datatable({ "aadata": result.itembasketdata, "aocolumndefs": [ { "atargets": [ 0 ], "mdata": "id", "mrender": function ( data, type, full ) { var checked = "checked"; if(data) { check

php - Joomla page redirection -

in url page showing www.domainname.com/index.php/events/?txtlabel=tender if user typing www.domainname.com/tender , url redirected above url. but other pages, url same is, www.domainname.com/index.php/xxxx . have tried using index.php file. not possible in page. where write exception without hampering whole site, page work? you can use joomsef component url redirection in joomla. http://www.artio.net/downloads/joomla/joomsef

debugging - Segmentation fault strcmp in c -

i'm trying run program in c takes in text file , string user , searches file string. keeps getting segmentation fault , gdb pointing me towards function not sure problem is. pretty sure has strcmp call not sure. issue appreciated. int intable( const char *s ) { int i; for( i=0; i<numlines; ++i ) { if( strcmp( st[i], s ) == 0 ) return 1; } return 0; } you should check use strcmp() , api is: int strcmp(const char *str1, const char *str2) you must: 1) validate st[i] , first argument pointer. 2) make sure st[i] & s has null terminator '\0'`. 3) check st[i] & s pointing allocated place in memory before calling strcmp() .

javascript - Ionic /How to select multiple options from select control(Maximum selection will 3 options only)? -

i'm using ionic 1.3.16 version currently. here need select multiple options in select control. here ionic html code: <div class="list"> <label class="item item-input item-select"> <div class="input-label"> lightsaber </div> <select> <option>blue</option> <option selected>green</option> <option>red</option> </select> </label> </div> you missing value attribute in select option, because when select option reflect ng-model .additionally select multiple need add multiple attribute in select. markup <select ng-model="selectedvalues" multiple> <option ng-repeat="option in options" value="{{option.value}}">{{option.name}}</option> </select> {{selectedvalues}}

python - Parsing <ul> tag using beautiful soup -

consider code: divtag = soup.find_all("div", {"class":"classname"}) print divtag tag in divtag: ultag = soup.find_all("ul", {"class":"classname"}) print ultag tag in ultag: litag = soup.find_all("li", {"class":"classname"}) print litag tag in litag: ditag = soup.find_all("div", {"class":"classname"}) print ditag tag in ditag: atags = tag.find_next("a") value = atags.string print value it prints "divtag" & "ultag". i'm sure class names right. there 7 'li' tags within 'ul' tag not print of 'li' tags. please help. in advance. update: <div class="classname"> <ul auto-load="true" class="classname" data-href=""> <li class="c

GIt Push reject from origin -

This summary is not available. Please click here to view the post.

Get Spring Bean from AspectJ ProceedingJoinPoint -

i'm looking spring data repository interface or bean calling void delete(id) using aspectj, problem function there no argument or return type guess bean, there idea how calling bean or interface name aspectj proceedingjoinpoint. this actual code: @pointcut("execution(public * org.springframework.data.repository.repository+.save(..)) || execution(public * org.springframework.data.repository.repository+.delete(..)) && target(repository)") public void publicnonvoidrepositorymethod(crudrepository repository) { } @around("publicnonvoidrepositorymethod(crudrepository repository)") public object publicnonvoidrepositorymethod(proceedingjoinpoint pjp , crudrepository repository) throws throwable { ....... } you can add target parameter repository has been called: @aspect @component public class sampleaspect { // apply repositories in package repositories @after("execution(* repositories.*.delete(*)) && target(repository

Trying to get property of non-object laravel 5 hasOne eloquent -

im trying use hasone relation following error : trying property of non-object (view: /home/vagrant/code/gsup_backend/resources/views/exam/index.blade.php) my models class session extends model { /* * @var string * */ protected $table = 'gs_session'; protected $primarykey = 'idsess'; public $timestamps = false; public function exam(){ return $this->belongsto('app\model\exam','idex','idsess'); }} the exam model class exam extends model { /* * @var string */ protected $table = 'gs_exam'; public $timestamps = false; protected $primarykey = 'idex'; /* * @var string */ protected $fillable = ['*']; public function matiere(){ return $this->hasone('app\model\matiere','idmat','idex'); } public function session(){ return $this->hasone('app\model\session','idsess','idex'); } public function personne(){ return $this->hasone('app\model\pers

javascript - Cordova + ratchet - script inside Push is not working on Android 4.3 and below -

i developing cordova application android , windows , using ratchet framework. have written pagewise script inside push function like, window.addeventlistener('push', function() { //my custom events }); after building application cordova, my custom events firing in android 4.4 whereas not firing in android 4.3 , below. when checked html pages on browser without building app, push working fine in versions . i stuck here . problem ? thanks in advance. customevent not defined in webview on android <4.4. check pull request on ratchet, it's patch redefine customevent if not. https://github.com/twbs/ratchet/pull/748/files

algorithm - How to make a 4x4 sudoku solver in java -

can guys give me ideas algorithm 4x4 sudoku solver in java laugauge. having diffcultly in figuring out agorithm. have read wikipedia page 9by9 solver, maybe guys can simplify idea of here's page explains 4x4 grid. way, should try googling before asking question here. searched "sudoku solver example program" find this. http://www.mathworks.com/company/newsletters/articles/solving-sudoku-with-matlab.html

java - Return unknown characters in DateFormat as literals -

designing android app requires users able enter custom date format used display current time/date in exact user requested format dateformat. i need users able mix literals (i.e. actual characters not parsed) characters using format date. understand can surround literals in ' (single quotes) desired behavior is: characters can formatted date part , other characters should return original character. for example: if try format date string t hh:mm , error: unknown pattern character 't' . (as fallback return original string). desired behavior return formatted date unknown character e.g. t 11:03 how can achieve this? to clarify: don't want rely on single-quotes 2 reasons: 1. want make simpler user enter date format and 2. want still work if user enters incorrect format (as aside know when setting format textclock view behavior desired: unknown characters returned literally)

perl - Net::Google::DataAPI::Auth::OAuth2 failed oauth call access token: received error: 400 Bad Request -

i following solution in here: net::google::authsub login failed new google drive version however, @ line: my $token = $oauth2->get_access_token($code) or die; i getting error below: failed oauth call access token: received error: 400 bad request { "error" : "invalid_request" } what issue? in net::google::dataapi::auth::oauth2 need fix? using strawberry perl in windows. edit: below code: my $oauth2 = net::google::dataapi::auth::oauth2->new( client_id => 'xxxxxxx.apps.googleusercontent.com', client_secret => 'xxxxxxxx', scope => ['http://spreadsheets.google.com/feeds/'], ); $url = $oauth2->authorize_url(); print "oauth url, code: $url\n"; use term::prompt; $code = prompt('x', 'paste code: ', '', ''); $token = $oauth2->get_access_token($code) or die; when this, codes start 4/ , end mwi#. maybe you're missing last # character?

CasperJS/PhantomJS download CSV file -

i'm having trouble getting contents of csv file being downloaded via casperjs/phantomjs. file download being triggered via link on page being clicked , resourcerecieved event triggered , can access header/meta info file, can't content of file need. what take content of csv file in casperjs/phantomjs?

javascript - Issues Integrating ACE Editor with Keystonejs App -

it says here( http://ace.c9.io/#nav=embedding ) copy 1 of src* subdirectories somewhere project have put in mykeystoneapp/public/js(my default home mykeystoneapp/public) here errors get: 1.uncaught typeerror: $.cookie not function(ui.js:8) 2.uncaught error: missed anonymous define() module: function …(require.js:141) http://requirejs.org/docs/errors.html#mismatch here jade code: script(src='/js/ace/demo/kitchen-sink/require.js') script. require.config({paths: {ace: "/js/ace/build/src"}}); define('testace', ['ace/ace'], function(ace, langtools) { console.log("this testace module"); var editor = ace.edit("editor_container"); editor.settheme('eclipse'); editor.session.setmode('javascript'); require(["/js/ace/lib/ace/requirejs/text!src/ace"], function(e){ editor.setvalue(e); }) }); require(['testace']); secondly if put debugger in eventemitter(

javascript - TypeError: Main.login is not a function -

i trying implement this example project. can see front-end side code here . this controller (function(){ 'use strict'; /* authentication controllers */ var app = angular.module('pook'); app.controller('authctrl',['$http','$rootscope', '$scope', '$location', '$localstorage', 'ngtoast', 'main', function($http, $scope, $location, $localstorage, ngtoast, main){ $scope.login = function(){ var formdata = { username: $scope.username, password: $scope.password }; main.login(formdata, function(res) { if (res.type == false) { alert(res.data) } else { $localstorage.token = res.data.token; window.location = "/"; } }, function() { $rootscope.error = 'failed signin'; }); } }]); })(); below factory service

php - Laravel 5 foreign key migration error -

i have issue when try reset migrations. using oracle sql when problem appeared first think i've done emptied database in sqldeveloper don't see tables if run tinker every table created. when trying rollback migrations recieve error referenced fact have foreign keys in tables: unique/primary keys in table referenced foreign key, when try remove constraints artisan says table not have constraint. here migrations files: categories table: public function up() { schema::create('categories', function(blueprint $table) { $table->increments('id'); $table->string('name'); $table->integer('parent'); }); schema::create('article_category', function(blueprint $table){ $table->integer('article_id')->unsigned()->index(); $table->foreign('article_id')->references('id')->on('articles')->ondelete('cascade'); $table-&

The java "Object" Class equivalent in Scala -

it seems good reason need switch scala! so, excuse me if question might seem novice. it seems any in scala supper class of types , might considered object type equivalent in java. type any abstract, while object not. more concretely, can not write following code in scala (since class abstract , cannot instantiated): val k:any = new any(); while can write following code in java: object k=new object(); what should use if need concrete equivalent type of java object type? anyref type not abstract seems equivalent of java object class (see this ) so following works in scala: val k:anyref = new anyref();

html - Php - imap_delete - Delete just selected email -

i have script prints out inbox emails fetched imap server. have added delete submit button when pressed needs delete email belongs button. however, script right now, deletes email when delete button pressed. simplified code below: <?php foreach($emails $email_number) { ?> <form method="post"> <th class="tg-031e"><input type="submit" name="delete_inbox" value="delete"></th> </form> <?php if(isset($_post['delete_inbox'])){ $check = imap_mailboxmsginfo($imap); echo "messages before delete: " . $email_number . "<br />\n"; imap_delete($imap, $email_number); $check = imap_mailboxmsginfo($imap); echo "messages after delete: " . $check->nmsgs . "<br />\n"; imap_expunge($imap); $check = imap_mailboxmsginfo($imap); echo "messages after expunge: " . $check->nmsgs . "<br />\n"; } }?> an

c# - ApplicationUserContext is null in Entity Framework -

i came accross out of world today. basically, i'm using default applicationusercontext included in entityframework, , somehow, when add role user, subject needs logout roles updated. in fact, normal because roles stored in cookie in infos loaded every 30 minutes, or everytime user signs in. so in case, trying add specific role user, using role manager , forcing "resignin", aka logout login. _usermanager.addtorole(userid, "the role of world"); applicationuser theuser = _usermanager.findbyid(user.identity.getuserid()); if (returnurl != null) { accountcontroller ac = new accountcontroller(); await ac.relogin(theuser); return redirect(returnurl); } now see, created new instance of accountcontroller since in other controller , called method "relogin(user)" public async task relogin(applicationuser _user) { await signinasync(_user, false); } private async task signinasync(applicationuser user, bool ispersis

c# - Why when using a textBox to search for text and color the results the program freeze? -

i have class: private class utility { public static void highlighttext(richtextbox myrtb, string word, color color) { int s_start = myrtb.selectionstart, startindex = 0, index; while ((index = myrtb.text.indexof(word, startindex)) != -1) { myrtb.select(index, word.length); myrtb.selectioncolor = color; startindex = index + word.length; } myrtb.selectionstart = s_start; myrtb.selectionlength = 0; myrtb.selectioncolor = color.black; } } then using it: private void textbox1_textchanged(object sender, eventargs e) { utility.highlighttext(richtextbox1, textbox1.text, color.red); } first time when click in textbox color text in richtextbox. when delete text in textbox , it's empty program freeze , used breakpoint seems stuck

css3 - CSS different backgrounds for different divs -

something's not working. the code here: bambakids.com/menu content: index.html jquery.easing.1.3.js smoothscroll.js css folder: css/style.css let me know if want images too, although shouldn't matter. goal: there different background color on contact div on main 1 (headermenu) in html file have in line 57 background-color: !red; the ! not valid part of color name , needs removed.this looks typo me. doing yields red background on "hello!" placeholder. you should using linter. such tool have spotted error you.

c - Segmentation Fault GTK+ application -

i'm making gtk 3+ application using glade. here structure in c : # include <gtk/gtk.h> # include <stdio.h> # include <stdlib.h> typedef struct s_gtk { gtkbuilde

python - Inheritance and classes -

this in class file. class edifice: def __init__(self,storeys,area): self.__storeys = storeys self.__area = area def show_info(self): print('storeys:',self.__storeys,', floor area:',self.__area) class home(edifice): def __init__(self, storeys, area, bedrooms): super().__init__(storeys, area) self.__bedrooms = bedrooms def show_info(self): super(home, self).show_info() print("for human habitation: ", self.__bedrooms, "bedrooms") this in executable file: from classes import edifice, home def main(): print("home") h = home(2,3000,3) h.show_info() main() from executable file need create instance of home show_info() method different text output. you want use like: class home(edifice): def __init__(self, storeys, area, bedrooms): super().__init__(storeys, area) self.__bedrooms = bedrooms super(home, self).show

javascript - Pop up djstripe payments modal without button click -

since have 1 djstripe subscription plan, i'm trying djstripe payments/subscribe page pop payments modal without click. javascript works click of button this: $(function() { $('body').on("click", '.djstripe-subscribe button[type=submit]', function(e) { e.preventdefault(); // retrieve current $(".djstripe-subscribe") var $form = $(e.target).parents('form'), token = function(res) { $form.find("input[name=stripe_token]").val(res.id); $("button[type=submit]").attr("disabled", "true"); $('#in-progress').modal({"keyboard": false}) $('.progress-bar').animate({width:'+=100%'}, 2000); $form.trigger("submit"); }; stripecheckout.open({ key: "{{ stripe_public_key }}", name: 'payment method', panell