Posts

Showing posts from March, 2013

breeze - Include server side properties not mapped to entity framework entity -

we adding additional properties our objects on server not track in database. data gets returned client object materialized breeze not have property. how can add properties our objects return breeze not map them database store data? example: widget class property - mapped database property b - has [notmapped] attribute not stored in database. calculated on fly server. when object on client get: widget class = { property a: ko.observable(value a) } property b missing. when @ json returned server see: widget class = { property a: value a, property b: value b } properties notmapped attributes not part of metadata generated efcontextprovider, properties won't available in client side breeze entity. in js can extend client side entity , add property entitytype yourself. make sure value property correctly set when json object retrieved server. http://www.breezejs.com/documentation/extending-entities

Can't access squid proxy from remote machine -

i have set squid proxy on ubuntu machine, , i'd testing accessing proxy computer (not on same lan). seem unable connect squid proxy server. i've tried several different ways connect: setting proxy in web browser, , using unix program "curl" issue http requests command line. can't connect. i've tried setting acl in configuration file squid.conf allow access remote machine. don't know what's going on. if try access internet same machine squid proxy on, works correctly. the lines in squid.conf added allow access remote machine are: acl my_machine src 50.193.61.125/255.255.255.0 http_access allow my_machine is there else needs done allow remote machine access squid proxy? thanks. got same problem. ec2 instance fedora 19 os , squid 3.2.9. created security group incoming rule port 3128. wont work if connect remote pc. think there restriction in aws-cloud.

ios - Crashlytics is not sending Crash report from iPhone -

i've setup crashlytics in 1 ios application , installed application on real device. crashlytics dashboard displaying that, i've added app. however, it's not sending crash report. internet speed not good. can check emails device. can guess, problem? xcode debugger not allow crashlytics process crash reports. yeah, seem weird me when read first time fact ( source ). that's reason never see crash report when: - running app in simulator - running app on idevice directly build , run xcode debugger on. to make sure crash reported during testing ( copied crashlytics support site ): 1. launch simulator 2. press stop 3. launch app , force crash 4. relaunch app simulator 5. see crash report in web dashboard. edit: added reference; crashlytics provides short article on a quick way force crash , article on why don't see data first crash .

Objective C - NSNumber storing and retrieving longLongValue always prefixes with 0xFFFFFFFF -

i trying store file size in bytes nsnumber. reading file download size nsurlresponse , gives me long long value , create nsnumber object value , store it. when go retrieve value later, comes higher bytes set ffffffff. for example, read in size 2196772870 bytes (0x82f01806) , store nsnumber. when back, -2098194426 bytes (0xffffffff82f01806). tried doing binary , 0x00000000ffffffff before storing value in nsnumber still comes negative. code below: long long bytestotal = response.expectedcontentlength; nslog(@"bytestotal = %llx",bytestotal); [downloadinfo setfiletotalsize:[nsnumber numberwithint:bytestotal]]; //[downloadinfo setfiletotalsize:[nsnumber numberwithlonglong:bytestotal]]; long long filetotalsize = [[downloadinfo filetotalsize] longlongvalue]; nslog(@"filetotalsize = %llx",filetotalsize); output: bytestotal = 82f01806 filetotalsize = ffffffff82f01806 any suggestions? edit: forgot setter downloadinfo object. the problem

jquery - Show/Hide div using classes and masonry -

i looked @ existing question , didn't find fixed problem. im using masonry display content accordingly filters. im using js hide , show entire classes , reload masonry of container: $(document).ready(function(){ $('#allvfx').click(function(){ $('.itemfilm').hide(); $('.item').show(); $('#container').masonry(); }); $('#allfilms').click(function(){ $('.item').hide(); $('.itemfilm').show(); $('#container').masonry(); }); }); the problem when clicking on first filter "allvfx" works, using second filter "allfills" makes freeze. any ideas? thanks

python - Converting Index into MultiIndex (hierarchical index) in Pandas -

in data working index compound - i.e. has both item name , timestamp, e.g. name@domain.com|2013-05-07 05:52:51 +0200 . i want hierarchical indexing, same e-mails grouped together, need convert dataframe index multiindex (e.g. entry above - (name@domain.com, 2013-05-07 05:52:51 +0200) ). what convenient method so? once have dataframe import pandas pd df = pd.read_csv("input.csv", index_col=0) # or source and function mapping each index tuple (below, example question) def process_index(k): return tuple(k.split("|")) we can create hierarchical index in following way: df.index = pd.multiindex.from_tuples([process_index(k) k,v in df.iterrows()]) an alternative approach create 2 columns set them index (the original index dropped): df['e-mail'] = [x.split("|")[0] x in df.index] df['date'] = [x.split("|")[1] x in df.index] df = df.set_index(['e-mail', 'date']) or shorter df['e-m

Delphi Indy login and download a file -

problem cant download file (cause im not logged). can login, nothing more. delphi version: xe2, indy version: 10.5.8.0 (also tested on delphi xe4 newest indy). there 1 cookie 1970r date. help. code: (login , password real) var idhttp: tidhttp; request: tstringlist; response: tmemorystream; file: tmemorystream; begin try response := tmemorystream.create; try request := tstringlist.create; try request.add('user[login]=1212test1212'); request.add('user[password]=test1212'); idhttp := tidhttp.create; file := tmemorystream.create; try idhttp.allowcookies := true; idhttp.cookiemanager:=form1.idcookiemanager1; idhttp.handleredirects := true; idhttp.request.contenttype := 'application/x-www-form-urlencoded'; idhttp.post('http://www.twitch.tv/login', request, response); idhttp.get('http://www.twitch.tv/broadcast/fmle3_confi

javascript - Google Maps API + Wax.g + IE = Tiny Tiles -

i'm using wax.g display custom tiles on google map. works fine in every browser i've tested, except ie. in other browsers, tiles rendered correctly, in ie, tiles rendering smaller version of true selves. issue best explained in following screenshots: what should like: http://cl.ly/image/2e0u2b0c0f0w what in ie: http://cl.ly/image/2f3b353q0g0c this issue doesn't happen time, , if pan or zoom, correctly sized tiles, , don't. not sure if wax issue or issue how google maps api renders custom overlaymaptypes . has else experienced issue? insight appreciated... (cross-posted mapbox github issue - no answers there yet) so problem images inheriting style height , width of auto, , wax.g's gettile method method creates image using new image(256, 256) , writes height , width attributes of img ( img attributes, not inline style). inline styles took priority on attributes, img being sized using auto . fixed ensuring img had height , width of 256 using

spring - ClassNotFoundException: org.hibernate.hql.ast.HqlToken when ever I am trying to execute HQL -

the following exception occurring when try execute hql in code. checked in various sites , found antlr.2.7.6.jar shd in class path. checked in project , found there in maven dependencies. there should not such issue. still getting issue. can me in regard. getting error in line "emplist = gethibernatetemplate().find("from employee");" in following function. public list<employeeto> getallemp() { list<employee> emplist = new arraylist<employee>(); list<employeeto> emplistto = new arraylist<employeeto>(); emplist = gethibernatetemplate().find("from employee"); try { beanutils.copyproperties(emplistto, emplist); } catch (illegalaccessexception e) { e.printstacktrace(); } catch (invocationtargetexception e) { e.printstacktrace(); } return emplistto; } exception stacktrace: root cause of servletexception. org.springframework.orm.hibernate3.hibernatequeryexception: classnotfoundexception: org.hiber

ubuntu - Graphviz Subscript -

i trying graphviz , working , desperately need subscripts in node labels. unfortunately, looking through endless posts people on similar problems seems fit proposed solutions , yet still not working. heres have code: digraph g{ execute [label=<ex<sub>2</sub>>]; main -> parse -> execute; main -> init; main -> cleanup; init -> make_string; main -> printf; } also run this: $ dot -tps:cairo -v test.gv -o out.ps and output: > dot - graphviz version 2.26.3 (20100126.1600) activated plugin library: libgvplugin_pango.so.6 using textlayout: textlayout:cairo activated plugin library: libgvplugin_dot_layout.so.6 using layout: dot:dot_layout using render: cairo:cairo using device: ps:cairo:cairo plugin configuration file: /usr/lib/graphviz/config6 loaded. render : cairo dot fig gd map ps svg tk vml vrml xdot layout : circo dot fdp neato nop nop1 nop2 osage patchwork sfdp twopi textlayout : textlayout device

java - Which strategy to use? Object Clone or a simple Map -

i need something. code of following template. assume customobject has multiple property1, property2, ..property100. list<customobject> customobjectlist = /*<method call external api returns said list >*/ if(customobjectlist != null && customobjectlist.size() > 0){ //*** point ***<clone object> resultlist = <some method process above list>(customobjectlist) if(resultlist.size() > 0){ for(iterator<map.entry<customobject, externalresponse>> itr = resultlist.entryset().iterator(); itr.hasnext();) { //code modifies properties in customobjects //*** point b ***resetaproperty(<object clone>) } } } at point b, need 1 unmodified specific property of original object use in method. have 2 strategies this: clone object @ point a, , use cloned copy property shown in above code. @ point a, use loop , a map form associate array of object names, property original values , traver

c# - Uncomment code programmatically -

how can comment out comment programmatically? think of this:- void releasea() { //todo: } //string = "test"; releasea(); textbox1.text = a; how can achieve , implement method releasea comment out //string = "test"; searched still can't find anything. i think want this: string = ""; if (condition) = "test"; textbox1.text = a; so example of checkbox , text box: string text = ""; if (checkbox.checked) text = inputtextbox.text; resulttextbox.text = text;

initrd - initramfs - need to edit text file -

i'm stuck in initramfs on linux mint v15 , need edit /bin/grub/grub/cfg. have sda1 device mounted not sure edit. try exec ./usr/bin/vi , throws kernel panic. ok, once took deep breath , thought problem, booted off install cd, went recovery mode , fixed problem. good. just remember, first tool in fixing problem taking deep breath , relaxing :-)

excel - Method range of object _global failed -

i want use value in c2 populate rest of column c same value way bottom of data in sheet. sub testfill1() ' ' testfill1 macro ' ' sheets(1).select lngendrow = lastcellblock range("c2:c" & lngendrow).formular1c1 = "1" end sub i want use value in c2 populate rest of column c same value way bottom of data in sheet. this should want: sub filldown() range("c2", "c" & rows.count).filldown end sub if doesnt work or doesnt answer question let me know

java - Unable to cache images served by Spring MVC -

i trying serve assets using spring mvc controller. assets database managed , have served way. service looks metadata of asset database, reads file file system , builds response. here how controller looks like. @controller @requestmapping("/assets") public class assetcontroller { @autowired private assetservice assetservice; @requestmapping("/{assetname:.+}") public responseentity<byte[]> getasset(@pathvariable("assetname") string assetname) throws filenotfoundexception, ioexception { asset asset = assetservice.findbyname(assetname); httpheaders headers = new httpheaders(); headers.setcontenttype(mediatype.valueof(asset.getcontenttype())); headers.setcachecontrol("max-age=1209600"); headers.setlastmodified(asset.getmodifiedon().gettime()); // in past return new responseentity<byte[]>(assetservice.tobytes(asset), headers, ok); } } seems simple , straightfo

BlackBerry Simulator freezes when navigating through browser -

the blackberry device simulator v6.0.0.706 (9800) freezes every time attempt load page in browser. i'm able load browser , go www.google.com, loading other page freezes entire simulator. simulator, have close window , relaunch.. stopping page load or pressing of other buttons in window not work. this have tried: tried loading other web pages see if problem persists. tried installing c:\blackberry instead of default directory in case spaces issue. updated allow full access users , windows user account. tried running administrator. no error messages display, simulator freezes , stays stuck on same page until relaunch simulator. running on windows 7. help.

mongodb - Rails, Mongoid, query: Not returns documents -

i have problem, have been trying show view in haml, throws me this: started "/tipocontenidos/index" 127.0.0.1 @ 2013-07-23 17:22:36 -0500 processing tipocontenidoscontroller#index html moped: 127.0.0.1:27017 command database=admin command={:ismaster=>1} (30.4270ms) moped: 127.0.0.1:27017 query database=cms_monrails_development_crud_bd collection=ctipocontenido selector={} flags=[:slave_ok] limit=0 skip=0 batch_size=nil fields=nil (82.3016ms) rendered tipocontenidos/index.html.haml within layouts/application (126.7ms) completed 500 internal server error in 187ms actionview::template::error (undefined method `tipocontenido_path' #<#<class:0x000000026ee6f8>:0x000000027c4528>): 8: 9: - @tipocontenidos.each |tipocontenido| 10: %tr 11: %td= link_to 'show', tipocontenido 12: %td= link_to 'edit', edit_tipocontenido_path(tipocontenido) 13: %td= link_to 'destroy', tipoc

android - Java based code that replicates Netstream and netconnection -

is there java api allows use netstream , netconnection functions adobe? i'm working on android app , trying add video chat feature on app. since rest of app coded in java doesn't seem can attach swf file 1 of activities. i'm looking alternative solutions to connect web based flash video chat website app. there juv rtmp tool java api access rtmp servers. support audio/video streaming need provide codec code. it paid product, @ least works fine. never find open source solution this.

javascript - Website find People near me -

how website facebook location service ? want create website can detect location, , friend location. , location (maybe coordinate) , use information major maximum distance " near me category " what need this? http://www.uv.es/~montanan/redes/trabajos/facebook%20friends.pdf i think help. google great thing should try it;)

php - htmlentities() not working properly on web hosting server -

i'm using htmlentities() on user-inputted data , on local server there no problems. however, when run code on web hosting server character encoding seems messed up. example (using string åäö áàâ ); local server [message] => &aring;&auml;&ouml; &aacute;&agrave;&acirc; output = åäö áàâ however result on web hosting server is web hosting server [message] => &atilde;&yen;&atilde;&curren;&atilde;&para; &atilde;&iexcl;&atilde;&nbsp;&atilde;&cent; output = åäö áà â the "charset problem" occurs when applying htmlentities() string. how fix it? i fixed , cause of problem; according php.net , php versions prior 5.4.0 has 'iso-8859-1' default encoding. had change 'utf-8' in; htmlentities($string, ent_compat | ent_html401, 'utf-8'); (this first thing tried though, wrote 'utf-8' in lower case didn't work!!)

html - unable to get checked property of htmlinoutcheckbox on server side(code behind) -

i have created html input check-boxes dynamically code behind , after rendering check-boxes on aspx page i'm unable checked property of check-boxes on button click event. week enum alldays of week. here sample code. htmlinputcheckbox chkbx = new htmlinputcheckbox(); chkbx.attributes.add("id", ((week)i).tostring()); chkbx.attributes.add("runat", "server"); chkbx.attributes.add("name", ((week)i).tostring()); chkbx.attributes.add("value", "checked"); htmlgenericcontrol label = new htmlgenericcontrol("label"); label.attributes.add("for", ((week)i).tostring()); if (i == 1 || == 7) { label.attributes.add("class", "dow disabled"); label.attributes.add("disabled", "true"); } else { label.attributes.add("class", "dow"); chkbx.checked = true; } label.innertext = ((week)i).tostring().substring(0,2); _dowcontrol.c

html5 - Any way to mask an SVG clipping path for CSS? -

i have div element want clip. i'm able use -webkit-clip-path reference svg clippath element , clip element: example html <svg width="0" height="0"> <clippath id="clipping"> <polygon points="0 100, 300 30, 220 290" /> </clippath> </svg> <div id="tiles"></div> example css #tiles { background:red; width:300px; height:300px; -webkit-clip-path: url(#clipping); } see jsfiddle . but how can cut shape out of shape? example, put triangle in red triangle? how can mask clipping path? i've seen resources few years ago saying firefox supports it, need work chrome, haven't tried getting work firefox. i've read chrome supports -webkit-mask-image , , i've seen examples of working (see twitter bird example ). when tried recreate on jsfiddle, realized works on external svg files not inline svg. see jsfiddle . clipping clipping pat

Android app storage path returning null only for .jar classes -

here issue. have 2 separate classes include app. 1 advertising sdk other robospice. both don't have source on .jar files include. when applications try path external storage write temp files getting null. know because of logs dump console. in own source code if use assume same routines such getexternalstorage() returns path , lets me save files fine. seeing don't have source code these classes can't step through debug can rely on write console. now full story. project 1 inherited developer. used maven in project , of dependencies relied on non-public maven sources. went ahead , converted standard eclipse project. old compiled source has robospice temp files stored on testing devices @ /data/data//cache know old source writing device fine in past. ideas on why compiled sources wouldn't able proper storage locations on device? you can include sources of libs use using this technique in eclipse. rs open source , it's source code can locate

php - SELECT query fails silently, no output produced -

first of need tell i'm newbie on php/mysql... i'm trying write simple plugins using php. here php function code : function example() { global $db; $examplesql = $db['db_database']->query("select tid, added table group tid order added desc limit 5"); while ($row = $db['db_database']->fetch_assoc($examplesql)) { $time = date('y-m-d h:i:s',$row['added']); $torid = $row['tid']; } eval("\$exampletemplate = \"" . $db['db_template']->loadtemplate('exampletemplate') . "\";"); return $example; } so when create template named exampletemplate , insert template this; <table width="200" border="1"> <tr> <td>$time</td> <td>$torid;</td> </

javascript - linqjs group by with a sum -

this might seems easy question i'm struggling linqjs syntax. given following basic json: { "dateevent": "2013-04-23 14:00:00z", "daterecord": "2013-04-23 14:00:00z", "amount": -9500, "type": { "description": "capital" }, "currency": { "id": "usd", } } using linqjs how can return total each currency? enumerable.from(data) .groupby("{ currency: $.currency.id }", null, function (key, g) { var result = { currency: key.currency, total: g.sum($.amount) }}); the code above doesn't work. you had it. key selector in groupby , sum incorrect. key selector needs string. try following: var result = enumerable.from(data).groupby("$.currency.id", null, function (key, g) {

android - Integer type not allowed at 'padding' for 5dp -

i have project wrote, when finished it fine code worked no errors. 1 day open eclipse , have 3 errors, 1 each in 3 of of layouts. two cases of: error integer type not allowed @ 'padding' this error code: <tablerow xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="5dp" > # line error on the above same in 2 different layouts , code bellow third: <textview android:id="@+id/finalbilltextview" android:layout_width="match_parent" android:layout_height="wrap_content" #line error on android:layout_span="2" android:layout_weight="1" android:text="@string/total_bill_tv" /> with error of: error parsing xml: duplicate attribute i dont understand how doing wrong. else in code use '5dp' or similar fine. if if delete cod

Writing SQL query for a given combination of letters -

i want write sql query wherein fourth letter should 'x' , there should 'm' anywhere in whole word. having list of on 5000 words. i tried command where name '___x%m%' but give me x fourth letter , there m after x, how find names have x fourth letter , have m coming before x ? you can this: where name '____x%' , name '%m%'

ios - About supporting iPhone 5 when using nib files and backwards compatibility -

i've been looking apple's documentation , posts regarding issue, didn't make clear how should deal this, since of information found storyboards , autolayout feature. i'm using nib files instead of storyboards, , in addition need support ios 5+, can't use autolayout. i'm using xcode 4.6.3 , i've observed that, in ib, going view's attributes inspector > simulated metrics, can choose size ("retina 3.5 full screen", "retina 4 full screen"...). right now, have parameter set "none", should have 1 nib file per each screen size , detect programmatically if current device iphone 5 or phone (similarly supporting ipad in universal app)? if not, how should manage iphone 5 support, given particular conditions? thanks! 1.add "default-568h@2x.png" image,with this,when app launch use iphone5 screen size,if not, when app launch use iphone4s screen size 2.set custom viewcontroller's view autoresizingmask prop

jquery - Fullcalendar (full calendar) Not defaulting to display the current today's date. Month shows february and not today's -

i trying calendar invoke today function or set date current date. when calendar first loads shows calendar month february. there button can click called 'today' switch date today's date. invoke function or set current date today's date. documentation of jquery plugin can found if google adam shaw fullcalendar jquery plugin. http://arshaw.com/fullcalendar/ . can see example set current today's date. my code follows: //loads fullcalender in head use <div id='calendar'></div> display function render_calendar(){ //calendar [1] ?> <script type='text/javascript'> <?php $calendar = "#"; ?> <?php $calendar .= get_option('fc_option_calendar'); ?> jquery(document).ready(function($) { // $() work alias jquery() inside of function $(document).ready(function() { $('<?php echo $calendar ?>').fullcalendar({ header: { left: 'prev, next today, agenda

joomla2.5 - migrating from 1.5 to joomla 2.5 -

im having huge problems migrating 1.5 2.5 bought spupgrade still have no real luck. not sure im doing wrong.. is there fail proof way mirgrate old 1.5 joomla websites 2.5? thanks did try already? http://docs.joomla.org/j2.5:migrating_from_joomla_1.5_to_joomla_2.5 take time, not easy task, set testing environment, backups, check requirements , stuff hate :-) good luck.

android - Bluetooth low energy APIs in java -

i working bluetooth low energy . there apis or open source sdk ble in java ? goal run pc ble peripheral . , have tried , searched apis time , have found this . dont know how implement. edit: have here , think used create characteristic , services . per understanding there no driver required in window8 has inbuilt support . confused library add in run code. as far know there no library yet. best way build jni wrapper around windows 8 c++ library. why not start open source project? as have low level there nice little helper library work gatt profiles: https://github.com/movisens/smartgattlib smartgattlib java library simplifies work bluetooth smart devices (a.k.a bluetooth low energy in bluetooth 4.0). provides uuids of adopted gatt specification , convenient way interpret characteristics (e.g. heart rate, batterylevel). library has no dependencies , can use every bluetooth smart stack.

java - Viewpager but not responding to clicklistener/ -

i have bug kind of know going on not sure hoo solve it. i have viewpager each individual fragment contains 2 more fragment -- front side , side. app flashcard app can swipe next card , when click it turns other side. my problem: have set of radiobuttons available on both sides. if user checks button , clicks on card, card should turn, , newly chosen radio button choice should appear on other side of card well. functionality of buttons on both sides same-- put on both sides user can choose change radiobuttons no matter if he/she on front side or side of flashcard. part radiobuttons change on other side if pick radiobutton works when each card fresh. if scroll off offscreenlimit , swipe back, function not work anymore(the radiobuttons on other side won't automatically change newly selected one) . since offscreenlimit 2, if scroll immediate next card , scroll back, still works. my listener inside of outer fragment final viewanimator viewanimator1 = (viewanimat

ios - How To Set CAGradientLayer to CAShapeLayer Without Frame -

hello working core animation , core graphics.i drawing 1 path not rectangle or circle or ellipse cant give frame path.now want set gradient colour path.but need frame,that cant give.here code path : cgpoint point1 = cgpointmake(120.0f, 50.0f); cgpoint point2 = cgpointmake(240.0f, 150.0f); cgpoint point3 = cgpointmake(360.0f, 50.0f); cgpoint point4 = cgpointmake(480.0f+50/2.0, 100.0f); cgmutablepathref curvedpath = cgpathcreatemutable(); cgpathmovetopoint(curvedpath, null, 50, 50); cgpathaddcurvetopoint(curvedpath, null, point1.x, 50, point1.x, 50, point1.x, point1.y); cgpathaddcurvetopoint(curvedpath, null, point2.x, 50, point2.x, 50, point2.x, point2.y); cgpathaddcurvetopoint(curvedpath, null, point3.x, 50, point3.x, 50, point3.x, point3.y); cgpathaddcurvetopoint(curvedpath, null, point4.x, 50, point4.x, 50, point4.x, point4.y); cgpathclosesubpath(curvedpath); return curvedpath; use cgpathgetpathboundingbox . if gradientlayer sublayer or mask layer of shapelayer , tr

c# - Implement Login using Facebook,Twitter,Linkin in asp.net web application -

i had integrate login using google,twitter,facebook asp.net web forms application , i'm not using mvc. searched around , found open source library task. http://dotnetopenauth.net/ but site doesn't have info on how implement in asp.net web form applications. links on how implement using dotnetopenoauth library appreciated.and no mvc, simple asp.net web forms application if open project 4.5 template provided of code written, have into. see also: http://www.asp.net/aspnet/overview/aspnet-45/oauth-in-the-default-aspnet-45-templates http://blogs.msdn.com/b/webdev/archive/2012/08/15/oauth-openid-support-for-webforms-mvc-and-webpages.aspx

exclude Test.java class from maven build war -

i've tried exclude .java file of src/test/java being packaged in maven build. pom.xml is: plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <inherited>true</inherited> <configuration> <source>1.6</source> <target>1.6</target> </configuration> <executions> <execution> <id>default-testcompile</id> <phase>test-compile</phase> <configuration> < test excludes > <exclude>**/test1.java</exclude> <exclude>**/test2.java</exclude> <exclude>**/test3.java</exclude> <exclude>**/test4.java</exclude>

android - Remove unnessecary Spaces in ListView of Images -

Image
i rendering listview consists of image. wish rid plane grey color. how rid of ? seems, weird , rather easy 1 unable figure out solution. list_view.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#efefef" android:orientation="vertical" > <listview android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:cachecolorhint="#00000000" android:divider="@android:color/black" android:dividerheight="1.0sp" android:textcolor="#000000" /> </relativelayout> image.xml <?xml version="1.0" encoding="utf-8"?> <

asp.net - string with 's not getting inserted with insert statement -

i trying insert question in database field in table nvarchar(max) (sql server 2008 r2) code follows: protected sub btnsave_click(byval sender object, byval e system.eventargs) handles btnsave.click gc.executecommand("insert questionmaster values('" & txtquestion.text & "','" & viewstate("clientid") & "','" & viewstate("kioskid") & "')") response.write("<script type='text/javascript' language='javascript'>alert('question added sucessfully!!!')</script>") bindgrid() end sub when insert string : what's name? then gives me error: incorrect syntax near 's'. unclosed quotation mark after character string ')'. if supply string as: what name? then not gives me error. please me. you escape single quote replacing single quote (') 2 single quotes ('') in txtquesti

ios - Dynamically Define Variables -

arrayname = @"blah"; nsarray (array(arrayname))= [something or other]; after defining variable name called "arrayname", wish name of array it's condition. code defining nsarray possible? p.s. code pseudo code. sounds want use nsmutabledictionary can have variable names keys, , assign them specific values. but asking isnt possible

How to write RewriteRule for login in a Wordpress multisite? -

in wp multisite mysite.com, want login request sent custom login page @ mysite.com/login. found rewrite rule: rewriterule ^(.*)/login/$ http://mysite.com/login/ [l] it works, not send user previous page after login. previous page on mysite.com or mysite.com/subsite1. thanks here´s answer ;) rewriterule ^(.*)/login/$ http://mysite.com/login/ [l,qsa,ne]

Display a progress bar in an existing tcltk window with R -

my program contains main window in display progress bar. use tcltk , r. the following code shows how display progress bar in new popped-up window, not want : want inside window precedently created. pb <- tkprogressbar("test progress bar", "some information in %",0, 100, 50) sys.sleep(0.5) u <- c(0, sort(runif(20, 0, 100)), 100) for(i in u) { sys.sleep(0.1) info <- sprintf("%d%% done", round(i)) settkprogressbar(pb, i, sprintf("test (%s)", info), info) } sys.sleep(5) close(pb) i've no idea how insert in window. thank you this pretty lifted this answer . gist tkprogressbar won't want. instead, there's function tk2progress in tcltk2 package. using function, can create widget can place in window. root <- tktoplevel() l1 <- tk2label(root) pb1 <- tk2progress(root, length = 300) tkconfigure(pb1, value = 0, maximum = 9) tkgrid(l1, row = 0) tkgrid(pb1, row = 1) (index in 1:10){ t

android - onActivityResult returns null data for an Image Capture -

@override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); filepath = getoutputmediafile(filecolumns.media_type_image); file file = new file(filepath); uri output = uri.fromfile(file); intent = new intent(android.provider.mediastore.action_image_capture); i.putextra(mediastore.extra_output, output); startactivityforresult(i, return_file_path); } @override protected void onactivityresult(int requestcode, int resultcode, intent data) { super.onactivityresult(requestcode, resultcode, data); //data null here. //requestcode = return_file_path; //resultcode = activity.result_ok; } i checked values file , output uri , both fine , captured image exists @ location . but data returned in onactivityresult null after capturing image. edit: i checked question: onactivityresult returns data = null which says: whenever save image passing extraoutput camera intent data parameter inside

c# - Using object in API response -

i'm building api responds requests. 1 field object , needs repeated data many times query returns. can give me example of how use object in response c#? class need create? thanks in advance. add: so far have structure like: public class root { public int model { get; set; } public string lang { get; set; } public part[] parts { get; set; } } public class part { public int id { get; set; } public string name { get; set; } public type part_types { get; set; } } public class type { public string url { get; set; } public string desc { get; set; } } and response coming { "model" : 4 , "lang" : "en_us", "parts" : [ { "id" : 1545, "name" : "part 1", "part_types" : { "url" : "part.com/type1", "desc" : "has 6 bits" } } ] } but need like { "model" : 4 , "lang" : "en_us", "parts" : [ { "id" : 1545, &qu

LU Decomposition on GPU MATLAB -

i trying run lu decomposition on matlab such use gpu. according nvidia/matlab documentation, lu supposed supported cuda (see, example http://www.nvidia.com/content/gtc-2010/pdfs/2267_gtc2010.pdf ). now, have compared speeds between cpu , gpu, , while gpu indeed faster matrix multiplication , fft seems give pretty same results lu decomposition, important me. i have tried different sizes, remains pretty same. for instance, on gpu: a=gpuarray(randn(1000)); tic; [l,u,p]=lu(a); toc elapsed time 0.056832 seconds. on cpu: b=randn(1000); tic; [l,u,p]=lu(b); toc elapsed time 0.031463 seconds. cpu faster. cpu i7-2630qm , gpu gt-550m (laptop). tried on stronger computer has gtx-660 , results same. my matlab version 2012b using matlab r2013a on tesla c2070, see this: a = gpuarray.randn(1000); tic; [l,u,p]=lu(a); toc elapsed time 0.016663 seconds. which 2x faster cpu. matrix size increases further, speedup increases, on machine peaking @ 5x faster on gpu - typical

python - List files in directories with flask -

i’d list files in directories , subdirectories. have used this answer have list, items non-clickables, i’d add link between name of files , locations. have try modify template : <!doctype html> <title>path: {{ tree.name }}</title> <h1>{{ tree.name }}</h1> <ul> {%- item in tree.children recursive %} <li><a href="{{ item.name }}">{{ item.name }}</a> {%- if item.children -%} <ul><a href="{{ loop(item.children) }}">{{ loop(item.children) }}</a></ul> {%- endif %}</li> {%- endfor %} </ul> but doesn’t work, links not good. wheareas want link http://192.168.0.70:5000/static/repertory/subrepertory/file , have link http://192.168.0.70:5000/file , leads 404. can me ? try this: <ul><a href="/static/{{ loop(item.children) }}">{{ loop(item.children) }}</a></ul> i added static path need directly after href=" , be

asp.net - IE9 behaves differently for the same CSS3 but different applications(WebFrom and MVC) -

i have 2 applications, 1 in asp.net 4.5 web forms , other in asp.net 4.5 mvc). used same css3 background both follows. background-color:#xxxxx; background-image:url("../media/background/xxxxxxxxx.gif"); background-repeat:no-repeat; background-size:cover; but ie9 behaves differently web form , mvc. it can seen in following websites www.dsw.dynamicwebapplication.net (web form) www.weyni.dynamicwebapplication.net (mvc) note: understand difference, check both websites in different browsers + ie9 did make mistake or ....? your web form site contains tag: <meta http-equiv="x-ua-compatible" content="ie=8" /> that isn't present in mvc site. in general, if want same result in browser, need send same html.

php - Which request headers can be used for a browser/client fingerprint? -

for added security our server keeps track of browser fingerprint. @ moment use following headers: 'http_client_ip', 'http_x_forwarded_for', 'http_x_forwarded', 'http_x_cluster_client_ip', 'http_forwarded_for', 'http_forwarded', 'remote_addr' (take first non-empty client-ip) http_acceptxxxx http_user_agent are there more (optional) headers can used? what in general best 'algorithm' calculate client fingerprint? you can use unique browser fingerprint (user agent, web browser, canvas, etc) , after hash. /* generate fingerprint string browser */ function generatefingerprint(){ //generate string based on "stable" information taken browser //we call here "stable information", information don't change during user //browse application after authentication var fingerprint = []; //take plugins for(var = 0; < navigator.plugins.length; i++){ fingerprint.push(navigator.plugins[i

numpy - Problems installing nimfa (Python Matrix Factorization library) -

i have large (~25000 x 1000) matrix factorize. wrote own code based on numpy, it's inefficient , keeps throwing memory error. i've been trying install , use nimfa ( http://nimfa.biolab.si/ ) , install process (tried easy_install, pip, , downloading , running git) doesn't show errors. when try call using import nimfa below error. checked nimfa prerequisites , doesn't mention besides numpy , scipy. i'm on windows 8, , using python 2.7.5 numpy , scipy installed. i've tried installing (and subsequently uninstalling) mingw , doing this. any ideas? traceback (most recent call last): file "<pyshell#0>", line 1, in <module> import nimfa file "c:\python27\lib\site-packages\nimfa-1.0-py2.7.egg\nimfa\__init__.py", line 18, in <module> mf_run import * file "c:\python27\lib\site-packages\nimfa-1.0-py2.7.egg\nimfa\mf_run.py", line 26, in <module> utils import * file "c:\python27\lib

Logging 3000 events per second from c program -

what best options logging 3k events per second c file ? following of options come mind. not able decide robust solution less failure points, higher reliability , less latency. use messaging server relay events happen use syslog logging use unix pipe use of logging agents fluent send events analysis server write log file locally , rotate periodically rotate analysis server using rsync try syslog. no reason make complicated. syslog-ng can local logging through udp, set local syslogd forward through tcp central syslog server. might need run without fsync on central syslog server keep load (but test first), can mitigated forwarding 2 separate machines. gives asynchronous performance locally , enough reliability should never lose events. another option i've done log events redis, riak or other nosql data store (i don't recommend them complex, event logging right alley). set mirroring redundancy , should able keep way more 3k events per second.

Java Regex to check "=number", ex "=5455"? -

i want check string matches format "=number", ex "=5455". as long fist char "=" & subsequence number in [0-9] (dot not allowed), popup "correct" message. if(str.matches("^[=][0-9]+")){ window.alert("correct"); } so, ^[=][0-9]+ correct one? if not correct, can u provide correct solution? if correct, can u find better solution? i'm no big regex expert , more knowledgeable people me might correct answer, but: i don't think there's point in using [=] rather = - [...] block used declare multiple choices, why declare multiple choice of 1 character? i don't think need use ^ (if input string contains character before = , won't match anyway). i'm unsure whether presence makes regex faster, slower or has no effect. in conclusion, i'd use =[0-9]+

how to change different environments easily in asp.net application? -

i have asp.net application needs run on different environment such development, test , production. site uses couple of connection strings, 3 web services, different url paths odata services, different file upload directories, different passwords file upload directories , different connection error logging. it becomes real pain whenever need change different environment make sure have changed needed change , becomes hard maintain. keep different web.config files don't think it's best way solve problem. when have update .svcmap fils web services don't think problem solved keeping multiple web configs. can suggest me options have?

git filter branch - how to rename/unite directories by git for all commits -

let exist git repo following directory structure (it converted svn): / release 1 sub_dir1 somefiles1 sub-dir2 somefiles2 release 2 sub_dir1 somefiles1 sub-dir2 somefiles2 release 3 sub_dir1 somefiles1 sub-dir2 somefiles2 ... annotation history of svn repo: every year cleaver body took latest release , copyed new release next number @ same repo. sub-dir/files structure releases same. every release has different history periods. for each commit (hole repo) how to: 1 rename releasex roots 1 directory named "release"? 2 keep/unite commit history files of releases? result repo must looks like: / release sub_dir1 somefiles1 sub-dir2 somefiles2 alternatively can reconvert each releasex svn separate repox. each repox need rename releasex release. need unite repos... ugrhh. think it's rakerway the current approach seems on complicated. something chew on: have considered creating separate bra

mysql - Securing backup credentials for MySQLDump -

i want use mysqldump backup db on weekly basis using cron job. don't want hardcode credentials in shell script. mysql db version 5.1, mysql-config-editor not available. aware of options file, can secure using linux file permissions of 600. there way encrypt credentials , make them unreadable? is there way encrypt credentials , make them unreadable? ask want protect file , why encryption going besides normal file permissions. if going encrypt file containing password, have make sure legitimate backup process has access encryption keys can read password file. have make sure other processes don't have access keys. since further complicates things, increases risk on leak without adding security on top of basic file system security model. recommend stick right ownership , file permissions on .my.cnf file. further reading: http://benlog.com/articles/2012/04/30/encryption-is-not-gravy/ i run mysqldump daily root via cron. in order break attacker needs break

ruby on rails - Destroy method in testing controller with rspec -

i have transaction model, in have following scope : scope :ownership, -> { property: true } i made tests of controller (thanks m. hartl). there : require 'spec_helper' describe transactionscontroller let(:user) { factorygirl.create(:user) } let(:product) { factorygirl.create(:givable_product) } before { be_signed_in_as user } describe "ownerships" describe "creating ownership ajax" "should increment ownership count" expect xhr :post, :create, transaction: { property: true, user_id: user.id, product_id: product.id } end.to change(transaction.ownership, :count).by(1) end "should respond success" xhr :post, :create, transaction: { property: true, user_id: user.id, product_id: product.id } expect(response).to be_success end end describe "destroying ownership ajax" let(:ownership) { user.transactions.ownership.create(pr