Posts

Showing posts from March, 2010

ruby - Rerouting to AWS hosted assets from a Heroku Rails app -

i have heroku hosted rails app has reached 300mb limit slug size , can no push heroku. fix issue, i've setup aws s3 account , want redirect assets being requested rails app new s3 location. rails app serving json files point static assets using relative url. ios app using rails json has hardcoded domain url, , appends path resources domain , requests assets needs. i want update heroku app , change asset locations without requiring update ios app in order change asset domain. so, need redirect static asset requests rails app aws server. in git repo, i've ignored assets in public folder i've moved aws server. asset files present on local machine, not part of git repo when uploaded heroku. so far i've tried changing config.action_controller.asset_host not seem work since these static assets , being returned web server before rails gets it. i tried using routes rules redirect different domain, these routes never seem captured. static files appear returned befo...

MySQL: Join distinct rows of two tables in a certain order? -

i have list of inventory units , sale transactions want to, (1) join unit sku, , (2) associate 1 transaction 1 inventory unit in first-in-first-out order date. i'm having trouble second part. the best can come is: select `units`.`unit_date`, `units`.`unit_id`, `trans`.`tran_date`, `trans`.`tran_id`, `units`.`unit_sku` `units` inner join `trans` on `trans`.`unit_sku` = `units`.`unit_sku` group `trans`.`tran_id`, `trans`.`unit_sku` order `units`.`unit_date` asc, `trans`.`tran_date` asc ; units table: unit_date | unit_id | unit_sku 2015-06-01 | 1 | u1klm 2015-06-02 | 2 | u1klm 2015-06-03 | 3 | u2qrs 2015-06-04 | 4 | u2qrs 2015-06-05 | 5 | u1klm trans table: tran_date | tran_id | unit_sku 2015-06-11 | | u2qrs 2015-06-12 | b | u1klm 2015-06-13 | c | u1klm 2015-06-14 | d | u2qrs 2015-06-15 | e | u1klm the desired result 1 tran_id joined 1 unit_id of unit_sku earliest-to-latest order of unit_...

angularjs - Nesting column layout inside a row layout -

i'm trying accomplish nested scrollable layout has left sidebar , right container divided horizontally. i've used ui-layout still quite new (and buggy). given codepen <body ng-controller="appctrl" layout="row" layout-fill> <div flex="33" class="blue">left</div> <div flex="66" class="green" layout-fill> <div layout="column" layout-align="start start"> <div flex="25">above</div> <div flex="75">below</div> </div> </div> </body> why unable see nested column layout properly? expect above horizontally take 25% of right-hand side of page , below rest 75%. doing wrong, or possible using layout directive? change <div flex="66" class="green" layout-fill> <div layout="column" layout-align="start start">...

php - Dropzone js parallel upload causes problems in backend -

i'm building system, users can upload images ads. each ad can have 8 images associated. 1 of images become primary image, display in search results , on. when upload multiple images using parallel , count existing records in db, make sure limit aren't reached, things weird. because images hit server @ same time, passes check make sure, upload 8 images , uploaded suddenly. works fine, if user upload 1 image @ time. i don't know how come along bug. best practice ? i'm using laravel 5, in case... thanks! public function store(uploadadimagerequest $request, $id) { $ad = $this->adrepo->getwithimages($id); $this->imagerepo->hasspace($ad); $image = $this->imagerepo->upload($request->file('image')->getrealpath(), $ad); }

mysql - RAM allocation in WHM/Cpanel using SSH -

i have server(vps) 4gb ram. create 4 cpanels allowed ram 1gb each, use individual memory. how can using ssh? if want setup memory limit user need use cloudlinux os on server, cloudlinux server can set memory, process , cpu limit on account basis https://www.cloudlinux.com/about/features.php

c++ - Recursive solutions for glob pattern matching -

i'm studying implementations of unix-style glob pattern matching. generally, fnmatch library reference implementation functionality. looking @ of the implementations , reading various blogs/tutorials this, seems algorithm implemented recursively. generally, sort of algorithm requires "back tracking", or requires returning earlier state, nicely lends recursive solution. includes things tree traversal, or parsing nested structures. but i'm having trouble understanding why glob pattern matching in particular implemented recursively. idea tracking necessary, example if have string aabaabxbaab , , pattern a*baab , characters after * match first "baab" substring, aa(baab)xbaab , , fail match rest of string. algorithm need backtrack character match counter starts over, , can match second occurrence of baab , like: aabaabx(baab) . okay, recursion used when might require multiple nested levels of backtracking , , don't see how necessary in...

batch file - How to check and correct user input when he omit the extension .exe to kill the process? -

i have batch kill process typed of course user , works 5/5 when user example typed calc.exe extension, issue improve batch in order add automatically program if user has omitted add extension .exe calc without extension .exe not work. @echo off & cls mode con cols=72 lines=7 set tmpfile=tmpfile.txt set resultat=killresult.txt if exist %tmpfile% del %tmpfile% if exist %resultat% del %resultat% ::******************************************************************************************** :main title process killer hackoo 2015 cls & color 0b echo. echo quel(s) processus voulez-vous fermer ? echo. set/p "process=entrer le(s) nom(s) de(s) processus> " cls & color 0c title killing "%process%" ... echo. echo killing "%process%" ... echo. echo %date% *** %time% >> %tmpfile% %%a in (%process%) call :killprocess %%a cmd /u /c type %tmpfile% > %resultat% start %resultat% echo. goto :main ::*******...

c# - web service utf8 arabic decoding -

i built c# web service accepts unicode characters have client consumes web service php insert data ms sql database runs correctly english characters when push arabic text insert "???????" chars database i tried decode utf8 unicode no luck here conversion code: private byte[] getrawbytes(string str) { int charcount = str.length; byte[] byttemp = new byte[charcount]; (int = 0; < charcount; i++) { byttemp[i] = (byte)str[i]; } return byttemp; } private string utf8tounicode(string str) { byte[] bytutf8; byte[] bytunicode; string strunicode = string.empty; bytutf8 = getrawbytes(str); bytunicode = encoding.convert(encoding.utf8, encoding.unicode, bytutf8); strunicode = encoding.unicode.getstring(bytunicode); return strunicode; }

swift - Incorrect UITableViewCell height UIImageView -

Image
i have uitableviewcell contains uiimageview . using uitableviewautomaticdimension working other cells in tableview, except image view cell. tableview.estimatedrowheight = 100 tableview.rowheight = uitableviewautomaticdimension i want image tall wants, maintain image's aspect ratio , fill width. set image view's constraints pinned cell's frame using auto layout , set image views contentmode aspect fit. set uiimageview's background red. , cell above white. actual image black down below. when that, cell has 100 px above image , 100px below. images size want. has had same issue? because red space isn't same size , lot taller when have big image in there, believe layout thinks height should actual height of image, without aspect fit constraint. thanks help! i want image tall wants, maintain image's aspect ratio , fill width. set image view's constraints pinned cell's frame using auto layout , set image views contentmode ...

mysql - Eloquent update and get record back -

when update record do $myobject->update(['field' => 'value']); and updates both database , instance $myobject. need bulk update use model facade , do $result = myobject::where(...)->update(['field' => 'value'); the issue here $result sends me boolean instead of updated instances have separately right after need same filter time get(). $objects = myobject::where(...)->get(); is there more efficient way update , records in 1 call / request database? imho way arguably efficient eloquent. if care performance more using eloquent raw queries in postgresql (with returning clause) or sql server (with output clause) can return updated records in 1 go. mysql unfortunately doesn't have such support on statement level. in supported laravel databases can achieve (one trip database) stored procedure.

how to scan a barcode image in a meteor application -

i'd put mobile-friendly data acquisition app app used in data center, means working in disconnected mode app needs carry (on client) mongodb collection of asci| character codes, matched incoming barcodes once being online, app should sync acquired data back-end mongodb based on these requirements, think, meteor choice my questions is: there meteor packages, can scan image, , translate image ascii character code? to barcode scanning capability, use barcodescanner cordova plugin: meteor add cordova:com.phonegap.plugins.barcodescanner@2.0.1 template <head> <title>barcode scanner</title> </head> <body {{> barcode_scanner}} </body> <template name="barcode_scanner"> <button>scan</button> </template> js if (meteor.iscordova) { template.barcode_scanner.events({ 'click button': function () { cordova.plugins.barcodescanner.scan( function (result) { ...

java - ListPreferences; Getting an option from a string-array -

i learning basics of android development through udacity. class asking make setting on app user chose whether temperatures should done in fahrenheit or in celsius. i've created array in xml user choose preference, don't know how pass info down java code. have provided few places problem might going wrong. of right now, code displays , works fine until user changes pref_general.xml <?xml version="1.0" encoding="utf-8"?> <preferencescreen xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <edittextpreference android:key="location" android:title="location" android:defaultvalue="85383" android:inputtype="text" android:singleline="true"/> <listpreference android:title="@string/pref_units_label" ...

javascript - string replacer and json -

i'm working in app replace strings other strings inside string. example: "nuggets" replaces "chicken" input = "i chicken"; output = "i nuggets"; for have textarea input. user input json object this. example: replacing_box_input = "{"a":"b","b":"c","c":"d","chicken":"nuggets"}"; input = "i chicken abc"; output = "i nuggets bcd"; here code using: var output = $("#output"); string.prototype.cap = function () { return this.charat(0).touppercase() + this.slice(1); }; function trans() { var dic_editor = $("#dic-editor"); var value = dic_editor.val(); var mapobj = json.parse(value); var re = new regexp(object.keys(mapobj).sort(function(a, b) { return b.length - a.length; }).join("|"), "g"); value = value.replace(re, function (matched) { re...

jquery - Is there any easier way to write a scrollTop animation? -

i'm wondering if there easier or better way of writing jquery animation triggers after point. the code have @ moment looks like; html <div class="div"> <div id="box"></div> </div> script $(document).scroll(function() { var scrolled = $(document).scrolltop(); if(scrolled > 300) { $("#box").css("margin-left", "300px"); } else { $("#box").css("margin-left", "0px"); } }); also there away add different amount of time each animation take complete instead of add .css("transition", "all 2s"); tl; dr : yes, there multiple ways fire off transitions jquery, javascript, , css. there few ways , have showcased them in following jsfiddle , can comment/uncomment code necessary see 2 different ways of using transitions. 1st option jquery $('#box').addclas...

c# - How to Build Cross Platfrom ( Windows Phone and Android) -

i begainner mobile app devolpment , , wanted make mobile apps programming lang , wated make app cross platfrom dont need write 2 or 3 times , heared xmairin need write ui more 1 time , thats ok on platfrom should start , saw cool tuts on ms vitrual academey if devolped example windows 8.1 app able port android , change ui , prgramming language should start in order develop full multi-platform mobile apps xamarin without rewrite ui should use xamarin forms. check xamarin forms

angularjs - Securing Symfony RESTful API consumed by angular front? -

i have set symfony based api being used angular front end totally dependent of (user registration included) i have read multiple threads recommending using wsse or fosoauthserverbundle i'm not sure best method ? if understood correctly, wsse has send each api request x-wsse headers make me think not best suited performance. about fosauthserverbundle have never used , looks bit complicated me compared wsse, that's why i'm asking there before trying implement it. i have 2 simple groups of user (basic , admin), best way secure api, additionally providing easy way keep user persistence (i mean accesses through different pages)? how should in angular front side ? thanks help. refs: http://blog.tankist.de/blog/2013/07/16/oauth2-explained-part-1-principles-and-terminology/ http://obtao.com/blog/2013/06/configure-wsse-on-symfony-with-fosrestbundle/ it depends on requirements are. first of all, oauth 2 authentication mechanism/spec can use in combinati...

c - Error: called object type int is not a function or function pointer -

i error in c code: error:called object type int not function or function pointer i have looked on answer , everywhere have checked confirms code should working, missing? want assign random numbers 2 different variables. i've commented off errors i'm getting in ide. (note: isnt full code, relevant section) #include <stdio.h> #include <stdlib.h> #include <time.h> int main(void){ int k, seed, mines, row, column, boom; int board[9][10]; printf("please enter seed: "); scanf("%d", &seed); getchar(); srand(seed); for(k = 1; k <= mines; k++) { row = rand() % 8; //error:called object type int not function or function pointer column = rand() % 8; //error:called object type int not function or function pointer if(board[row][column] == 0) { board[row][column] = boom; } } } int k; seed; mines; row; column; correct above line follows: int k, seed, mines, row, column; ...

python - Split a list into chunks determined by a separator -

i have list (python): [item1],[item2],[item3],[/],[item4],[item5],[item6],[/]...and on. i want separate these chunks , elements go each chunk elements before separator "/". so chunks like: chunk1:[item1],[item2],[item3] chunk2:[item4],[item5],[item6] i've tried , tried, nothing efficient came mind. tried looping through , and if element[x] == '/' positions. it's dirty , doesn't work. any appreciated. the usual approach collecting contiguous chunks use itertools.groupby , example: >>> itertools import groupby >>> blist = ['item1', 'item2', 'item3', '/', 'item4', 'item5', 'item6', '/'] >>> chunks = (list(g) k,g in groupby(blist, key=lambda x: x != '/') if k) >>> chunk in chunks: ... print(chunk) ... ['item1', 'item2', 'item3'] ['item4', 'item5', 'item6'] (y...

haskell - parsec running out of memory -

i wrote parser large csv file works on smaller subset runs out of memory ~1.5m lines (the actual file). after parsing elements list(using manytill), instead used parser state store them in single binary search tree - worked large file. i have since split "element type" in 3 separate types , want store them in own tree, resulting in 3 trees of different type. version, though, works small test file while running out of memory larger one. import qualified data.tree.avl avl import qualified text.parsercombinators.parsec parsec ---- data enw = enw (avl.avl extent) (avl.avl node) (avl.avl way) ---- used element = extent | node | way in (tree element) - worked csvparser :: parsec string enw enw csvparser = (parsec.manytill (parsel) parsec.eof) >> parsec.getstate parsel = parseline >> ((parsec.newline >> return ()) <|> parsec.eof) parseline :: parsec string enw () parseline = parsenode <|> parseway <|> parseextents parsenode :: parse...

ios - How to know which row and which section is editing -

i have 10 sections , each section has 1 row. row contain 5 text fields. if change text field value how update particular row ? it should not effect sections rows. have taken customview cell designing. check https://stackoverflow.com/a/2... answer. set tag textfield , use dictionary store values, otherwise reusing cell textfield text re-appearing in other cells. cellforrowatindexpath return section , row... own logic in dict store textfield values... [txtfield addtarget:self action:@selector(textfielddidchange:) forcontrolevents:uicontroleventeditingchanged]; -(void)textfielddidchange:(uitextfield *)txtfield { uilabel *label = (uilabel *)[txtfield.superview viewwithtag:100]; nsstring *labelstring = label.text; nsstring *textfieldstring = txtfield.text; [amounts setobject:textfieldstring forkey:labelstring]; } maintain unique key cell or textfield store in dict, check dict key exist, if exist change value else add new key value. i think is, want...do...

android - getActivity().getActionBar() on first fragment crash -

public class mainactivity extends actionbaractivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); setupviewpager(); } private void setupviewpager() { // todo auto-generated method stub fragmentpageritemadapter adapter = new fragmentpageritemadapter( getsupportfragmentmanager(), fragmentpageritems.with(this) .add("home", homefragment.class) .add("message", messagefragment.class) .add("my", myfragment.class).create()); viewpager viewpager = (viewpager) findviewbyid(r.id.viewpager); viewpager.setadapter(adapter); smarttablayout viewpagertab = (smarttablayout) findviewbyid(r.id.viewpagertab); final layoutinflater inflater = layoutinflater.from(viewpagertab.getcontext()); final r...

CSS positioning without the use of float or margin adjustments -

how can move ul element on the right of browser without using float, or 'guesstimating' element flush right margin through use of tools such margin px/% etc? .nav li { display: inline; } .nav h1 { background-color: red; display: inline-block; } .nav ul { display: inline-block; border: 1px solid black; } <div class="nav"> <h1>resume</h1> <ul> <li>home</li> <li>portfolio</li> <li>skills</li> <li>experience</li> <li>contact</li> </ul> </div> depending on browsers need support, can use flexbox. mdn - flexible boxes specifically, want container display: flex; , justify-content: space-between; something like: <div class="nav" style="display: inline-flex; justify-content: space-between;"> ... child items here ... </div> note flexb...

How to traverse a tree in Clojure while collecting the value from each node node? -

i want create function collects value each node in binary tree. in clojuredocs, found several functions traversing tree/graph, such tree-seq, prewalk, , postwalk. https://clojuredocs.org/clojure.core/tree-seq https://clojuredocs.org/clojure.walk/prewalk https://clojuredocs.org/clojure.walk/postwalk can of these used accumulate value of nodes traversed? clojure newby, don't see how it. if know how (in clojure or similar lispy language), please show me. ideally, answer understandable clojure newby;-) my binary tree represented nodes this: (value left-child right-child). example: ( 2 (7 nil nil) (88 (5 nil nil) nil) ) from example, i'd function return (2 7 88 5). note: traversal method isn't important. want learn technique collecting node values. well, tree-seq give node sequence (of depth first walk). can other transformation on it, including (map some-value-extractor-fn (tree-seq ... values in each node. need pick tree representation ...

ios - Opening and closing form animation -

Image
is animation possible in ios, third party api's that? figured out myself nested animations -(void)viewdidload { expandiview = [[uiview alloc] initwithframe:cgrectmake(137, 269, 30, 2 )]; expandiview.backgroundcolor = [uicolor redcolor]; [self.view addsubview:expandiview]; expandiview.hidden=yes; } -(ibaction)expand:(id)sender { expandiview.hidden=no; [uiview animatewithduration:0.5f animations:^{ expandiview.frame = cgrectmake(60, 269, 200, 2); } completion:^(bool finished) { [uiview animatewithduration:1 animations:^{ expandiview.frame = cgrectmake(60, 269, 200, 100); }]; }]; } -(ibaction)collapse:(id)sender ...

php - Symfony2 innerJoin is returning columns multiple time -

i'm using symfony2 application. query i'm using this: $contents = $em->getrepository('bbdbongoappbundle:content') ->createquerybuilder('c') ->select('c.id, c.title, c.sequence, c.sequence_count, c.category_sequence, c.unique_id, c.priority, c.status') ->addselect('o.slug owner') ->addselect('cat.slug category') ->addselect('m.name media') ->innerjoin('c.content_owner', 'o') ->innerjoin('c.category', 'cat') ->innerjoin('c.media', 'm') ->getquery() ->getarrayresult(); everything before added ->innerjoin('c.media', 'm') because of content title , other returning twice if media has 2 value, i.e (youtube,website) if media has 1 value returning single result if has multiple returning multiple result. what want single title media in single result. i...

.net - Contract First SOA and WCF Contracts -

i have simple question. using wcf create web services. have created services without filling operation bodies. have wsdl files auto-generated service contracts. approach "contract first", if coding operation implementations later? yes, because you're defining contract between , consuming api first. (but not always) contract/api defined via interface. edit: namphibian said in comments, if you're building web services contract first, want define wsdl first , generate code there. answer assumed wanted develop .net api contract first , going expose web service after fact. second edit: wanted add soa principles have nothing web services. can build services exposed via codified api.

rust - Stack behavior when returning a pointer to local variable -

i have simple example behaviour of rust not match mental image, wondering missing: fn make_local_int_ptr() -> *const i32 { let = 3; &a } fn main() { let my_ptr = make_local_int_ptr(); println!("{}", unsafe { *my_ptr } ); } result: 3 this not expect. using notation given in the stack , heap i expect stack frame this: address | name | value ----------------------- 0 | | 3 inside make_local_int_ptr() , after line, let my_ptr = make_local_int_ptr(); since a goes out of scope, expect stack cleared. apparently not. furthermore, if define variable between creating my_ptr , printing dereferenced value of it: fn main() { let my_ptr = make_local_int_ptr(); let b = 6; println!("{}", b); // have use b otherwise rust // compiler ignores (i think) println!("{}", unsafe { *my_ptr } ); } my output is: 6 0 which again not expected, thinking: address | name | valu...

php - Twitter OAuth : Invalid or expired token [its NOT duplicate] -

before goes in hurry , mark question duplicate, let me tell its not duplicate i have checked similar question this , this , this , this , 2 years old , library has been changed since answers not useful. so here's question. i'm using abraham's libraray can found here . below code i'm using: if(!empty($_get['oauth_verifier']) && !empty($_session['oauth_token']) && !empty($_session['oauth_token_secret'])) { $connection = new twitteroauth('my_consumer_key', 'my_consumer_secret', $_session['oauth_token'], $_session['oauth_token_secret']); $access_token = $connection->oauth("oauth/access_token", array("oauth_verifier" => $_request['oauth_verifier'])); $_session['access_token'] = $access_token; $user_info = $connection->get("account/verify_credentials"); print_r($user_info); } from print_r did above, result follows:...

bluetooth - Using Evothings JavaScript to read BLE characteristic data -

i have ble (bluetooth 4.0)pedometer device want read characteristic data using evothings plugin (which uses javascript api interact device) i using following code - callback when device connected = function deviceconnected(device) { console.log('connected device: ' + device.name) console.log('reading services... have patience!') device.readservices( null, // null means "read services". readallservicescharacteristicsandnotifications, // listallservicescharacteristicsdescriptors, readserviceserror) } callback code readallservicescharacteristicsandnotifications - function readallservicescharacteristicsandnotifications(device) { // data each service console.log('number of services ' + device.__services.length) console.log('number of characteristic ' + device.__services[0].__characteristics.length) //var characteristic = service.__characteristics[characteristicuuid] d...

uiwebview - WebViewProgressProxy violates Content Security Policy (CSP) rules -

we started using content security policy (csp) on our website , noticed many users violates csp rules through webviewprogressproxy urls. in such cases receive following report csp: {"csp-report":{ "document-uri":"http://example.com/en/booking/b2", "referrer":"http://example.com/en/booking/b1/nnn", "violated-directive":"default-src 'self'", "original-policy":"default-src 'self'; font-src data: 'self'; img-src 'self' www.google-analytics.com data: s3.amazonaws.com; script-src 'self' www.google-analytics.com; report-uri /cspreport", "blocked-uri":"webviewprogressproxy://", "source-file":"http://example.com/en/booking/b2", "line-number":1 }} user-agent: mozilla/5.0 (iphone; cpu iphone os 8_1_2 mac os x) applewebkit/600.1.4 (khtml, gecko) mobile/12b440 [fban/messengerforios;fbav...

android - How to add a surfaceview into a fragment? -

i have surface view , fragment, need display surface view in fragment. below surface view , fragment classes. is approach i'm doing right, draw in fragment? or have other suggestion? fragment class: public class fragment1 extends fragment{ public static int width,height; @override public view oncreateview(layoutinflater inflater,viewgroup container,bundle savedinstancestate){ return new gameview(getactivity()); } fragment xml <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/index" android:orientation="vertical" > </linearlayout> gameview(surface view) public class gameview extends surfaceview { private bitmap bmp; private surfaceholder holder; public gameview(context context) { super(co...

combine all vectores into dataframe which starts with specific name in R -

i have different numeric vectors same length , want combine specific name dataframe; lets say: want combine vectors starts " pred " prednn=c(1,2,3,4,5) prednb=c(2,6,4,7,8) nope=c(5,7,5,1,1) predsv=c(55,11,22,33,44) result: dfpred: prednn prednb predsv 1 2 55 2 6 11 3 4 22 4 7 33 5 8 44 how can in r? thanks you can try mget data.frame(mget(ls(pattern='^pred'))) # prednb prednn predsv #1 2 1 55 #2 6 2 11 #3 4 3 22 #4 7 4 33 #5 8 5 44

c - Reading packets from a client stops after 1 or 2 received -

i'm writing server program in c read commands client. commands in form of 5 byte packets, , client sending bunch of them in succession. code have read each command is: while(1) { char buffer[1024]; int alreadyread = 0; int socket = dequeue(); while(alreadyread != 5) { { nowread = read(socket,buffer+alreadyread,5-alreadyread); alreadyread += nowread; } while((nowread > 0) && (5-alreadyread > 0)); if(nowread == -1 || nowread == 0) { printf("error reading client socket\n"); exit(1); } //do command but doesn't seem work: if client sends 10 packets, read 1 or 2 , segfault. have idea why? the while (alreadyread != 5) seems extraneous since alreadyread 5 or nowread less 0 after do-while, , if nowread less 0 exit. you've poorly defined command, think need more information on that. it looks you...

aop - Error in springs.xml , aspectj-autoproxy -

i trying hand in springs. facing following error stacktrace: exception in thread "main" org.springframework.beans.factory.xml.xmlbeandefinitionstoreexception: line 20 in xml document class path resource [spring.xml] invalid; nested exception org.xml.sax.saxparseexception; linenumber: 20; columnnumber: 29; cvc-complex-type.2.4.c: matching wildcard strict, no declaration can found element 'aop:aspectj-autoproxy'. @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.doloadbeandefinitions(xmlbeandefinitionreader.java:399) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:336) @ org.springframework.beans.factory.xml.xmlbeandefinitionreader.loadbeandefinitions(xmlbeandefinitionreader.java:304) @ org.springframework.beans.factory.support.abstractbeandefinitionreader.loadbeandefinitions(abstractbeandefinitionreader.java:181) @ org.springframework.beans.factory.support.abstractbeandefinitionreader....

git refuses to connect without proxy -

i work on linux system in windows environment. authenticate nt proxy server had setup cntlm , configured system programs use via setting http_proxy environment variable in /etc/environment file. now want remove proxy setting , have programs connect directly. so unset system environment variables: unset http_proxy unset http_proxy check ~/.gitconfig ensure there no proxy entries. explicitly instruct git not use proxies: git config --global --unset http.proxy git config --global --unset https.proxy verify no proxy configured: git config --system --get https.proxy git config --global --get https.proxy git config --system --get http.proxy git config --global --get http.proxy and push remote repo: git push but git still tries connect via proxy: fatal: unable access ' https://xxx@bitbucket.org/xxx.git/ ': failed connect 127.0.0.1 port 3128: connection refused why won't let go off cntlm ? the easiest check is: env|grep -i pr...

osx - Can't See 'TestNG' option in the Preferences of eclipse project on Mac OS 10.10.3 -

i can't see testng in preferences of project. facing issue on mac os 10.10.3 latest eclipse luna sr2 (4.4.2) , testng 6.9.5. same thing works fine on windows machine same eclipse , testng. i tried installing jdk 8 u45 , worked me. help.

c - Is it possible to disable, fade or make a button inside a dialog unclickable in GTK? -

Image
i have dialog this: gtkwidget *dialog = gtk_dialog_new_with_buttons("spell checking", null, 0, gtk_stock_ok, gtk_response_accept, gtk_stock_add, gtk_response_apply, gtk_stock_cancel, gtk_response_reject, null); after adding other necessary elements it'll this: what want disable ok button if list of correct words empty. of course, there workarounds creating dialog: with ok when list not empty without otherwise nevertheless, i know if can disable/fade buttoon , how. gtk widgets have property sensitive , when it's set false, widget grayed out, i.e. user couldn't interact it. there's a function purpose...

actionscript 3 - Remove click after going to another scene in AS3? -

after switching 2nd scene, keyboard event not work until left-click screen. how avoid left click can trigger keyboard event directly right after moving 2nd scene? more details may need: 1st scene btnstart.addeventlistener(mouseevent.click, initgame); function initgame(e:mouseevent) { gotoandplay(1, "gameplay"); } 2nd scene use 1 frame. have object. set keyboard event function move object right or left. stop() frame. keyboard function doesn't work until give screen mouse click. var moveup:boolean = false; var movedown:boolean = false; var moveleft:boolean = false; var moveright:boolean = false; var ismoving:boolean = false; stage.addeventlistener(keyboardevent.key_down, movecowboy); function movecowboy(e:keyboardevent) { if (e.keycode == keyboard.w) { moveup = true; if (ismoving == false) mycowboy.gotoandplay(15); ismoving = true; } else if (e.keycode == keyboard.s) { movedown = true; ...

sockets - Communicating with WebSocket server using a TCP class -

would possible send , receive data/messages/frames , websocket server interface using standard tcp class? or need fundamentally change tcp class? if possible, show me little example of how like? (programming language doesn't matter) example found node.js code represents simple tcp client: var net = require('net'); var client = new net.socket(); client.connect(1337, '127.0.0.1', function() { console.log('connected'); client.write('hello, server!'); }); client.on('data', function(data) { console.log('received: ' + data); }); maybe show me have changed make communicate websocket. websockets protocol runs on tcp/ip, detailed in standard's draft . so, in fact, it's using tcp/ip connection (tcp connection class / object) implement protocol's specific handshake , framing of data. the plezi framework , written in ruby, that. it wraps tcpsocket class in it's wrapper called connection...

PL/SQL: Join between two tables error -

Image
i have got task in have display information 2 different tables using cursor. tried doing example did before, doesn't seem work! below mentioned 2 tables have take records , display them. 'emp' table 'dept' table i want display employee number, names, salary, department name , department location working in. below did: set serveroutput on; declare cursor staff_cursor select e.empno,e.ename,e.sal, d.dname, d.dloc emp e, dept d e.deptno = d.deptno; v_eno emp.empno%type; v_lname emp.ename%type; v_esal emp.sal%type; v_ddname dept.dname%type; v_dloc dept.dloc%type; begin dbms_output.put_line ('******************'); open staff_cursor; fetch staff_cursor v_eno, v_lname, v_esal, v_ddname, v_dloc; while staff_cursor%found loop dbms_output.put_line (v_eno); dbms_output.put_line (v_lname); dbms_output.put_line (v_esal); dbms_output.put_line ('******************'); dbms_output.put_line (v_ddname...

c# - comparing array of chars to database records and read the record -

i trying change database mysql sql server 2008 express vs2010 c# project. after change connection string , queries, program produces error 'null reference exception unhandled' on "cmr.close()". here code , place error occurred : namespace jawirdrsql { /// <summary> /// interaction logic mainwindow.xaml /// </summary> public partial class mainwindow : window { sqlconnection sc = new sqlconnection("data source=user-pc\\sqlexpress;initial catalog=firstdb;integrated security=true"); sqlcommand cmd; sqldatareader cmr; public mainwindow() { initializecomponent(); } //string sc; string strvalue; private void button1_click(object sender, routedeventargs e) { strvalue = textbox1.text; char[] strval = strvalue.tochararray(); array.reverse(strval); foreach(char obj in strval) ...

javascript - running a jquery task forever -

i new in jquery / java script; trying make slider. please following problem. i want make div (class slider) fade-out , fade-in forever; please check code. possible use setinterval() function this? <html> <head> <title>slider</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="../jquery/jquery.min.js"></script> <style> .slider1{ width: 500px; height: 250px; margin: 0 auto; background-image: url(images/rectblue.png); } </style> <script type="text/javascript"> var runforever = $(document).ready(function () { $(".slider1").fadeout(2000, function () { $(".slider1").fadein(2000); }); }); runforever(); //setinterval(runfore...