Posts

Showing posts from February, 2012

jsf - Bootsfaces scrollUp and Gliphicon -

i'm working jsf project uses bootsfaces 1.1.3 i've tried following without luck <b:scrollup text="" distance="150" class="glyphicon glyphicon-chevron-up"/> how can set glyphicon icon using b:scrollup? i didn't try yet, according documentation of plugin have set attribute image="true" . image must defined in css snippet: #scrollup { background-image: url("../../img/top.png"); bottom: 20px; right: 20px; width: 38px; /* width of image */ height: 38px; /* height of image */ } to use glyphicon, it's best approach glyphicon definition , copy css snippet: .glyphicon { position: relative; top: 1px; display: inline-block; font-family: 'glyphicons halflings'; font-style: normal; font-weight: normal; line-height: 1; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .glyphicon-c

performance - Java: Creating massive amount off new Objects -

i working on simple gameoflife program , try out optimizations it. problem when create cells game (small class 6 primitives) can take long time (especially when create 10000*10000 ). so question if has idea how faster? cells = new cell[this.collums][this.rows]; (int x = 0; x < cells.length; x++) { (int y = 0; y < cells[0].length; y++) { cells[x][y] = new cell(x * this.cellsize, y * this.cellsize, this.cellsize); } } if you're big (or quasi-unlimited) game fields, should not model single cells objects in first place. the field in game of life not populated much, it's better modelled sparse matrix. there huge number of trick optimize game fo life implementation - both data storage performance (copmuting field on next step). check question, instance: sparse matrices / arrays in java it might idea have cell instances representing single cells, , might work relatively small fields. if aim larger fields, won't work well. in case

java - Spring boot client app (XML security) with remote authorization by oauth2 SSO -

i have app spring security in xml file connect sso server(oauth2) authorize app (client) , user (real person). login page on sso. i'll wanna use authorization code flow. in java configuration annotations it's simple how make in spring-security.xml? sso done, problem in client app.

reporting services - Omitting clients from a report based on a summed value -

i working on report sums virtual bank accounts clients , displays them in list total each account right of account. @ end sum accounts specific client. users want ability omit client on report if total sums accounts equal zero. not matter sums of each account when they're summed @ end, if equals 0 omit client report. this easier on server. i'm assuming using sql server here, make no mention of data in question. something this... select * ( select clientid, accountid, accountamount , sum(accountamount) over(partition clientid) balance clientaccountamounts ) caa balance !=0

reactjs - React loop over an object with array -

data = [ { "2017-08-09": [ "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30" ] } ] i'm trying map on array of objects , display info follows: date 2017-08-09 available hours 09:00 09:30 10:00 ... i'm having trouble looping on data structure, https://codesandbox.io/s/qzrvlvx9nj i've updated link. did not use lodash, nested map() calls. first map through initial array, , within each object grab keys of object. after that, map through keys of object, , 1 last map() through times of each date. you can refer below code: const data = [ { "2017-08-09": [ "09:00", "09:30"

find - How to identify renamed files on linux? -

i using 'find' command identify modified files. i've noticed method identifies content-modified files , new files. not identify files change rename. there way use 'find' identify renamed files? if not, there other linux command can used this? here current method identifying changed files going 1 month (this method not identify renamed files): $ touch --date "2017-09-10t16:00:00" ~/desktop/tmp $ find ~/home -newer ~/desktop/tmp -type f > modified-files you should replace option -newer \( -newer -o -cnewer \) in order catch modifications file metadata well.

c# - Microsoft Device client too heavy for Windows FormAplicattion -

Image
os: windows10 sdk: microsoft.azure.devices v1.3.2 language: c# hello, i´m developing windows form application on c#. in app, i´m sending messages iot hub using nuget packet microsoft.azure.devices v1.3.2 , receive messages on raspberry pi. ony package install, app 30 mb, , that´s ok me. problem need receive messages iot hub in app too, did install nugetpacket microsoft.azure.devices.client v1.5.0 me receive messages, if install package, increases weight of app 300 mb more, , that´s way heavier want it. my question is, there other way receive message iot hub in windows form application without weight? missing package me in more easy way? thank in advance. you can use eventhubclient receive message azure iot hub, in windowsazure.servicebus . windowsazure.servicebus has no dependencies, 3m. , more, can sample source code azure-iot-sdk-csharp . tool of deviceexplorer use eventhubclient receive message. there dependencies microsoft.azure.devices.client v1.5.0. when

sql front end forms -

i starting learn sql , silly question code used front end, user friendly input database or table? example when fill in contact information website information doesn't go off inputs individually in table/database using sql syntax, how sql tied individual form sections being filled in customer? responsibility of database manager create link or of web developer through html code? this open question because there ton in middle guess best way summarize it in modern web development ( not looking @ aspx or mvc5 razor templates ) have client side application web technologies client side lands in area of html5, css3, javascript creates ui user. once form filled out there 2 ways submit data 1 via form attribute (you can read more in link) have attribute called method defines type of http protocol send data can read different type here , action server endpoint. there ton more info why has it's own books written should read about. other method via custom javascript using

javascript - display mp3 id3 tage image on web page -

i'm trying obtain mp3's id3 tag information server , gets album art displayed on front end. to obtain tag information used external js library on git hub . , here code retrieve tag information , image information id3 tags: function disp_image(tag){ var image = tag["tags"]["picture"]; var base64string=""; if(image){ for(var i=0;i<image.data.length;i++){ base64string += string.fromcharcode(image.data[i]); } var base64 = "data:"+image.format + ";base64,"+window.btoa(base64string) $("#album-pic")[0].src = base64; } else{ $("album-pic")[0].style.display="none"; } } i embedded image src base64 format, think i'm having format converting problems not sure problem is.

Excel VBA performance issues comparing row to column delete -

just wondering why column delete took 3 seconds more time execute row delete? matrixws is symmetrical sheet. how improve code? if activerow >= 8 , activerow < lastrow , deleterowbutton debug.print & " start delete normal rows" --> 23:13:53 normalws.rows(activerow).entirerow.delete debug.print & " lap time before matrix" --> 23:13:53 matrixws.rows(activerow).entirerow.delete debug.print & " lap time after matrix row" --> 23:13:53 matrixws.columns(activerow - 5).entirecolumn.delete debug.print & " lap time after matrix column" --> 23:13:56 end if

php - Error in Undefined variable: languageID in Opencart 2.3.0.2 -

Image
am having small issue in site related tab in both arabic , english interface it's showing in english, need me fix issue i'm getting error: have setup name in translation files both languages. php notice: undefined variable: languageid in public_html/catalog/view/theme/marine/template/product/product_detail_hitech.tpl on line 254 <?php if( $productconfig['enable_product_customtab'] && isset($productconfig['product_customtab_name'][$languageid]) ) { ?> php notice: undefined variable: languageid in public_html/catalog/view/theme/marine/template/product/product_detail_hitech.tpl on line 335 <?php if( $productconfig['enable_product_customtab'] && isset($productconfig['product_customtab_content'][$languageid]) ) { ?> the code calling this: <?php if ($products) { ?> <li> <a href="#tab-related" data-toggle="tab"> related products (<?php echo count($products);

r - How to display total count in geom_text -

Image
i have been trying produce count of booking made , no booking made. below code have used. giving me full count (sum) across days. how can amend code give me count across stacked graph is. want count of booking made , count of non booking made. p <- ggplot(swiss,aes(x=as.factor(no.of.days.request.took))) p + geom_bar(aes(fill=as.factor(booking_new))) + geom_text(aes(label=..count..), vjust=1,stat='count', position = "stack")

python - Django template doesn't output values to HTML table cells -

Image
i have following template: <table> <tr> <th>monday</th> <th>tuesday</th> <th>wednesday</th> <th>thursday</th> <th>friday</th> <th>saturday</th> <th>sunday</th> </tr> {% row in table %} <tr> {% in week_length %} <td>{{row.i}}</td> {% endfor %} </tr> {% endfor %} </table> and following view: def calendar(request): template_name = 'workoutcal/calendar.html' today_date = timezone.now() today_year = today_date.year today_month = today_date.month today_day = today_date.day table = maketable(today_date) # creates like: [[none, 1, 2, 3, 4, 5, 6],[7, 8, ...],...,[28, 29, 30, 31, none, none, none]] template = loader.get_template('workoutcal/calendar.html') #workout.objects.filter("workouts lie

java - Find If Two Strings are Permutations While Prioritizing Time/Long Strings/Short Strings -

so trying find best implementation methods find if 2 strings permutations of each other 3 cases: 1. long input strings, 2. long input strings , prioritizing speed, , 3. short input strings , prioritizing space. my implementation first case using xor: if (string1.length() != string2.length()) { return false; } int find = 0; for(int = 0; < string1.length();i++ ){ find ^= string1.charat(i) ^ string2.charat(i); } return find == 0; my implementation second case using hash map or hash set haven't implemented yet. my implementation last 1 sorting strings , using java .equals compare if strings equal. if (string1.length() != string2.length()) { return false; } char[] = string1.tochararray(); char[] b = string2.tochararray(); arrays.sort(a); arrays.sort(b); return arrays.equals(a, b); ** test input: 2 empty strings; "ab" "ba"; "abc" "acd"; " rats "

ruby - Chef Template : Using a nested object to generate a configuration file -

i generate config file chef template. correct syntax achieving in chef 13+ i have databag following sub keys: "mykey1" : { "param1" : "mysubvalue1", "param2" : "mysubvalue2" }, "mykey2" : { "param1" : "mysubvalue11", "param2" : "mysubvalue22" }, then in recipe use template resource: template 'mytemplate.erb' ... variables ({ :keys => [mykey1, mykey2] }) end then in template: <% @keys.each_pair |name, _object| %> ["#{name}"] param1 = "#{_object.param1}" # work?? <% end %> what correct way reference param1 , param2 by time data that, it's normal ruby hash object. use _object["param1"] .

how to create several lines plot in r -

Image
let's have x1=c(6,3,5,4,3,7) , x2=c(5,2,1,7,5,2) , want create plot like: where x axis x1 , x2 , y axis corresponding value. how can in r? thx plot(1, 1, xlim = c(1,2), ylim = range(c(x1, x2)), type = "n", xaxt = "n") axis(side = 1, @ = 1:2, labels = 1:2) segments(x0 = 1, y0 = x1, x1 = 2, y1 = x2) points(x = rep(1, length(x1)), y = x1) points(x = rep(2, length(x2)), y = x2)

sql - Select all elements from one column that have ONLY ONE value in an associated column -

i have following database table id_a 1 2 3 4 table b id_b id_o 1 2 2 2 3 2 4 5 5 8 6 2 7 5 8 1 table c id_a id_b 1 3 1 2 3 6 2 8 4 4 4 7 i want elements have associated 1 id_o table b, table c link between 2 tables. in case bring me id_a id_o 4 5 since id_a=4 has associated records table b id_o=5 what tried was: select c.id_a, b.id_o tablec c join tableb b on c.id_b = b.id_b group c.id_a, b.id_o having count(id_o) = 1; but doesn't return want @ all, doing wrong? sql statement select ta.id_a, tb.id_o tablea ta left join tablec tc on tc.id_a = ta.id_a left join tableb tb on tb.id_b = tc.id_b group ta.id_a, tb.id_o having count(tb.id_o) = 1; description of sql statement: select records of tablea . attach, e.g. join corresponding details tablec (link table) attach, e.g. join corresponding details tableb group tablea 's id_a , tab

php - menu and submenu editable on backoffice -

i'm trying make menu submenu in php because want possible add or remove menu / submenu, i'm not able submenu part ... html of submenu in form of comment, not running code not working ... this code: <?php require_once "conexao.php"; $conexao = conexao_db(); $sql = "select * menu menu_visivel '1'"; $registo = mysqli_query($conexao, $sql); if(mysqli_num_rows($registo)!=0){ while ($row = mysqli_fetch_assoc($registo)) { $menu_titulo = $row['menu_titulo']; $menu_link = $row['menu_link']; if ($row['menu_link']=='quinta.php') { $cor = "style='color: black;'"; } else { $cor = "style='color: grey;'";

javascript - Toggle HtmlEncode on asp:BoundField -

title pretty self explanatory. have 2 bound fields , want toggle them function (either js or c#). i'm not sure how since not have id elements. here code: <asp:boundfield datafield="fieldoldvalue" headertext="fieldoldvalue" htmlencode="false"/> <asp:boundfield datafield="fieldnewvalue" headertext="fieldnewvalue" htmlencode="false"/> <label class="switch"> <input id="htmltoggle" type="checkbox" onclick="togglehtml()"> <span class="slider round"></span> </label> ideally js this: function togglehtml() { if('htmltoggle'.checked) //render html (htmlencode="false") else //un-render html (htmlencode="true") } the fields showing raw html initially, , when hit toggle, both fields render html. update: have maybe gotten closer solving still not getting work (i'm trying either asp:button o

php - Can i remove the csfr thing so it would work? Or must i have it there to work? -

code: error_reporting(e_all); include("gameengine/account.php"); if(isset($_get['del_cookie'])) { setcookie("cookusr","",time()-3600*24,"/"); header("location: login.php"); } if(!isset($_cookie['cookusr'])) { $_cookie['cookusr'] = ""; } if ( $_server[ 'request_method' ] == 'post' ) { if ( !isset( $_session[ 'csrf' ] ) || $_session[ 'csrf' ] !== $_post[ 'csrf' ] ) throw new runtimeexception( 'csrf attack' ); } $key = sha1( microtime() ); $_session[ 'csrf' ] = $key; error: ( ! ) fatal error: uncaught exception 'runtimeexception' message 'csrf attack' in c:\wamp64\www\login.php on line 26 ( ! ) runtimeexception: csrf attack in c:\wamp64\www\login.php on line 26 call stack # time memory function location 1 0.0010 278680 {main}( ) ...\login.php:0

sql - What do i wrong? -

http://sqlfiddle.com/#!6/30c6fe/4 here code: create table employees ( id integer identity(1,1) primary key, lastname varchar (16), pass_num varchar (16) ) ; insert employees values ('ivanov', '11111111'); insert employees values ('ivanov', '11111111'); insert employees values ('ivanov', '55555555'); insert employees values ('petrov', '22222222'); insert employees values ('petrov', '22222222'); insert employees values ('sidorov', '11111111'); select id, lastname, pass_num employees emp group lastname, pass_num having min(id); and error: expression of non-boolean type specified in context condition expected, near ')'. you have error on having min(id); it expecting expression sample having min(id) = 1; also, group not include columns not in aggregate function. should include column id well group lastname, pass_num

typescript - Import turn.js in ionic 2 project -

i have literally searched , tried every single solution out there include 3rd party javascript files/libraries not supported npm, in ionic 2 projects. nothing worked me. there best practice purpose or self-explanatory tutorials available? can suggest solution include turn.js in ionic 2 projects? if search turn.js on npmjs.com find first entry there. here link. but not recommend using such old , unmaintained library. need jquery real downer size/performance of app. users mentioned in github issues not work on modern browsers , problems on mobile devices exist. can try this alternative solution, though don't know how works. , here can find offical ionic docs on how work third-party-libs.

signature - DKIM signing error -

i wanted configure mail server. honestly, i'm not @ debian, decided use how-tos. i tried use these ones few times: https://thomas-leister.de/en/mailserver-debian-stretch/ https://scaron.info/blog/debian-mail-postfix-dovecot.html after configuring use these serivces if dkim. http://appmaildev.com/en/dkim/ & https://www.mail-tester.com/ but dkim-result: none (no signature) , your message not signed dkim despite fact strictly according instructions. sending message via php, os debian 9. any ideas i'm doing wrong? send need analyze prombles, tell me what. or can give me link 1 how-to . thanks! i did once on ubuntu server , put down steps here: https://gist.github.com/putnamhill/0fe3fcd5a6543dc2214b hopefully it's not outdated.

asp.net - Try Catch and then continue -

i have code goes in loop , sends emails off using function. when there error not continue send emails after email had issue. i error caught , system continue sending rest of emails. please see code below. public static sendemailresult setemailandsend(datarow[] rows) { try { sendemailresult results = new sendemailresult(); foreach (datarow row in rows) { try { //set values here string strfn = row["firstname"].tostring(); string strln = row["lastname"].tostring(); string stremail = row["email"].tostring(); //some more here sent = emailfunctions.sendemail(stremail, strfromaddress, strfromname, strsubject, strfn + " " + strln, strbody, strsignoffembeddedimagepath, strsignoffembeddedimagename, strccreminderemail); } catch (exception exc) {

ios - How can I add double quote between double quotes to be a string value? -

i want filter double quotes in text , separate words. when added double quote in double quotes (like """ ), didn't work. tried add way ("\"") in between double quotes didn't work too. my codes below. can see in findcommonwords function want. how can solve problem? thanks. import uikit import rogoogletranslate import swiftsoup class feeddetailvc: uiviewcontroller, uiwebviewdelegate { @iboutlet weak var txtmain: uitextview! @iboutlet weak var scrollview: uiscrollview! @iboutlet weak var lblheader: uilabel! var commonwordsarray = [string]() var selectedheader = string() override func viewdidload() { super.viewdidload() lblheader.text = selectedheader self.txtmain.sizetofit() dispatchqueue.main.async { self.contentheight = self.lblheader.frame.height + self.txtmain.frame.height self.scrollview.contentsize = cgsize(width: self.view.frame.width, height: self.contentheight + 100) self.reloadinput

javascript - $lookup from Multiple Collections, and nested output -

i have multiple collections , used separate collection & foreign key approach , , want join collections build nested collections. schemas of collections: const surveyschema = new schema({ _id:{ type: schema.objectid, auto: true }, name: string, enabled: {type: boolean, default: true}, created_date:{type: date, default: date.now}, company: {type: schema.types.objectid, ref: 'company'},}); const groupschema = new schema({ _id:{ type: schema.objectid, auto: true }, name: string, order: string, created_date:{type: date, default: date.now}, questions: [{type: schema.types.objectid, ref: 'question'}], survey: {type: schema.types.objectid, ref: 'survey'} }); const responseschema = new schema({ _id:{ type: schema.objectid, auto: true }, response_text: string, order: string, created_date:{type: date, default: date.now}, question:{type: schema.types.objectid, ref: 'question'} }); and code build nested object: survey.ag

jquery - stop this slider from looping -

i have code , want prevent looping example has slide 1 slide 2 slide three, must not able go slide 3 slide 1 , slide 1 slide three. here jquery code jquery(document).ready(function ($) { $('#checkbox').change(function(){ setinterval(function () { moveright(); }, 3000); }); var slidecount = $('#slider ul li').length; var slidewidth = $('#slider ul li').width(); var slideheight = $('#slider ul li').height(); var sliderulwidth = slidecount * slidewidth; $('#slider').css({ width: slidewidth, height: slideheight }); $('#slider ul').css({ width: sliderulwidth, marginleft: - slidewidth }); $('#slider ul li:last-child').prependto('#slider ul'); function moveleft() { $('#slider ul').animate({ left: + slidewidth }, 200, function () { $('#slider ul li:last-child').prependto('#slider ul'); $('#slider ul').css('left', ''); }); }; functi

javascript - Use Fabric.js freeDraw how to remove controls and borders -

/** * created xj on 2017/9/11. */ var circle,origx,origy; prototypefabric.circle={ drawcircle:function(){ circlemode=true; }, addcenterpoint:function(options){ var pointer=canvas.getpointer(options.e); origx=pointer.x; origy=pointer.y; circle= new fabric.circle({ radius: 1, fill: '', stroke: 'red', strokewidth: 1, left: pointer.x, top: pointer.y, originx:'center', originy:'center', selectable: false, hasborders: false, hascontrols: false }); canvas.add(circle); }, generatecircle:function(options){ var pointer=canvas.getpointer(options.e); var r=calculate.linelength(origx,origy,pointer.x,pointer.y).tofixed(2); text=new fabric.text('radius'+r+'('+origx.tofixed(2)+',&#

Database PC, Android Phone -

i'm taking thesis year , thesis requires me create sql database accepts new users , saves information. turn pc server can accessed via android smartphone. application in phone can see data in database. my question this: possible save copy of entire database pc android phone via internet when internet goes down, phone can still @ data via offline option?

go - Docker Golang SDK - How to redirect container stdout to a file -

using docker golang sdk following method can used create container , bind it's output stdout . resp, err := cli.containercreate(ctx, &container.config{ image: "alpine", cmd: []string{"echo", "hello world"}, attachstdout: true, }, nil, nil, "") how can redirect output file using sdk ? i'm using official sdk of docker - github.com/docker/docker/client you can use below out, err := cli.containerlogs(ctx, resp.id, types.containerlogsoptions{showstdout: true}) if err != nil { panic(err) } f, err := os.create("/tmp/clogs") io.copy(f, out) but make sure to after have started container, create create container , not start it

deep learning - Are there any plans to implement a leaky ReLU in H2O? -

are there plans implement leaky relu in deep learning module of h2o? beginner neural nets, in limited amount of model building , parameter tuning, have found relus generalize better, , wondering if better performance might obtained using leaky relus avoid dying relu problem. this not direct answer question because product roadmap not can comment on. however, if worried dying relu problem in h2o, why don't use exprectifier , stands exponential linear unit (rlu) , not suffer dying relu problem. matter of fact, this paper proves elu outperforms relu variants. drawback is more computational heavy involves exponent in calculation.

Query by association on Conceptnet 5.5 -

i have code used query older version of conceptnet using following url: http://conceptnet5.media.mit.edu/data/5.4/assoc/c/en/cat?filter=/c/en/dog/.&limit=10 this kind of query used give shared edges between these 2 concepts. in latest conceptnet documentation ( https://github.com/commonsense/conceptnet5/wiki/api ) mentions api still supports queries association (which query assoc used do) in examples shows usage of query kind of query such http://api.conceptnet.io/query?node=/c/en/dog&other=/c/en/cat how can update urls use new version? can use older api specifying 5.4 somewhere in new host?

windows - Python crashing when launching my tkinterapp -

i'm experiencing error other computer using project demonstration. it's using anaconda 3. windows giving me error stating "pythonw.exe has stopped working". below details: problem signature: problem event name: bex application name: pythonw.exe application version: 0.0.0.0 application timestamp: 577c1105 fault module name: stackhash_0a9e fault module version: 0.0.0.0 fault module timestamp: 00000000 exception offset: 3f271bee exception code: c0000005 exception data: 00000008 os version: 6.1.7601.2.1.0.256.4 locale id: 3081 additional information 1: 0a9e additional information 2: 0a9e372d3b4ad19135b953a78882e789 additional information 3: 0a9e additional information 4: 0a9e372d3b4ad19135b953a78882e789 can shed light cause of issue? edit: found source of error. it's when pack self._frameplotter self._frameplotter = tk.frame(master) self._plotter = plotter(self._frameplotter) sel

javascript - I can't get an ES6 promise to work -

i can't grasp how promises work. figured i'd jump in , try , create 1 see if helps. following returns undefined value (arrtables): app.get("/gettables", function (req, res) { var arrtables = gettables().then(function(response) { console.log("gettables() resolved"); console.log(arrtables.length); console.log(arrtables[1].id()); }, function(error) { console.error("gettables() finished error"); }); }); function gettables() { return new promise(function(resolve, reject) { while (mlobby.tlbcount() < lobby_size) { var objtable = new table(); mlobby.addtable(objtable); } resolve(mlobby.tables); }); } new table() references custom class makes async database call. i'm trying use promises make sure call resolves before continue in code. can point out i've gone wrong? here's console output: gettables() resolved undefined (node:65

c# - EF Core: Update-Database command not creating user tables -

following this tutorial created asp.net core 1.1.1 - code first app on vs2017 ver 15.3.3 . difference between tutorial , app chose individual user accounts option , i'm using sql server 2012 express db instead of localdb. following commands run fine , create blogging database blogs , posts tables. note: i've not upgraded .net core 2.0 yet on both computers compatibility issues of our existing applications. pm> add-migration myfirstmigration -context bloggingcontext pm> update-database -context bloggingcontext issue but when run following command generate user tables (aspnetusers, aspnetrols etc) command runs without error user tables not created. not happening before upgraded vs2017 ver 15.3.3. also, on other computer (windows 10 sqlexpress 2014) don't have such problem. computer windows 7. possibly issue here - , may missing here? update-database -context bloggingcontext .csproj file <project sdk="microsoft.net.sdk.web"> <pro

How to determine equality for two JavaScript objects? -

a strict equality operator tell if 2 object types equal. however, there way tell if 2 objects equal, much hash code value in java? stack overflow question is there kind of hashcode function in javascript? similar question, requires more academic answer. scenario above demonstrates why necessary have one, , i'm wondering if there equivalent solution . the short answer the simple answer is: no, there no generic means determine object equal in sense mean. exception when strictly thinking of object being typeless. the long answer the concept of equals method compares 2 different instances of object indicate whether equal @ value level. however, specific type define how equals method should implemented. iterative comparison of attributes have primitive values may not enough, there may attributes not considered part of object value. example, function myclass(a, b) { var c; this.getclazy = function() { if (c === undefined) c = * b // imagine

python - Weakref not getting deleted in REPL even after manual gc collection -

i seeing issue when executing below code in repl, after manually doing gc.collect() can still see weakref object. see below [67]: weakref import weakvaluedictionary class a: def __init__(self): self.val = 1 = a() w = weakvaluedictionary() w['k1'] = dict(w) out[72]: {'k1': <__main__.a @ 0x1e59e9b84a8>} del gc.collect() out[74]: 239 dict(w) out[75]: {'k1': <__main__.a @ 0x1e59e9b84a8>} ideally weakref should cleared once strong ref has been deleted , manual gc has been done, why still seeing this. it looks like using ipython. described in the docs , ipython stores each output in numbered global variable. there global variable _72 holds reference dict(w) (the value output in out[72] ), of course contains strong refence object formerly known a .

angularjs - angular table orderBy colunm -

i try angular table order date column(descending order).but doesn't work(date column data type string,in reason have string data type).please me. sample data trans.date | receipt / ref no | trx code | description | receipt amt | debit | credit | running balance 2013-08-15 | 000000000001 | ost | ost | 0.00 | 150.00 | 0.00 | 150.00 2013-08-15 | 000000000001 | oth | amounts | 0.00 | 8,000.00 | 0.00 | 8,150.00 2013-09-15 | 000000000001 | rnt | rental | 0.00 | 3,041.00 | 0.00 | 11,191.00 2013-10-15 | 000000000002 | rnt | rental | 0.00 | 3,041.00 | 0.00 | 14,232.00 code <table id="tbltrans" class="display table-bordered" cellspacing="0" width="100%" style="font-size: small;"> <thead> <tr> <th>date</th> <th>receipt / ref no</th> <th&

How to edit an specific subString in XML using C# -

i have xml file example looks this. <file> <add key="1" val="great.me"/> <add key="2" val="notsogreat"/> <add key="3" val="lessgreat.me/yey" /> <add key="4" val="sogreat/yey" /> </file> i replace value of .me .awesome. ex: <add key="1" val="great.me"/> to <add key="1" val="great.awesome"/> and ex: <add key="3" val="lessgreat.me/yey" to <add key="3" val="lessgreat.awesome/yey" can me guys? tia try this, string oldtext = file.readalltext(filepath); string newtext = oldtext.replace("me", "awesome"); file.writealltext(filepath, newtext, encoding.utf8); xmldoc = new xmldocument(); xmldoc.load(filepath);

php - different domains same directory - codebase -

i create dynamic website php. website must work 5 different databases , 5 domain names, same codebase. when access domain of these 5, website understand domain user access , call appropriate database. see domain user access, use code this . now, best solution have 5 domains 1 same codebase-directory? use cpanel if helps. any help? thank in adavance! edit: solution find create addon domains or parked domains via cpanel pointing same directory. after use $_server['server_name']; find domain visitor use , call appropriate database. the solution create addon domains via cpanel pointing same directory. after use $_server['server_name'] find domain visitor use , after call appropriate database.

ruby on rails - Why default locale does not work? -

Image
in application controller, forcing locale handling before filter: before_filter :set_locale def set_locale #i18n.default_locale en i18n.locale = extract_locale_from_tld || i18n.default_locale end def extract_locale_from_tld parsed_locale = params[:locale] || ((lang = request.env['http_accept_language']) && lang[/^[a-z]{2}/]) #so, english default language. parsed_locale= 'en' if parsed_locale.nil? i18n.available_locales.include?(parsed_locale.to_sym) ? parsed_locale : nil end however, if tried visit http://localhost:3000/ko/lab result routing error error 404 eventually. any locale out of following locates result routing error: any advice? edit my route.er: # -*- encoding : utf-8 -*- myapp::application.routes.draw mount alchemy::engine => 'blog' rails.application.routes.draw filter :pagination, :uuid, :locale end devise_for :users, :controllers => { :omniauth_callbacks => "callbacks",