Posts

Showing posts from February, 2011

How to use autoclose brackets in Jupyter notebook? -

this may sound silly question, how make use of autoclose brackets in jupyter notebook? example, when type print( jupyter notebook auto-closes brakets print() and places cursor inside. type argument, say print(1 + 1) now cursor between second 1 , right bracket ) . key navigate right of ) ? of course can press end or → or ) achieve this, not seem save time, purpose of brackets autoclose suppose? thanks in advance.

git - What are the pitfalls of "always" rebasing? -

a few people @ work swear git pull --rebase . in fact, won't git pull without it, when several people working on shared branch. it understanding rewrites history . in fact, have seen said 1 should never rebase on public/shared branch . my question: what concrete example of way rebasing "rewrites history"? what concrete examples of bad things occur if violate "golden rule of rebasing"? possible difference suggested dupe: i'm not talking rebasing master feature branch. talking several developers working on same feature branch, doing git pull --rebase , making changes, pushing (doing pull --rebase if push rejected), etc. we use in our workflows. if use on short-lived branches it's relatively safe. you're replaying your local commits (rewriting that history) on top of pushed commits of coworkers. if you're rebasing entire collaboration branch in best interests coordinate coworkers. otherwise it's easy lose work...

Python- Calling elements from a list returns wrong ones -

from list, shuffle: rotationspeedarray = [4,6,8,10] #in hz random.shuffle(rotationspeedarray) i try call 1 specific number @ time, print rotationspeedarray[0] print rotationspeedarray[1] print rotationspeedarray[2] print rotationspeedarray[3] but whenever this: #an actual empty space [ 6 , the code part meant draw figure , rotate it. want different speeds, that's why created list takes 1 of rotation speeds , uses it. figure moves each trial @ different speed, process of taking 1 value @ time works. don't why whenever ask show me each value of list, this. i hope sufficiently clear; please don't hesitate asking me question. i'm having no problems. sure you're not surrounding converting list string somewhere down line?? it's treating rotationspeedarray string, why ask. random.shuffle throw typeerror if had put quotes around list, i'm assuming there code you're not showing somewhere past converting string? import random rota...

How to detect an CTS approved Android build? -

in documentation of android n preview mentioned: this build not compatibility test suite (cts) approved. apps depend on cts approved builds won’t work (android pay example). in android app want check whether device/build cts approved on first launch. possible? how android pay it? the safetynet api allows run compatibility check which: allows app check if device running matches profile of device has passed android compatibility testing. compatibility check creates device profile gathering information device hardware , software characteristics, including platform build. once have connected googleapiclient using safetynet.api , can call byte[] nonce = getrequestnonce(); // should @ least 16 bytes in length. safetynet.safetynetapi.attest(mgoogleapiclient, nonce) .setresultcallback(new resultcallback<safetynetapi.attestationresult>() { @override public void onresult(safetynetapi.attestationresult result) { status status = result.getstatus(); ...

javascript not working in embed svg file -

i start learning svg. got example code manipulating svg documents using ecmascript (javascript) , dom . change little: <!doctype html> <html> <body> <svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="300" height="300"> <script type="text/ecmascript"> <![cdata[ function changerectcolor(evt) { var red = math.round(math.random() * 255); evt.target.setattributens(null,"fill","rgb("+ red +","+ red+","+red+")"); } ]]> </script> <g id="firstgroup"> <rect id="mybluerect" width="100" height="50" x="40" y="20" fill="blue" onclick="changerectcolor(evt)"/> <text x="40" y="100">click on rectangle change it's color.</text> </g> </svg> <...

javascript - Rails 4: dynamically added checkboxes are not submitting -

i started learn rails , try apply ajax records added dynamically in listing. want delete multiple records selected via checkboxes directly in listing. it works fine not when create new record , want delete without refreshing page . header's response : "activerecord::recordnotfound in accountscontroller#destroym". acts if click button without checking checkboxes. thanks :) accounts_controller.rb def destroym account.destroy(params[:delete]) respond_to |format| format.html {redirect_to accounts_path} format.js #render accounts/destroym.js.erb end end _row.html.erb <% @data = account.find(id) %> <tr id='tr<%= @data.id %>'> <td><%= @data.id %></td> <td><%= @data.login %></td> <td><%= check_box_tag 'delete[]', @data.id %></td> </tr> index.html.erb <table class="table table-striped table-hover " id="accountslisti...

assembly - I'm trying to make an array and sort it with a sentinel value which is 0 but it's not working it's giving me an error -

i want prompt user input want take input , put array. want print out array. know can print them out without putting them in array practice. .data array: .space 40 prompt: .asciiz "enter integer (0 quit) :" text: .asciiz "after sorting, list of integers is:" .text .globl main main: la $a1, array read_numbers: li $v0, 4 la $a0, prompt syscall li $v0, 5 syscall sw $v0, 0($a1) addiu $a1, $a1, 4 beqz $v0, sort j read_numbers sort: la $a1, $array li $v0, 4 la $a0, text syscall loop: lw $t0, 0($a1) addiu $a1, $a1, 4 beqz $t0, done li $v0, 1 move $a0, $t0 syscall j loop done: the error i'm having is: instruction references undefined symbol @ 0x00400050 [0x00400050] 0x3c010000 lui $1, 0 [$array] ;24: la $a1, $array

ios - Checking a website for an update in Swift? -

i've been looking answer have been unable find one. what's best way check website update (maybe using rss feed?) , show there has been update on app in swift if there has been update? any appreciated, cheers i check last modified field in http header. the steps follows : check current modified field webpage. store date variable or persist somewhere. at future date check webpage's last modified field once more. compare old value new value, if values aren't equal webpage has been modified. check out link : getting header response in swift find how view http header of given url in swift.

osx - Problems opening a java file using gedit on terminal -

i'm using terminal test java code. have mac. when compile example: ->javac myjava.java (it compiles perfectly) ->java myjava (it works perfectly) but problem when i'm trying edit java file using gedit, this: ->gedit *.java it displays error: ->(gedit:12827): gtk-warning **: cannot open display: what cause? have installed gedit on mac, still giving same problem. regards! you're trying launch editor (gedit) requires xwindows. download , install xserver (like xquartz ) or use terminal based editor vim, or use native mac editor.

php - htaccess exclude a page from rule -

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritecond %{http_referer} !^http://(www\.)?pirate-punk.com(/)?.*$ [nc] rewriterule ([^/]+\.[a-z0-9]+)$ http://www.pirate-punk.com/dl.php?f=$1 [r,nc,l] options +indexes this htaccess redirect incoming traffic page if come different domain. i exclude index.php pages rule visitors can still visit index.php page if come outside of domain how can ? you can add condition excludes ends / or /index.php : rewriteengine on rewritecond %{request_uri} !/(index\.php)?$ rewritecond %{http_referer} !^http://(www\.)?pirate-punk.com(/)?.*$ [nc] rewriterule ([^/]+\.[a-z0-9]+)$ http://www.pirate-punk.com/dl.php?f=$1 [r,nc,l]

ios - How to spawn a node on a scheduled timer loop in a override touch began method -

so creating shooting game ios , having trouble looping bullet spawn method activated touching , moving joystick. i've tried seems coding there right way. here bullet defined: func spawnbullet1(){ self.addchild(bullet1) bullet1.position = cgpoint (x: gun1.position.x , y: gun1.position.y) // bullet spawn @ anchor point bullet1.xscale = 0.5 bullet1.yscale = 0.5 //physics, not important right bullet1.physicsbody = skphysicsbody(rectangleofsize: bullet1.size) bullet1.physicsbody?.categorybitmask = physicscategory.bullet1 bullet1.physicsbody?.contacttestbitmask = physicscategory.enemy1 bullet1.physicsbody?.affectedbygravity = false bullet1.physicsbody?.dynamic = false let wait:skaction = skaction.waitforduration(0.5) //bullet spawn wait let block:skaction = skaction.runblock(spawnbullet1) //re-spawn bullet let seq3:skaction = skaction.sequence( [ wait, block ]) //sequence self.runaction(seq3) //execution } my jo...

html - Trying to place a video in bootstrap carousel. But disappears when i set position to fixed -

im trying place video in bootstrap carosel. trying move video around fits div @ particular responsive hieght not dimensions of video itself. but when make video position fixed disappears. i'm not sure whats going on here. html <video class="videoinsert" autoplay loop poster="~/content/video/posters/b-roll-1.jpg" muted> <source src="https://broken-links.com/tests/media/bigbuck.webm" type="video/webm"> <source src="https://broken-links.com/tests/media/bigbuck.m4v" type="video/mp4" /> browser not support video tag. </video> </div> </div> <a class="left carousel-control" href="#mycarousel" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"...

python - object has no attribute 'clean_data' error -

i keep on getting object has no attribute when cleaning data. error occurs when try post form register user. while have used django built in registration view , form, decided use built 1 since wanted make easier use extended custom user model later. views: def register(request): if request.method == 'post': user_form = userregistrationform(request.post) if user_form.is_valid(): new_user = user_form.save(commit=false) new_user.set_password( user_form.clean_data['password']) new_user.save() profile = profile.objects.create(user=new_user) return render(request, 'account/register_done.html', {'new_user':new_user}) else: user_form = userregistrationform() return render(request, 'registration.html', {'user_form': user_form}) forms: from django import forms django.contrib.auth.models import user django.contr...

html - combine fade and slide ( left/top/bottom/right ) with AngularJS -

i see lot of single page app(s) uses fade-in , slide-up during scrolling etc .. but can't seem find can integrate angular's nganimate , in websites it's either install new code new lib , want stop myself keep installing 1000 modules @ point can't scale ( because don't know how combine 2 animation @ once ) i've seen code example: http://codepen.io/astrotim/pen/kdbbe , trying import , adjust used angularjs w/o luck :/ html <div ng-if="front_wallpaper" class="animated fade-and-slide"> mytext </div> angular's app js angular.module('app', ['nganimate']) .controller('somectrl', function ($scope, $timeout) { $scope.front_wallpaper = false; $timeout(function () { $scope.front_wallpaper = true; },1000); }); css div { font-size: 48pt; color: white; position: relative; left: -60%; top: 20%; opacity: 0; ...

c# - How to convert Vector3 to Quaternion? -

trying figure out how convert vector3 quaternion. ok if need update said value? you can quite convert vector3 quaternion using, example, this: quaternion quaternion = quaternion.euler(v.x, v.y, v.z); so, example, that's quaternion rot = quaternion.euler(v3.x, v3.y, v3.z); that should it!

parsing - PHP Parse/Syntax Errors; and How to solve them? -

Image
everyone runs syntax errors. experienced programmers make typos. newcomers it's part of learning process. however, it's easy interpret error messages such as: php parse error: syntax error, unexpected '{' in index.php on line 20 the unexpected symbol isn't real culprit. line number gives rough idea start looking. always @ code context . syntax mistake hides in mentioned or in previous code lines . compare code against syntax examples manual. while not every case matches other. yet there general steps solve syntax mistakes . references summarized common pitfalls: unexpected t_string unexpected t_variable unexpected '$varname' (t_variable) unexpected t_constant_encapsed_string unexpected t_encapsed_and_whitespace unexpected $end unexpected t_function … unexpected { unexpected } unexpected ( unexpected ) unexpected [ unexpected ] unexpected t_if unexpected t_foreach unexpected t_for unexpected t_while unexpected t_do ...

java - JavaFX: ListView not displaying in GUI -

my problem listview not showing on gui, have added placeholder test , show placeholder text other cannot add list. my aim have list of clients accounts, have included account class, want display accounts id's in listview. for reason not work, have tried inputting random data see if thats issue still not luck. i have static set called allaccounts in main.class file. any appreciated, have searched near , far , since new struggle understand why not working. controller.class public class controller implements initializable{ @fxml private tableview<?> tableview; @fxml private tablecolumn<?, ?> tableaccount; @fxml private tablecolumn<?, ?> tabledate; @fxml private tablecolumn<?, ?> tabletime; @fxml private tablecolumn<?, ?> tabletotal; @fxml private tablecolumn<?, ?> tablenotes; @fxml private listview<string> list; @fxml private textarea invoiceview; @fxml pr...

javascript - Ember Data error while processing route this.store.findALL is not a function -

Image
i'm going through ember.js guides, , i'm getting hung on ember data section. ember data guide the tutorial shows how create ember data model , use in conjunction mirage render basic rentals info on index page. my code appears same tutorial (see note @ bottom), index page doesn't display anything, , these errors in chrome console: any offer appreciated. app/models/rentals.js import model 'ember-data/model'; import attr 'ember-data/attr'; export default model.extend({ title: attr(), owner: attr(), city: attr(), type: attr(), image: attr(), bedrooms: attr() }); app/mirage/config.js export default function() { this.get('/rentals', function() { return { data: [{ type: 'rentals', id: 1, attributes: { title: 'grand old mansion', owner: 'veruca salt', city: 'san francisco', type: 'estate', be...

Have Unmanaged c++ code call managed c++ code that calls c# code -

i'm having trouble figuring out how reference managed c++ code calls c# code unmanaged c++ code. let me throw out few scenarios: i have unmanaged code reference , call managed code, managed code's call c# code commented out, builds , works fine. uncomment c# code, compiler errors saying c# namespace doesn't exist. in unmanaged code comment out reference , call managed code. managed code calls c# code. builds , runs fine... picture here. compiler error c2653. here's i'm doing: unmanaged c++ code: i've set linker include managed c++ lib file. #include "managedcpp.h" managedcpp::foo(); managed c++: extern "c" __declspec(dllexport) void __stdcall foo() { csscode::bar(); } c# public static void bar() { // here initializes stuff registry // data structures plan on marshaling // other method calls, know involves placing // things on stack can returned // managed c++ code need marshed // unman...

mysql - Updating table in trigger after update on the same table -

how can update table's column in trigger after update on same table? here's trigger: create trigger upd_total_votes after update on products_score each row update products_score set products_score.votes_total = (select (votes_1 + votes_2 + votes_3 + votes_4 + votes_5) products_score id = new.id) now when update table like update products_score set votes_1 = 5 id = 0 this doesn't work, following: #1442 - can't update table 'products_score' in stored function/trigger because used statement invoked stored function/trigger. so how on earth can work? if change trigger before instead of after this: create trigger upd_total_votes before update on products_score each row begin set new.votes_total = new.votes_1 + new.votes_2 + new.votes_3 + new.votes_4 + new.votes_5 end ;

c++ - How to create a QPushButton with the text displayed over the icon? -

i trying create qpushbutton in project such text shows on top of custom button image or icon. tried below methods: imagepath = path; qpixmap pixmap(imagepath); qicon buttonicon(pixmap); button->seticon(buttonicon); button->seticonsize(pixmap.rect().size()); button->setgeometry(0,0,height,width); button->setstylesheet( "background-color: gray;" "border: 1px solid black;" "border-radius: "+qstring::number(radius)+"px;" "color: lightgray; " "font-size: 25px;" ); when try use settext here, shows icon first , text on right. want text appear on top of icon. i tried below method found online: imagepath = path; button->setgeometry(0,0,height,width); button->setstylesheet("background-image: url(:/images/images/2adjacenttracksbutton.png));" "background-position: center center"); this 1 not accepting url path, hence not displaying image ne...

How to get DNS server IP(s) from hostName in java -

situation: trying dns servers entries/details each system. each system can have different dns ips. ques: how get/fetch dns server ip(s) hostname in java ? i did this: linkedlist<string> nameservers = (linkedlist<string>) sun.net.dns.resolverconfiguration.open().nameservers(); , able dns details of localsystem - want details of other systems aswell. any suggestion ?

Resetting a LDAP user's password in PHP, without the old password, using admin user -

i trying figure out how reset ldap user password when connected user (admin user) in php password reset feature. $this->con = ldap_connect($this->server); ldap_set_option($this->con, ldap_opt_protocol_version, 3); $user_search = ldap_search($this->con, $this->dn,"(|(uid=$user)(mail=$user))"); $this->user_get = ldap_get_entries($this->con, $user_search); $user_entry = ldap_first_entry($this->con, $user_search); $this->user_dn = ldap_get_dn($this->con, $user_entry); $this->user_id = $this->user_get[0]["uid"][0]; $entry = array(); $entry["userpassword"] = "$encoded_newpassword"; ldap_modify($this->con, $this->user_dn, $entry) (aggregated class methods) works resetting user's password using old password, how go doing password change user (admin in case)? i think there ldap authentication/binding not understanding. perhaps can point me in right direction. can ldap_bind before ldap_modify ...

image processing - Deconvolution with Lucy-Richardson method using MatLab -

i trying deblur image using matlab. have point spread function (psf) images blurred with. furthermore, know there noise gaussian distributed, , signal noise ratio (snr) high (>20). matlab has couple of deconvolution functions use direct filtering (regularized filter , weiner filter), not yield satisfactory results. matlab has lucy-richardson (lr) iterative algorithm that, in case, job in deblurring image (judged visually). my question is: theoretically sound use lr method when noise in image has gaussian distribution ? the lr assumes poisson noise in blurred image - mean performs best poisson noise, may adequate use other types of noise - can expect similar results if want deblur similar images in future? or mean lr may randomly yield non-sense results if used images have other types of noise poisson ?

How to use structured data (JSON-LD) for a local business that is made up of several sub businesses -

i built website local business has golf course, indoor sports complex (tennis, racquetball, wally ball, batting cages, nautilus), restaurant, catering, , offers weddings , receptions. not sure how started. appreciated. good afternoon, the following example might helpful. please note, @id i've made assumption you've created dedicated page each entity , indicated link in example doesn't have working link therefore if haven't created dedicated page can create unique id each entity (this id should not change on time). please see definitions of department , suborganization @ schema . <script type="application/ld+json"> { "@context" : "http://schema.org", "@type" : "localbusiness", "name" : "business name", "@id" : "http://www.your-company-site.com", "logo" : "http://www.your-company-site.com/logo.jpg", "sameas" : [ "...

doctrine2 - MongoDB - find ids of documents with the highest value in a group -

assume following collection: _id:1, humanid:a, value:10 _id:2, humanid:a, value:20 _id:3, humanid:b, value:33 question: what easiest way find ids of documents have highest value when grouped humanid , i.e. output [2, 3] . bonus question: can done using doctrine odm query builder?

php - Codeigniter Community AUth Use of undefined constant USE_SSL -

i on codeigniter 3 . installed community auth , receiving error: use of undefined constant use_ssl - assumed 'use_ssl'". when change code to use_ssl , error resolved want make sure correct solution , use_ssl not global variable or function versus constant not see on codigniter forum this. yes first step must $config['enable_hooks'] = true; , second in /application/config/hooks.php add these line $hook['pre_system'] = array( 'function' => 'auth_constants', 'filename' => 'auth_constants.php', 'filepath' => 'hooks' ); $hook['post_system'] = array( 'function' => 'auth_sess_check', 'filename' => 'auth_sess_check.php', 'filepath' => 'hooks' );

dns - Client transferred/changed domain names...how do I salvage the WordPress site -

so built client wordpress site , after if completed , paid decided didn't domain name. logged hostgator , bought/transferred new domain. then day later calls , wonders why page isn't loading. i'm able go ftp , save wp-content , every file there... question how wordpress site built onto new domain name? i've read kinds of tutorials how export/import require site you're transferring live.. can't log wp-admin portion because looks domain not exist anymore. i'm not back-end guy.. i've build few sites off line xamp have no idea i'm doing when comes trying salvage site. help? wordpress flexible handle situations moving server. first wordpress directory, images, plugins, , other files on site database. detailed steps on how documented in website https://codex.wordpress.org/moving_wordpress .

ios - GoogleMaps/GoogleMaps.h' file not found when I archive an app -

Image
i used in googlemap project,there no problem when use simulator.but when archive project ,i'm getting build error - googlemaps/googlemaps.h file not found. change bulid configuration debug (edit scheme -> archive -> build configuration ->debug)is no problem.can me,what reason this?

c++ - Chapter 4 Stroustrup Drill. A challenging step (at least for me!) -

i'm working through stroustrups's "programming principles , practice using c++" , got stuck in 1 exercise. here indications : 1) write program consists of while-loop (each time around loop) reads in 2 ints , prints them. exit program when terminating '|' entered. 2)change program write out smaller value is: followed smaller of numbers , larger value is: followed larger value. 3)augment program writes line numbers equal (only) if equal. 4)change program uses doubles instead of ints. 5)change program writes out numbers equal after writing out larger , smaller if 2 numbers differ less 1.0/100. 6) change body of loop reads 1 double each time around. define 2 variables keep track of smallest , largest value have seen far. each time through loop write out value entered. if it’s smallest far, write smallest far after number. if largest far, write largest far after number. this code have far: int main(){ double number1 = 0; double number2...

java - Relations among the Action class, JSP page and HTTP request? -

with struts, can request url http://example.com/list.do?xxx=xx handled action class , flow jsp file. , can request jsp page http://example.com/list.jsp directly. what's relations among these 3 concept? dynamic things direct jsp page request? you should prevent using direct jsp redirection as possible. whole concept

javascript - Tablesorter sorting arrows are unable to use -

Image
i'm new jquery , php programming. think stupid question , many question here nothing works. have gone through these issue 4 hours already, feel desperate fix this. as can see, table looking ok. but... arrows not working. once clicked, nothing me don't know what's wrong it. these codes far. (i skipped major of table codes reduce length of post) <head> <link rel="stylesheet" type="text/css" href="jquery.tablesorter/docs/css/jq.css?4005963428"/> <link rel="stylesheet" type="text/css" href="jquery.tablesorter/themes/green/style.css?4005963428"/> <link rel="stylesheet" type="text/css" href="jquery.tablesorter/addons/pager/jquery.tablesorter.pager.css?4005963428"/> <style> table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { padding: 5px; } </style> <script type="text/javascript" src="jquery.table...

javascript - Heartbeat method in Meteor -

i have meteor application that, every second while user holding button, decrements value on post 1. there many many buttons, , each should affect itself. if 1 person holding button, go down rate of 1 per second. if 2 people (on different clients) 2 per second. the exact moment @ updated in database unnecessary, client should see counter decrement variable amount each second. so trigger method used following template.button.onrendered(function() { var data = this.data; meteor.setinterval(function() { if(isclicked) { meteor.call('heartbeat', data); } }, 1000); }); which calls client/server method 'heartbeat': function(button) { buttons.update({_id: button._id}, {$inc: {life: -1}}); if(button.life <= 1) { console.log('remove dead buttons'); buttons.remove({life: {$lte: 0}}); } } and causes weird activity when latency comes play. when click on button, life goes down predictably @ 1hz on client. on different cl...

xcode4 - XCode: Possible to specify CFBundleIdentifier per-build-configuration? -

i can't figure out how this. i have special build configuration alongside debug , release . (let's call foo ) my cfbundleidentifier com.my-company.our-project . however, when build (and archive) foo configuration, want use bundle identifier com.my-company.foo.our-project is possible? i've tried has failed. i spend of day building white-label product, have time. the solution came use xcode "run script" build phase "postflight" script. in project file, select target, build phases, , add new "run script" build phase. renamed phase "postflight" , ensured move phase last thing done amongst build phases. the essential thing postflight script built .app package, info.plist within it, , change cfbundleidentifier within whatever our present build configuration set for. our script lot more (other logic, post-processing, resource manipulations, etc.). i can't provide many specifics since setup customized me...

javascript - Is there any way of converting a string containing es6 to es5? -

i creating application user enter es6 code , application return es5 equivalent. know babel converts es6 es5 there way use strings contain es6 code. e.g input: "[1, 2, 3].map(n => n * 2)" output: "[1, 2, 3].map(function(n) { return n * 2; }, this)" this called "transpiling". transpilers programs transfers code written in language language @ same level of abstraction. (from wikipedia ) for es6 es5, mention in question, there tool named babel . from babel's documentation : var babel = require("babel-core"); babel.transform(code, [options]) transforms passed in code. returning object generated code, source map, , ast. babel.transform(code, [options]) // => { code, map, ast } example var result = babel.transform("code();", options); result.code; result.map; result.ast;

java 8 - What is side effects in functional programming? -

i learning java 8 newly , see 1 definition related functional programming "a program created using only pure functions , no side effects allowed". one of side effects "modifying data structure in place". i don't understand line because @ last need speak database storing or retrieving or updating data. modifying database not functional means how speak database in functional programming ? "modifying data structure structure in place" means directly manipulate input datastructure (i.e. list). "pure functions" mean the result function of it's input , not other hidden state the function can applied multiple times on same input producing same result. not change input. in object oriented programming, define behaviour of objects. behaviour provide read access state of object, write access it, or both. when combining operations of different concerns, introduce side effects. for example stack , it's pop() operatio...

android - Getting a String from Plurals to use in XML? -

i using plurals simplify code. e.g., used have <string name="cat">cat</string> <string name="cats">cats</string> using plurals instead of multiple strings, have <plurals name="cats"> <item quantity="one">cat</item> <item quantity="other">cats</item> </plurals> however, used retrieve strings use titles or summaries in xml. e.g., android:title="@string/cats" having removed string in favor of plural, unsure how retrieve string xml. did make naive attempt with android:title="@plurals/cats" but gives me @1234567890 instead of cats (or cat ). anyone know if possible retrieve string out of plural xml? you have set code: ...settext(yourcontext.getresources().getquantitystring(r.plurals.cats, catscountvar));

Python: How to query utf-8 string from sqlite database -

i'm trying insert arabic words in sqlite database query these words. i'm facing result me : ('\xd9\x85\xd8\xb1\xd8\xad\xd8\xa8\xd8\xa7\xd9\x8b',) so here simple code explain i'm doing : # coding: utf-8 import sys; reload(sys).setdefaultencoding("utf-8") import sqlite3 class database(object): def execute_db(self, *args): db = sqlite3.connect("sqlite3.db") db.text_factory = str cur = db.cursor() data = true try: args = list(args) args[0] = args[0].replace("%s", "?") args = tuple(args) cur.execute(*args) arg = args[0].split()[0].lower() if arg in ["update", "insert", "delete", "create"]: db.commit() except exception, data: data = false db.rollback() db.commit() db.close() return data def fetch_one(self, *...

jquery - How can I freeze the first column of table? -

i trying fix first column gridview, looked of related posts such as: link1 link2 but not working. not gridviewscroll helped me. may due conflict existing css or something. i therefore including rendered html table , css, can please me .csstablegenerator { margin: 0px; padding: 0px; width: 90%; border: 1px solid #000000; -moz-border-radius-bottomleft: 0px; -webkit-border-bottom-left-radius: 0px; border-bottom-left-radius: 0px; -moz-border-radius-bottomright: 0px; -webkit-border-bottom-right-radius: 0px; border-bottom-right-radius: 0px; -moz-border-radius-topright: 0px; -webkit-border-top-right-radius: 0px; border-top-right-radius: 0px; -moz-border-radius-topleft: 0px; -webkit-border-top-left-radius: 0px; border-top-left-radius: 0px; } .csstablegenerator table { border-collapse: collapse; border-spacing: 0; width: 100%; height: 100%; margin: 0px; pad...