Posts

Showing posts from September, 2010

javascript - Un-Defined index with $http. -

not sure reason got undefined index below code. checked can't find what's wrong. $http({ url: "php/mainload.php", method: "get", data: {"userid":"1"} }).success(function(data, status, headers, config) { console.log(data); }).error(function(data, status, headers, config) { // $scope.status = status; alert(status); }); php echo $_get['userid']; parametere data on ajax expecting method post , if need $_get , use params instead : $http({ url: "php/mainload.php", method: "get", params: {"userid":"1"} // change `params` `data`. }).success(function(data, status, headers, config) { console.log(data); }).error(function(data, status, headers, config) { // $scope.status = status; alert(status); });

ios - AVAssetWriter Writes Video but does not record AUDIO -

i have been successfull in making viedo (though blur) but have been unsuccessful in recording audio please help. i using following code pls go through ans suggest solution or working tutorial. i appending sample buffer using [encoder._writerinput appendsamplebuffer:samplebuffer]; , app crashes when following statement called [encoder.audiowriterinput appendsamplebuffer:samplebuffer]; - (void) initpath:(nsstring*)path height:(int) height andwidth:(int) width bitrate:(int)bitrate { self.path = path; _bitrate = bitrate; [[nsfilemanager defaultmanager] removeitematpath:self.path error:nil]; nsurl* url = [nsurl fileurlwithpath:self.path]; //initialize video writer _writer = [avassetwriter assetwriterwithurl:url filetype:avfiletypempeg4 error:nil]; //initialize audio writer // audiowriter = [avassetwriter assetwriterwithurl:url filetype:avfiletypecoreaudioformat error:nil]; // nsdictionary* settings = @{ // avvideocodeckey: a

android - How to slice sprites into multiple sprites in AndEngine -

i'am newbie andengine. have situation wherein have slice/cut particular sprite multiple sprites, how can achieve that? you won't able using andengine functionalities. have implement such thing yourself. let's talk , on slicing fruit (like in fruit ninja;) ) should have 3 sprites watermelon. 2 halves , whole fruit. after slicing should hide whole watermelon , show 2 halves @ place setting it's x, y , rotation. (you have read , calculate slice position , direction somehow. more realistic) why 2 halves instead of 1 if same? shouldn't same if want 3d effect. 1 of sprite show of watermelon inside (you know, red thing eat;) ) the other possibility similiar instead of attaching , detaching sprites can have 2 sprites attached togheter in way whole watermelon. ps if remember fruit ninja has 3d fruit models objects won't cool in 2d (they won't rotate in z-axis). used fruit ninja example want similiar effect. don't know other possibility in an

android - How to delete all arcs drawn on a Bitmap -

i have declared bitmap this. mbitmap = bitmap.createbitmap(width, height, bitmap.config.argb_8888); mcanvas = new canvas(mbitmap); now after drawing arcs on it, how clear bitmap in same state when app started you can use mcanvas.drawcolor(color.transparent, mode.clear); here documentation.

php - .htaccess URL rewrite subfolder $_GET -

i trying create htaccess file website. got subfolders called admin. in subfolder index.php , content pages. want rewrite url's domain.com/admin/page1 example. everything working main index files can't $_get['page'] working in admin folder. url: http://techniekquiz.schl.nl/ http://techniekquiz.schl.nl/admin/ htaccess code: rewriteengine on rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ ?page=$1 rewriterule ^admin/(.*)$ admin/index.php [nc,l] rewriterule ^(.*)admin/(.*)$ ?page=$1 my index.php (admin/index.php) file (only $_get part of it) $page = (isset($_get['page']) ? $_get['page'] : ''); if (!empty($page) && file_exists(''.$page.'.php')) { require (''.$_get['page'].'.php'); } elseif ( ( (!file_exists(''.$page.'.php')) or (!file_exists(''.$page.

sql - mysql query - credit debit-> calculate balance (complex tables structure) -

Image
i have tables structure: the "plati" table = credit. the "suma" column = amount. sample debit data: sample credit data: and want result: plati.id debite.iddosar debite.suma plati.suma plata (debite.suma - previous plati.suma order plati.data) restplata like excel: is possible sql query not variable, because want split query's create 1 view on finally?

javascript - Safari does not trigger form Submit -

for project got 2 select-formfields sent via jquery trigger("submit"); works in firefox und chrome, in safari nothing happens. this html-code: <body> <form action="http://google.de" target="_blank" style="display: inline;" method="get"> <select class="bstarch2" data-role="none" name="q"> <option value="none">please choose</option> <option value="a: worked">a</option> <option value="b: worked">b</option> </select> </form> <select class="bstarch" data-role="none"> <option value="none">please choose</option> <option value="http://google.de">google</option> <option value="http://en.wikipedia.org">wikipedia</option> </select> <form action="" method="

qt5 - Signal/Slots with VIsual studio and Qt plugin -

i have issue slots , signals in visual studio 2012 qt plugin. when compile qt project, shows error: moc_mainwindow.obj : error lnk2019: unresolved external symbol "public: void __thiscall mainwindow::onupdate(class qstring)" (?onupdate@mainwindow@@qaexvqstring@@@z) referenced in function "private: static void __cdecl mainwindow::qt_static_metacall(class qobject *,enum qmetaobject::call,int,void * *)" (?qt_static_metacall@mainwindow@@caxpavqobject@@w4call@qmetaobject@@hpapax@z) these classes: mainwindow.h #ifndef mainwindow_h #define mainwindow_h #include <qmainwindow> #include <qtextedit> #include <qstring> namespace ui { class mainwindow; } class mainwindow : public qmainwindow { q_object public: explicit mainwindow(qwidget *parent = 0); ~mainwindow(); public slots: void onupdate(qstring info); private: ui::mainwindow *ui; qtextedit *textedit; }; #endif // mainwindow_h mainwindow.cpp

Print if origin in tuple is [0] (python) -

i format code print the word river , sand if value[0] called. datafile.txt river, 4 -5, 6 -6, 8 6, 9 sand, 10 6, 7 -6, 76 -75, 75 my code textfile =open("datafile.txt", "r") datastring = textfile.read() value=[] split in datastring.split('\n\n'): split = ','.join(split.split('\n')) split = ''.join(split.split(' ')) split = split.split(',') x in range(0, len(split)-1): if (x == 0): value.append(split[x]) value.append((0, split[x+1])) else: temptuple=(split[x], split[x+1]) value.append(temptuple) print(value[0]) datafile.close() the above code prints "river", (0,4),(-5,6),(-6,8),(6,9), "sand", (0,10), (6,7),(-6,76),(-75,75) . it print river , sand when value[0] called. how change code that? data comes text file. the expected output when value[0] called should print "river" , "sand"

mongodb - Connections pool in Go mgo package -

in article running-mongodb-queries-concurrently-with-go said mgo.dialwithinfo : create session maintains pool of socket connections mongodb, when looking in documentacion of function dialwithinfo not find talk me pool connection, find in dial function dial function said : method called once given cluster. further sessions same cluster established using new or copy methods on obtained session. make them share underlying cluster, , manage pool of connections appropriately. can me how works pool connections on mgo , if possible set pool? is true dialwithinfo create pool connection or dial function create pool? thanks in advance looking source code dial function calls , can see dial function calls dialwithtimeout function calls dialwithinfo function. answer question differences between functions, seems dial convenience wrapper dialwithtimeout , in turn convenience wrapper dialwithinfo , result in same connection pool. as how manage connection po

c# - EntityState clarification with SaveChanges -

i used technique shows in answer ( https://stackoverflow.com/a/6282472/2045385 ) create trackingdbcontext inherit many of contexts now, , entity needs createdate/lastmodified properties inherits trackingbase entity. has worked far. until today. ultimately fixed problem changing way add new entity collection, don't understand why original isn't working... , i'd understand figure going come bite me again , again until understand it. originally adding new status record orderitem creating new status object , adding collection of statusitems of order object, so. var newlypaidorders = shopdb.shoporders .where(o => o.status == "new" && o.payment >= o.cost) .tolist(); (int = 0; i< newlypaidorders.count; i++) { var paidorder = newlypaidorders.elementat(i); foreach ( var paiditem in paidorder.orderitems ) { shoporderi

.htaccess - htaccess search and replace plus sign with dash -

i have form 2 parameters city,keyword passed search.php ,after submitting redirects url website.com/search/lenovo+laptop+dealers/delhi but need url parsed without plus signs dash in url example: website.com/search/lenovo-laptop-dealers/delhi code in htaccess file rewriteengine on rewritebase / rewritecond %{the_request} \s/+search\.php\?keyword=([^&]+)&city=([^\s&]+) [nc] rewriterule ^ /search/%1/%2? [r=301,l,ne] rewriterule ^search/([\w-]+)/([\w-]+)/?$ /search.php?keyword=$1&city=$2 [l,qsa] you can have rules this: rewriteengine on rewritebase / rewriterule "^(search)/([^+]*)\++([^+]*\+.*)$" /$1/$2-$3 [l,nc] rewriterule "^(search)/([^+]*)\+([^+]*)$" /$1/$2-$3 [l,r=301,ne,nc] rewritecond %{the_request} \s/+search\.php\?keyword=([^&]+)&city=([^\s&]+) [nc] rewriterule ^ /search/%1/%2? [r=301,l,ne] rewriterule ^search/([\w-]+)/([\w-]+)/?$ /search.php?keyword=$1&city=$2 [l,qsa]

Inside celery Task Class run method get task_id -

i trying run following code: class mytask(task): def run(): print mytask.request.id but code giving none request_id. please explain me why not able read id in side celery task class you trying access request object on class not object instance. try this: class mytask(task): def run(self, *args, **kwargs): print self.request.id you can use @task decorator: app = celery('tasks', broker='amqp://guest@localhost//') @app.task(bind=true) def mytask(self): print self.request.id

RegEx Find/Replace in Dreamweaver - Paste HTML as variable? -

i have convert spreadsheet data (name, image name, & bio) html, use regex find/replace variables in dw easy enough. issue 1 column contains bio html (paragraphs , italics mainly) , regex ignores "row" reasons beyond researching capabilities. i don't want strip manually add html again, show me way! tl;dr: there way paste html regex variable? here's example table data paste/format excel dw: <tr> <td>james brian hellwig</td> <td>james_brian_hellwig</td> <td><p>lorem ipsum dolor sit amet, <em>consectetur adipisicing</em> elit. sunt, ut iste tempore laborum aperiam nostrum obcaecati neque natus adipisci fugit. </p> <p>dolores, eligendi animi ea totam nobis cumque ullam eveniet accusamus!</p></td> </tr> <tr> <td>jiminy cricket</td> <td>jiminy_cricket</td> <td><p>lorem ipsum dolor sit amet, <em>consectetur adipis

c# - Override a method in the third party -

i have third party party class log . contains methods public void write(string s, params object[] args) { monitor.enter(this); try { string logentry = string.format(s, args); this.write(logentry); } { monitor.exit(this); } } and public void write(string logentry) { this.write(0, logentry); } i defined property outlog in own class public static log outlog {get;set;} i want use feature "callermembernameattribute" etc. in .net 4.5 , override write method like: public void write(string s, [callermembername] string membername = "", [callerfilepath] string sourcefilepath = "", [callerlinenumber] int sourcelinenumber = 0) { monitor.enter(this); try { string logentry = string.format(s, membername, sourcefilepath, sourceline

python - Using protocol buffer in Windows -

Image
i trying use google protocol buffer in windows python binding, meet problem during install step. follow instruction, have compile pb myself using vs, have no vs installed on machine, found window binary @ download page. also download full source code package , put protoc-2.5.0-win32.zip\protoc.exe c:\windows\system32 . then go protobuf-2.5.0.zip\python , run python setup.py install install python binding. however error this: and when check directory, file google\protobuf\compiler not exist. what's problem? is possible use without compiling? i suffering same problem. solution explicitly build step before. python setup.py build python setup.py install that worked me.

android.os.Process.killProcess(pid) did restart the processes again -

killprocess method kill processes why processes restart again , suppose not restarting process again. here goes code. activitymanager manager = (activitymanager) getsystemservice(context.activity_service); list<runningappprocessinfo> services = manager.getrunningappprocesses(); (runningappprocessinfo info : services) { int service1name = info.pid; android.os.process.killprocess(service1name); } thanks concern. actually process kill through killprocess restart process because android os assume process has been shutdown due crashing , restart again. find can use higher priority (activity manager) kill process. example can find here : try { log.d("application process", "killing++"); string killcommand = "am force-stop com.nil.android.ssd"; runasroot(new string[]{killcommand},true); } catch (exception e) { e.printstacktrace();

java - Eclipse shows source folders twice when importing Maven project -

on simple application, valid maven pom file compiles expected (e.g., when running mvn install) , works fine intellij idea, eclipse insists on displaying source code twice. assuming top level package of project com.example.app , source code placed in path ending in pro/java/ , structure of project like pro/java/main/com/example/app... pro/java/test/com/example/app... after importing maven project in eclipse , nested src forder created in workspace, below there nested versions of actual source folders, e.g. src/java/main/com/example/app src/java/main/com/com/example/app in addition that, there 2 "valid" source folders in workspace, i.e. src/main/java... src/test/java... excluding 2 folders source path leaves nothing compiled , keeping nested src folder causes sorts of weird problems in compilation within eclipse . any clues? thanks.

magento - Enable/disable cash-on-delivery only for some specific products -

i want disable cash on delivery payment method option specific products. want show cash on delivery method specific products , need hide other payment options. how can this? read this other question did not solve problem. you can use following free extension solve problem http://www.magentocommerce.com/magento-connect/shipping-and-payment-filters.html

java - annotation mapping using hibernate select data from database and display on jsp page but error is below -

severe: servlet.service() servlet [jsp] in context path [/konzern] threw exception [org.hibernate.hql.internal.ast.querysyntaxexception: attendance not mapped [from attendance a.status=:status]] root cause org.hibernate.hql.internal.ast.querysyntaxexception: attendance not mapped @ org.hibernate.hql.internal.ast.util.sessionfactoryhelper.requireclasspersister(sessionfactoryhelper.java:189) it simple problem, forgot map entity 'attendance' use @entity @table(name="table_name",catalog="dbname") on top of entity(pojo class) , add <mapping class="package.attendance"/> in hibernate configuration file. problem solved.

asp.net web api - Cross Domain Web API: Install-Package Microsoft.AspNet.WebApi.Cors Not Working -

as cross domain call web api project not working asp.net web forms client in ie (working in other browsers). guess need install following nugget pakage. install-package microsoft.aspnet.webapi.cors but when try install got following error. install failed. rolling back... install-package : not install package 'microsoft.aspnet.webapi.client 5.1.2'. trying install package project targets '.netframework,version=v4.0', package not contain sembly references compatible framework. more information, contact package author. @ line:1 char:16 + install-package <<<< microsoft.aspnet.webapi.cors -pre -project webapi + categoryinfo : notspecified: (:) [install-package], invalidoperationexception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.powershell.commands.installpackagecommand i trying install in: visual studio 2010 targets .net 4.0. does package not supported in .net 4.0 ? best regards hardeep .net 4.5 min

java - What is the advantages of using Dozer in Spring Hibernate project? -

i want know benefit of using dozer in project. here confuse how use ? , why use ? please me. want map entity classes dto classes , want data flow on gui through dto classes. , when saved data gui db want convert dto class dao class. dozer mapping a java bean java bean field based value propagation , in memory objects. while hibernate mapping pojo (domain objects) relational database . so can see, not apparentely related 1 other, , need use both of them should upon personal choice. as question has been edited: a basic conceptual architecture should map entities (domain objects - you did call dao classes ) through hibernate database. then entities can mapped java beans (which did call dto classes) using dozer .

eclipselink - JPA: Pre-allocate ID block not work fine -

i'm trying manage id generation through annotation @tablegenerator allocationsize default. understand it, avoid updating row every single identifier gets requested, allocation size used. in theory, provider should pre-allocate block of identifiers equal value of allocationsize - 50 in case - , give out identifiers memory requested until block used or transaction comes end. i use eclipselink (el) jboss 7.1. the problem not happen. inserting 3 records in table students, el pre allocates each record block of 50 id, if transaction same. then, each record, there access table. logs see 3 pre allocations , 3 pairs of select/update query id , ids generated 1- 51 -101 , sequence has final value 150. piece of log connection acquired connection pool update sequence set seq_count = seq_count + ? seq_name = ? bind => [50, table_seq] select seq_count sequence seq_name = ? bind => [table_seq] local sequencing preallocation table_seq: objects: 50 , first: 1, last: 50 connection rel

python - Testing pages generated via window.showmodaldialog -

i have website generates page via javascript using window.showmodaldialog. when using selenium ide , firefox forced monkeypatch javascript insert new function return value dialog, convert window.showmodaldialog window.open, driver.execute_script("function setretval(mval) { window.myreturnval = mval; }") driver.execute_script("window.showmodaldialog = function( surl,varguments, sfeatures) { if(window.myreturnval!=null) { var winarg = window.myreturnval; window.myreturnval = null; return winarg; } modalwin = window.open(surl, varguments, sfeatures); return false; }") and modify onbeforeupload send result back. driver.execute_script("window.onbeforeunload = function() { window.opener.setretval(window.returnvalue); } ") i'm trying convert python + selenium webdriver testing purposes. i'd away injecting new javascript during testing. problem driver.find_element_by_id("maincontent_buttonaccountlookup").click() triggers code

css - AngularJS Twitter bootstrap 3 Navtab class removed -

i wanted add styling bootstrap tabs dynamically via angularjs (computed values) found class reference angular scope 'class="{{iscomplete1}}"' removed. these computed values display expected when not part of class what right way add class nav-tab dynamically? <ul class="nav nav-tabs"> <li class="{{iscomplete1()}}"><a href="#welcome" data-toggle="tab">welcome</a></li> <li class="{{iscomplete2()}}"><a href="#step1" data-toggle="tab">step 1</a></li> thanks my first thought bootstrap issue simple angularjs issue all needed use ng-class directive i.e. ng-class="iscomplete1()".

android - crash on Splash to Menu -

when splash screen moveed menu, program crashed. logcat details while crash follows : 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.instrumentation.checkstartactivityresult(instrumentation.java:1508) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.instrumentation.execstartactivity(instrumentation.java:1384) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.activity.startactivityforresult(activity.java:3190) 04-24 11:40:17.082: e/androidruntime(3180): @ android.app.activity.startactivity(activity.java:3297) 04-24 11:40:17.082: e/androidruntime(3180): @ com.pearson.lagp.v3.startactivity$1.run(startactivity.java:68) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.handler.handlecallback(handler.java:605) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.handler.dispatchmessage(handler.java:92) 04-24 11:40:17.082: e/androidruntime(3180): @ android.os.looper.loop(looper.java:137) 04-24 11:40:17.082: e/android

svg - Use .tofront() with raphael -

it seems can't use .tofront() (no capital f) option in map using raphael js the fiddle links working example, it's javascript code , bit of css3 animate path http://jsfiddle.net/6cvxf/20/ i each path goes front when click it, unfortunately piece of code doesn't work $('path').click(function() { (this).tofront(); }); there's way better retrieve element use in click function? thanks jquery can't access svg elements directly can use library: keith-wood.name/svg.html mentioned here: how use jquery in svg (scalable vector graphics)? or can simple use following built in rapahel click function achieve result seeking: var r = raphael("canvas",500,500); var rectangle = r.rect(10, 10, 100, 100).attr({fill:'red'}).click(function(){ //click function statements this.tofront(); });

ruby on rails - RSpec changing model attribute name -

not value, name of attribute. yes, real. don't know hell going on. the migration: class createfolders < activerecord::migration def change create_table :folders |t| t.string :name, null: false t.timestamps end change_table :bookmarks |t| t.belongs_to :folder end end end the schema: activerecord::schema.define(version: 20140424065045) # these extensions must enabled in order support database enable_extension "plpgsql" create_table "bookmarks", force: true |t| t.string "name", null: false t.string "url", null: false t.datetime "created_at" t.datetime "updated_at" t.integer "folder_id" end create_table "folders", force: true |t| t.string "name", null: false t.datetime "created_at" t.datetime "updated_at" end end what shows inside of rails c : [3]

Draw Circle with Dash Dot in my Qt Project -

to draw circle dash dot should include , code should use ? try codes in project not work: qpainter painter(this); painter.setbackgroundcolor(qt::cyan); painter.setbrush(qt::yellow); painter.drawellipse(0,0,500,500); i see normal project work not circle or area. please , write code ? in main.cpp or myproject.cpp ? lot. you should write code example in paint event of qgraphicsitem or in paintevent of qwidget. can use qt::dashdotline pen: void myitem::paint(qpainter *painter, const qstyleoptiongraphicsitem *option, qwidget *widget) { painter->setrenderhint(qpainter::antialiasing,true); painter->setwindow( -500,-500,1000,1000); painter->setviewport( -500,-500,1000,1000); painter->setpen(qpen(qt::black, 20, qt::dashdotline)); painter->setbrush(qt::yellow); painter->drawellipse(-450, -450, 900, 900); }

jquery - Which is the more efficient way for SELECT onchange? -

in jquery, have 2 ways select onchage: 1. use .change specifying name html: <select name="a"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> jquery: $('select[name=a]').change(function(){ alert($(this).val()); }); 2. use .change specifying id html: <select id="a"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> jquery: $('#a').change(function(){ alert($(this).val()); }); so, given smaller or larger list of elements, 1 faster/more efficient when using jquery? what best practice? first of there lots of other ways select element (including select element) in jquery. selecting elements id better supposed unique , gives results

windows phone 8 - Modify user-agent WP8 -

in windows phone 8 app, call external apis developed client may in php. told user agent showing nativehost . want windows phone better track windows phone requests. try setting the httpwebrequest.useragent property .

r - How to sort all dataframes in a list of dataframes on the same column? -

i have list of dataframes dataframes_list . example, put dput(dataframes_list) @ bottom. want sort dataframes in list on column enrichment . can sort 1 dataframe first_dataframe <- dataframes_list[[1]] sorted_dataframe <- first_dataframe[order(first_dataframe$enrichment),] how can every dataframe in dataframes_list ? example dataframes_list : list(structure(list(rank = c(1, 2, 3, 4, 5, 6), cmap.name = c("meclocycline", "pimozide", "isocorydine", "alvespimycin", "15-delta prostaglandin j2", "naloxone"), mean = c(-0.471, 0.504, -0.49, 0.193, 0.296, -0.383 ), n = c(4, 4, 4, 12, 15, 6), enrichment = c(-0.869, 0.855, -0.859, 0.539, 0.476, -0.694), p = c("0.00058", "0.00058", "0.00068", "0.00072", "0.00122", "0.00199"), specificity = c("0", "0.0302", "0", "0.069", "0.2961", "0.0155"), perce

javascript - why jscript does not work in Chrome browser on iOS 7? -

please explain me why simple script not work in chrome browser on ios 7. works in safari, android devices, desktop browser not in ios chrome... browser says nothing... not error, no message. why? <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> alert("11"); </script> </head> <body> </body> </html> try wrap 11 in quotes: alert("11");

unix - Find file names using find command and regex, functioning improperly -

we have samba server backing s3 bucket. come find out large number of file names contain inappropriate characters , aws cli won't allow transfer of files. using "worst offender" build quick regex check, tested in rubular against file name try , generate list of files need fixed: ([中文网é¡ÂµÃ¦Ë†‘们çš„Ã¥›¢Ã©˜Å¸Ã¥­™Ã©¹Ã¢€“¦]+) the command i'm running is: find . -regextype awk -regex ".*/([中文网é¡ÂµÃ¦Ë†‘们çš„Ã¥›¢Ã©˜Å¸Ã¥­™Ã©¹Ã¢€“¦]+)" this brings small list of files contain above string, in order, not individual characters contained throughout name. leads me believe either regextype incorrect or wrong formatting of list of characters. i've tried types emacs , egrep seem similar regex i've used outside of unix environment no luck. my test file name is: this-is-my€™s'-test-_ folder-name. which, according rubular tests, should returned isn't. appreciated. your regex .*/([中文网é¡ÂµÃ¦Ë†‘们çš„Ã¥›¢Ã©˜Å¸Ã¥­™Ã©¹Ã¢€“¦]+) expects 1 of special ch

Show Stack content (not stack call) at visual studio 2013 -

how can view stack content (not stack call) @ visual studio 2013? view esp pointing , below. show content @ char. thanks help. you can going debug > windows > registers, location of esp, , enter address in debug > windows > memory window. however, give raw memory. as owenwengerd points out in comments, can type esp in address field if you're debugging native code. reason, doesn't work managed code though.

debugging - Powershell don't pass Verbosity level to called functions -

consider following script: function a{ [cmdletbinding()] param() write-verbose "a verbose" write-host "a normal" } function b{ [cmdletbinding()] param() write-verbose "b verbose" write-host "b normal" } b -verbose if invoke function 'b' verbose parameter switch specified, function 'a' (that called in 'b') called implicit verbose parameter. there way avoid this? (in other words, call 'b' verbose switch , 'a' without it). if want suppress verbose output a outside function b , can use $psdefaultparametervalues variable, starting powershell v3. function a{ [cmdletbinding()] param() write-verbose "a verbose" write-host "a normal" } function b{ [cmdletbinding()] param() write-verbose "b verbose" write-host "b normal" } $psdefaultparametervalues['a:verbose'] = $false

Having trouble with SQL Server connection on WebSphere 8.5 -

i'm having kinds of trouble getting ibm websphere 8.5 connect sql server 2012 data source. have url of jdbc:sqlserver://localhost;username=user;password=password . see following error (i know it's kind of long): the test connection operation failed data source reachingrecovery on server server1 @ node mweiss7x16node01 following exception: java.sql.sqlexception: tcp/ip connection host localhost, port 1433 has failed. error: "connection refused: connect. verify connection properties. make sure instance of sql server running on host , accepting tcp/ip connections @ port. make sure tcp connections port not blocked firewall." now, sql server , websphere running on same machine, don't think it's firewall issue. i've checked sql server properties under "connections", , indicates fine ("allow remote connections server" checked.) i'm @ loss understand why happening. suggestions? thx mimi i found out

mapkit - Mapbox polygons not displayed in ios 7 app -

i have designed required map on https://www.mapbox.com/editor/ several polygons, when load same map using id on ios 7 test app map displayed ok polygons not visible/added in ios app. here code using sample code given on mapbox site... rmmapboxsource *tilesource = [[rmmapboxsource alloc] initwithmapid:@"id_of_mapbox_map"]; rmmapview *mapview = [[rmmapview alloc] initwithframe:self.view.bounds andtilesource:tilesource]; [self.view addsubview:mapview]; have tried many different changes @ point trying figure out if supported. the api want -[rmmapboxsource initwithtilejson:enablingdataonmapview:] . however, points automatically supported right now. relevant code here if interested in submitting patch, however.

python - Any alternate to slice sling of integers? -

i attempting make recursive function adds 2 last numbers until there none left. example: sumdigits(239) would equate to: 2+3+9=14 it difficult because input must integer, cannot sliced without converting it. decided try turn lists because thought pop() method useful this. appears though approach not working. suggestions? execution: >>> sumdigits('234') 9 >>> sumdigits('2343436432424') 8 >>> code: def sumdigits(n): l1 = list(str(n)) if len(l1) > 1: = int(l1.pop()) b = int(l1.pop()) l1.append(str(a+b)) return sumdigits(int(''.join(l1))) else: return n with functional tools reduce() problem solved by from functools import reduce def sumdigits(n): return reduce((lambda x, y: int(x) + int(y)), list(str(n)))

twitter bootstrap - Panel Heading not displaying correctly -

Image
i new-ish twitter bootstrap, , trying have panel, within panel. the first outer panel fine, inner 1 - header seems cut off edges. here's screenshot of what's happening: and here's code attempted use: <div class="panel panel-default"> <div class="panel-heading"> <h4>@string.format("{0} {1} - {2}", model.institution, model.description, model.accounttype)</h4> </div> <div class="panel-body"> <br /> <div class="col-md-4 panel panel-default"> <div class="panel-heading"> <h3>account details</h3> </div> <div class="panel-body"> <div class="row"> <div class=""> <small> @html.labelfor(x => x.institution)</sma

HTTPPOST with JSON Object having array -

below json object need pass on server: { "postimages": [{ "fileformat": "jpeg", "id": "0", "filebytearray": "long byte array of file", "filecaption": "", "videolink": "" },{ "fileformat": "jpeg", "id": "0", "filebytearray": "long byte array of file", "filecaption": "", "videolink": "" }], "adminscheduleid": "0", "categoryid": "1", "userid": "4", "presenter2": "0", "ideatitle": "gfgfdgdfgdfg", "isimplementedbyown": "false", "noofvolunteer": "0", "postid": "0", "clubid": "2"

php - Which is the best - Using built in functions or writing my own? -

which 1 faster , good? writing own functions or using in built function in php eg. converting 2d array 1d array. have use array_merge($array1) or writing own function using foreach(){ } in general, predefined php functions faster. written in c, therefore faster, no matter how write own php functions. if write them yourself, have more control , power on outcome. have decide whats necessary in case.

java - OpenShift: Not able to deploy war generated by Jenkins in Openshift to container (Tomcat) in another gear -

first of all, let me inform issue related openshift. i'm tired of building war jenkins , manually transferring newly built war file server - it's time consuming. i'm trying deploy maven application built jenkins in 1 gear , deploy in tomcat 7 server running in gear. i'm using deploy container plugin via jenkins push war file tomcat server after being built jenkins. in tomcat server, edited tomcat-users.xml. <role rolename="manager"/> <role rolename="admin"/> <user username="admin" password="admin" roles="manager"/> i tried deploy jboss 7 available. not deploy either - decided switch tomcat hope deployment in tomcat easier in jboss. here how can jenkins/execute shell: (this example java/maven can use other stack.) source $openshift_cartridge_sdk_bash ## aliasing rsynch alias rsync="rsync --delete-after -az -e '$git_ssh'" ## openshift_namespace => redrumapi ##

Ascii unicode string codes to utf8 in javascript -

i have string containing unicodes , i'd transform them utf8. how implement -> input: var data = "\u03b1" // coming python remote callback data var html = "letter a: " + data document.getelementbyid('input').innerhtml = html output on div#input is: letter a: \u03b1 but should be: letter a: α i suspect because "\u03b1" not written on javascript code, passed via text variable python, javascript engine doesn't transform characters correct form, keeps them strings. i found answer from: converting unicode character string format function unicodetochar(text) { return text.replace(/\\u[\da-fa-f]{4}/g, function (match) { return string.fromcharcode(parseint(match.replace(/\\u/g, ''), 16)); }); } applying in case: var html = "letter a: " + unicodetochar(data)

rotation - iOS take "homebutton + powerbutton" screenshot from rotated view is upside down -

when user makes screenshot press of homebutton , powerbutton screenshot upside down. device never autorotate. observe uideviceorientationdidchangenotification , if in landscape, show rotated view. depending on left or right device orientation this happens when show view rotated code cgaffinetransform rotationtransform = cgaffinetransformidentity; rotationtransform = cgaffinetransformrotate(rotationtransform, degrees_to_radians(90)); landscape.transform = rotationtransform; here rotation methods of viewcontroller - (bool)shouldautorotate { return no; } - (bool)shouldautorotatetointerfaceorientation:(uiinterfaceorientation)tointerfaceorientation { return no; } - (nsuinteger)supportedinterfaceorientations { return uiinterfaceorientationmaskportrait; } i disable autorotate , force rotation: - (void)forceorientationchange { uideviceorientation deviceorientation = [uidevice currentdevice].orientation; cgaffinetransform rotationtransform = cgaffinetransf

Check if user has webcam or not using JavaScript only? -

is possible figure out whether user has webcam or not using javascript? don't want use plugin this. you can use new html5 api check if give permission use webcam. after all, if deny permission, might not have webcam, code's perspective. see navigator.getusermedia() . edit: navigator.getmedia = ( navigator.getusermedia || // use proper vendor prefix navigator.webkitgetusermedia || navigator.mozgetusermedia || navigator.msgetusermedia); navigator.getmedia({video: true}, function() { // webcam available }, function() { // webcam not available });

linux - Am i hacked? unknown processes dsfref, gfhddsfew, dsfref etc are starting automatically in centos 6.5 -

Image
im using centos 6.5, realised computer uploading something(i didn't ask for), @ upload speed 11mbps, scary part internet upload speed 800kbps, every day shows 200gb uploaded , on.. can see unknown processes starting in image 1 attached.. gfhddsfew, sdmfdsfhjfe, gfhjrtfyhuf, dsfrefr, ferwfrre, rewgtf3er4t , sfewfesfs, sdmfdsfhjfe, i tried kill processes manually kill command , deleted files /etc/ folder, still, if connect internet these files placed in /etc/ automatically, don't see issue in windows(my pc dual boot). note: used chattr -i change permissions , deleted file sfewfesfs , when tried delete file without using chattr, says permissions cant changed/file cant deleted . , 1 more thing, when used command #rm /etc/sfewfesfs without chattr , computer restarted, happened time tried delete file without chattr. , these executables show in running processes when internt connected. note: im using beam cable internet(beamtele.com ,hyderabad, india) here images sho

php - How can I shorten URL extentions to make them more friendly -

we have links showing this, turkish-property-world.com/turkey_villas.php?bid=4&page=1 would show, turkish-property-world.com/turkey_villas in .htaccess include rule nothing changes. rewriteengine on rewritecond %{http_host} !^www.example.com$ [nc] rewriterule ^(.*)$ http://www.example.com/$1 [l,r=301] any help? you can use following; rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^([^/]+)/([^/]+)/([^/]+)$ $1.php?bid=$2&page=$3 [l] by doing this, turkish-property-world.com/turkey_villas.php?bid=4&page=1 will be turkish-property-world.com/turkey_villas/4/1 you need kep other parameters too update: above rule work not turkey_villas , work other *.php names

eclipse - Error while running coredova app -

i getting "no targets build against" while running coredova sample application on android emulator. android applications running fine. please let me know set target coredova app. using jboss hybrid mobile(cordova) plugin in eclipse. os windows 32-bit have posted snap here http://i61.tinypic.com/301q3hu.png in advance, regards, chandan kumar

objective c - Audio playing while app in background iOS -

i have app based around core bluetooth. when specific happens, app woken using core bluetooth background modes , fires off alarm, can't alarm working when app not in foreground. i have alarm singleton class initialises avaudioplayer this: nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:soundname oftype:@"caf"]]; self.player = [[avaudioplayer alloc] initwithcontentsofurl:url error:nil]; [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:nil]; [[avaudiosession sharedinstance] setactive: yes error: nil]; [self.player preparetoplay]; self.player.numberofloops = -1; [self.player setvolume:1.0]; nslog(@"%@", self.player); this method called when alarm code called: -(void)startalert { nslog(@"%s", __function__); playing = yes; [self.player play]; nslog(@"%i", self.player.playing); if (vibrate) { [sel

sql server - Increment Row Number on Group for regular withdrawal amounts -

i need create sql server query groups "common" sequential data , assigns unique id group. in example below have withdrawals made policy on regular basis. create table #temp2 (policy_id int, wdl_date int, amount decimal(9,2)); insert #temp2 values(1001, 19881028, 190.00); insert #temp2 values(1001, 19881129, 190.00); insert #temp2 values(1001, 19881229, 494.89); insert #temp2 values(1001, 19890130, 494.89); insert #temp2 values(1001, 19890227, 494.89); insert #temp2 values(1001, 19890330, 494.89); insert #temp2 values(1001, 19890530, 525.00); insert #temp2 values(1001, 19890629, 525.00); insert #temp2 values(1001, 19890728, 525.00); insert #temp2 values(1001, 19890830, 525.00); insert #temp2 values(1001, 19930723, 51.00); insert #temp2 values(1001, 19931213, 190.00); insert #temp2 values(1001, 19940311, 190.00); insert #temp2 values(1001, 19940613, 190.00); insert #temp2 values(1002, 19881028, 50.00); insert #temp2 values(1002, 19881129, 50.00); insert #temp2 values(1