Posts

Showing posts from June, 2014

windows 8 - Stop focus being lost when a grid or border control is touched in Win RT Xaml -

i have grid , in row 1 have stack panel 2 textboxes. textboxes highlight when have focus (i use custom style same happens without one). when click on mybutton button event fires , focus stays within textbox have istabstop="false" on button. if click on grid space next buttons focus on textbox lost. how can stop happening on controls grid there no istabstop option on grid?. have same problems on other controls. idea how can stop focus being lost when grid example touched? this windows 8 store app using win rt xaml , designed use on tablet device. thanks <grid background="lightgray" x:name="gridmaingrid"> <grid.rowdefinitions> <rowdefinition height="auto" /> <rowdefinition height="*" /> <rowdefinition height="auto" /> <rowdefinition height="auto" /> </grid.rowdefinitions> <!-- header --> <border grid.ro

unity3d - Unity-style WASD fly navigation in Maya? -

i learning autodesk maya in school. i know unity 3d. i love fact in unity can hold down right mouse button , fly around wasd keys (like when in spectator mode in shooting game). is possible in autodesk maya? far, have been able find standard rotate/zoom/pan controls in maya. thanks in advance well, unity allows first person navigation wasd keys because it's game engine, , there logic permits it. basically, using fps controller, engine applies translation main character (and, consequently, main camera, that's attached it). maya, instead, isn't game engine, modeling software, , (afaik), doesn't have built-in features that, because not essential software of kind. but, answering @ question, there exist plugins. there mayafps , example. permits move perspective camera around, , recreate kind of exploration similar fpss' one.

Brunch config file conventions -

according brunch documentation property "conventions.assets" in config file should regexp, i'm trying include following: conventions: { assets: /^app\/.*\.html/ } in order add htmls public folder. (i know can create assets folder , include things there, it's not possible moment according structure we've agreed). i think property expect directory, in case fix value in order reach goal?, function maybe? finally overriding method property "assets" accepts. assets: function(path) { /** * loops every path , returns path|true|false according need * @param path file or directory's path * @returns path if directory * true if fit regular expression * false otherwise * */ if( /\/$/.test(path) ) return path; return /^app\/.*\.html/.test(path); // regexp need }

objective c - Unrecognized selector sent to instance and crash in main.m in iOS application -

hi cannot understand i'm searching help. here is... i'm working on storyboard ios , during prepareforsegue method trying set property of viewcontroller loaded. right here crash pointing @ center line of main.m , here message: *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uitableviewcontroller setdetails:]: unrecognized selector sent instance 0x8880b80' here method prepareforsegue ended looking mistakes following exception: - (void) prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([[segue identifier] isequaltostring: @"cellsegue"]) { apptestdetailviewcontroller *detailviewcontroller = [segue destinationviewcontroller]; nsindexpath *indexpath = [self.tableview indexpathforselectedrow]; detailviewcontroller.details = self.detailslist[indexpath.row]; } } well.. self.detailslist nothing array of details items. details property declared in apptestdetailviewcontroller.h this

c++ - SDL2 program SIGSEGV on start -

i wrote snake in sdl , want port android, means had rewrite parts of use sdl2. replaced key control , rendering parts , compiles without errors. however, when try run it crashes immediately. ran debugger, doesn't give useful information: (no debugging symbols found) program received signal sigsegv,segmentation fault in ?? () () i set breakpoint on first line of code , doesn't reach before crashing. using sdl_image , sdl_ttf. source code: http://www.mediafire.com/?n0zdd061d343w35 maybe error on sdl loading, can not resolve symbols , error.

javascript - LDAP query from Chrome App -

i believe javascript constrained use http, curious if there out there can enable chrome application make ldap query client side (without having go through webserver connect ldap , check credentials). goal here have users login internal web application using network credentials, without having wait on server establish https connection. also, there security concerns setup such this? a chrome app indeed capable of doing want. you'd use chrome.socket api establish connection directly ldap server. however, question sets off several alarms. if client code separately checking ldap credentials, , querying web application content, what's stopping malicious or buggy client skipping ldap step , grabbing content, without authorization, directly web app? if web app assumes trusted clients, why bother checking ldap @ all? in real life, design handing note bank teller saying "i don't need show id because promise showed security guard stationed outside bank. please g

javascript - Gmaps.js Route with Distance -

i'm using gmaps.js api in little project i'm building. basically replicate google maps functionality i'm looking route & distance 1 address (can input/form fields). notice this demo , requires clicking on map, , doesn't show total distance or drive time? any opinions on best way of parsing 2 addresses form, calculating route , drive time using gmaps.js api? breaking parts need to: search form entered addresses , geocode them using geocoding api. use results geocoding calculate route. pull required data route , plot/display for geocoding see example: http://hpneo.github.io/gmaps/examples/geocoding.html gmaps.geocode({ address: $('#start').val(), callback: function(results, status) { if (status == 'ok') { var latlng1 = results[0].geometry.location; } } }); //repeat destination / end point now have lat/long points. you can take few approaches route, drawing can done example: http://hpneo.github.io/gmap

javascript - Injected JS assigning window.onerror fails to fire -

i need run third party js scan jserrors. running following in chrome's console window.onerror = function(errormsg, url, linenumber) { alert(errormsg); } throw new error('foo'); i expect both console inform me of error , alert pop displaying error message. alert never fired, , assume event not being fired. why not? the chrome developer console won't call user-defined error event listener if error thrown (according this answer paul s. ). throwing error "just in time": > window.onerror = function () {console.log('error!');}; function () {console.log('error!');} > throw new error(); error throwing error deferred: > window.settimeout(function() {throw new error()}, 0); xxxx error! uncaught error ( xxxx specific return value of settimeout() ) here original code snippet led me point chrome dev console changes internal behaviour somehow: // #btn simple button document.getelementbyid("btn").addeve

objective c - Cocoa WebView reloads on first click -

i have os x application webview reloads webview on first click if click not on link within view. any suggestions of how hunt down? assumed have focus, thought maybe had encountered before. thanks, charlie please check in code somewhere loading manually this:- [[webview mainframe]loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:@"http://www.google.com"]]];

javascript - Pop up doesn't feel responsive enough -

i've been following this guide make fold out pop-up , added following script make close when clicking anywhere else. jsfiddle example without javascript jsfiddle example javascript $(document).ready( function(){ $('#linkie').click( function(event){ event.stoppropagation(); $('.box').toggle(); }); $(document).click( function(){ $('.box').hide(); }); }); but doesn't feel responsive original without script when triggering pop-up. takes 2 3 clicks trigger, wonder if there's needs tweaked in css make bit more responsive. appreciated. css: label { position: relative; cursor: pointer; } .box { position: absolute; left: 0; top: 100%; z-index: 100; /* prevent white flashing in safari 5.1 */ -webkit-backface-visibility: hidden; background-color: #eeeeee; background-image: -webkit-gradient(linear, left top, left bottom, from(#eeeeee), to(#9999

haskell - How is this function equivalent to getting the last item in a list? -

after completing first problem (" find last element of list ") in 99 questions exercises , wanted see how solution compared others , found this solution . mylast' = foldr1 (const id) this documentation seems show foldr1 takes 2 arguments, first being function , second being list. definition appears take function argument. there implicit definition of arguments passed this? mylast' xs = foldr1 (const id) xs i have looked definitions of foldr1 , const , , id , i'm having hard time understanding how 3 work return last item in list. you're right. in haskell, function takes 2 arguments can treated function takes 1 argument , returns function takes argument; known currying . note function signature foldr1 is: (a -> -> a) -> [a] -> while think of "a function takes function , list arguments , returns value", it's "a function takes function argument , returns function takes list , returns value".

asp.net - Cannot open database "StarterSite" requested by login -

i working webmatrix asp.net web pages , sql server 2008. going great, , installed windows 8. re installed webmatrix (sql, iis installed it) via web platform installer. not able use of databases, have checked in webmatrix database workspace, , database isn't loading, error is "cannot open database "startersite" requested login. login failed user 'sa'". what tried: have googled alot this, tried told. tried repair webmatrix control panel, reinstalled sql server 2008. in webmatrix site workspace, there error .net framework 2.0 not installed! tried install it. still same issue being provided everywhere. i have replaced files had while using windows 7. in place belong. issue still there. why here: here, because have tried google , have tried post own question on forums.asp.net . everytime did not succeed, tried here. have tried reading question posted here too. not helping me out. my question: find connection settings website's databases.

c# - Business functionality - RhinoMocks IEnumerable static method mocking -

just basic question hope within rules ask. have been looking information experience "automated testers" have practiced before. business functionality of mocking static ienumerable methods? there attained mocking them? create clutter code/tests? how know worth writing test 1 of ienumerable methods? have read on ways accomplish task of mocking , testing curious purpose serves. wouldn't system methods work fine , not need tested? please excuse questions if "green" trying deeper understanding/knowledge base of testing. there no business functionality mocking system ienumerable methods. mock static methods however, should create virtual class calls static methods. mock virtual class allowing "access" static methods in test.

deployment - Excel Import Data from Analysis Services - Date comes across as text -

i'm trying use (exercise) ssas tabular model in excel. model contains column date , in proporties window data type date , date format general . when import data excel date column seems come across text. to import, open excel, go data -> external data -> other sources -> analysis services after data gets imported, date column contains text representations of date. "group" section of pivottable options tab greyed out, , sort a-z. how data type come across? analysis services delivers attribute names strings. either build own mdx query extract, instead of relying on default import wizard query. in custom query, convert name measure of date data type. similar this: with member measures.mydate cdate([datedim].[dateattrib].currentmember.name) select { measures.mydate } on columns, [datedim].[dateattrib].[dateattrib].members on rows [mycubename] or, within tabular model, build calculated column in date format, i. e. create calculated

javascript - Soundcloud Widget - Event.PLAY not working -

i'm having problems soundcloud widget api. for reason event.play not working anymore... var i, song, iframes = document.getelementsbytagname('iframe'); (i = 0; < iframes.length; i++) { if (string.prototype.indexof.call(iframes[i].src, '//w.soundcloud.com/player') > -1) { iframes[i].id = "sc_player_"+i; song = sc.widget(iframes[i].id); song.bind(sc.widget.events.play, function(eventdata){ song.getcurrentsound(function(sound) { console.log(sound.title); }); }); } } thanks reporting this, looking why play event doesn't fire on first play right now. upd . bug play event not firing on initial play fixed now. on side note, there's problem code: functions creating (event handlers) inside of loop reference last iframe song . should either wrap event handler creation in iffe passing current song par

php - Storing and retrieving $_SESSION variables -

i've got problem. i'm sure i'm being stupid can't seem able rertive $_session variable. run throught code variable called $setup post each time reset. each time run through code increment $setup starts off no value has value 1 , then value 2. when it's one, set session posted value. next time when it's two, session doesn't seem have value. this code when page loaded: <?php session_start(); $setup=$_post['reset']; if ($setup==null) { $setup=0; } elseif ($setup==1) { $_session['value1']=$_post['value1']; $value1=$_session['value1']; } elseif ($setup==2) { $value1=$_session['value1']; $_session['value2']=$_post['value2']; $value2=$_session['value2']; } ?> when setup 1 can print out value1 when setup 2 use code echo $value2 . " " . $value1 . "."; all value2 followed dot

css - @font-face embeded fonts not working IE, but work from server IIS -

currenlty implementing ~5 different fonts using @font-face. syntax declarations correct. testing in firefox, chrome, ie/8/9/10. not accessing page using 'localhost' @ time. senario 1: accessing page using www.dev.site.com/page server firefox: works ie/8/9/10: works chrome: works senario 2: accessing page using www.dev.site.com/page outside server firefox: works ie/8/9/10: not work chrome: works it strange because not using localhost access site. added network service full control on directory , didnt seem help @font-face { font-family: 'sf_movie_posterregular'; src: url('../fonts/customtitle-webfont.eot'); src: url('../fonts/customtitle-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/customtitle-webfont.woff') format('woff'), url('../fonts/customtitle-webfont.ttf') format('truetype'), url('../fonts/customtitle-webfont.svg#sf_movie_posterregular') format('svg'); font-weigh

mysql - Delete all tables created by a user -

is possible delete tables created specific user? in least, how can delete tables created? there not appear way detect user created table in mysql, not able delete table based on creator. the closest able hoping during table creation, comment created containing user's name. can table's comment with: select table_name information_schema.tables table_comment '%name%'

io - How to read array saved in binary mode to text file in C -

i have array of string saved so: char clientdata[5][128]; char buffer[256]; ... input values array ... file *f = fopen("client.txt", "w+b"); fwrite(clientdata, sizeof(char), sizeof(clientdata), f); ... read array file ... fclose(f); now want read array file in above code. tried: fread(clientdata, sizeof(char), sizeof(clientdata), f); then tried use sprintf on clientdata: sprintf(buffer,"%s",clientdata[1]); this gave me error : request member in clientdata not structure or union what did wrong? as others have noted, have not provided explain request member in not structure or union would have come from, in code example, not see buffer defined anywhere... in case: brute force method: (compiles, builds , runs in ansi c) #include <ansi_c.h> #define newbinaryfile "c:\\tempextract\\newbinaryfile.bin" int main(void) { file *fp; int i; char clientdatanew[5][128] = {"","&qu

php - Get date from monday depending on week number -

i can`t figure out code date monday depending on week number of year. could me code? thanks. this provide monday of week year: $thisyear = date('y'); $weeknum = 40; $date = date('y-m-d', strtotime("$thisyear-w$weeknum-1")); // outputs 2013-09-30

sql - Nvarchar column value is doubled, how do I detect and fix this? -

i've inherited project somehow ended random rows in application settings table getting duplicated. got duplicate rows removed successfully, noticed actual values, of type nvarchar, said rows duplicated. for instance, 1 row has key column error email address , value column websupport@mycompany.com,websupport@mycompany.com . value column should contain websupport@mycompany.com . there numerous records this, following same pattern of the value,the value . how can detect when value column contains kind of duplicated data , correct it? note comma alone not enough row invalid, because things key default error message value oops, went wrong correct , contain comma. here query: update tablename set col1=substring(col1,0,charindex(',',col1)) substring(col1,0,charindex(',',col1))=substring(col1,charindex(',',col1)+1,500) replace col1 column name, , tablename actual table name. replace rows value before , after comma(,) same single value.

inheritance - Inheriting a class from static library causing undefined symbols in objective c -

i have static library in work space. in there apple.h & .m file in .h file defined 2 @interface apple : nsobject & @interface greenapple : nsobject in same work space have ios application project references static library. in application when inherit greenapple 'undefined symbols' error both device , simulator build. but, there no error if inherit apple. across project should imported .h , inherited class has same or greenapple inheritance should work though under apple.h file? edit to test theory renamed file match error class, still same error. actual implementation given below file cmsgmealmenuitem.h. @interface cmsgmealmenu : nsobject @property (nonatomic, readonly) cmsgmealtype mealtype; @property (nonatomic, readonly) nsdate *orderstarttime; @property (nonatomic, readonly) nsdate *orderendtime; @property (nonatomic, readonly) nsarray *items; @end @interface cmsgmealmenuitem : nsobject @property (nonatomic, readonly) nsstring *itemid; @property (n

android - Managing fragments -

i'm creating simple pageviewer-supported application, can switch thru fragments horizontally. application want use same background of fragments, difference between fragments text. i've made few fragments , application overly-solicitating, taking lot of space , using lot of memory. want optimize application in way space , memory needed running minimized. here mainactivity's code: (i'm creating class , different layout each fragment i'm not familiarized other way of doing so) --edit: i've forgot say, @ moment have 7 fragments application need 400-500 fragments optimization must. public class mainactivity extends fragmentactivity { /** * {@link android.support.v4.view.pageradapter} provide * fragments each of sections. use * {@link android.support.v4.app.fragmentpageradapter} derivative, * keep every loaded fragment in memory. if becomes memory * intensive, may best switch * {@link android.support.v4.app.fragmentstatepageradapter}. */ sectionspagerad

php - Merging arrays of different lengths -

given 2 arrays of following formats: $array1 = array("1", "2", "3", "4", "5"); $array2 = array( 0 => array("start" => "09:00", "end" => "17:00"), 1 => array("start" => "18:00", "end" => "20:00") ); i need merge result is: $result = array( array( "start_day" => "1", "start_time" => "09:00", "end_day" => "1", "end_time" => "17:00" ), array( "start_day" => "1", "start_time" => "18:00", "end_day" => "1", "end_time" => "20:00" ) // , on each item in $array1 ); both arrays can of varying lengths each item in $array2 must applied item in $array1. throwing out there see if has experience sort of merge. current s

c++ - pointer problems with inherited class -

in below code secclass inheriting 'item' firstclass. when run 'classc' in main both first item , second item 210. if remove pointer inherited class(firstclass), runs should. i'm still rather shaky both pointers , inheritance there's i'm missing here... // declaration of firstclass // firstclass.h #include <iostream> #ifndef firstclass_h #define firstclass_h using namespace std; class firstclass { private: int *item; public: firstclass(); firstclass(int thatitem); ~firstclass(); int getitem(); void setitem(int thatitem); }; #endif // implementation of firstclass.h // firstclass.cpp #include "firstclass.h" using namespace std; firstclass::firstclass() { int *setinitial = new int; *setinitial = 5; item = setinitial; } firstclass::firstclass(int thatitem) { item = &thatitem; } firstclass::~firstclass(){} int firstclass::getitem() { return *item; } void firstclass::setitem(int thatitem) { it

android - How do I modify one activity's variables from another activity? -

let's first.class has variable string currentvalue = "red" button leads second.class (an activity). first.class(activity) displays in textview variable currentvalue happens be. (currently, red). if push button, takes second.class, has edittext box modify variable in first.class. has button confirm change. finally, has textview @ bottom showing preview of first.class' value variable is. when user types in "blue" in second.class' edittext box , hits button, how change variable first.class without using intents , going activity? want stay within second.activity , changes there. after hitting confirm button, preview textview should update match newly modified variable. should still seeing second.class, remind you. if user hits "back" or "up" @ point, should return first.class , see textview in first.class has been changed. how modify first.class' variables if second.class entirely separate first.class , cannot access it? (

javascript - How to reference object instance from event handler -

in code below, there better way reference object instance handleclick() pulling in global? var widget = function() { this.property = 'value'; this.bindevents(); } widget.prototype = { bindevents: function() { $('button').on('click', this.handleclick); }, handleclick: function() { var self = window.widget; console.log(self.property); } } window.widget = new widget(); this question asks same thing, , (non-accepted) answer pass callback $.on() , call handler there, passing in instance parameter this: bindevents: function() { var self = this; $('button').on('click', function() { self.handleclick.apply(self); }); } is technique of passing instance around right way it, or there still preferred way besides 2 i've shown? you use bind() : bindevents: function() { $('button').on('click', function() { this.handleclick(); }.bind(this)); } but when comes ie, work

c++ - DirectX Compile Shader from Memory? -

using shaders compiled files works: d3dx11compilefromfile(filename, null, null, "main", "vs_5_0", d3d10_shader_enable_strictness, 0, null, &vertexshaderbuffer, &errormessage, null); but if replace above line one: d3dx11compilefrommemory(vs, strlen(vs), null, null, null, "main", "vs_5_0", d3d10_shader_enable_strictness, 0, null, &vertexshaderbuffer, &errormessage, null); while vs char* of shader file (if print vs out using std::cout , prints correctly). it crashes @ line... what doing wrong? d3dx apis deprecated, should use d3dcompile apis instead d3dcompiler.h . same things d3dx11 replaced d3d transition simple. edit message @ least callstack or output log because wihtout more information, hard more specific on answer.

php - How To Obtain All Twitter Followers Without Hitting API Limit -

i imagine it's pretty easy do, can't figure out i'm doing wrong. i'm using abraham's oauth gain access. i'm building database follower's information: screen name, user name , twitter id. nothing special. i referenced twitter's " cursoring " page, pseudo code, make code. don't want click link see said pesudo code, looks following: cursor = -1 api_path = "https://api.twitter.com/1.1/endpoint.json?screen_name=targetuser" { url_with_cursor = api_path + "&cursor=" + cursor response_dictionary = perform_http_get_request_for_url( url_with_cursor ) cursor = response_dictionary[ 'next_cursor' ] } while ( cursor != 0 ) with every request, end user gets "cursor" allows them navigate through "pages" of results. each page holds 20, , if have 200 followers have go through 10 pages. have on 900 followers. modified following: include('config.php'); //db conne

javascript - Angular, services, and module dependency confusion -

i'm starting out angular , running in problems. i'm not sure understanding how module dependencies work. when creating module, pass in array of required modules (that contain services), right? , when use controller in module, pass service function defined in 1 of required modules. this error encountering in application: failed instantiate module myapp due to: error: [$injector:modulerr] here html: <!doctype html> <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge,chrome=1"> <title>myapp</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="css/foundation.min.css"> <link rel="stylesheet" href="css/main.css"> </head> <body data-ng-app="myapp&

python - Pythonic way to know when / why my threads exited -

context: have script, runs indefinitely, monitors simple queue of urls need downloaded. if url enters queue, script checks if spawned thread url , if hasn't, spawns thread who's job fetch data url periodically until url returns 404 (which know happen because urls available specified period of time) @ point, call sys.exit raise systemexit exception , mark termination understand it. question: able log specific time when thread exits, if exits other reason besides call sys.exit , gather meta data why exited possible. best way this? threads pass info parent spawned them when exit? code: a simplified example of code class mythread(threading.thread): def __init__(self, sf, id): threading.thread.__init__(self) self.sourcefile = [sf] self.id = id def run(self): #do stuff until encounter 404, @ point, i'll call sys.exit if __name__ == '__main__': while true: #logic chec

c# - Custom ControllerFactory does not replace DefaultControllerFactory when there is a controller collision -

i have custom controller factory (very basic implementation relevant question): public class mycontrollerfactory : defaultcontrollerfactory { public override icontroller createcontroller(requestcontext requestcontext, string controllername) { var controller = base.createcontroller(requestcontext, controllername); return controller; } protected override system.web.sessionstate.sessionstatebehavior getcontrollersessionbehavior(requestcontext requestcontext, type controllertype) { return base.getcontrollersessionbehavior(requestcontext, controllertype); } } which registered in global.asax this: protected void application_start() { controllerbuilder.current.setcontrollerfactory(typeof(mycontrollerfactory)); // other code here } breakpoints set in controller factory hit when there no conflict in resolving controller (e.g. 1 controller found in resolution process). however, when have 2 controllers same name (in case

Wireshark filter per ip address "different from" something -

i'd captured packets in origin or destination ip address different from, say, 192.168.0.1. purpose tried ip.addr != 192.168.0.1, filter turns yellow, instead of green, must wrong. how can (correctly) done? 6.4.4. common mistake [warning] warning! using != operator on combined expressions like: eth.addr, ip.addr, tcp.port, udp.port , alike not work expected! often people use filter string display ip.addr == 1.2.3.4 display packets containing ip address 1.2.3.4. then use ip.addr != 1.2.3.4 see packets not containing ip address 1.2.3.4 in it. unfortunately, not expected. instead, expression true packets either source or destination ip address equals 1.2.3.4. reason this, expression ip.addr != 1.2.3.4 must read "the packet contains field named ip.addr value different 1.2.3.4". ip datagram contains both source , destination address, expression evaluate true whenever @ least 1 of 2 addresses differs 1.2.3.4.

android - How to set the background color of the selected tab in PagerTiltleStrip -

i trying change color of selected tab in pagertitlestrip, able change color of entire strip. not wanted. how achieve this? can 1 help? you can pagertitlestrip too. implement viewpager.onpagechangelistener in main activity put setonpagechangelistener viewpager myviewpager.setonpagechangelistener(this); then overrride methods onpagescrolled, onpageselected, onpagescrollstatechanged we need put our code in onpageselected(int position) method if have 5 pages, beforthat need - declare pagertitlestrip in main code. pagertitlestrip pagertitlestrip; and in oncreatemethod pagertitlestrip = (pagertitlestrip) findviewbyid(r.id.title); r.id.title id of pagertitlestrip in main_layout if(position==0){ pagertitlestrip.setbackgroundcolor(0xff3d0201); } if(position==1){ pagertitlestrip.setbackgroundcolor(0xff013e10); } if(position==2){ pagertitlestrip.setbackgroundcolor(0xff242f52); } if(position==3){ pagertitlestrip.setbackgroundcolor(0xff606

vim: complete depending on previous character -

i want create mapping changed ins-completion depending on character before cursor. if character { want tag completion, if : want normal completion (that depends on complete option) , if characters backslash plus word ( \w+ ) want dictionary completion. have following in ftplugin/tex/latex_settings.vim file: setlocal dictionary=$dotvim/ftplugin/tex/tex_dictionary setlocal complete=.,k setlocal tags=./bibtags; function! mylatexcomplete() let character = strpart(getline('.'), col('.') - 1, col('.')) if character == '{' return "\<c-x>\<c-]>" elseif character == ':' return "\<c-x>\<c-n>" else return "\<c-x>\<c-k>" endif endfunction inoremap <c-n> <c-r>=mylatexcomplete()<cr> this doesn't work , don't know how fix it. edit: seems work i'm want conditional checks \w+ (backslash plus word) , final 1 g

css - Using :before and :after tags with tables -

so i'm trying use css :before , :after tags html tables generate sort of automatic headers , footers, styling. they're cosmetic, i'd able define these things part of, well, general table style. right i'm testing simple rounded borders (using images) trying place particular images @ right , left side of element, i'd use same technique number of other styles. i'm doing this: .mintable { background-color: #3377aa; } .mintable:before { background: transparent url("topright.png") scroll no-repeat top right; height: 13px; display: block; border: none; content: url("topleft.png"); } .mintable:after { display: block; line-height: 0.1; font-size: 1px; content: url("bottomleft.png"); margin: 0 0 -1px 0; height: 13px; background: transparent url("bottomright.png") scroll no-repeat bottom right ; padding: 0; } ... <table class="mintable" width="800" border

Is there a way to detect filename encoding on Windows and Linux in c++? -

im trying make crossplatform application in c++ character conversion. have setup conversion table in utf-8 rules. eq( = 诶). use boost library filenames. understanding have convert them encoding x utf-8, conversion, convert encoding x , save new filename. how find out encoding filesystem using? windows uses utf-16 , linux platforms "binary". binary mean whatever bytes see filename filename - don't decode or re-encode bytes. there no indicator state format written in, it's utf-8.

iphone - Sending SMS to dynamic Telephone number -

i have app sends sms , calls dynamic telephone number, here code: #pragma mark - picturelistmaintablecelldelegate methods -(void)picturelistmaintablecell:(picturelistmaintablecell *)cell wantstocallnumber:(nsstring *)number { mfmessagecomposeviewcontroller *messagecomposer = [[mfmessagecomposeviewcontroller alloc] init]; nsstring *message = @"your message here"; [messagecomposer setbody:message]; messagecomposer.recipients = [nsarray arraywithobjects:@"0003233", nil]; messagecomposer.messagecomposedelegate = self; [self presentviewcontroller:messagecomposer animated:yes completion:nil]; nslog(@"texting telephone number [%@]", messagecomposer); nsstring *urlstring = [nsstring stringwithformat:@"tel://%@", number]; nslog(@"calling telephone number [%@]", number); [[uiapplication sharedapplication] openurl:[nsurl urlwithstring:urlstring]]; nslog(@"%@", [self devic

cryptography - What is the meaning of http://uri.etsi.org/TrstSvc/eSigDir-1999-93-EC-TrustedList/SvcInfoExt/RootCA-QC from ETSI TS 102 231 V3.1.2 -

from technical spec http://uri.etsi.org/trstsvc/esigdir-1999-93-ec-trustedlist/svcinfoext/rootca-qc a root certification authority certification path can established down certification authority issuing qualified certificates. used extension, if servicetype http://uri.etsi.org/trstsvc/svctype/ca/qc but purpose of having uri associated tspservice servicetypeidentifier http://uri.etsi.org/trstsvc/svctype/ca/qc ? does mean if have prospective certificate path one: - (root ca) - b (intermediate) - c (end user) where 1 registered in tsl tspservice without http://uri.etsi.org/trstsvc/esigdir-1999-93-ec-trustedlist/svcinfoext/rootca-qc uri associated, can't construct valid certification path b , c ?

Fading out (increasing transparency) Pygame Function Using set_alpha Not Working -

i'm trying make function fades out (increases transparency of) sprite overlay, large color block covers screen. however, reason, fade-in function works intended. fade-out function draws sprite overlay @ max opacity (255), doesn't show desired fade-out effect in spite of using same algorithm fade-in function does, though different range values, of course. edit: alright, think know deal here. the fade-out function draws overlay on background... , leaves there keeps continuously drawing on moron. i it. i'm gonna toy around this. here 2 functions: this 1 works: def fade_in(self): self.faderinuse.add(self) x in range(0, 256, self.rate): self.colorfade.set_alpha(x) screen.blit( self.colorfade, ( 0, 0 ) ) pygame.display.flip() clock.tick(15) self.faderinuse.clear( screen, screen ) drawscreen() this one, however, doesn't quite cut it: def fade_out(self): self.faderinuse.add(self) x in range( 25

ruby on rails - Custom validation after submit button is pressed -

is there way can make link_to submit button run custom validation? i need writing validation checks presence of fields , make sure there @ least 4 entries in nested form array. im using gem cocoon nested form , project requires user has @ least 4 questions attached application form. my associations follows: class app < activerecord::base belongs_to :user has_many :questions, :dependent => :destroy end class question < activerecord::base belongs_to :app end multistep controller: class userstepscontroller < applicationcontroller include wicked::wizard steps :personal, :school, :grades, :extra_activity, :paragraph, :submit def show @user = user.find(current_user) case step when :school, :grades, :extra_activity, :paragraph, :submit @question = question.find(current_user) end render_wizard end def update @user = user.find(current_user) @user.update_attributes(user_params) case step when :school, :grades,

c# - How to fill AvalonDock 2.0 application only with AnchorableWindows - no DocumentPane -

i fill avalondock application "tool" windows without document. can manually minimize documentpane area if possible, fill small area anchorable window layoutdocumentpane's width , height zero. problem avalondock framework's assumption there @ least single empty documentpane becomes apparent in case. though there no document, emptry space of documentpane overlapped or underlapped other tool windows near it. makes window partly invisible or under-filled. what tried in vain far: removed layoutdocumentpane tag dockmanager declaratrion set dockwidth , dockheight of layoutdocumentpane zero manually minimized documentpane , serialize layout any clue appreciated there seems no way except changing source code. in collectgarbage method of layoutroot.cs, commented out following code , got wanted - avalondock application without documentpane. if there no method this, highly suggest author have option without modifying source. hope helps others me.

.htaccess - htaccess file not working in php? -

i have code , code not working this htaccess code rewriteengine on rewriterule ^([0-9]{1,10000})-([a-za-z0-9_]{1,10000})$ news.php?id=$2&namenews=$3 and php code <a href='$slidefetch->id_ar-$slidefetch->name_ar'> i think got few things wrong. in rewrite rule have $2/3 when should $1/2. plus have {1,10000} means min of 1 number 100000 digits long! might want have {1,6} or whatever limit is. believe there limit on length of url ~2000 characters long depending on browser/search engine, better keep them shorter! if want 1-10000 can try: rewriterule ^([1-9][0-9]{0,3}|10000)-([a-za-z0-9_]{1,6})$ news.php?id=$1&namenews=$2 otherwise: rewriterule ^([0-9]{1,6})-([a-za-z0-9_]{1,6})$ news.php?id=$1&namenews=$2 (----$1----) (-------$2--------) i'm not sure if have echo tag should like: echo '<a href="', $slidefetch->id_ar, '-', $slidefetch->name_ar, '">';

c - What does this not work for getchar() method? -

this own experiment understand goes under hood, program mean compiler? main() { int c; printf("%d\n",c); printf("%d ", getchar()); while ((c == getchar()) != eof){ putchar(c); } } when c must equal getchar() (c == getchar()), not proceed through while loop? confused of own code, of c must mean! also, in code: main() { int c; c = getchar() while ((c = getchar()) != eof) putchar(c); } if modify int c int c = getchar() , why cannot somply write this: while (c != eof)( putchar(c); c = getchar(); } the compiler should know previous statement c = getchar() , why have write statement again? sorry, if confused. while ((c==getchar()) != eof) { ... } is while loop. evaluates condition each iteration of loop , terminates if condition false. in case, condition is: (c==getchar()) != eof) which nonsensical expression, let's examine anyway: first, program evaluate: getchar() this grabs keystroke standa

mysql - Wordpress non registered comments slow to post / tracing php -

i bought cheap vps , installed apache 2.2, mysql , wordpress. overall runs pretty decent page load times. if logged in admin can make post comments , save non registered / anonymous user when try save comment takes 45 - 60 seconds save. i have tried using fast cgi , mod_php results similar. this out of box install no plugins or non stock themes enabled. is there way trace calls made during post process? have tried setting wp debug doesn't provide logging.

Custom Method in Rails Controller -

i need call custom method in controller android app. have table name 'lists' has multiple columns 1 of them being 'tableno'. need call controller method fetch rows lists table in db passed table number , return json. in app read json. have defined method in lists controller below: def tableorder @list = list.where(:tableno => params[:tableno]) respond_to |format| format.json { render json: @list } end end in routes file have given resources :lists member 'tableorder' end end and url using execute android app lists/tableorder get method. parameters send android app jsonobject: jsonobject.put("tableno", tableno); . tableno here actual column name in lists table. the problem not executing query , giving missing template error. checked server , not reading params have sent. new rails , writing such thing first time not sure if missing something. please advise. thanks. attempt hit lists/tableorder.json

html - How to show border corners when a border is hidden -

so, have div 3 sides shown , bottom border set none. however, i'd keep bottom left , right corners visible. know of way this? thanks! use css styles <html> <div id="test" >something </div> </html> <style> #test { border-top-style: hidden; border-right-style:solid; border-bottom-style:solid; border-left-style:solid; } </style>

jquery - Tags data-value with separator ' ' (one whitespace) was interpreted as one -

i trying use select2 x-editable edit tags, override defaults: set separator ' ' (default comma). i set data-value="what,no,alright,sha e b r" should 4 tags: what,no,alright,sha e b r . turned out 1 tag what,no,alright,sha,e,b,r shown. here js code: http://jsfiddle.net/mydj9/5/ just let me know if need clarified. thanks. got same problem, solved in way issue report @ x editable same subject x-editable support answer , more info had found @ select2 primary developing site github.com/ivaynberg/select2/issues oryginally: separator: ",", tokenseparators: [], // array default empty, separator default ",", so if find problem in app [php or other programmers] change delimeter need to: separator: "|", need give tokenseparators:["|", " "], or other need.cheers