Posts

Showing posts from February, 2010

javascript - hide child element with dynamic bootstrap table -

i'm using dynamic table example found here (bootply). table parent, child relationship, can click on row , drop down row. added 1 more level example, can think of example parent, child, grandchild relationship. issue if go 2 levels deep, , click parent row hides child row, not grandchild rows. need fix 'bug' somehow.. i've tried wrapping parent row in div , using href="#collapse1" , putting id on grandchild row doesn't work. other suggestions appreciated. here's html.. <table class="table table-responsive table-hover"> <thead> <tr><th>column</th><th>column</th><th>column</th><th>column</th></tr> </thead> <tbody> <tr class="clickable" data-toggle="collapse" id="row1" data-target=".row1"> <td><i class="glyphicon glyphicon-plus"></i></td>

c# - How to get the hex color code from a color dialog in visual studio? -

this question has answer here: convert system.drawing.color rgb , hex value 6 answers i have color dialog in visual studio, using c# code display color dialog , set color panel: private void colorbutton_click(object sender, eventargs e) { if (colordialog1.showdialog() == dialogresult.ok) { colorpanel.backcolor = colordialog1.color; } } how set label hexadecimal color code of color picker? you can try this get argb (alpha, red, green, blue) representation color filter out alpha channel: & 0x00ffffff format out value hexadecimal ( "x6" ) implementation string code = (colordialog1.color.toargb() & 0x00ffffff).tostring("x6");

java - Find files of given name quickly -

in java 7 program, need find files in network directory have given name (say: "build.xml"). there quicker way using fileutils.listfiles ? in pure java, using java libraries enumerate files in directory fastest way. you might consider creating index of files backed hashmap , can lookup files name more quickly, , refresh hashmap when necessary.

user interface - Calender Event UI android -

i can create event this: public void mindencalendar(){ contentresolver cr = getactivity().getcontentresolver(); calendar calendarevent = calendar.getinstance(); long idk[] = new long[szam]; idk[szam-1] = cu.addeventtocalender(cr,"a","b","c",5,calendarevent.gettimeinmillis()); szam++; } ... public class calendarutils{ context context; final int idf = 12; public static long addeventtocalender(contentresolver cr, string title, string addinfo, string place, int status, long startdate) { string eventuristr = "content://com.android.calendar/" + "events"; contentvalues event = new contentvalues(); event.put("calendar_id", 1); event.put("title", title); event.put("description", addinfo); event.put("eventlocation", place); event.put("eventtimezone", &q

ios - Check NSString is encoded or not -

how detect nsstring encoded or not.? i'm encoding string below. before encoding want verify weather [product url] encoded or not. nsstring *encodedurlstring=[[product url] stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; you try decoding string , see if original string , decoded string same or not. if same wasn't encoded yet. nsstring *original = product.url; nsstring *decoded = [original stringbyreplacingpercentescapesusingencoding:nsutf8encoding]; if ([original isequaltostring:decoded]) { // url not encoded yet nsstring *encodedurlstring=[[product url] stringbyaddingpercentescapesusingencoding:nsutf8stringencoding]; } else { // url encoded } btw - these methods deprecated of ios 9 if app's deployment target ios 9.0 or later should use newer methods. for ios 9 or later should use: nsstring *original = product.url; nsstring *decoded = [original stringbyremovingpercentencoding]; if ([original isequaltostring:decoded]) {

excel vba - Turn 3 listboxes into 1 3-column listbox? -

the following code searches column a(sorted) item# , each time finds it, corresponding b, c & d column entered 3 listboxes. use 3-column listbox. help? private sub cmdsearch_click() dim response long dim notfound integer dim arr variant dim long dim str1 string, str2 string, str3 string notfound = 0 activeworkbook.sheets("items").activate response = val("0" & replace(txtitemnumber.text, "-", "")) if response <> false activesheet arr = .range("a2:d" & .cells(.rows.count, "a").end(xlup).row) end = 1 ubound(arr) if arr(i, 1) = response str1 = iif(str1 = "", arr(i, 2), str1 & "|" & arr(i, 2)) str2 = iif(str2 = "", arr(i, 3), str2 & "|" & arr(i, 3)) str3 = iif(str3 = "", arr(i, 4), str3 & "|"

java - Hashmap to query -

i working on html5+js api based website, can apk java sources api, because there no documentation. i got api raw urls looking like: http://api-test.com/?key=value but can trace wireshark apk never called raw urls directly , using rest api url looking this: http://api-test.com/rest/?key=value the problem is, can't understand params sents via rest api, because rest api urls somehow hashed keys , values in this: http://api-test.com/rest/?s=cf9489a2823b900ec1119fa1847669ab9fab1c2b&d=v2rc84aukmgdahuztpsmyma4&t=1467399404811 http://api-test.com/rest/?s=280f8a9454775de6a14d2b53da9088eb028bfe1a&d=v2rc84aukmgdahuztpsmyma4&t=1467399374801 http://api-test.com/rest/?s=a395b00e56db6679c8aaf869d95aa1d1ccfb424c&d=v2rc84aukmgdahuztpsmyma4&t=1467399344791 because not familar java @ all, possible somehow convert hashed data query? this part java source code, think relating apis: public picsearchresult picsearch(string isc, string q, string ci

performance - Is there a way to create a Tableau session via Python which will open a workbook and refresh extracts, then publish workbook to the server? -

i looking everywhere , not having luck. using python 2.7 , tableau 9.0. if you(reader) know of other viable options, i'm open anything, more proficient python. can please give me direction can found? or if possible? thank you, phil hi phill can use tabcmd achive functionality. here list of commands: http://onlinehelp.tableau.com/current/server/en-us/tabcmd_cmd.htm 1) tableau login tabcmd login -s https://<yourservername> -u <yourusername> -p <yourpassword> 2)refresh tabcmd refreshextracts --url "<workbook_name>" 3)to local copy: tabcmd https://<yourservername>/workbooks/workbook_name?format=twb&errfmt=html" -f "<new_name.twbx>" 4)publish tabcmd publish "<localpath>" -n "<new_name>" it worked me. let me know if helped too.

excel vba - VBA_Using UsedRange.Count but failed -

this question has answer here: error in finding last used cell in vba 10 answers i met little problem when use: count_line = activesheet.usedrange.rows.count count how many lines have in worksheet. can not give me correct number. can influenced format of cells? cause i've different coulour highlight important columns. if you've got sime idea, please leave comment. thank you! usedrange.rows.count not reliable way pull last row, doesn't account empty rows @ start of sheet. assuming finding last row text in it, use end method find row.

android - How to apply a Theme, which could be changed in runtime, to the UI? -

users of app have possibility change theme of application. can check in play store: https://play.google.com/store/apps/details?id=at.guger.musixs until now, every activities onapplythemeresource -method overridden. this costly, cannot done in 1 way, because every activity has own peculiarities, e.g. 1 has no actionbar. there 1 other problem. these styles not applied alertdialogs, can see if check app! so there better way apply styles? saw module called appthemeengine , able around themes, 1 requires superuser-permissions, it's useless normal costumers. @override protected void onapplythemeresource(resources.theme theme, int resid, boolean first) { super.onapplythemeresource(theme, resid, first); mpreferences = preferencemanager.getdefaultsharedpreferences(getapplicationcontext()); int ithemeid = r.style.noactionbarthemeblue; string sprefblue = getresources().getstring(r.string.pref_color_blue); string sprefgray = getresources().getstring(r.strin

javascript - Span element height issue -

Image
i trying customize file input control. did <div class="ui-select form-input" style="display:inline-block; margin-right:5px; margin-bottom:-8px;width:400px;"> <span class="input-group-btn"> <label class="btn btn-info btn-file" for="multiple_input_group"> <div class="input required"> <input id="multiple_input_group" type="file" multiple name="files" ng-files="getthefiles($files)"> </div> browse </label> </span> <span class="file-input-label" ng-model="filename"></span> </div> this <span class="file-input-label" ng-model="filename"></span> displays file name upon selection . expands height , ui gets out of proportions if file name large enough i tried giving width did not work . .file-inpu

hadoop - Spark submit, spark shell or pyspark not taking default environment values -

i have installed hadoop , spark on google cloud using click deploy. trying run spark shell , spark submit test installation. when try spark-shell --master yarn-client i error caused by: org.apache.hadoop.yarn.exceptions.invalidresourcerequestexception: invalid resource request, requested memory < 0, or requested memory > max configured, requestedmemory=6383, maxmemory=5999 the problem when don't provide --executor-memory 1g or value , doesn't pick default 1g value , don't know why yarn allocates max memory executor. commands arguments , without arguments pyspark --master yarn-client --executor-memory 1g --num-executors 1 --verbose parsed arguments: master yarn-client deploymode null executormemory 1g numexecutors 1 pyspark --master yarn --verbose parsed arguments: master yarn deploymode null executormemory null numexecutors

c# - How to reach button objects which were created in ItemsControl -

i made buttons in uwp this: <itemscontrol x:name="tstack" grid.row="1"> <itemscontrol.itemspanel> <itemspaneltemplate x:name="ipt"> <stackpanel x:name="tstack1" orientation="horizontal"/> </itemspaneltemplate> </itemscontrol.itemspanel> <itemscontrol.itemtemplate> <datatemplate> <button height="64" width="64" tooltipservice.tooltip="{binding name}" click="button_click" tag="{binding appuri}" background="{binding color}" > <stackpanel> <image source="{binding iconuri}"></image> </stackpanel> </button> </datatemplate> </itemscontrol.itemtemplate> </itemscontrol>

javascript - Select an Option in ng-options Not working with jQuery -

i trying select option in ng-options using jquery based on options label being generated based upon text in variable. $scope.storedday = 'today'; <select id="selectedday" name="selectedday" class="form-control" ng-model="selectedday" ng-options="day.text day in days"></select> $('#selectedday option[label="' + $scope.storedday + '"]').prop('selected', true); generated html <select id="selectedday" name="selectedday" class="form-control ng-pristine ng-untouched ng-valid" ng-model="selectedday" ng-options="day.text day in days" tabindex="0" aria-invalid="false"> <option value="?" selected="selected"></option> <option value="object:35" label="today">today</option> <option value="object:36" label="tomorrow">tomor

php - Laravel custom controller method calling -

i need basic help, new laravel. situation i have controller articlescontroller has index method lists articles , it's working fine. route below, allows me show individual articles 'id' articles/id example articles/35 . need show articles category "swimming" . when hit articles/swimming id=swimming. don't know how make custom route list articles "swimming" category. have made method "swimming" inside controller need route? route::bind('articles', function($value, $route) { return $list = app\article::whereid($value)->first(); }); you can create/use 2 separate routes, 1 articles id , articles category , example, routes declared like: route::get('articles', 'articlecontroller@index'); route::get('articles/{id}', 'articlecontroller@getbyid')->where('id', '[0-9]+'); route::get('articles/{category}', 'articlecontroller@getbycategory'

tfs - How to order rules in work item field -

is there way apply rules in specific order? i want offer yesno if 2 specific values selected field... rules in xml this: <when field="xxx.yyy.foundinversion" value="xxx"> <allowexistingvalue /> <allowedvalues not="[project]\xxx" expanditems="true"> <listitem value="no" /> <listitem value="yes" /> </allowedvalues> </when> <when field="xxx.yyy.foundinversion" value="yyy"> <allowexistingvalue /> <allowedvalues not="[project]\xxx" expanditems="true"> <listitem value="no" /> <listitem value="yes" /> </allowedvalues> </when> <allowedvalues not="[project]\migrationaccounts" expanditems="true"> <listitem value="no" /> </allowedvalues> this works. if either of both whens cor

count every element of a data Frame in R -

i'm looking way count each element of data frame, data frame big, 29 columns , na's. i tried table(mydata) i'm still getting error error in table(mydata) : attempt make table >= 2^31 elements how count each element in data frame? need like item frequency 3 3 45 4 24 1 6 5 given know little data, try doing whatever doing first few rows. e.g. testdata <- head(mydata, 10) you'll see more how might have abused 'table' function.

ios - Dynamic height with UITableViewAutomaticDimension -

Image
i have problem. i'm trying implement dynamic cel l height in annex, when have nothing. normally, in cell have 1 uiimageview , 3 uilabel . task implement dynamic height of text without changing picture size. picture comes server , scaled inside cell mod scale fill. text not change height in cell . self.tableview.estimatedrowheight = 415.0f; self.tableview.rowheight = uitableviewautomaticdimension; i found numberoflines = 0; the problem picture stretched server, should not text of size not change. the problem have not placed limiting constraints on image view's size. therefore adopts size of image.

sql - Remove subsequent duplicate string in a column of table -

Image
i have table named event id event_sequnce 1 a->c->b->b->b->c->b 2 d->d->a->d->c->a->a->c i want remove subsequent duplicate letter column event_sequnce so output table be id event_sequnce 1 a->c->b->c->b 2 d->a->d->c->a->c how write query achieve this? you have use regex it: select regexp_replace('d->d->a->d->c->a->a->c', '(\w\-\>)\1+', '\1', 'g'); update version select regexp_replace(regexp_replace(textcat('d->d->a->d->c->a->a->c->c', '->'), '(\w\-\>)\1+', '\1', 'g'), '\-\>$', '');

javascript - How do I get a canvas to attach to paperclip so I can save it into my database? -

i have little demo of of camera app: https://shielded-plains-5586.herokuapp.com/ when press "drop', creates canvas after take picture webcam below it. problem don't know how canvas image , have save database through form paperclip on it. i'm stumped. help? use canvas.todataurl() , return image data uri. post server need write file , save path in database. https://developer.mozilla.org/en-us/docs/web/api/canvasrenderingcontext2d/getimagedata

Angularjs HTML5 mode on doesnt work even after rewriting URLs on server side -

in angularjs application '#' present in url. set html5 mode app true , made necessary changes on application code urls. pfb code that. app.config(function($locationprovider){ $locationprovider.html5mode({ enabled: true, requirebase: false }); }); now per this link made necessary changes in configuration file. changes follows: options followsymlinks rewritebase / rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule ^(.*)$ /$1 [l] the problem: the application still won't work , still doesn't refresh url i.e. still 404: page not found error. please me regarding this. well, setting requirebase: true , inserting <base href="/"> (or ever else, depending on env) in header, , using settings rewriteengine on rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] # rewrite else index.html allow html5 state links rewriterule ^ ind

java - Where do I run AI logic in MVC app.? -

i need make swing application school project let 2 ai play against each others on kind of snake game. i used mvc design pattern , created class need basics test i'm not sure should run code makes ai plays. the class of jpanel want run game : public class gamepanel extends jpanel { public gamepanel (jframe frame) { ... } public paintcomponent (graphics g) { ... // draw grid represent game } } i tried put code makes ai plays in constructor wasn't working because need call paintcomponent() method each time ai play (to refresh grid represent game) , can't call because getgraphics() gives me 'null' (i can't call paintcomponent() without instance of graphics ). where supposed place code make ai play? i've never used swing before think i'm missing obvious, i'm kinda lost... i hope of make sense, english not mother tongue , have troubles explain issue. hope understand meant , can me!

AWS API Gateway with EC2 Api backend -

im trying use , ec2 api backend , not exposing public. want put api gayeway on top of it. options have? proxy option in api gateway? if it's how can protect api backend? if use client side certs doesn't protect me against dos attacks , stuff. im hoping there better way this. unfortunately client side certs option available @ current time. vpc support on our roadmap, can't commit time table when available.

javafx - How can I find out the relative position of the vertical scroll bar in a Java FX TextArea? -

java fx, textarea within scrollpane within borderpane's center area. how can find out current position of vertical scroll bar? in fact want know is, if scroll bar thumb @ bottom of scroll bar, or not. whenever look, scrollpane.getvvalue() returns 0.0, no matter scrollbar thumb is. any bright idea? thx keksi

synthesis - synthesizable FF in Verilog with active low reset -

i synthesize ff positive edge clock , active low reset. wrote following verilog code: module dff_rstl (q,qn,clk,d, clearl); input clk,d, clearl ; output q,qn; reg q; @(posedge clk or negedge clearl) //asynchronous reset begin if (clearl) begin q <= d; end else begin q <= 1'b0; end end assign qn=~q; endmodule but following error during synthesis: cannot test variable 'clearl' because not in event expression or wrong polarity. (elab-300) * presto compilation terminated 1 errors. * do know can make synthesizable? lot!!! the testing logic should ~clearl , first line/condition reset block . module dff_rstl (q,qn,clk,d, clearl); input clk,d, clearl ; output q,qn; reg q; @(posedge clk or negedge clearl) //asynchronous reset begin if (~clearl) begin q <= 1'b0; end else begin q <= d; end end assign qn=~q; endmodule

javascript - radio button in android - crashes if none selected -

i use code below in android app check selected radio button in radio group, work crashes if none of radio buttons selected. how wrap in if statement prevent app crashing? checkradiobuttonid = genderrd.getcheckedradiobuttonid();// selected radio button radiogroup checkedrbvalue = (radiobutton) findviewbyid(checkradiobuttonid); // find radio button returned id radiobuttontext = checkedrbvalue.gettext().tostring(); thanks. sorry i'm unable compile right try: if(checkrbvalue != null){ //enter code here. } hope helps. :)

Basic Activity Template in Android Studio without menu -

when create new project basic activity template, have menu in resources , methods in activity class. if create second activity same template basic activity, don't have menu in resources , methods in activity's class. why? how create new activity menu automatically? if right click while in file tree can select new activity, , select basic activity. should make new activity toolbar , fab.

Flex: Number input with buttons -

i'm trying use buttons text input, far can make input 1 number. (if click button second input, erases first input.) there way fix this? i added code here , image show i'm trying make. i'd appreciate help! <mx:button x="18" y="116" label="1" width="20" height="20" fontsize="7" click="one(event)"/> <mx:button x="37" y="116" label="2" width="20" height="20" fontsize="7" click="two(event)"/> <mx:button x="56" y="116" label="3" width="20" height="20" fontsize="7" click="three(event)"/> <mx:button x="18" y="135" label="4" width="20" height="20" fontsize="7" click="four(event)"/> <mx:button x="37" y="135" label="5" width="20&quo

gcc - jni call involving open cobol dlls -

i trying invoke existing cobol application using jni. cobol application structure follows. c-wrapper(main)-->cobolprogram -> several dyn(.so) , static called modules the existing cobol application involves several statically called subprograms(cobol) , many dynamic(cobol) ones. jni invocation of application ok, not locate , invoke cobol dynamic sub modules. modified application structure (for jni) follows: java class --> libjni.so --> appl.so i verified cob_library_path , ld_library_path environment variables before call, seems fine. following error message got in case dynamic modules. libcob: ....<module>.so: undefined symbol: cob_save_call_params i use 64 bit , 1.1.0 on linux. gcc used create binary using c output of cobc command this issue can resolved specifying -lcob linkage option(when using gcc). gcc command used create binary contained option, mistakenly placed in between target , source file, not in effect. execution of dll

MySQL query select rows from table according to specific key that is not in another table -

how select exams id , title (from table 'exams'), student (in table 'grades') hasn't written yet? table: grades +--------------+----+---- |student_number|e_id| ... +--------------+----+---- |888075 |1 | ... |888075 |2 | ... |888075 |4 | ... |637020 |2 | ... +--------------+----+---- table: exams +----+------+ |e_id|title | +----+------+ |1 |exam 1| |2 |exam 2| |3 |exam 3| |4 |exam 4| +----+------+ in particular case expect following output student 888075 : +--+------+ |id|title | +--+------+ |3 |exam 3| +--+------+ i need inverse selection of this: select e.e_id id, e.title title grades g left join exams e on g.e_id = e.e_id g.student_number = '888075' your query close -- reverse joins , check null accordingly: select e.e_id id, e.title title exams e left join grades g on g.e_id = e.e_id , g.student_number = '888075' g.e_id null

postgresql - Need to require a Postgres user on AWS RDS to login with password -

i have new postgres database on rds. have set database publicly accessible can login via ssh. can without supplying password. want force user have login password. all of searches solutions recommend editing .pgpass file don't think applies postgres database on rds. if know how appreciate help aws postgres rds not support password-less login via database parameter group change e.g. turning on trust authentication. if not being prompted password when using psql, must using .pgpass file locally. can confirm temporarily removing file or renaming file , trying connect; should prompted password.

undefined variable on php page using session -

i've tried building secured area using php session(). basic workflow: log in->go checkuser page that: queries database user starts session -> session_start(); , sets session variables goes home member page code on check userpage session_start(); error_reporting(e_all); ini_set('display_errors', 1); include 'dbconnect.php'; $email_address = isset($_post['email_address']) ? $_post['email_address'] : ''; $password = isset($_post['password']) ? $_post['password'] : ''; $passwordmd5 = md5($password); $result = mysqli_query($con, "select * users email_address='$email_address' , password='$passwordmd5' , activated='1'"); $login_check = mysqli_num_rows($result); if($login_check > 0){ while($row = mysqli_fetch_array($result)){ foreach( $row $key => $val ){ $$key = stripslashes( $val ); } $_session['first_name'] = $first_name; }

laravel - Using in_array within elequent call -

i can make following call $usergroups = auth::user()->getgroups(); the above output following array:10 [▼ 0 => "admin" 1 => "teama" 3 => "usa" 4 => "security" 9 => "users" ] so can see member of of above groups. have clients table, , 1 of fields of table team. example client so #attributes: array:11 [▼ "id" => "3" "clientname" => "some client" "contactemail" => "" "team" => "teama" "created_at" => "2016-07-04 15:08:15" "updated_at" => "2016-07-04 15:08:15" ] what trying clients have team part of logged in users groups. can see apart of teama therefor want clients have team value of teama. thinking along lines of this $clients = client::where('team', in_array('teama', $usergroups))->get(); the above returns

jquery - Retrieving Data from a Submitted Form -

i trying submit information through form in separated html file html file wanted retrieve information. how can value submitted data in file2.html using jquery , display them? javascript $(document).ready(function(){ $("#form").submit(function(e){ e.preventdefault(); var dataform = $(this).serialize(); $.ajax ({ type : "post", url : $(this).attr('action'), data : dataform, success: function(data) { alert(data); } }); });//endsubmit });//end ready html <body> <form id="form" action="file2.html"> <input type="text" name="fname" id="fname" value="" /> <input type="text" name="lname" id="lname" value="" /> <input type="subm

Creating agenda view with PHP MySQL - Divide fetched MySQL rows by year and month -

good afternoon everyone. i've got mysql table organized this: | id | date | some_information | +----+------------+----------------------------+ | 1 | 2016-03-02 | note day... | | 2 | 2016-03-22 | note day... | | 3 | 2016-04-05 | note... | i need display data in similiar way google calendar app's agenda view . should: divide fetched rows, ordered date, month; before displaying data corresponding each month (let's march), display <div> heading corresponding month. can please tell me if possible, , how? mysql: select table.id, table.date, table.some_information, month(table.date) m, year(table.date) y table order table.date desc php: $lastym = ''; foreach($result $row) { $ym = $row['y'] . '-' . $row['m']; if($ym != $lastym) { echo '<div class="month">' . $row['m'] . '</div>'; $lastym =

html - Having trouble with my javascript -

i'm trying set part of website when enter information in input , click button, changes text in div. after want submit info form know how , part of should okay. html; <div class="inner"> <div class="mydiv"><input placeholder="exam name" type="text" id="mystring" name="title"></div> <p><input type="radio" id="lc" name="level" value"lc"=""> option 1<br> <input type="radio" name="level" value"jc"="" id="jc"> option 2 </p> <div style="text-align:center;padding-top:10px;"><!--&#091;x_button shape="rounded" size="small" float="none" title="nextbutton" info="none" info_place="top" info_trigger="hover" id="mybuttonyo"&#093;next&#091;/x_button&#093;--> &

android - App crashes when a opening a new item ( fragment) from the navigationDrawer (see code)? -

i trying make app navigationview . navigation view has many options when clicked opens new fragment.i have set home fragment default. app crashing whenever click option navigationview. new android development, please help! my log ava.lang.illegalargumentexception: no view found id 0x7f0c0086 (rishabh.example.com.navigationdrawer:id/home_id) fragment profilefragment{10c46e27 #1 id=0x7f0c0086} @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1059) @ android.support.v4.app.fragmentmanagerimpl.movetostate(fragmentmanager.java:1252) @ android.support.v4.app.backstackrecord.run(backstackrecord.java:742) @ android.support.v4.app.fragmentmanagerimpl.execpendingactions(fragmentmanager.java:1617) @ android.su

security - Firebase: Does the auth.uid stay active across page tabs? -

tools: firebase 2.3.1 problem type : setting security rules user in session authentication method: authwithpassword() i know user logged app in browser. i set rules expectation once user has opened session can access room data in tab on browser. yet if try fetching url below in different tab in same browser.. https://myfirebaseurl.firebaseio.com/rooms.json ..i { "error" : "permission denied" } which weird because url working fine in program in tab open app or if refresh page for instance isn't throwing errors: var firebaseroomsref = new firebase("https://myfirebaseurl.firebaseio.com/rooms")//fetch fine here rules like: { "rules": { "rooms": { ".read": "root.child('users/'+auth.uid).exists()", } } so main question: error happening because i'm trying call url json directly that? or app doing differently giving permission access mes

Python Programming: Need to add spaces between character in a split string -

i have print out every third letter of text spaces between , none @ end. can spaces between each of letters. here have. line = input('message? ') print(line[0]+line[3::3].strip()) to join things spaces, use join() . consider following: >>> line = '0123456789' >>> ' '.join(line[::3]) '0 3 6 9'

ruby - Loop through an array while summing the output -

i trying use for loop , sum of outputs. know basic question, not sure if should trying solve within loop or using array. for example: for in 1..100 if foo / 2 == 0 #find sum of outputs end end try this: (2..100).step(2).inject(:+) #=> 2550 or: 2.step(100,2).inject(:+) #=> 2550

sql server - MS SQL Bulk Insert -

i have requirement insert large 2 gb csv file ms sql database. of rows in not required insert. did not find filter rows while doing bulk insert.i using ms sql bulk insert command this. there option filter rows on mysql/mssql/oracle on bulk insert? bulk insert payroll.t_allowance 'f:\orders\lineitem.csv' ( fieldterminator =' |', rowterminator =' |\n' ); you can use openrowset bulk option: select * openrowset(bulk 'f:\orders\lineitem.csv', formatfile= 'f:\orders\format.xml') ... format.xml file configure delimeters, column names, terminators etc: https://msdn.microsoft.com/en-us/library/ms178129.aspx

ios - TableView Cell Tapped Returning Nil in Segue -

i'm trying pass table view information view controller , getting "fatal error: unexpectedly found nil while unwrapping optional value". here code..... func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { self.resultstableview.deselectrowatindexpath(indexpath, animated: true) dispatch_async(dispatch_get_main_queue()) { () -> void in self.performseguewithidentifier("playersegue", sender: self.resultstableview) } } and... override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if segue.identifier == "playersegue" { let index = resultstableview.indexpathforselectedrow!.row let controller = segue.destinationviewcontroller as! videoviewcontroller controller.vidtitlelbl.text = self.videotitle[index] controller.videoid = self.videoid[index] } } it's not showing information @ indexpath.row. c

android universal image loader out of memory -

i'm loading 50 images. in activity have configuration displayimageoptions defaultoptions = new displayimageoptions.builder() .cacheondisk(true).cacheinmemory(true) .imagescaletype(imagescaletype.exactly) .resetviewbeforeloading(true) .displayer(new fadeinbitmapdisplayer(300)) .build(); imageloaderconfiguration config = new imageloaderconfiguration.builder(getapplicationcontext()) .defaultdisplayimageoptions(defaultoptions) .memorycache(new weakmemorycache()) .diskcachesize(100 * 1024 * 1024) .build(); imageloader.getinstance().init(config); in binderdata imageloader imageloader = imageloader.getinstance(); imageloader.displayimage(uri, holder.iv_img); some images loaded, not , outofmemory error. check tips useful info if got outofmemoryerror in app using universal image loader then: disable caching in memory. if oom still occurs seems ap

python - Pandas: Join dataframes on selected columns -

i have 2 data frames following data set id type msg 1 high lets 2 low whats 3 medium thats data set b id accounttype 2 facebook 3 linkedin how can updated table of join in pandas, should updated dataseta id account type msg 1 high lets 2 facebook low whats 3 linkedin medium thats i can in sql update , inner join, how perform in pandas, tried it, of operations append/ merge. appreciated try this: df4 # id type msg # 0 1 high letsdo # 1 2 low whatsit # 2 3 medium thatsit df3: # id accounttype xxx # 0 2 facebook 24 # 1 3 linkedin 44 df4.merge(df3[['id','accounttype']],how='left').fillna("") # id type msg accounttype # 0 1 high letsdo # 1 2 low whatsit facebook # 2 3 medium thatsit linkedin

web applications - Shiny output and R MarkDown render_site() -

i'm facing issue regarding use of shiny outputs in r markdown document when trying export two-paged site through use of render_site() (rmarkdown package) here's chunk of code create issue (located within knitr or 1 of .rmd documents): uioutput("main") output$main <- renderui({ if(test$n != 0){ plotoutput("mainplot", height = test$n*length(input$yaxes)*400) } }) output$mainplot <- renderplot({do.call("grid.arrange", c(test$plots, ncol = 1))}) when processing, render_site() tells me "output" object not defined. running .rmd file alone works fine; issue appears when trying include website. finally, website created when remove lines above. are output$foo not supported r markdown or missing dumb? thank in advance, regards, paul ps: searched before asking, i've been trying figure out hours ._. have tried putting output-generating code function? server <- function (input, output) { out

php - ActiveMQ with stomp calling function inside a website -

i have website on local host using wamp , php. when enter website sends message mqserver using stomp, since i'm new using activemq i'm stuck on following. want mqserver sends message different website fire off function on website without me having go directly website. have taken @ apache camel jms , don't know either or if can use it.

select - Get multiple data into one colomn Oracle Query -

i have 3 tables: table_a , table_b , table_c . table_a has primary key , referred foreign key table_b . table_c has primary key referred foreign key table_b . design this: table_a: id_a textdata table_b: id_b id_a id_c table c: id_c textdata i want join between 3 tables this: select a.id_a, a.textdata dataa, ( select c.textdata table_b b, table_c c b.id_c = c.id_c , b.id_a = c.id_a ) data_c table_a; i know should error if try compile error like: return more 1 elements . but client want me join data table c 1 row, know using concate every data. don't know how it. never try create function or package on oracle. can me how fix query? the result should like: id_a | dataa | data_c 1 texta text1, text2, text8 2 textb text2, text3, text9 3 textc text1, text8, text9 xmlagg or similar need. (not tested, should give hint): select a.id_a, a.textdata dataa, ( select xmlelement("thedata&qu

python - NoReverseMatch for Dynamic URLs Django Template -

in urls.py have set url editing post slug/edit url(r'^(?p<slug>[\w-]+)/edit/$', post_update, name='update'), when calling href="{% url 'posts:update' %} template, following error: noreversematch @ /posts/this-is-my-title-to-my-awesome-post/ reverse 'update' arguments '()' , keyword arguments '{}' not found. 1 pattern(s) tried: ['posts/(?p<slug>[\\w-]+)/edit/$'] it seems fail inherit slug post instance. (to clear posts:update called within post itself. have tried type out correct full url, reversematch fails find pattern altogether. environment: request method: request url: http://192.168.1.58:8800/posts/this-is-my-title-to-my-awesome-post/ django version: 1.9.7 python version: 3.5.1 installed applications: ['django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.messages', 'django.c