Posts

Showing posts from July, 2014

c - How to open a non-decorated fullscreen window on Ubuntu -

c - How to open a non-decorated fullscreen window on Ubuntu - what trick open non-decorated fullscreen window on ubuntu? used alter _net_wm_state property _net_wm_state_fullscreen accomplish while working fine on kde doesn't seem work on ubuntu (gnome; tested 12.04 lts). launcher on left , title bar still there , appear above non-decorated fullscreen window not want. when switching fullscreen mode in firefox, however, firefox's fullscreen window covers finish screen including launcher panel , title bar must possible somehow open windows cover entire screen, including ubuntu's launcher , title bar. could explain how accomplish behaviour using plain x11 without middleware? thanks! i've found problem. setting _net_wm_state_fullscreen not enough. 1 should set override_redirect attribute true prevent window manager intercepting configure , map requests seems gnome doing on ubuntu putting launcher panel , title bar on fullscreen window. setting override_

python - Any way to create PDF file with wkhtmltopdf without returning HttpResponse or using URL? I just want to attach PDF file to email -

python - Any way to create PDF file with wkhtmltopdf without returning HttpResponse or using URL? I just want to attach PDF file to email - i'm using wkhtmltopdf wrapper generate template pdf in django 1.6. works fine when want display pdf afterwards or send pdf file httpresponse download want create file in tmp folder , attach email. i'm not sure how accomplish this. # views.py context = { 'products_dict': products_dict, 'main_categories': main_categories, 'user_category': user_category } response = pdftemplateresponse(request=request, context=context, template="my_template.html", filename="filename.pdf", show_content_in_browser=true, cmd_options={'encoding': 'utf8', 'quiet': true,

problm with int pointer in C++ -

problm with int pointer in C++ - int *sub(int *a,int q) { int = id(a,q)+1,j = id(a,q)-1; int *l , *m ; m = (int*)malloc(sizeof(int)); *m = q; l = m ; for(i ; *(a+i) != '\0' && *(a + i) >= q ; ++i) { ++l = (int*)malloc(sizeof(int)); *l = *(a+i); } ++l = (int*)malloc(sizeof(int)); *l = '\0'; for(j ; j>=0 && *(a + j) >= q ; j--) { --m = (int*)malloc(sizeof(int)); *m = *(a+i); } for(i = 0 ; *(m + i) != '\0' ; i++) cout<<*(m+i)<<"##\t"; homecoming m; } it's function supposed take pointer 1d array (a) , homecoming pointer 1d array(m) subarray of , has elements greater or equal q(passed parameter function sub ) guess there problem way manipulate int pointers. #include <iostream> #include <string> #include <vector> #include <algorithm> int _tmain(int argc, _tchar* argv[]) { s

javascript - Getting localstorage data when second page loads -

javascript - Getting localstorage data when second page loads - i new phonegap. trying localstorage info stored in firstpage on sec page. not getting alert "hello", when secondpage loads. running on ios simulator. <html> <head> <title>submit form via ajax</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.css" /> <script src="http://code.jquery.com/jquery-1.5.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a4/jquery.mobile-1.0a4.min.js"></script> </head> <body> <script> function onsuccess(data, status) { info = $.trim(data); //$("#notification").text(data); alert(data); console.log(data); if(data=="success"){

python - Django 1.6: MultiValueDictKeyError in dropdown form -

python - Django 1.6: MultiValueDictKeyError in dropdown form - i'm trying implement 2 dropdown menus in 1 of template maintain error. traceback: file "/library/python/2.7/site-packages/django/core/handlers/base.py" in get_response 114. response = wrapped_callback(request, *callback_args, **callback_kwargs) file "/library/python/2.7/site-packages/django/views/decorators/csrf.py" in wrapped_view 57. homecoming view_func(*args, **kwargs) file "views.py" in doclistings 91. request.session["genderselect"] = request.post['genderselect'] file "/library/python/2.7/site-packages/django/utils/datastructures.py" in __getitem__ 301. raise multivaluedictkeyerror(repr(key)) exception type: multivaluedictkeyerror @ /doclistings/ exception value: "'genderselect'" here template i'm trying have 2 dropdown menus in 1 single form work class="

Python zip all files in directory script failed -

Python zip all files in directory script failed - i want write simple script python zip file in folder. have until now: import os import zipfile zfname = 'simonszip.zip' foo = zipfile.zipfile(zfname, 'w') dirname, dirnames, filenames in os.walk('.'): # print path filenames. filename in filenames: print (os.path.join(dirname,filename)) foo.write(os.path.join(dirname, filename)) foo.close() when sudo python script.py script runs, never ends, while producing enormous zip file. any ideas? you're doing recursion. since zip created listed in files. you're writing zip within zip within zip within zip , on. python

java - What does having a Parent / Child Relationship really means in Android Ecosystem? -

java - What does having a Parent / Child Relationship really means in Android Ecosystem? - i have dilemma when said 2 activities having parent/child relationship in android ecosystem. so 1 it: activity-a spawns activity-b ? activity-a spawns activity-b , activity-b inherits parent activity-a ? any idea/pointer appreciated. java android inheritance android-activity parent-child

javascript - clicking a marker opening a image next to map -

javascript - clicking a marker opening a image next to map - i have leaflet map has lots of markers , open image next map linked marker on marker click. know need javascript/jquery , ajax create work. here illustration like: http://www.washingtonpost.com/wp-srv/special/local/14th-street-businesses/ any hints/tips/tutorials appreciated. in advance! here solution problem: http://franceimage.github.io/leaflet/10/ var selectedmarker = false; var geojsonmarkeroptions = { radius: 8, fillcolor: "#ff7800", color: "#000", weight: 1, opacity: 1, fillopacity: 0.8 }; l.geojson(fi_markers, { pointtolayer: function (feature, latlng) { var marker = l.circlemarker(latlng, geojsonmarkeroptions); marker.on('click', function (e) { var feature = e.target.feature; var content = '<h3>' + feature.properties.popupcontent + '</h3><a href=

c++ - MFC Statusbar - Making text a link with button behavior -

c++ - MFC Statusbar - Making text a link with button behavior - im trying utilize status bar in mfc application described here i managed add together items status bar described in link. there's nil post here code reference 1:1 in link. want create text link, when clicked, i'll grab callback , something. couldn't find how it, yet i've seen in apps before. i utilize similar, need derive own class cstatusbar. a) place next code @ top of derived statusbar.cpp begin_message_map(cmystatusbar, cstatusbar) on_wm_lbuttonup() end_message_map() b) add together next declaration cmystatusbar in derived statusbar.h afx_msg void onlbuttonup(uint nflags, cpoint point); c) place next code later on in derived statusbar.cpp void cmystatusbar::onlbuttonup(uint nflags, cpoint point) { crect rc; int npaneindex = commandtoindex(id_indicator_time); getstatusbarctrl().getrect(npaneindex, &rc); if (rc.ptinrect(point)) { //

"git reset --hard HEAD" after "git commit --amend" -

"git reset --hard HEAD" after "git commit --amend" - i performed git commit --amend . i made changes, wanted discard them, performed git reset --hard head , thinking go point amended. seems have gone point of original commit. there numerous answers undoing git reset --hard head on here, none deal undoing reset in situation (with amend involved), , wanted create sure should follow same pattern before proceeding. this seems popular answer: undoing git reset --hard head~1 edit you know what, i'm realizing i've done couple of --amend s today without first doing git add together . . crappy day. there way work if didn't git add together . ? if git commit --amend involved content modification (git add), git reset --hard have worked expected. but git commit --amend without modification modify commit date (hence changing/sha1 commit sha1) if changes added, this answer shows git fsck should able show changes. a more finish co

JQuery.js WordPress conflict -

JQuery.js WordPress conflict - i have wordpress site uses jquery mega menu plugin , theme-my-login both call: <script type='text/javascript'src='http://localhost/wadhaa/dynamic/wp-includes/js/jquery/jquery.js?ver=1.11.0'></script> in head section by: <?php /* have wp_head() before closing </head> * tag of theme, or break many plugins, * utilize hook add together elements <head> such * styles, scripts, , meta tags. */ wp_head(); ?> and have include: <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> which causes conflicts wordpress jquery.js can can help me prepare this? or allow me know @ to the lowest degree why conflict happen. the error conflict is: uncaught typeerror: undefined not function you don't need include own jquery, wordpress have included it, $ name reserved. just call: jquery(function($) { $('#what_eve

java - Regular expression matching issue with the following scenario -

java - Regular expression matching issue with the following scenario - i developing application. user come in of setting value in server. when inquire value server through inbuilt api. getting values whole string: example- name={abc};display={xyz};addressname={123} here properties name, display , address , there respective values abc, xyz , 123. used split ; first delimeter , = sec dleimeter. string[] propertyvalues=ipropertiesstrings.split(";"); for(int i=0;i<propertyvalues.length;i++) { if(isnullempty(propertyvalues[i])) continue; string[] propertyvalue=propertyvalues[i].split("="); if(propertyvalue.length!=2) mpropertyvalues.put(propertyvalue[0], ""); else mpropertyvalues.put(propertyvalue[0], propertyvalue[1]); } } here mpropertyvalues hash map used keeping property name , value. problem there can string

jquery - Adding e.preventDefault(); to disable anchor behavior broke function -

jquery - Adding e.preventDefault(); to disable anchor behavior broke function - i'm pretty stumped on because seems simple. took function: $('#nav-link-1').click(function(){ $('#nav-pulldown-div-1').slidetoggle(); }); ...and changed (in line i've seen other people doing disable anchor's default behavior): $('#nav-link-1').click(function(e){ e.preventdefault(); $('#nav-pulldown-div-1').slidetoggle(); }); ...and stopped working. (the nav-pulldown-div-# divs should toggle view when link clicked.) i'm still not versed jquery, can imagine i'm overlooking simple. edit: here's jsfiddle: http://jsfiddle.net/grbyz/2/ i know it's weird there's links 2 , 3, there's reason in design. there typo on fiddle. missing . in $('#nav-link-3').click(function(e) { $('#nav-pulldown-div-3').slidetoggle(); e.preventdefault(); }); jquery

amazon web services - AWS EIP Limit Increase -

amazon web services - AWS EIP Limit Increase - i understand 5 eip per part , if need more need request service limit increase. my question how many can after service limit increase? possible 50 eip? please note dns ip aws provides not alternative since cannot assigned after instance created , dns ip cannot attached sec interface of device (it can assigned eth0 of given ec2 instance) all need public ip can assign eth1 or eth2 , need 50 ec2 instances. yes can more eip on request. can attach/reattach them ec2 instances. contact aws back upwards - indicating service limit increase. eip service limit increment - link general ec2 limits info - link amazon-web-services amazon-ec2 ec2-ami elastic-ip

ios - jQuery Mobile - Resize image before uploading -

ios - jQuery Mobile - Resize image before uploading - i'm working in jquery mobile app user can take pictures (with iphone) , upload online. but iphone image big, big, 2448x3264 on pixels size , 3mb file size. is there way cut down image locally on phone , when user click upload button image uploaded reduced size? 640x480 , less 3mb? you can accomplish after using canvas resize javascript library: https://github.com/gokercebeci/canvasresize it resizes image in browser , uses ajax send resized image information. there total illustration provided - check index.html file on git page, illustration php file receiving uploaded image information. jquery ios jquery-mobile

sql server - MSSQL T-SQL Table Hierachy including parent/child(group) -

sql server - MSSQL T-SQL Table Hierachy including parent/child(group) - i have query lists databases table hierarchy in relation level of fk/checks on referenced tables , columns. this depict order in info deleted/inserted. problem is, within want include path i.e. levels 1 through 'x' grouping path each follows (some might have multiple paths through levels). anyone have suggestions, utilize cte recursively grab level. perchance utilize fk referenced table-name? ;with ctetbhierarchy ( select distinct 1 levelid , object_schema_name(parent.object_id) tableowner , parent.name tablename , parent.object_id tbobjid , object_name(refkey.referenced_object_id) referenced_tablename , refkey.referenced_object_id , refkey.referenced_column_id sys.objects parent left outer bring together sys.

oracle - grant select on view -

oracle - grant select on view - somewhere along way going wrong, , can't seem find out why. if asked apologies. i have 3 schema's in database: colldesk local_it gerben colldesk our main schema, local_it our local development, , gerben end user (should have select options). now have table in colldesk schema called gestiones. in local_it have view called actions. holding 4 columns table gestiones in colldesk schema. far good! now want give gerben schema select privileges in view actions. when say grant select on local_it.actions gerben i error ora-01720: grant alternative not exist colldesk.gestiones now tried giving gerben select privileges gestiones, still getting error message any help appreciated! kind regards gerben create public synonym view , seek 1 time again grants create public synonym actions local_it.actions; grant select on actions gerben; oracle select database-schema grant

jquery - Javascript inheritance: overriding functionality with module pattern and $.extend -

jquery - Javascript inheritance: overriding functionality with module pattern and $.extend - i have next situation, in extend parent class , override behavior. overridden behavior not called. // parent scope definition (function ($) { $.extend(true, window, { demo: { parent: parent } }); function parent() { function a() { //do } function b() { //do else a(); } // public api $.extend(this,{ "a":a, "b":b }); } })(jquery); // kid scope definition (function ($,parent) { $.extend(true, window, { demo: { child: kid } }); function child() { // inherit parent parent.apply(child,arguments); this.a = function () { // override parent behavior } this.b(); } })(jquery,parent); //...somewhere else, in scope call: var kid = new child(); <html> <script> var kid = new child(); </script> </html> when creating new kid object, b called, "this" pointing kid co

ruby - Rails 4 Rescope or Refilter child object on the fly -

ruby - Rails 4 Rescope or Refilter child object on the fly - there billingcycle : class billingcycle has_many :billing_data, class_name: billingdata has_many :billing_data_lines, through: :billing_data end class billingdata has_many :billing_data_lines end and here billingdataline : class billingdataline belongs_to :billing_data end there place in code rescope or update list of kid records this: @cycle.billing_data_lines = @cycle.billing_data_lines.where(info_number: @restricted_numbers) but doesn't work , spits out error: cannot modify association 'billingcycle#billing_data_lines' because source reflection class 'billingdataline' associated 'billingdata' via :has_many. maybe i'm trying approach situation wrong way, nice if re-filter/re-scope kid object's records on fly. there way accomplish needed? in class billingcycle refract class_name argument string: class billingcycle has_many :billin

mysql - I would like to find goes up by one and falls by one. Use SQL -

mysql - I would like to find goes up by one and falls by one. Use SQL - i think problem 1 week. anyway.i find goes 1 , falls one. utilize sql. for illustration this table exists. name: valtable no val 1 → 2 2 → 3 3 → 2 4 → 4 5 → 3 6 → 3 7 → 4 8 → 3 9 → 2 10 → 0 two points applied. ① no.1-3 → 2,3(+1),2(-1) ② no.6-8 → 3,4(+1),3(-1) is carrying out using sql possible? (oracle, posgresql, mysql ) plenty if first number known. or please advice should alter table construction , select t1.val first, t2.val second, t3.val 3rd test t1 bring together test t2 on t2.no = t1.no + 1 , t2.val = t1.val + 1 bring together test t3 on t3.no = t2.no + 1 , t3.val = t1.val http://www.sqlfiddle.com/#!2/02685/7 mysql sql oracle postgresql

r - how to run chisq.test in loops using apply -

r - how to run chisq.test in loops using apply - i newbie of r. due need of project, need chisq test hundred one thousand entries. i learned myself few days , write code runing chisq.test in loops. codes: the.data = read.table ("test_chisq_allelefrq.txt", header=t, sep="\t",row.names=1) p=c() id=c() (i in 1:nrow(the.data)) { data.row = the.data [i,] data.matrix = matrix ( c(data.row$cohort_1_aa, data.row$cohort_1_ab, data.row$cohort_1_bb, data.row$cohort_2_aa, data.row$cohort_2_ab, data.row$cohort_2_bb,data.row$cohort_3_aa,data.row$cohort_3_ab,data.row$cohort_3_bb), byrow=t, nrow=3) chisq = chisq.test(data.matrix) pvalue=chisq$p.value p=c(p, pvalue) no=row.names(the.data)[i] id=c(rsid, snp ) } results=data.frame(id,p) write.table (results, file = "chisq-test_output.txt", append=f, quote = f, sep = "\t ",eol = "\n", na = "na", dec = ".", row.names = f, col.names = t) this code might have several

spring - Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)? -

spring - Why is maven dependency being added automatically to pom when using Eclipse (STS 3.5.1)? - the next maven dependency not added me (i'm dev on project): <dependency> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-remote-shell</artifactid> <version>1.0.0.release</version> </dependency> what going on here? workaround per @andreistefan linked jira issue: open "window >> preferences" go "java >> editor content assist >> advanced" see 'jar type search' proposal provider. disable in both top , bottom. should disable across entire workspace. eclipse spring maven spring-tool-suite

windows phone - webClient.DownloadString load new string -

windows phone - webClient.DownloadString load new string - it's code: public void pobierzsuchary() { webclient webclient = new webclient(); webclient.downloadstringcompleted += new downloadstringcompletedeventhandler(webclient_downloadstringcompleted); webclient.downloadstringasync(new uri("http://../michal/suchary.txt")); } void webclient_downloadstringcompleted(object sender, downloadstringcompletedeventargs e) { toastprompt toast = new toastprompt { background = new solidcolorbrush(colors.green), message = "suchary zostały pobrane" }; string[] sucharytab = e.result.split('@'); messagebox.show(sucharytab[1]); .. } button runs pobierzsuchary() , downloading string, have problem when press sec time button. see in messagebox older value, changed string on server(manually). have disable applications ,

c# - How to Programatically create Multiple textboxes in an aspx page and save to database? -

c# - How to Programatically create Multiple textboxes in an aspx page and save to database? - i trying populate textboxes (txtfirstname, txtsecondname) programatically allowing users type in (say, 4) in textbox , press button populate these panel. if set 2 in 2 rows of textboxes first , lastly name. problem when save cannot text these textboxes created on fly. suggestions? //button protected void button1_click(object sender, eventargs e) { int number = int.parse(textbox1.text); (int = 0; < number; i++) { //horizontal line literalcontrol hrline = new literalcontrol(); hrline.text = "<hr />"; //textboxes textbox txtfirstname = new textbox(); textbox txtsecondname = new textbox(); //firstname txtfirstname.id = "txtfirstname" + i; txtfirstname.text = "first name " + i; //second name txtsecondname.id = "txtsecondname" +

bash - Android sh script array issue -

bash - Android sh script array issue - ok, unsure doing wrong here? i maintain getting [#]: not found error each of these lines. trying create array of properties , values, can loop on them , either update, or write build.prop file. #!/system/bin/sh # prop , prop value variable arrays proparr=; propvalarr=; #properties alter array proparr[] = net.tcp.buffersize.default; proparr[] = net.tcp.buffersize.wifi; proparr[] = net.tcp.buffersize.umts; proparr[] = net.tcp.buffersize.gprs; proparr[] = net.tcp.buffersize.edge; proparr[] = wifi.supplicant_scan_interval; proparr[] = ro.home_app_adj; proparr[] = dalvik.vm.dexopt-flags; proparr[] = dalvik.vm.execution-mode; proparr[] = dalvik.vm.heapstartsize; proparr[] = dalvik.vm.heapgrowthlimit; proparr[] = dalvik.vm.heapsize; proparr[] = dalvik.vm.heaptargetutilization; proparr[] = dalvik.vm.heapminfree; proparr[] = dalvik.vm.heapmaxfree; proparr[] = debug.sf.hw; #property values propvalarr[] = 4096,87380,256960,4096,16384,256960;

c# - Convert word document to XML -

c# - Convert word document to XML - can suggest how convert word document xml document using c#.net code? want track sections of word documents against word document standard template. differences between 2 xml structures help in validation. for c#, can utilize com reference microsoft.word object library want. using visualstudio 2010 , reference version 14.0 sure older versions work same. after create reference, include using statement such: using word = microsoft.office.interop.word; after that, explore wdformatxmldocument see if want. //creating instance of word application word.application newapp = new word.application(); // specifying source & target file names object source = "c:\\abc\\source.doc"; object target = "c:\\abc\\target.xml"; // utilize parameter type not known or // missing object unknown = type.missing; // source document open here //

c++ - Template function overload for base class -

c++ - Template function overload for base class - how forcefulness compiler pick template function overload base of operations class? here illustration illustrates question #include <iostream> class {}; class b : public {}; template <class t> void f (const t& t) { std::cout << "generic f" << std::endl; } void f (const a& a) { std::cout << "overload a" << std::endl; } template <class t> void call_f (const t& t) { f (t); } int main() { call_f (10); call_f (a()); call_f (b()); homecoming 0; } it produces output generic f overload generic f why doesn't compiler pick f (const a&) in 3rd case? upd: ok, 1 clear void f<b> (const b&) improve void f (const a&) , i'm still looking reply 2nd question. and possible forcefulness without casting b a? using call_f(b()) results in phone call `f() best matched template version. n

charts - Issue with aligning bars with x axis and making the bar width fit to a range -

charts - Issue with aligning bars with x axis and making the bar width fit to a range - i'm trying create bar chart using graphview display count against ranges. way input info graphviewdata(1, 0), graphviewdata(2, 5),graphviewdata(3, 7) , likewise. each of these x values represents range 0 1, 1 2......., 23 24. how can accomplish this? this how chart appears now. (pleas note doesn't aligned x axis. instance bar @ (18.6, 8) must (20, 8)). in advance. charts android-graphview

internet explorer 8 - angularjs location.search ie9 ie8 -

internet explorer 8 - angularjs location.search ie9 ie8 - i newbie angularjs , i'm trying read query string key value pairs using $location.search. next code works on chrome, ie10 , firefox: var app = angular.module('myapp', []); app.config(function($locationprovider){ $locationprovider.html5mode(true).hashprefix('!'); }); app.controller('paramcontroller', function($scope, $location, $window) { console.log($location.search()['term']); }); on ie8/9 page re-displayed '#!' in url eg. /demo/angularjs/index.html /#!/demo/angularjs/index.html is there way in angularjs read , parse querystring parms in ie8/9? angularjs internet-explorer-8 internet-explorer-9

meteor - collectionfs insert userid for insert method -

meteor - collectionfs insert userid for insert method - the default collectionfs insert function add together images info mongodb cfs.images.filerecord collection, how can add together userid insert method whenever need find images userid? fs.utility.eachfile(event, function(file) { images.insert(file, function (err, fileobj) { }); }); to acces userid of current in meteor can use meteor.users.findone({})._id you can insert in collection illustration through images.insert( { user: meteor.users.findone({})._id images.insert(file, function (err, fileobj) } ) meteor

c++ - How do separate a string from a text file -

c++ - How do separate a string from a text file - i have text file has info format this: id last,first string for example: 0 snow,john nothing 1 norris,chuck everything how lastly name , first name stored separately? to info file, did: #include <fstream> int id; string str; string last; string first; int main() { ifstream myfile(ex.txt); myfile >> id; while (myfile) { (int = 0; < 4; i++) // amount of times i'll info 1 line { id = id; // some_structure.id = id, omit getline(myfile, last, ','); // think need utilize function getline whole line cout << id; cout << last; // print out whole line! } } } ifstream myfile; string line; while (getline(myfile, line)) { istringstream ss(line); int id; ss >> id; string fullname; ss >> fullname; string firstname, lastname; {

node.js - Populate() ref nested in object array -

node.js - Populate() ref nested in object array - i trying populate() subscriptions in user model info show model. have tried .populate('subscriptions.show') nil results. if create subscriptions plain array of refs so subscriptions: [{type: schema.types.objectid, ref: 'show'}] doing populate('subscriptions') works intended i have looked @ every similar question find on stackoverflow , find on docs. can't see doing wrong. complete test file source working https://gist.github.com/anonymous/b7b6d6752aabdd1f9b59 schema , models var userschema = new schema({ email: string, displayname: string, subscriptions: [{ show: {type: schema.types.objectid, ref: 'show'}, favorite: {type: boolean, default: false} }] }); var showschema = new schema({ title: string, overview: string, subscribers: [{type: schema.types.objectid, ref: 'user'}], episodes: [{ title: string, firstaired: date }] }); var use

linux - Bash, how to check for control character(non-printable character) in a variable? -

linux - Bash, how to check for control character(non-printable character) in a variable? - i have bash statement user input(a single character) tmpchar : read -n 1 -t 1 tmpchar and can check printable character input this: if [ "$tmpchar" = "n" ] || [ "$tmpchar" = "n" ]; # something... fi now question is: if user input return, or esc, or ctrl+a, ctrl+b etc, how check them? env: opensuse 12.3 , bash 4.2.42(1)-release maybe you're looking ansi-c quoting. e.g., ctrl-a represented $'\ca' . linux bash

Convert Date to CYYMMDD SQL-Server -

Convert Date to CYYMMDD SQL-Server - i interested in converting date value cyymmdd using native sql server 2012 functions. i checked here: http://www.sql-server-helper.com/tips/date-formats.aspx and couldn't find anything. anyone know? c stands century guess... have looked @ new format function in sql server 2012? http://msdn.microsoft.com/en-us/library/hh213505.aspx you should able utilize this: select format(yourdatecolumn, 'yyyymmdd') or whatever want utilize - basically, the same formatting options in c# / .net available when using format sql date sql-server-2012 format

javascript - document.getElementById not working even if I ve ID present in my css -

javascript - document.getElementById not working even if I ve ID present in my css - i tried searching didnt valid reply question. "null" when phone call document.getelementbyid("#"+id) , alerts document not loaded . my javascript code function changedisplay(id) { alert("#"+id); if (!document.getelementbyid("#"+id)) { alert("document not loaded"); } else { if (id == "property_photos") { alert(id); document.getelementbyid("#property_photos").style.display = "block"; document.getelementbyid("#property_details").style.display = "none"; document.getelementbyid("#property_reviews").style.display = "none"; alert(document.getelementbyid(id).style.display); } if (id == "property_details") { alert(id); document.getelementbyid

vba - Reading crosstab numbers from excel to access -

vba - Reading crosstab numbers from excel to access - i have load bunch of numbers excel access. used import excel info in access load info earlier. earlier :- field1 field2 field3 qty a1 b1 c1 1 a1 b2 c2 2 a1 b3 c3 3 a1 b4 c4 4 a1 b5 c5 5 my info in crosstab format now. illustration :- a1 b1 b2 b3 b4 b5 c1 1 0 0 0 0 c2 0 2 0 0 0 c3 0 0 3 0 0 c4 0 0 0 4 0 c5 0 0 0 0 5 is there direct way in can import access? or have utilize macro convert linear form used earlier. thanks, arka. excel vba ms-access

asp.net web api - Web API Passing int[] to Get Not Via Querystring -

asp.net web api - Web API Passing int[] to Get Not Via Querystring - i in process of writing c# httpclient invoke web api method, accepts int[]. in reality array thousands of bytes not want pass via querystring, in situation, should utilize sendasync? post? options? thanks in advance m asp.net-web-api web-api

php - Silex login and retrieve ID -

php - Silex login and retrieve ID - i have basic silex login process , running user coming database. the database table utilize contains more info want readily available logged in session, can't find "where set it". symfony\component\security\core\user\user has few fields username, password, salt, provides no method store more info against object. the alternative thought store info in separate db tables, unable retrieve id of database row of logged in user, cannot link other tables user. little reluctant have both user table , table using 'username' identifier. i must doing wrong, need little help. update: should add together used userprovider detailed here: http://silex.sensiolabs.org/doc/providers/security.html#defining-a-custom-user-provider you can utilize custom user class in userprovider // userprovider file <?php namespace x; utilize yournamespace/yourcustomuser; ... public function loaduserbyusername($username) { ...

ios - Can you set the scroll view insets for container controllers? -

ios - Can you set the scroll view insets for container controllers? - i have container controller displays bar of info right below lop layout guide. i want kid controller of container controller able scroll behind bar navigation bar , status bar. seems when uikit automatically adjusts scroll view insets of controller takes business relationship length of top layout guide. is there way scroll view insets should top layout guide + height of bar? know people going suggest set automaticallyadjustsscrollviewinsets = no have tried this. problem cannot seem replicate when uikit sets content insets , sorts of weird border cases break insets. prominent illustration beingness uitableviewcontroller where, because set content insets manually, refresh command not in right position , when end refreshing insets of scroll view set { 0, 0 } content hidden behind bar , navigation bar. update: magic seems within methods _setnavigationcontrollercontentinsetadjustment on uiviewcontro

command - Tab autocomplete and simple implementation of subcommands in python cmd module? -

command - Tab autocomplete and simple implementation of subcommands in python cmd module? - is possible add together tab autocomplete subcommands in python cmd class in cmd module? running command loop, , wanted have command called add , can have selection of animal names, add horse , or add elephant . how can tab autocomplete sub commands, if @ possible? one thing i'm doing actual project i'm working on using different classes different modes. if type whitelist , runs command loop in class , in "whitelist" mode. can type exit go main command loop. seems more heavyweight modes, creating whole new class inherits cmd seems bit much simple adding different types of things illustration above. so, best way add together simple (in terms of code) sub commands cmd class can tab completed? thanks. the next works: #!/usr/bin/env python __future__ import print_function cmd import cmd import readline # noqa class zoo(cmd): def __init__(se

javascript - Solved: context.RewritePath and jquery ajax not calling webmethod -

javascript - Solved: context.RewritePath and jquery ajax not calling webmethod - question background:- question part of other question, posted new question create things easy understand, main question link this:- link , in link can find total brief info of project , solutions loading css context.rewritepath issue. in project, wrote context.rewritepath in global.asax redirect user request different location without changing addressbar address. issue : without context.rewritepath jquery ajax working perfectly;calling webmethod response in json. when using context.rewritepath jquery ajax response html instead of json. here live links: jasbir.bhinderblink.com bhinderblink.com/users/jasbir/default.aspx both links calling same page server. first context.rewritepath , sec without context.rewritepath. demo test, on page can click top sec or 3rd text box , give type box save info database. you notice first link generates error , if go firebug java helloworld post resp

google adwords - get KW in campaigns with campaign label -

google adwords - get KW in campaigns with campaign label - i want know if there way kw campaigns have specific campaign label for example: top 10 kw in campaigns have campaign label called "abc" ? thanks the best method attach campaign name label on keyword level. if have few campaigns, can go each campaign, keywords view within ui, select , add together new label campaign's name. if have giant business relationship (this won't work if have other keyword level labels set, if do, utilize first method): go keywords view within ui.download keywords study (check editable) then re-create contents of c column , paste contents label column (making sure column still called "labels" [don't alter else] then click reports , uploads tab in left navigation window. select uploads subtab. click "browse file" locate edited , saved report. click "upload" button. a yellowish box appear reminding uploading study update a

remember me - Apache Shiro: RememberMe feature doesn't work with default password service -

remember me - Apache Shiro: RememberMe feature doesn't work with default password service - i developing jsf-based project using apache shiro 1.2 security. have problem 'remember me' feature. [main] jdbcrealm=org.apache.shiro.realm.jdbc.jdbcrealm jdbcrealm.authenticationquery = select password user username = ? jdbcrealm.userrolesquery = select role userroles userid = (select id user username = ?) ds = com.mysql.jdbc.jdbc2.optional.mysqldatasource ds.servername = localhost ds.user = root ds.password = 12345 ds.databasename = testdb jdbcrealm.datasource= $ds authc.loginurl = /index.xhtml user.loginurl = /index.xhtml passwordservice = org.apache.shiro.authc.credential.defaultpasswordservice passwordmatcher = org.apache.shiro.authc.credential.passwordmatcher passwordmatcher.passwordservice = $passwordservice jdbcrealm.credentialsmatcher = $passwordmatcher #or configuration #passwordmatcher = org.apache.shiro.authc.credential.sha256credentialsmatcher #credentialsm

ios - SDWebImage into NSArray -

ios - SDWebImage into NSArray - how can add together 3 imageviews using sdwebimage nsarray? i have images in form: [self.imageview1 setimagewithurl:[nsurl urlwithstring:[self.objc objectforkey:@"image1"]] placeholderimage:[uiimage imagenamed:@"placeholder.png"]]; [self.imageview2 setimagewithurl:[nsurl urlwithstring:[self.objc objectforkey:@"image2"]] placeholderimage:[uiimage imagenamed:@"placeholder.png"]]; [self.imageview3 setimagewithurl:[nsurl urlwithstring:[self.objc objectforkey:@"image3"]] placeholderimage:[uiimage imagenamed:@"placeholder.png"]]; sdwebimage has method completion block. utilize method [self.imageview setimagewithurl:[nsurl urlwithstring:[self.objc objectforkey:@"image1"]] placeholderimage:[uiimage imagenamed:@"placeholder.png"] completed:^(uiimage *image, nser

java - StringUtils.countMatches words starting with a string? -

java - StringUtils.countMatches words starting with a string? - i'm using stringutils.countmatches count word frequencies, there way search text words starting-with characters? example: searching art in "artificial fine art in apartment" homecoming 3! need homecoming 2 words starting art only. my solution replace \r , \n in text space , modify code be: text = text.replaceall("(\r\n|\n)"," ").tolowercase(); searchword = " "+searchword.tolowercase(); stringutils.countmatches(text, searchword); i tried next regex: patternstring = "\\b(" + searchword.tolowercase().trim() + "([a-za-z]*))"; pattern = pattern.compile(patternstring); matcher = pattern.matcher(text.tolowercase()); questions: -does first solution create sense or there improve way this? -is sec solution faster? i'm working big text files , decent number of search-words. thanks text = text.replaceall("(\r\n|\n)&

data binding - ASP.Net MVC page refresh using json values instead of html -

data binding - ASP.Net MVC page refresh using json values instead of html - i have page has "prev" , "next" day button, , rather reload entire page, ajax phone call controller returns entire partial view, replace div with. $("#divid").html(ajaxresponse); pretty simple. however, i'm finding partial view vastly more info need (html doesn't alter @ all, data) , it's causing slowness on mobile browsers. my question is, there tool out there allow me homecoming json representation of model info , refresh values on page automatically? for example, have: @html.inputfor(x => x.firstname) and json returns { firstname: 'henry', lastname: 'mcleery' } is there library available can automate process of doing: $("#firstname").val(ajaxresponse.firstname); $("#lastname").val(ajaxresponse.lastname); etc... ? take @ angular.js. angular javascript framework uses mvc patter

jquery - How to require a field with a value of "yes" using javascript? -

jquery - How to require a field with a value of "yes" using javascript? - i need able require fields if selects value of "yes" dropdown. i've used next code doesn't seem work. $(function () { $('#anyadditionalinc').keyup(function () { if ($(this).val() == "no") { $('#additionalincomesource').removeattr('required'); $('#additionalincomeamt').removeattr('required'); } else { $('#additionalincomesource').attr('required', 'required'); $('#additionalincomeamt').attr('required', 'required'); } }); }); my dropdown looks this <div class="form-group">@html.labelfor(m => m.anyadditionalinc, new { @class = "col-sm-2 control-label" }) <div class="col-sm-10"> <div class="col-sm-4">@html.dropdownlistfor(m =>

jquery - How to debug Greasemonkey script on Firefox 30? -

jquery - How to debug Greasemonkey script on Firefox 30? - i've been developing javascript snippet youtube uses greasemonkey, , imports bootstrap , jquery libraries. application has add together button each 1 of search list results , when user clicks it, must bring user uploaded videos channel. i've tested button , works on firefox 29. nevertheless, updated firefox version 30, , i'm unable see/debug code wrote, although firefox executes it. i'd know, if there solution issue? here code if seeing it: // ==userscript== // @name requerimiento2-2-guille.user.js // @description rodrigo // @include http://www.youtube.com/* // @include https://www.youtube.com/* // @grant none // ==/userscript== /* here it's bootstrap , jquery code pasted (i know should done include).*/ var boton='<button style="float:right;" type="button" class="vervideos btn btn-lg yt-uix-button yt-uix-button-size-default yt-uix-

python - In TKinter, why does tkMessageBox bar me from modifying Entry objects? -

python - In TKinter, why does tkMessageBox bar me from modifying Entry objects? - i'm using tkinter , have weird situation. i've created little application has listbox, 2 buttons, , entry. 2 buttons add together , remove items listbox, respectively, , entry specifies name of item added. encapsulated in frame. to right of frame near identical one, except listbox of frame contains items parented ones on left. basically, 'lists' or 'categories' created in first listbox, , items added lists in sec listbox. tl;dr: here 3 screenshots of application in use, create things easier visualize. in application, there can no 2 categories of same name. if there 2 categories of same name, tkmessagebox.showerror(...) called. works correctly , programme still functions correctly, except cannot highlight or modify either of entry fields anymore. i @ first thought reason beingness set disabled or readonly, know cannot because buttons of programme still work, ,

Reading data out of an ADC (MCP3001) with python (SPI) -

Reading data out of an ADC (MCP3001) with python (SPI) - i seek read info adc python, unfortunatly doesn't work. hope has hint me, because script creates chaos-data. don't see error bits... i've updated script below i'm reading 16 bits , cutting of first , lastly 3 bits. need 10 middle bits info - if understand datasheet correctly... datasheet mcp3001: (page 15) http://ww1.microchip.com/downloads/en/devicedoc/21293c.pdf import time import rpi.gpio gpio gpio.setmode(gpio.bcm) high = true low = false def readanalogdata(sclkpin, mosipin, misopin, cspin): gpio.output(cspin, high) gpio.output(cspin, low) gpio.output(sclkpin, low) adcvalue = 0 in range(16): gpio.output(sclkpin, high) gpio.output(sclkpin, low) adcvalue <<= 1 if(gpio.input(misopin)): adcvalue |= 0x01 adcvalue >>= 3 adcvalue &= 0x3ff time.sleep(0.5) homecoming adcvalue sclk =

svcutil.exe - HOw to manage newly added methods into WCF service -

svcutil.exe - HOw to manage newly added methods into WCF service - i have created wcf service , added refernece web application project. have added below way: 1. generated proxy , config file using - svcutil command , added proxy file web application project , merged configuraiton file. now, have added new methodsinto wcf service , have utilize - svcutil command on each time or should work automatically.... now, need generate proxy file each time.. please suggest best way. note: service instance available asp.net web applicaiton (client) unable when utilize client - mvc applicatoion. please suggest. thanks in web application, open service references folder. right click on service want update. select update. wcf svcutil.exe

android - PagerSlidingTabStrip making horizontalscrollview's width fixed -

android - PagerSlidingTabStrip making horizontalscrollview's width fixed - i'm using pagerslidingtabstrip library in application now. have 5 tabs, it's on screen width. have scroll see lastly tab. i want see tabs on screen , never wanna scroll see other items. i tried changing horizontalscrollview linearlayout in pagerslidingtabstrip.java it's weird little. indicator moved bad. // public class pagerslidingtabstrip extends horizontalscrollview public class pagerslidingtabstrip extends linearlayout and tried shouldexpand options true. didn't work again. app:pstsshouldexpand="true" what can ???? i had same problem next code ,i found if need set tabs shouldexpand need before setting viewpager tabs. tabs = (pagerslidingtabstrip) findviewbyid(r.id.slidingtabstrip); //before setting view pager tabs.setshouldexpand(true); //works tabs.setviewpager(vppager); //after setting view pager tabs.setshouldexpand(true); //will not wo

c# - Extract hostname from fully qualified domain name (FQDN) -

c# - Extract hostname from fully qualified domain name (FQDN) - i need implement method extracts hostname fqdn. illustration if hypothetical mail service server mymail.somecollege.edu want result mymail , if illegal string (not real fqdn ) need no null or error code how can extract hostname?- don`t want create parsing of input myself.but rather looking existing api. tried search first dot '.' - substring before hostname. looking existing api c# host fqdn

excel - VBA switching between workbooks gives wrong cell reference -

excel - VBA switching between workbooks gives wrong cell reference - introduction: i working on vba code imports info 1 sheet in workbook sheet in workbook. goal copy-paste-procedure re-create range a2 in targetworkbook a2 in sourceworkbook . procedure goes wrong. code: sub import() worksheets("alle borgere").range("a2:bz9999").clearcontents dim targetworkbook, sourceworkbook string dim startskurow, stopskurow integer dim cellvaluestring, rangetarget string dim quotebutton dim val(10) double on error resume next ' save workbook name , search old quote workbook sheet9.select ' quote sheet sourceworkbook = activeworkbook.name ' check workbook utilize old quote activewindow.activatenext targetworkbook = activeworkbook.name if targetworkbook = sourceworkbook msgbox ("Ã…ben venligst rette dokument") 'sheet9.protect 'exit sub end end if quotebutton = msgbox("er dette

OpenCV '3.0.0-dev' with Python : Memory leak in While Loop cv2.imread() and cv2.VideoCapture.read() function -

OpenCV '3.0.0-dev' with Python : Memory leak in While Loop cv2.imread() and cv2.VideoCapture.read() function - i have updated opencv 2.4.9 3.0.0-dev utilize new function in python interface used on opencv python tutorial in offcial site. i utilize pre-built install http://sourceforge.net/projects/opencvlibrary/files/opencv-win/3.0-ocl-tech-preview/tp1/ but had issue photographic camera capturing , image read in while loop. example import cv2 cap = cv2.videocapture(0) num = 0 while true: ret,frame = cap.read() cv2.imshow('video',frame) k = cv2.waitkey(1) if k == ord('q'): break elif k == ord('c'): cv2.imwrite('photo'+str(num)+'.jpg',frame) num += 1 cap.release() cv2.destroyallwindows() and if alter cap.read() cv2.imread() import cv2 num = 0 while true: frame = cv2.imread('d:/boat/work/hga_counter/test_photo/photo0.jpg') cv2.imshow('video',frame)

javascript - Overlay the content of html file into another html file -

javascript - Overlay the content of html file into another html file - is there possibility of overlaying content of within html others. for illustration have 2 html files in different folders in same root. html1: <section> <div class="html1"></div> <section> html2: <section> <div class="html2"></div> <section> now on click of button need show content of html2 overlay , 1 time again on click of same button need hide html2. can allow me know how accomplish this. do not know why need this, can :-) <input id="b" type="button" value="button" /> <section id="container" style="width:400px;height:200px;border:1px solid;font-family:verdana"></section> <script> var button = document.getelementbyid('b'); var section = document.getelementbyid('container'); var path = ['html_document1.htm

javascript - Bxslider not working with collapse -

javascript - Bxslider not working with collapse - i calling boostrap's collapse.js , bxslider.js on same page , seems collapse function not work. when comment out bxslider.js collapse works fine. know work-around this? here faq page inquiring about: http://testing.printlabelandmail.com/faqs/ below illustration of current mark-up: <!-- jquery --> <script src="http://code.jquery.com/jquery.js"></script> <script src="http://testing.printlabelandmail.com/wp-content/themes/printlabelandmail- theme/js/jquery.easing.1.3.js"></script> <!-- bootstrap js --> <script src="http://testing.printlabelandmail.com/wp-content/themes/printlabelandmail-theme/js/bootstrap.min.js"></script> <!-- touch effects hover effects in work section --> <script src="http://testing.printlabelandmail.com/wp-content/themes/printlabelandmail-theme/js/toucheffects.min.js"></script> <!-- animated