Posts

Showing posts from April, 2011

jquery - FabricJs Ctrl C + Ctrl V -

i'm trying make copy paste action using ctrl + c , ctrl + v fabricjs. i managed something. object i'm selecting , doing copy paste copied if press again ctrl + v item places inside last one. , if select items changing position. copy paste actions: if (map[17] && map[67]) { event.preventdefault(); if(canvas.getactivegroup()){ for(var in canvas.getactivegroup().objects){ var object = fabric.util.object.clone(canvas.getactivegroup().objects[i]); object.set("top", object.top+5); object.set("left", object.left+5); copiedobjects[i] = object; } console.log(copiedobjects); } else if(canvas.getactiveobject()){ var object = fabric.util.object.clone(canvas.getactiveobject()); object.set("top", object.top+5); object.set("left", object.left+5); copiedobject = object; copiedobjects = ne

How to use index match with IF in excel? -

Image
table1 b c d 1 seq item re-order qty on-hand qty 2 1 x 10 15 3 2 y 10 5 4 3 z 10 10 other worksheet: table2 expected output: b c 1 seq item re-order qty 2 1 n/a n/a 3 2 y 10 4 3 n/a n/a in table2 need put in column 2 equation this: index(table1[item],match(table2[seq],tabel1[seq],0) table1[reorder qty] > table1[on-hand qty] i'm not sure how such requirement managed? this can done. requires use of array formula in table2 . normally index use range of cells array (first argument of formula). in case, give new array return based on results of conditional (your where clause). i start picture of results , give formulas. me, table1 on left, table2 on right. formulas the formulas similar, main difference column r

stored procedures - In MySQL, get number of pregnant women who received 3 ANC checkups -

i working on project required find out total number of pregnant women have received 3 anc(ante-natal care) checkups done. a pregnant women said receive 3 anc checkups if 3 of 4 columns(visit1_date,visit2_date,visit3_date , visit4_date) have value. for this, need calculate count of number of rows 3 of 4 columns given in table not null. so, basically, required find count of rows 3 of visit1_date, visit2_date,visit3_date,visit4_date not null my table has columns individually each of visit dates i have tried using ifnull, have no idea if help. in mysql, boolean operation treated number in numeric context, 1 true , 0 false. makes easy count number of non-null values: select count(*) table t ((visit1_date not null) + (visit2_date not null) + (visit3_date not null) + (visit4_date not null) ) >= 3;

I Need to have a blank observation after each row in r using dataframe? -

this question has answer here: insert blank row after each group of data 2 answers output getting in dataframe col1 col2 col3 col4 abc 25 35 abc asd 25 45 def 15 36 erf 23 69 erf asd 25 36 erf dfg 85 78 convert this 1. col1 col2 col3 col4 2. 3. abc 25 35 4. abc asd 25 45 5. abc def 15 36 6. 7. def erf 23 69 8. 8. erf asd 25 36 9. erf dfg 85 78 10 erf fgh 78 89 i need blank observation @ 2 6 , 8. there option? if assume col1 , col2 of class character , quick solution be res <- do.call(rbind, lapply(split(df, df$col1), function(x) rbind("", x))) row.names(res) <- null res # col1 col2 col3 col4 # 1 # 2 abc 25 35 # 3 abc asd 25 45 # 4 # 5 def 15 36 # 6

javascript - Diffrence between Ajax requests? -

i started working ajax, , i'm listening tutorials on 1 tutorial see code like: $("button").click(function(){ $.get("demo_test.asp", function(data, status){ alert("data: " + data + "\nstatus: " + status); }); }); on other cases see xmlhttprequest done in javascript can tell me diffrence between two? beacuse confusing listening 1 tutorial tells 1 thing , other second thing jquery wraps use of xmlhttprequest $.get request (etc.) bassicly using same method of ajax.

appcompat - Import errors of project Tower-develop -

i downloaded project "tower-develop" github , import eclipse. i import "android-support-v7-appcompat", , add library project "tower-develop". but found following errors: "no resource found matches given name 'theme.appcompat.light.dialog'" and "error: error retrieving parent item: no resource found matches given name 'widget.appcompat.dropdownitem.spinner'." i checked "android-support-v7-appcompat", , found package "android.support.v7.appcompat" empty. that maybe cause of errors. don't know how fix it.

twitter - The use of Textblob for multiple domain tweets for sentiment -

i'm building application analyze sentiment news-related tweets in different domains, such sports, disaster , technology, i'm using textblob default mode (patternanalyzer). provide sentiment though domains different? , how can evaluate performance? or better provide own training data each domain , train classifier? textblob basic sentiment predictor , wont accurate. basic training model trained on movie-review dataset wont work efficiently you. suggest create different datasets each, if possible.

osx - installing java 7 on Mavericks -

i have new mac mavericks (ie without java). installed java 8, grails project not supported java8, , need install java7. how can install java 7 manually (java installer determine java 8) without uninstalling existing java8? check out version installed java -version download , install version 1.7 oracle servers this should work

php - What is wrong in my .htaccess code? -

thank reading i trying website working again. running on webhost in stead of virtual server. code below .htaccesss using currently. <ifmodule mod_rewrite.c> rewriteengine on #rule imported rule 2 rewriterule ^error/(.*)$ error.php?p=$1 [] #rule imported rule 4 rewriterule ^administratie/backup/(.*)$ admin.php? p=dash&pagina=backup&table=$1 [] #rule imported rule 5 rewriterule ^administratie/chatlogs_popup/(.*)$ admin.php? p=chatlogs_popup&speler=$1 [] #rule imported rule 6 rewriterule ^administratie/berichtenbalk/verwijder/(.*)$ admin.php?p=dash&pagina=berichtenbalk&id=$1 [] #rule imported rule 7 rewriterule ^administratie/(.*)$ admin.php?p=dash&pagina=$1 [] #rule imported rule 8 rewriterule ^(.*)$ index.php?p=$1 [] #rule imported rule 9 rewriterule ^team/(.*)$ index.php?p=team&staff=$1 [] #rule imported rule 10 rewriterule ^forum/categorie/(.*)/topic/(.*)$ ./index.php?p=forum&id=$1&topic=$2 [] #rule impor

unity3d - Cannot multiply and assign to int -

i following unity tutorial , got error in unity car game tutorial: bce0051: operator '*' cannot used left hand side of type 'int' , right hand side of type 'boolean'. i found these last 2 same errors in thease line of code // these variables allow script power wheels of car. public var frontleftwheel: wheelcollider; public var frontrightwheel: wheelcollider; public var rearleftwheel: wheelcollider; public var rearrightwheel: wheelcollider; rearrightwheel.braketorque = 60 * input.getbuttondown("jump"); rearleftwheel.braketorque = 60 * input.getbuttondown("jump"); even better @general-doomer suggested: rearrightwheel.braketorque = input.getbuttondown("jump") ? 60 : 0; ternary operator: rearrightwheel.braketorque = 60 * (input.getbuttondown("jump")?1:0);

php - Is there any way that the first character of a text box is either '+' or '-' by default -

i have text field on form gmt time. want users enter integers '+5' '+6' or '-6' or '-5' etc. i want make easy users don't have write ' + ' or ' - ' there self. there should default option of ' + ' or ' - ' first character in text field. i saw solutions making simple drop down in front , user can select there automatically appear in text box. but want make more easy if other easy solution there. will prefer using html5 if not jquery fine.. try one: <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script> $(document).ready(function() { var num = 0; $('#txt1').keydown(function(e){ num += 1; if (e.keycode > 36 && e.keycode < 41) { if(num % 2){ $('#txt1').val('+'); }else{ $('#tx

php - AJAX loads same posts every time in wordpress loop -

i needed pagination wordpress ajax-powered. when visitor clicks "older entries" , page not have reloaded show older posts. i've serched , found solution here. problem is, loads same post everytime. here query: <ul class="recipe-list"> <?php $home_rcp = $redux_imd['home_rcp']; $rcpquery = new wp_query(array( 'cat'=> $home_rcp, 'posts_per_page' => 4 )); while ($rcpquery->have_posts()) : $rcpquery->the_post(); ?> <li> <?php the_post_thumbnail('recipe-thumb'); ?> <div class="caption"> <div class="blur"></div> <div class="caption-text"> <div class="post-title"> <h5><?php the_title() ?></h5> </div> <div cl

javascript - Make website support older browsers jQuery calls -

i'm bit stuck here. have website uses jquery 2.1.4 only. figured out won't support older browsers such ie 6, 7 , 8. use jquery many things in website, includes login system, live chat , management functions. anyway, thinking of implementing jquery 1.11.3 because supports these browsers. thing is, don't know start because don't think add script source jquery 1.11.3 , shall fix all, i'm looking way add won't have change functions or add special functions older browsers. the jquery methods use $.ajax , $.when , $.then . i don't think add script source jquery 1.11.3 , shall fix all you replace existing script source it. the 2.1.x branch 1.11 branch slow compatibility code old browsers removed. api compatible.

asp.net web api - tracking all consumers for WEB API -

i have standard enterprise level web api , going used across organisation. can have demarcation mainframe systems/online channel/etc through api key. however there can many systems( many systems in online) in webapi can share same key. need identify each , every call uniquely , if not being shared any ways it? you log ip address of each request. if systems internal organisation shouldn't hard match ips system is. edit or pass client id api key.

Android ViewFlipper flip without animation -

i'm using viewflipper flip views animation. disable animation sometimes? tried startflipping() failed. idea? thanks. just commenting out setinanimation , setoutanimation , call shownext() or showprevious() trick: //viewflipper.setinanimation(this, r.anim.slide_in_from_left); //viewflipper.setoutanimation(this, r.anim.slide_out_to_right); viewflipper.shownext(); final solution: viewflipper.setflipinterval(0); viewflipper.setinanimation(null); viewflipper.setoutanimation(null); viewflipper.shownext();

Reference multiple words in css -

i have wordpress page , see 1 of items style has id of wpb_text_column wpb_content_element textboxtest . how can reference in css since has spaces between words? it not have 1 class multiple classes. reference in css .wpb_text_column.wpb_content_element.textboxtest { /* css code */ } ids unique , div can contain one.

asp.net - VB.net For Each Loop Not Accounting for First Datarow -

i looping through data gridview in visual studio, loop works , code pretty want, my problem seems skip, or not account first row in gridview, have looked online resolve cannot find anything, i wondering if assistance this... here code loop: 'checks flags montor/expiry date set red or green cells '------------------------------------------------------------------ each row gridviewrow in gridview3.rows '----------------------------------------------------------------------------------------- dim monitorval string = gridview3.datakeys(e.row.rowindex).values("monitor").tostring if monitorval.contains("yes") dim isextention string = gridview3.datakeys(e.row.rowindex).values("filename").tostring if isextention = "" or isextention = nothing or isextention = "null" 'set red '--

sublimetext3 - Is it possible to pin the project into folder panel in Sublime Text 3? -

updated : probably, question doesn't make sense. please close it? i quite new sublime text. open project dragging , dropping project folder sublime text. however, when quit sublime text, , reopen it, project gone. need drag , drop again. possible pin project sublime text, next time when open, project still there? thanks. note: using sublime text 3 you can save project on disk: project > save project as... when open editor next time should open automatically. if not, go project > open recent . documentation: https://www.sublimetext.com/docs/3/projects.html

ios - Swift Callback change UIViewController Label -

i started study swift ios yesterday , i'm trying make simple login app. swift file import foundation import swifthttp func printsomething (sentence: string) { println(sentence); } func makelogincall(user: string, pwd: string, donefunction : (bool) -> void) { var url : string = "myurl" var request = httptask() request.requestserializer = jsonrequestserializer() request.responseserializer = jsonresponseserializer() request.post(url, parameters : ["username": user, "password": pwd], success: {(response: httpresponse) in if let dict = response.responseobject as? dictionary<string, anyobject> { println("\(dict)") donefunction(true) } }, failure: {(error: nserror, response: httpresponse?) in println("error \(error)") donefunction(false) }) } and viewcontroller import uikit class viewcontro

c - Specifying output string argument with GoogleMock -

i'm evaluating google test/mock framework unit tests of c code. how can specify output string argument function mock? here have int get_int_param(const char *) function test , uses int _get_text_file_content(const char *fn, char *content) function want mock. how specify char *content going result of execution of mocking function? i'm struggling code: test(getparametertest,positiv){ const static int strlen=29; char *text=(char *)calloc(strlen,1); strcpy(text, "param1=1\nparam2=42\nparam3=3"); mokedfunctions mokedfunctions; expect_call(mokedfunctions, _get_text_file_content("process.conf",_)).times(atleast(1)).willonce(setargreferee<1>(text)); expect_eq(1, get_int_param("param1")); } and got compile error: /usr/include/gmock/gmock-more-actions.h: in instantiation of ‘typename testing::internal::function<f>::result testing::setargrefereeactionp<k, value_type>::gmock_impl<f>::gmock_perf

Complexity classes examples -

i wanted know if answers indeed correct following statements: 3(n^3) + 5(n^2) + 25n + 10 = bigomega(n^3) -> t ->grows @ rate equals or slower 3(n^3) + 5(n^2) + 25n + 10 = theta(n^3) -> t -grows @ rate equals 3(n^3) + 5(n^2) + 25n + 10 = bigo(n^3) -> t -grows @ rate equals or faster thanks!!! formal definitions of o notations are: f(n) = o(g(n)) means there exists constant c , n0 f(n) <= c*g(n) n >= n0. f(n) = Ω(g(n)) means there exists constant c , n0 f(n) >= c*g(n) n >= n0. f(n) = Θ(g(n)) means there exists constants c1 , c2 , n0 f(n) >= c1*g(n) , f(n) <= c2*g(n) n >= n0. proof o: 3(n^3) + 5(n^2) + 25n + 10 < 3*n^3 + n^3 + n^3 = 5*n^3 you can see n >= 10 formula true. there exists c = 5 , n0 = 10 , o(n^3) . proof Ω: 3(n^3) + 5(n^2) + 25n + 10 > 3*n^3 so c = 3 , n0 = 1 , Ω(n^3) . because both o , Ω apply 3rd statement Θ true.

scjp - Formatters in java -

%b, %c, %d, %f, %s how work in java? have been trying read formatter class , formattable interface however, unable understand in regards conversions passed arguments. for example: system.out.printf("%f not equals %b", math.pi, math.e) even though formatter such %b, %c, %d, %f, %s limited in ocjp6 exam, feels huge topic prepare i think having trouble understanding how system.out.printf() works. simple once idea. you orginal question regarding below system.out.printf("%f not equals %b", math.pi, math.e) here system.out.printf trying output string . %f , %b can understood placeholder special meaning. placeholders because replaced data comes after comma. in case %f replaced value of math.pi , %b replaced value of math.e special meaning because each formatter stands somethings example mention above %b boolean %f decimal floating-point %c character %d decimal integer %s string now write orginal query in simple manner system.out.printf(&

java - Trouble with understanding routing priority -

i building sort of discussion board, can ask questions , write answers. ran problem routing , seem understanding them wrong. i have homepage called index , there can click button "ask question" or button "write answer". each button leads webpage (askquestion.scala.html or writeanswer.scala.html) can write question or answer. after hitting submit come index-page, new question or answer put view. in background, question / answer gets put db. my routes.conf : # home page / controllers.application.index() #questions /fragestellen controllers.application.askquestion() post / controllers.application.sendquestion() #answers /antwortgeben controllers.application.writeanswer() post / controllers.application.sendanswer() but when enter answer, gets written question-table in db! due fact question-route higher in routing table , therefore se

java - What class is directly implementing ListIterator? -

what class implements interface listiterator ? i'm studying collections api.. , seem though actual method returns listiterator within list implementation classes directly specified in list itself. the listiterator interface specifies actual methods use manipulate iterator.. having trouble finding actual class implements this. what class -implements- interface listiterator allows method in list classes work? i'm sure there has implementation class because calling listiterator() surely can not return interface, there must instantiated. you can't instantiate interface , can create "invisible" private class , satisfying interface , user can't directly see it. example, linkedlist defines listiterator as: public listiterator<e> listiterator(int index) { checkpositionindex(index); return new listitr(index); } private class listitr implements listiterator<e> { private node<e> lastreturned; private node&l

php - Currently my code exports data to a CSV file, and stores it on the server. But I want it to download the file. How do I do this? -

i tried doing headers in past, either downloaded empty csv file or php file itself. <?php $database = new pdo('mysql:host=localhost;dbname=db_name', "root", ""); $sql = "select card_id, card_uid, card_type cards"; $stmt = $database->prepare($sql); $stmt->execute(); $filename = 'mycsvfile-'.date('y-m-d').'.csv'; $data = fopen($filename, 'w'); while ($row = $stmt->fetch(pdo::fetch_assoc)) { fputcsv($data, $row); } fclose($data); ?> try can result. <?php $database = new pdo('mysql:host=localhost;dbname=db_name', "root", ""); header('content-type: text/csv; charset=utf-8'); header('content-disposition: attachment; filename=data.csv'); $sql = "select card_id, card_uid, card_type cards"; $stmt = $database->prepare($sql); $stmt->execute(); $data = fopen

ios - Panframe Sdk: forword video using "playWithSeekTo:onKeyFrame:" Method? -

here sending code player view of panframe sdk cmtime t = [pfasset getplaybacktime]; cmtime seekingcm = cmtimemake(t.value+10000000, t.timescale); [pfview run]; //[pfasset stop]; [pfasset playwithseekto:seekingcm onkeyframe:yes]; slider.value = cmtimegetseconds(t); [pfasset play];return; please advise how work.

java - Android: Passing TextView as parameter to external function returns nullpointerexception -

i'm trying pass textview parameter external class perform functionality i'm hitting nullpointerexception each time. activity.java tv = (textview) findviewbyid(r.id.tv); log.v("", "contents: " + tv.gettext().tostring()); // works fine externalclass.addviewtolist(tv); externalclass.printviewcontents(tv.gettext().tostring()); external class public list<view> _views; // doesn't work public void addviewtolist(view v) { try { this._views.add(v); log.v("", "added " + v.getid() + " list"); } catch(nullpointerexception ex) { log.e("", "nullpointerexception when adding view list"); } } // works fine public void printviewcontents(string contents) { log.v("",contents); } so know view has been found in layout.xml , has been initialized, question how pass view activity external class. thanks edit forgot lists need initalised arraylist

c# - Only fire the event on the correct User Control -

i have following scenario, have tabcontrol each tabpage represents year. on every year- tabpage have tabcontrol 12 tabpages months. on every month- tabpage have usercontrol . this: foreach (tabpage tp2 in tbmonat.tabpages) { ucmonat monat = new ucmonat(convert.toint32(tp.name), convert.toint32(tp2.name)); monat.parent = this; onseturlaub += monat.getselectedcells; monat.dock = dockstyle.fill; tp2.controls.add(monat); } on mainform have button , if button pressed event fired on usercontrol . @ moment event fired on every usercontrol . want fired on active usercontrol . how can that? mainform: public delegate void seturlaub(string date, eventargs e); public event seturlaub onseturlaub; public void cmdurlaub_click(object sender, eventargs e) { if (onseturlaub != null) onseturlaub(jahr + monat , e); } usercontrol: publi

asp.net - sharing same string constant in javascript and aspx file -

i want use string constant in javascript ans same string label in index.aspx. there way use same javascript constant in aspx ? declare public variable in (.cs) class file. (make const if dont want change it.) assign value wherever want to. public string strname = "tester"; & use in .aspx page : <label> <%: strname %> </label> <script type="text/javascript"> var x = '<%: strname %>'; </script>

java - How to fill a jframe table from an arraylist? -

i have jtable created using java gui , need fill arraylist. i'm not familiar java , have no idea how fill jtable. don't know if need use tablemodel or jtable table = new jtable(data, columnnames). code: public void filltable(){ arraylist a=new arraylist(); jframe4 j=new jframe4(); string m=j.getloggedemail(); // a=s.getemails(m); //this example of arraylist a.add("sender@gmail.com"); a.add("my subject"); a.add("hiiii"); try { string[] columnnames = {"sender", "subject", "body", }; //here need fill table } catch(exception e) { joptionpane.showmessagedialog(null, e); } } this declaration of jtable1 need fill: jtable1.setmodel(new javax.swing.table.defaulttablemodel( new object [][] { {null, null, null}, {null

python - Draw same lines drawn on a Tkinter Canvas on an OpenCV image -

using mouse, let user draw random curves on tkinter canvas. these curves drawn short lines between points on mouse moves. my aim save points used draw lines on canvas , draw same curves using same points on simple opencv window. the drawing on canvas works perfectly, however, wherever place opencv window never succeed fulfill goal. think problem may in wrong functions call order? from tkinter import * import numpy np import cv2 class test: def __init__(self): self.b1="up" self.xold=none self.yold=none self.liste=[] def test(self,obj): self.drawingarea=canvas(obj) self.drawingarea.pack() self.drawingarea.bind("<motion>",self.motion) self.drawingarea.bind("<buttonpress-1>",self.b1down) self.drawingarea.bind("<buttonrelease-1>",self.b1up) def b1down(self,event): self.b1="down" def b1up(self,event): self.b1="up"

Excel - copy row which have non-blank cell to another tab -

i need make situation happened: let's have 3 different tabs, let's call them atab , btab , sum. in atab , btab have rows of information. in column k , have "comment column". if comment column in row not blank (it has comment) - want whole row coppied sum tab. so in sum tab see of rows of atab , btab comments (on k column) . is possible? :) i want whole row coppied sum tab. i'm assuming mean “the sum of atab , btab should placed in sum tab” , tab mean cell. task easy, use formula: =if(k1<>""; sum(a1:b1); 0)

How To Use Spring RESTTemplate To Post Data to a Web Service -

i have written jersey client code call webservice.and working fine. insteade of jersey have use spring rest template call webservice . please me in converting jersey code spring 4.0. here jersey code. serviceclient.java package com.api.client; import java.io.file; import java.io.fileinputstream; import java.io.filenotfoundexception; import java.io.inputstream; import javax.ws.rs.core.mediatype; import javax.ws.rs.core.uribuilder; import org.slf4j.logger; import org.slf4j.loggerfactory; import com.sun.jersey.api.client.client; import com.sun.jersey.api.client.clientresponse; import com.sun.jersey.api.client.webresource; import com.sun.jersey.api.client.config.clientconfig; import com.sun.jersey.api.client.config.defaultclientconfig; import com.tcs.datashare.dao.configurelogdao; import com.tcs.ngps.sip.modeler.utils.productconfiguration; public class serviceclient { static final logger logger = loggerfactory .getlogger(serviceclient.class); private webreso

c# - Overriding toSting in derived class -

i have abstract class animal looking this abstract class animal{ protected int numberofpaws; public abstract string speak(); public string tostring(){ return "i have " + numberofpaws + " paws"; } } then have derived class has new implementation of tostring() looking this class cow : animal{ public cow : base(4) {} public override string speak(){ return "moo!"; } public new strinf tostring(){ return "i cow " + base.tostring(); } } and have main looking this void main{ cow c = new cow(); console.writeline(c.tostring()); } but when run prints userquery+cow console. i have no clue i'm doing wrong? doing beacause of base.tostring() ? use override keyword: abstract class animal { protected int numberofpaws; public abstract string speak(); public override string tostring(){ return "i have " + numberofpaws + "

How to start a wide browser inside a docker container, for Protractor testing -

when running end end tests inside docker container need browser wide, make sure elements (abutton) positioned far right visible , test expect(mainpage.abutton.isdisplayed()).tobetruthy(); succeed. when displaying browser width value close 1050 maximum: browser.driver.manage().window().getsize().then(function(size) { console.log('browser size', size); }); displays: browser size { height: 748, width: 1050, class: 'org.openqa.selenium.dimension', hcode: 436207616 } when using 2 docker images run tests against fail because button not visible. when running test on browser not inside docker/xvfb there no problem. https://registry.hub.docker.com/u/caltha/protractor/ modified settings of xvfb config linking local version (and log folders debugging..) mkdir -p /tmp/docker/protractor/supervisor docker run --rm \ --name run_protractor \ -v /tmp/docker/protractor:/var/log \ -v /tmp/testproject:/project \ -v

mysql - How to exploding a Bengali text using PHP to saving all content to Database? -

i have file (.txt) full of content , contains bengali , arabic, want split (explode) contents of file insert database. i did before english , persian, don't know why php doesn't know bengali. some text of file: ১। গৃহ যুদ্ধের সময় উষ্ট্র শাবকের মতো হয়ে যেয়ো, যার পিঠ এমন শক্ত নয় যাতে চড়া যায় অথবা বাট এমন নয় যা দোহন করা যায়। 1- قَالَ (عليه‏السلام) : كُنْ فِي الْفِتْنَةِ كَابْنِ اللَّبُونِ لَا ظَهْرٌ فَيُرْكَبَ وَ لَا ضَرْعٌ فَيُحْلَبَ ২। যে লোভে অভ্যস্ত হয়ে পড়ে সে নিজেকে অবমূল্যায়ন করে, যে নিজের অভাব অনটনের কথা প্রকাশ করে সে নিজকে অবমানিত করে, আর যার জিহবা আত্মাকে পরাভূত করে তার আত্মা দুষিত হয়ে পড়ে। 2- وَ قَالَ (عليه‏السلام) : أَزْرَى بِنَفْسِهِ مَنِ اسْتَشْعَرَ الطَّمَعَ.وَ رَضِيَ بِالذُّلِّ مَنْ كَشَفَ عَنْ ضُرِّهِ. وَ هَانَتْ عَلَيْهِ نَفْسُهُ مَنْ أَمَّرَ عَلَيْهَا لِسَانَهُ. ৩। কৃপণতা লজ্জা এবং কাপুরুষতা ত্রুটি। আর দারিদ্র একজন বুদ্ধিমান লোককেও তার নিজের বেলায় যুক্তি প্রদর্শন করতে ব্যর্থ করে এবং দুঃস্থ ব্যক্তি তার নিজের শহর

multithreading - How to send signal from Singleton thread to another thread (Not singleton) -

i'm facing problem while creating singleton class it's own thread sends signal thread not singleton class. consumer.h class consumer : public qthread { q_object public: explicit consumer(qobject *parent = 0); consumer(worker *worker); signals: void tomessage(const bool& keepcycle); public slots: void getmessage(const qstring& str); private: int m_counter; }; consumer.cpp consumer::consumer(qobject *parent) : qthread(parent) { m_counter = 0; connect(worker::instance(), signal(sendmessage(qstring)), this, slot(getmessage(qstring))); connect(this, signal(tomessage(bool)), worker::instance(), slot(frommessage(bool))); } // get's message singleton thread if counter > 5 sends signal terminate cycle in singleton thread void consumer::getmessage(const qstring &str) { m_counter++; if(m_counter <= 5) { qdebug() << "got message " << m_counter << ": " <<

wolfram mathematica - Passing a java function as a parameter -

i'm using wolfram mathematica 9.0 in java application. problem need generate long expression (something 1.2 * (x-1) + 1.25 * (x-1.5) + ...etc.) function , takes long time build stringbuilder. there ways pass java function without converting wolfram expression? upd this function talking about. builds wolfram function exxpression. usually, arr length more 100000. public static string buildcdfexpressionforwolfram(double [] arr){ stringbuilder strbuilder = new stringbuilder(); int n = arr.length; strbuilder.append("("); for(int = 0; < n; i++){ strbuilder.append("heavisidetheta[x"); if(arr[i] > 0) { strbuilder.append("-"); strbuilder.append(arr[i]); } else if(arr[i] < 0){ strbuilder.append("+"); strbuilder.append(-arr[i]); } strbuilder.append("]"); if(i != n - 1){ strbuilder.append("

php - Yii add one more select to CDbCriteria -

i'm relatively new yii. i fell confident raw sql still bit lost when comes orm. may dummy question. i've retrieved necessary records building such cdbcriteria : $criteria = new cdbcriteria(array( 'select' => 'sum(items) items', // 'condition' => 't.items > 0 , order.storage = "'product::storage_local . '"', 'condition' => 't.items > 0 , order.storage = "' . product::storage_local . '"', 'order' => 'sum(items) desc', 'with' => array( 'product' => array( 'select' => 'code, title, producer, local_rest', **// 'select' => 'code, title, producer, sum(local_rest) local_rest',** 'group' => 'product.code', ) ), 'join' => 'inner join `order` `order` on `t`.`order_id` = `order`.`id`', // 'group' => 

xml - How to Fix the table footer at bottom of the Page in XSL FO? -

Image
i'm working xsl-fo (processed using apache fop). my xsl code tables looks this: <!-- ... xsl fo code data occupying 1/2 page ... --> <fo:table> <fo:table-header> item name </fo:table-header> <fo:table-footer> total: <xsl:value-of select="total" /> </fo:table-footer> <fo:table-body> <fo:table-row> <xsl:value-of select="itemname" /> </fo:table-row> </fo:table-body> </fo:table> i want have table footer @ bottom of every page (i tried using fo:table-footer ). i want footnote on pages following first one: if content requires more single page need footnote "continuation of previous page" after table footer. the table footer must show total value on last page (i mean if i've 6 pages of table content every page except last must have footer total value blank , last page footer value). xml source: &l

git - How to download the flat file from GitHub? -

i'm trying download flat text file github local path. wget http://github..../exercise/tree/master/..txt after running command see file downloaded html tags. how file content alone downloaded git path? well thats pretty easy. use link format: https://raw.githubusercontent.com/<username>/<repo>/<branch>/folder/filename.c edit: thx comment

Bootstrap Dropdown menu selected item not loading -

linked bootstrap.min.css, bootstrap-theme.min.css, jquery.min.js", bootstrap.js,dropdown.js http://jsfiddle.net/id10922606/54edxsmv/1/ <script type="text/javascript"> $(document).ready(function(){ $('.dropdown-toggle').dropdown() }); </script> <div class="btn-group"> <button type="button" class="btn btn-danger">action</button> <button type="button" class="btn btn-danger dropdown-toggle" data- toggle="dropdown" aria-expanded="false"> <span class="caret"></span> <span class="sr-only">toggle dropdown</span> </button> <ul class="dropdown-menu" role="menu"> <li><a href="#">another action</a></li> <li><a href="#">something else here</a></li> <li class="divider"></

pipe - piping a cat command to c++ code multiple times -

if want read file multiple times command ./run in.txt , there straight way... 0- ofstream fin; 1- while (fin >> i) {...} 2- fin.clear(); fin.seekg(0); 3- while (fin >> i) {...} however, want pipe zipped input file program. command is bzcat file.bz2 | ./run and in code, instead of ofstream fin , have use std::cin . while (std::cin >> i) {...} the loop terminates when bzcat sends last line program. now... question is, how can go start position , tell bzcat please send lines 1 more time (form first end) , catch them std::cin ?! the pipe contents consumed read, need retain values in memory if need multipass algorithm, can uncompress , run on file or else can split program multiple stages , run them 1 after other: // 1 std::vector<int> data; std::copy(std::istream_iterator<int>(std::cin), std::istream_iterator<int>(), std::back_inserter(data)); // operate on data #2 $ bunzip2 file.bz2 && ./run file.b

javascript - How to implement webRTC in firefox? -

this code works in google chrome fine , tried convert support firefox , no error in console . cam seems ruining there's no video. here's script var socket = new websocket('ws://127.0.0.1:1338/'); // change ip address websocket server var stunserver = "stun.l.google.com:19302"; var sourcevid = document.getelementbyid('sourcevid'); var remotevid = document.getelementbyid('remotevid'); var localstream = null; var remotestream; var peerconn = null; var started = false; var isrtcpeerconnection = true; var mediaconstraints = {mandatory: { offertoreceiveaudio:true, offertoreceivevideo:true }}; var logg = function(s) { console.log(s); }; // send message websocket server function sendmessage(message) { var mymsg = json.stringify(message); logg("send: " + mymsg); socket.send(mymsg); } function createpeerconnection() { try {

Scala reflection to instantiate scala.slick.lifted.TableQuery -

i have base trait trait mybase { type m type t <: table[m] val query: tablequery[t] } where tablequery scala.slick.lifted.tablequery my subclasses instantiate tablequery so: type m = account type t = accountstable val query = tablequery[t] i'd instantiate tablequery in base trait, possibly using lazy val , i.e. lazy val query: tablequery[t] = { ... } i've been playing around reflection, haven't had luck. if understand correctly, want able extend mybase defining m , t without having explicitly instantiate tablequery in each derived class. using reflection not option because use tablequery.apply (as in val query = tablequery[mytable] ), , implemented through macro, you've got "runtime vs compile-time" issue. if absolutely need mybase trait (as opposed class), don't see viable solution. if can turn mybase class and turn m , t type parameters (instead of abstract types), there @ least 1 solution. hinted