Posts

Showing posts from April, 2013

powershell - npm install sometimes fails in Visual Studio Online -

i had problems vs online , nuget-restore. report couldn't find packages, visual studio 2015 found , installed. specified in nuget's targets file use apiv3 , apiv2. since than, nuget packages found, i'm starting experience different, rather random, errors npm. i've pre-build script (configured in project file) installs necessary npm , bower packages, , afterwards runs gulp. works fine locally, , of times online. every ~4th time on average, exception similar this: eperm, open 'c:\npm\cache\fedb6d47-pm-cache-clone-1-0-2-package-tgz.lock' or this: eperm, open 'c:\npm\cache\ca5822dc-sh-isarguments-3-0-4-package-tgz.lock' i working on gulpfile in beginning, thought of changes caused it, now, i'm not touching project anymore, , compiled fine until got error again. in meanwhile, i've added tiny change commit , push it, , compiles fine again. idea can cause , how can @ least reduce risk of getting error? here pre-build powershell script:...

c# - CRM Dynamics Plugin on Update not Working? -

i have crm dynamics plugin fires on update of boolean change, fails fire when select yes on 2 option control, please find code below , advice may going wrong. namespace webcall.plugin { public class webcalltrigger : iplugin { /// <summary> /// plugin initiate web call crm using marusip api /// </summary> /// <param name="serviceprovider"></param> public void execute(iserviceprovider serviceprovider) { ipluginexecutioncontext context = (ipluginexecutioncontext)serviceprovider.getservice(typeof(ipluginexecutioncontext)); if (context == null) { throw new argumentnullexception("localcontext"); } iorganizationservicefactory servicefactory = (iorganizationservicefactory)serviceprovider.getservice(typeof(iorganizationservicefactory)); iorganizationservice service = servicefactory.createorganizationservice(context.initiatinguserid); if (context....

python - Make template pluggable in Django -

let i'm writting app "profile" ; have following template (in profile/presentation.html): <h1>{{user.first_name}}<h1> <p> user likes {{user.hobby}}</p> which attached view : # profile/views.py class detailuserview(generic.detailview): model = user template_name = 'members/profile_detail.html' # profile/urls.py urlpatterns = ( url(r'^(?p<pk>[0-9]+)$', views.detailpersonview.as_view(), name='profile')) # project/urls.py urlpatterns = ( .., url(r'^profile/', include(profile.urls), ...) now "plug" template in project layout: <!-- project/templates/project/layout.html--> <html> <head> <title>my site</title> </head> <body> <header>the title !!</header> {%block body_block%}{%endblock%} </body> </html> if want keep uncoupled app, can't inherit "presentation.hmtl" "layout.html". how...

.net - TeamCity service message block error in build log -

Image
i use following code in nunit write teamcity's build log. console.writeline("##teamcity[blockopened name='arrange']") console.writeline("##teamcity[teststep name='step 1 : arrange export manager'") console.writeline("##teamcity[teststep name='step 2 : arrange object exported'") console.writeline("##teamcity[teststep name='step 3 : export object exported'") console.writeline("##teamcity[teststep name='step 4 : assert export worked'") console.writeline("##teamcity[teststep name='step 5 : arrange import manager'") console.writeline("##teamcity[blockclosed name='arrange']") and produces following in build log: any idea why there [test error output] message after block name ?

c++ - Passing pointer by reference—cannot change value -

this question has answer here: what differences between pointer variable , reference variable in c++? 30 answers i've read many topics passing pointers function reference, couldn't find answer. problem after pass pointer reference , change value, after leaving function, value of original pointer doesn't change. stuck it. please me! you're hope! btw. code pasted same code need work on, , cannot change calling of function. code: void f(char *p){ char *np = new char(100); np = "aaaaaaaaaaaaaaaaa"; p = np; } and calling of function: void *ptr; f((char *)&ptr); i thankful help! your question unclear, need guess @ question. guess of question cannot change signature nor call of function void f(char* p); ... void *ptr; f((char *)&ptr); and want change body of f, change ptr point literal within body of f. ...

r - How do you create a stacked barplot with X labels and borders grouped by a factor? -

Image
i create stacked barplot structure plot (using program distruct). how can group x labels common factor , display factor once? example, below there 6 individuals 2 populations, , want there 2 labels centered on population groups. also, there way place box around each group? here have: df <- data.frame(a1=c(0.000, 0.000, 0.020, 0.000, 0.000, 0.000), a2=c(0.000, 0.000, 0.235, 0.195, 0.166, 0.205), a3=c(0.065, 0.027, 0.000, 0.027, 0.000, 0.036), a4=c(0.000, 0.000, 0.007, 0.011, 0.000, 0.000), a5=c(0.000, 0.000, 0.000, 0.002, 0.028, 0.000), a6=c(0.000, 0.041, 0.021, 0.068, 0.106, 0.105), a7=c(0.093, 0.085, 0.001, 0.056, 0.110, 0.000), a8=c(0.000, 0.000, 0.000, 0.000, 0.000, 0.029), a9=c(0.000, 0.000, 0.058, 0.027, 0.096, 0.156), a10=c(0.000, 0.023, 0.129, 0.012, 0.074, 0.117), a11=c(0.000, 0.041, 0.000, 0.000, 0.000, 0.000), a12=c(0.024, 0.000, 0.000, 0.000, 0.000, 0.000), a13=c(0.817, 0.783, 0.52...

python - PyUSB does not get response from XBox One Controller -

i trying read xbox 1 controller responses keys. have found idvendor , idproduct using dev = usb.core.find(find_all=true) this controller works fine on ubuntu since use in steam, there no problem of drivers. when device object , try read 0s: dev = usb.core.find(idvendor=xxx, idproduct=xxx) interface = 0 endpoint = dev[0][(0,0)][0] if dev.is_kernel_driver_active(interface) true: dev.detach_kernel_driver(interface) usb.util.claim_interface(dev, interface) collected = 0 attempts = 50 while collected < attempts : try: data = dev.read(endpoint.bendpointaddress,endpoint.wmaxpacketsize) collected += 1 print data array('b', [0, 0, 0, ...] array('b', [0, 0, 0, ...] array('b', [0, 0, 0, ...] etc i tried filter responses 0s have never recieved anything. any help? thanks in advance!

javascript - Call variable from another script in HTML -

i have html file has 1 script declared follows: <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { code....... var = "hello" }); </script> i trying add script within html file call on variable "a". right now, doing this: <script type="text/javascript"> alert(a); </script> but not alerting anything. if replace string "hello", alerted. calling variable wrong? i've tried searching solutions of them should able call variables script assuming script declared , initialized before. thanks. move a declaration outside of function. e.g., var a; $(document).read...

innodb - Why do MySQL foreign key constraint names have to be unique? -

i've noticed can't create 2 different foreign key constraints have same name, regardless of set of tables in schema they're affecting. which can cope that, couldn't find in mysql documentation says case, nor why case. i'm using innodb, maybe it's specific that, i'm not finding documented either.

c# - (webform) how can i get the value from 9 different textbox and post back the value follow by ascending -

this code webform(asp.net c#): protected void button2_click(object sender, eventargs e) { int no1; int no2; int no3; int no4; int no5; int no6; int no7; int no8; int no9; no1 = int.parse(txt1.text); no2 = int.parse(txt2.text); no3 = int.parse(txt3.text); no4 = int.parse(txt4.text); no5 = int.parse(txt5.text); no6 = int.parse(txt6.text); no7 = int.parse(txt7.text); no8 = int.parse(txt8.text); no9 = int.parse(txt9.text); int[] = new int[] {no1,no2,no3,no4,no5,no6,no7,no8,no9 }; array.sort(a); foreach (var str in a) { messagebox.show(str.tostring()); //display in messagebox, want display 9 different textbox. } i can display result in messagebox. can't display result 9 different textbox. how can find solution? thank output http://i.gyazo.com/a91f7ffef1d6d1fa7815890464df3082.png txt1.text = a[0]; txt2.text = a[1]; txt3.text = a[2]; txt4.text = a[3]; txt5...

arrays - C - Relative path with fopen() -

here's question: have relative paths saved in matrix of strings. depending on user choiche, have open file. problem that, when use fopen function, file pointer doesn't point anything. here's sample of code: #include <stdio.h> #include <stdlib.h> #define max_path 100 ///global matrix of strings, containing paths used in fopen() function char paths[max_path][3] = {{"c:\\users\\thispc\\desktop\\file1.txt"}, {"c:\\users\\thispc\\desktop\\file2.txt"}, {"c:\\users\\thispc\\desktop\\file3.txt"}}; int main(){ ///declaring , initializing 3 file pointers null file *filepntr1 = null; file *filepntr2 = null; file *filepntr3 = null; ///opening 3 files correct arrays filepntr1 = fopen(paths[1], "w"); filepntr2 = fopen(paths[2], "w"); filepntr3 = fopen(paths[3], "w"); ///typing on files opened, check if files opened ...

Rails 4: strong parameters and array of scalars must be listed last on permit? -

see people_controller#person_params method code version of question: # person.rb class person < activerecord::base # attributes: # - names (string) # - age (integer) # combine: ["a", "b", "c", ...] => "a,b,c" def names=(values) self[:names] = values.join(",") if values.present? end end # people_controller.rb class peoplecontroller < applicationcontroller def create @record = record.new(person_params) @record.save! end def person_params params.require(:person).permit( # works fine :age, names: [] # works fine { names: [] }, :age # not work (syntaxerror) names: [], :age ) end end the question is, why names scalar array not work when list @ beginning without wrapping hash? the http://edgeguides.rubyonrails.org/action_controller_overview.html#strong-parameters doc examples don't wrap scalar arrays hash, aren't com...

Update child object in ElasticSearch using NEST -

i have elastic search document following structure: { "id": 123, "name": "myname", "skill": { "skillid": 321, "name": "skill name", "description": "skill description" } } i have class maps document: public class person { public int id { get; set; } public string name { get; set; } public skill skill { get; set; } } public class skill{ public int skillid { get; set; } public string name { get; set; } public string description { get; set; } } now want update skill description on elastic search: var person = _client.get(.......) var newskill = new skill(); newskill.skillid = person.skill.skillid; newskill.description = "this new description" var result = _client.update<person, skill>(u => u .idfrom(person) .doc(newskill) .retryonconflict(3) .r...

google spreadsheet - Bills sheet scripts -

i trying create spreadsheet create bills. have done in excel, , want use google sheets, having problems. i tried create function activated each time person clicks specific range i have save sheet specific name (for example value of a1 row + a2 row) , save google drive account i used importrange() import data of google form, if make copy of sheet have give permission display data. (how can without permission?) each of these question on own. however, here's answer questions: 1) i tried create function have activated each time person click specific range use onedit function perform whatever function wishing perform. however, values have changed in order perform function. there's no onclick() fucntion in gas (as mentioned here ). however, here's simple example onedit: function onedit() { var sheet = spreadsheetapp.getactivesheet(); var cell = sheet.getactivecell(); var actrow = cell.getrow(); var actcol = cell.getcolumn(); //assuming want rang...

javascript - Create a function to hide divs -

i want display tables when selection made in form , 'generate factsheet' button clicked. i've got working code individually hide other divs when displaying 1 interested in. since have several options in form (and hence several corresponding divs in respective tables enclosed), final code appears bulky. want write function hide other divs whiles displaying 1 interested in. code have: var tabledivs = ['tableopvdiv','tablepneumodiv','tablerotadiv']; var selectedvaccine; var selectedtablediv; function generatefactsheetfunction(){ // selecting vaccine chosen dropdown var e = document.getelementbyid("selectvaccine"); selectedvaccine = e.options[e.selectedindex].text; console.log("selectedvaccine: ", selectedvaccine); if (selectedvaccine=="rotavirus vaccine"){ selectedtablediv='tablerotadiv'; console.log("rotavirus sel...

javascript - calculate time difference from 24 hr select boxes -

i having trouble jscript function returning nan. have tried parseint on intime , outtime , neither works me. hoping guidance. function diffhours (h1,m1,h2,m2,t) { var intime = ((h1 * 60) + m1); var outtime =((h2 * 60)+ m2); /* converts total in minutes "hh:mm" format */ function totext (m) { var minutes = m % 60; var hours = math.floor(m / 60); minutes = (minutes < 10 ? '0' : '') + minutes; hours = (hours < 10 ? '0' : '') + hours; return hours + ':' + minutes; } h1 = parseint(intime, 10); h2 = parseint(outtime, 10); var diff = h2 - h1; document.getelementbyid(t).value = totext(diff) } i have 4 select boxes in document: hour in, minute in, hour out, minute out execute function onchange , should output readonly input difference in time. edit: here's input <cfset timehour = ['','00','01','02','03...

How to zoom a leaflet map depending on the latitude and longitude -

i want show popup window going show leaflet map. in popup window i'll show path between 2 points. these 2 points 2 [lat,lon] pairs point [lata,lona], point b [latb,lonb]. want set view or or zoom level of map map zoomed focusing distance between point , point b. means map have point @ near of 1 end of map , point b @ near of other end of map. how can it. using following command setview to point , point remains @ middle. here command map.setview([a[0],a[1]],14); so point @ middle point b go outside map. want both , b shown @ map , farthest distance within map. use fitbounds method instead of setview if want focus map area rather point.

How to query array columns in Rails 4? -

i can't find articles how query array columns in rails. came across need query array column in rails. i found article teaching how basic query here . let's follow example in article book covers many subjects , subjects stored array column: add_column :books, :subjects, :text, array: true, default: [] query books contains subject - e.g. history book.where("'history' = (subjects)") query books contains listed subjects - e.g. finance , business , accounting book.where("subjects @> ?", "{finance,business,accounting}") i wonder how can following? query books contains of listed subjects - e.g. fiction or biography query books doesn't contain subject - e.g. not physics query books doesn't contain of subjects - e.g. not (physics or chemistry or biology) and there rails way of doing above queries? don't store arrays in db. ever. there better solution ( associations )...

asp.net mvc - How to render the Dictionary values in the table in MVC -

i have dictionary containing values it. want render values using table have 1 table coming other model.this model containing dictionary want populate dictionary values table. public class unpaidchargesbystockrequestvm { public int? salvageid { get; set; } public string culture_code { get; set; } public list<unpaidchargesbystockresponsevm> getresuestmodel; } public class unpaidchargesbystockresponsevm { public int? buyer_id { get; set; } public int? stockno { get; set; } public dictionary<string, decimal?> salvagebuyerfees { get; set; } } this salvagebuyerfees having values it.i want display on view. view @model buyerpaymentmockui.web.models.unpaidchargesbystockrequestvm <table class="table-bordered"> <thead> <tr> <th>buyer_id</th> <th>stockno </th> </tr> </thead> ...

jquery - Export to Pdf and Export to Image for Kendo Charts not working in IE9/Safari -

// using chart id export pdf kendo charts , it's working fine // on chrome , firefox it's not working ie9 , safari // button click export pdf <button class="k-button export-button bar-control" id="export-pdf-button-onedimension" data-toggle="tooltip" data-placement="bottom" title="export pdf" onclick="exportcharttopdf('chart1');"></button> // function passing chartid exporting pdf function exportcharttopdf(chartid) { $("#" + chartid).getkendochart().exportpdf({ papersize: "auto", margin: { left: "1cm", top: "1cm", right: "1cm", bottom: "1cm" } }).done(function (data) { kendo.saveas({ datauri: data, filename: "chart.pdf" }); }); }

javascript - Play video using YouTube Iframe API after ajax call in mobile -

i building application user enter text , click button. based on text service call , fetch youtube video. using youtube iframe api, , after fetch data server load , play video. the thing doesn't work on mobile device, because mobile devices allow me play video javascript if in callback user input, since need fetch data server first, can't play video user click callback, need on ajax call callback. do knows workaround on that? edit: make more clear give example. not actual code illustrates issue //playv button on screen $("#playv").click(function(){ /*this function works on mobile without issues since callback user input*/ player.playvideo(); $.getjson("http://api.openweathermap.org/data/2.5/weather?id=2172797", function(data){ /*this function doesn't work here since callback of ajax call , not user input */ /*i want make works somehow*/ player.playvideo(); }) });

Login Multiuser with Java EE -

my friend , creating webapp using java ee (knowing it's our first experience java ee) have different users our webapp , set login in way home page user log in depend on role we're stack here. every appreciated. i think have issue database design. user : id (pk) user_name password user_type_id(fk) .... user_type : id(pk) role so, of kind of design, have common login page every user , depend on user_type can redirect dashboard per role.

c++ - My C program is crashing when I call a method from a class instance here is the code -

here class using. #include<stdio.h> #include <string.h> class ende{ private: int *k; char *temp; public: char * encryptstring(char *str); char * decryptstring(char *str); ende(int *key);}; ende::ende(int *key){ k=key; } char * ende::encryptstring(char *str){ int t=2; t=(int)k[1]*(int)2; (int i=0;i<strlen(str);i++){ temp[i]=str[i]+k[0]-k[2]+2-k[1]+k[3]+t; } char alp=k[0]*57; (int y=strlen(str);y<strlen(str)+9;y++){ //--* temp[y]=alp+y; //--* } temp[(strlen(str)+9)]='\0'; //--* return temp; } char * ende::decryptstring(char *str){ int t=2; t=k[1]*2; (int i=0;i<strlen(str);i++){ temp[i]=str[i]-t-k[3]+k[1]-2+k[2]-k[0]; } temp[(strlen(str)-9)]='\0'; return temp; } and here main program. #include <stdio.h> #include "e...

How to make abstract Python class from string? -

i'm working on module saved users' data onto parse.com cloud. using parse.py library, need this: class cat: pass cat = cat() cat.name = 'alice' cat.save() where cat name of table in cloud. possible somehow create class dynamically string not having anywhere else before? here suggested, there's module pre-defined class. here eval used on pre-defined class. so, it possible create class dynamicallly in runtime string? like: save_data('alice','myclass') def upload(cat_name, class_name): class_name.name = cat_name class_name.save()

How to set the width of R console in terminal evoked from vim? -

Image
i installed vim-r-plugin on linux computer. below r console prompted "\rf", seems narrow show columns of data though terminal window has been wide enough. wondering how make wider r console. install package setwidth , put library(setwidth) in ~/.rprofile . width of r console adjusts width of terminal (it same width output of tput cols ). if want custom width, can options(width = 120) , example.

PHP SQL query to print results in webpage -

i trying php script print rows have in database in neat order. im not getting anything. table has 4 columns, name, address, long , lat, , 2 rows data. table called locations. using following code im not getting to work: <?php $con=mysqli_connect("localhost","user","pass","db"); if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $sql = "select * `locations` "; if ($result = mysqli_query($con, $sql)) { $resultarray = array(); $temparray = array(); while($row = $result->fetch_object()) { $temparray = $row; array_push($resultarray, $temparray); } echo json_encode($resultarray); } // close connections mysqli_close($con); ?> here simple example using pdo instead of mysqli $dbhost = 'localhost'; $dbname = 'nilssoderstrom_'; $dbuser = 'nilssoderstrom_'; $dbpass = 'durandal82!'; $pdo = new pdo('my...

mysql - Counting the same column on the same table under different alias? -

i've 2 tables (well, 3, 1 user table id, name, email etc.. that's bog standard). table 1: questions: id (auto inc) user_id (int) question (text) parent (int) table 2: map_user_question_vote: question_id (int) user_id (int) vote (int) it's question , various anwsers site. so user posts question , parent set 0 when user posts reply, goes same table, parent field has id of parent question. every user presented vote button on questions , comments. (no downvoting or undoing). what need comment, find out vote total , parent questions vote total too, single user this have far: select questions.id , questions.question , coalesce(sum(qv.vote), 0) question_vote_score , coalesce(sum(cv.vote), 0) comment_vote_score , parent.id parentid , parent.title parentquestion `questions` join `questions` `parent` on `questions`.`parent` = `parent`.`id` join `map_user_question_vote` `cv` on `cv`.`question_id` = `questions`.`id` join `map_user_question_vote` `...

Android - Multiple GridViews in a ListView -

Image
i know there questions similar found no solution it. i'm trying create list of gridviews . this: what have this: item_cell.xml <-- layout each item in grid layout_grid.xml <-- layout of grid list_view.xml <-- layout of list included layout of activity . so thinking inflate item_cell layout_grid.xml inflate after list_view . kind of idea possible? havent tried though because i'm not sure of how approach it. one thing, there library kind of approach? any idea appreciated. as additional question, gridview calendar days of calendar on first column , rest of columns schedule. b c d mon data1 data2 data3 tues data1 data2 wed data1 data2 thurs fri sat sun mon . . . is there other way implement instead of putting in array/list , calculate in cell data should added using info row , columns ? to illustrat...

c++ - Clock_gettime() function outputting incorrect time -

i trying runtime of following code using clock_gettime function. when running code receiving time of 0.0000 every time runs. have output start , stop time individually , receiving exact same answer. struct timespec start, stop; double accum; if( clock_gettime( clock_realtime, &start) == -1 ) { perror( "clock gettime" ); exit( exit_failure ); } int src = 1, final_ret = 0; (int t = 0; t < rows - 1; t += pyramid_height) { int temp = src; src = final_ret; final_ret = temp; // calculate kernel argument... int arg0 = min(pyramid_height, rows-t-1); int thehalo = halo; // set kernel arguments. clsetkernelarg(cl.kernel(kn), 0, sizeof(cl_int), (void*) &arg0); clsetkernelarg(cl.kernel(kn), 1, sizeof(cl_mem), (void*) &d_gpuwall); clsetkernelarg(cl.kernel(kn), 2, sizeof(cl_mem), (void*) &d_gpuresult[src]); clsetkernelarg(cl.kernel(kn), 3, sizeof(cl_mem), (void*) &d_gpuresult[final_ret]); clsetkernelar...

c# - LINQ Type arguments cannot be inferred -

i have 2 objects want join _locations , lrslocations . want update _locations attributes corresponding lrslocations . using linq references both options , going through , updating ms2 attributes lrs (i know isn't linq made open new ideas. using linq query now: var joinresult = ms2 in _locations lrs in lrslocations ms2.lrs_id == lrs.attributes.route_id && ms2.lrs_loc_pt == lrs.attributes.measure select new {ms2, lrs}; it works need left outer join after googling attempting: var joinresult = ms2 in _locations join lrs in lrslocations on new { ms2.lrs_id, ms2.lrs_loc_pt } equals new { lrs.attributes.route_id, lrs.attributes.measure } merge lrs in merge.defaultifempty() select new { ms2, lrs }; the issue join lrs complains: http:/...

ruby - print unicode charcater to Rubymine console -

so want print hebrew character, unicode value of \u{fb20} rubymine console, common output hello world typically go if run puts 'hello world' . the code trying run puts "\u{fb20}" , nothing crazy. rubymine set default system encoding both projectg , ide levels, , have tried setting encoding utf-8 , utf-16, neither of these 3 setting print character correctly console. i ﬠ printed console @ moment, not right character. right character ﬠ . try encoding character in ruby, , printing it. symbol = "\ufb20" puts symbol.encode('utf-16') and change rubymine encoded in utf-16

jquery - Bootstrap Combobox breaking CSS -

i've got odd css issue when using bootstrap , bootstrap-combobox js. the desired result have option working expected, within table. when dropdown selected, lines break , dropdown doesn't display correctly. i've tried using stock bootstrap css file , still can't display properly. can please point me in right direction? thanks dan. as expected http://imgur.com/ghsqvif as result http://imgur.com/vns6qjd css: <div class="row"> <h1>inline form</h1> <form class="form-inline"> <div class="form-group"> <select class="form-control"> <option value="" selected="selected">select state</option> <option value="al">alabama</option> <option value="ak">alaska</option> </select> </div> <div class="form-group"> <select class="combobox form-control" name="inline"> ...

excel vba - Trouble accessing dual ranges -

i found majority of following code online , works awesome me. part have added creation of second range rnguniques2 , use of range string manipulation. problem having when try access range, not pulling correct value except first time. thinking using counter wrong, have not been able correct. know range has correct values in did each cell debug print. sub extract_all_data() 'this macro assumes first row of data header row. 'will copy filtered rows 1 worksheet, blank workbook 'each unique filtered value copied it's own sheet 'variables used macro dim wborig, wbdest workbook dim rngfilter range, rnguniques, rnguniques2 range dim cell range, counter integer dim xvalue, outvalue string ' prompt user choose file , open msgbox "please select file split." strfiletoopen = application.getopenfilename(title:="please select file split.", filefilter:="excel files *.xls* (*.xls*),") if strfiletoopen = "false" msgbox "...

javascript - Is localStorage considered a cookie by the browser -

Image
i making small html page javascript. won't need server side, need store person have done, using localstorage.(a checklist) now days browsers have option not store cookies, , sites warns user if use cookies or not. so questions are: 1:i need warn user data being stored, in client side? 2:browsers considers localstorage , sessionsotrage kind of cookie? mean, not save data when user select erase cookies or consider kind of threat. i need warn user data being stored, in client side? it depends on specific legislation concerned about. in uk, instance, wording of the privacy , electronic communications (ec directive) regulations 2003 says: , person shall not use electronic communications network store information, or gain access information stored, in terminal equipment of subscriber or user unless requirements of paragraph (2) met. while commonly referred "the cookie law", not apply solely cookies. browsers considers localstor...

How to Turn a Randomized String Array 'word' into an array made up of the string's Characters C#? -

okay, i'm creating hang-man game (lame, know, gotta' start somewhere). have pulled ~30 random words text file variable , can display word in random order onto screen (just test , make sure variable obtaining whole word in random order). but need take string , break single characters in order 'blank' out letters 'guessed' user. assume array best way - coupled while loop run while character != null. using system; using system.collections.generic; using system.io; using system.linq; using system.text; using system.threading.tasks; namespace hangman { class program { static void main(string[] args) { string[] mywordarrays = file.readalllines("wordlist.txt"); random randomword = new random(); int linecount = file.readlines("wordlist.txt").count(); int activeword = randomword.next(0, linecount); /*charenumerator activewordchar = activeword; --- have tried this, says ...

mongodb - How to deal with the timezone issue when storing dates in utc using mongod? -

i have mongodb collection each document has attributes , utc timestamp. need pull out data collection , use aggregation framework because use data collection display charts on user interface. however, need aggregation per user's timezone. assuming know user's timezone(passed in request browser or in other manner), there way use aggregation framework aggregate based on [client's] timezone? what you're asking being discussed in mongodb issue server-6310 . i found in link a discussion thread . the problem common grouping date, including sql databases , nosql databases. in fact, addressed head on in ravendb. there description of problem , ravendb solution here . the mongodb issues discusses workaround, similar described in comments above. precalculate local times interested in, , group instead. it difficult cover every time zone in world either approach. should decide on small handful of target zones make sense user base, such per-office approach de...

Formatting Excel to Text Format -

i have formated excel treat cell value text appending apostrophe cell value, see apostrophe appears on function bar, how can rid of apostrophe or best way of converting excel cell value text format? select cell, press ctrl+1, choose text format.

ios - [Solved]Segue pushing Nothing first time(delay in data sent) -

hello stackoverflow, i'm picking swift , trying implement data being passed between uitableview cell uiviewcontroller show detailed view of info shown on tableview, , whenever test application on emulator first time press table cell passes empty string , when try pressing cell viewcontroller shows string supposed seen earlier.i pasted code have tableview didselectrowatindexpath below. override func tableview(tableview: uitableview, didselectrowatindexpath indexpath: nsindexpath) { tableview.deselectrowatindexpath(indexpath, animated: false) var7 = lat[indexpath.item] var6 = long[indexpath.item] var5 = items[indexpath.item] var1 = detail[indexpath.item] var2 = date[indexpath.item] var3 = wop[indexpath.item] var4 = viewcontroller() nextview.locationpassed = var1 //self.performseguewithidentifier("detailpush", sender: self) println("value stored in var1: \(var1)"...

qt - Clip QML's ShaderEffect to circular shape -

i'm using shadereffect in qml have scaled visual copy of item. copy should moveable , dynamic ( live property of shadereffectsource set true ). my problem want inside of round rectangle won't clipped it. shadereffect overlaps parent , quadratic. i've coded quick qml example shows problem: import qtquick 2.4 import qtquick.controls 1.3 applicationwindow { title: qstr("hello shaders") width: 640 height: 480 visible: true color: "green" rectangle { id: examplerect property bool redstate: false anchors.centerin: parent width: parent.width / 3 height: parent.height / 3 color: redstate ? "red" : "cyan" rectangle { anchors.centerin: parent width: parent.width / 2; height: width; color: "white" rectangle { anchors.centerin: parent width: parent.width / 2...

jquery - Bootstrap 3 closing dropdown after click problems with IE and Chrome -

i'm trying close via jquery bootstrap 3 drop down after clicking on list item. html <div class="btn-group"> <button type="button" data-toggle="dropdown" class="btn btn-default dropdown-toggle">10 <span class="caret"></span></button> <ul class="dropdown-menu"> <li><a href="javascript: void(0)">10</a></li> <li><a href="javascript: void(0)">20</a></li> </ul> </div> js $('.header').on('click', '.dropdown-menu li a', function(e){ e.stoppropagation(); var number = $(this).text(), $(this).parents(".btn-group").find('.btn').html(number + " <span class=\"caret\"></span>"); $(this).dropdown("toggle"); // use close dropdown on click }); unfortunately solution not work ie , chrome...

java - Hibernate : from table to class -

as know, hibernate allows persist class table. but, can contrary ? can directly create class available table ? can directly create objects lines of available table ? thank everyone, you can generate entity classes database tables @ design/development time of hibernate tools. here basic example of it. before creating object of entity, class must exists.

sql server - SSIS Slowly Changing Dimension Historic Attribute -

Image
this simple scd type 2 (historic) change available. in image, when row updated, 2 distinct rows exist, 1 travels down 'new output' path , 1 travels down 'historical attributes inserts output'. down path of 'historical attributes inserts output', 'derived column' adds column (or replaces column information) rowiscurrent (for example) can changed false. down 'new output' path, row picks rowiscurrent status of 'true' @ 'derived column 1'. what not understand purpose 'union all' serves. why there connection between 'ole db command' , union all? if expired rows updated @ 'ole db command', being passed through, , wouldn't whatever passed through have rowiscurrent set 'true' @ 'derived column 1' before written database @ 'insert destination'? i think answer. records going down "new output" path records have new business key not exist in destinat...

javascript - Sorting/Filtering JSON based on certain property -

so got response api. want build select box types , how extract json related skill_level json without using loops. [ { "id": 32, "name": "beginner", "type": "skill_level" }, { "id": 33, "name": "intermediate", "type": "skill_level" }, { "id": 34, "name": "experienced", "type": "skill_level" }, { "id": 35, "name": "professional", "type": "skill_level" }, { "id": 36, "name": "expert", "type": "skill_level" }, { "id": 37, "name": "male", "type": "sex" }, { "id": 38, "name": "female", "type": "sex" }, { "id": 39, ...

ios - NSInternalInconsistencyException when i use UISplitViewController and UITabViewController -

Image
i want build structure flows: but when running demo, there exception: 2015-07-22 21:54:41.697 test[3884:2992098] *** terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'could not load nib in bundle: 'nsbundle </users/zhanggui/library/developer/coresimulator/devices/deba893c-5df5-4a9a-aaad-d992caed1185/data/containers/bundle/application/da15e304-cd75-4739-9af9-2b930ca84eff/test.app> (loaded)' name 'tit-bj-hqi-view-atr-6s-rdw'' *** first throw call stack: ( 0 corefoundation 0x02047746 __exceptionpreprocess + 182 1 libobjc.a.dylib 0x00531a97 objc_exception_throw + 44 2 corefoundation 0x0204766d +[nsexception raise:format:] + 141 3 uikit 0x00ab9ddf -[uinib instantiatewithowner:options:] + 1003 4 uikit 0x008d40d4 -[uiviewcontroller _loadviewfromnibnamed:bundle:] +...

Maven Javadoc 'Cannot find default setter' and fails -

i'm trying generate javadocs maven project, , i'm running error every time. unable parse configuration of mojo org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc parameter #: cannot find default setter in class org.apache.maven.plugin.javadoc.options.group . command i'm using mvn javadoc:javadoc root directory, pom is. i don't have groups configured @ all, or have special configuration @ all. same error whether omit plugin in pom completely, add reporting, or add build plugin. i've tried adding empty groups well, , while message changes somewhat, still appears. i ran across this question , a. don't have testng dependencies, b. i'm not using command line parameters, , c. never resolved. it selenium project, suppose there similar, can't figure out. ideas? i've included maven debug stack trace below. [error] failed execute goal org.apache.maven.plugins:maven-javadoc-plugin:2.10.3:javadoc (default-cli) on project selenium: un...

mongodb - How to serve files from gridfs using nginx (mongo 3.0)? -

is there alternative nginx-gridfs can work mongodb 3.0 speed comparable serving static files using nginx? there's gridfs fuse package. can mount gridfs files directory configure nginx serve files normal. i've never used though , have no idea performance might like.

html - Bootstrap full width search box -

Image
i try make full width search box. working in tab , mobile not working in desktop or laptop here code <div class="row"> <div class="col-md-offset-2 col-sm-offset-2 col-xs-offset-1 col-md-8 col-sm-8 col-xs-10"> <form action="" autocomplete="off" class="navbar-form" method="post" accept-charset="utf-8"> <div class="input-group"> <input name="searchtext" value="" class="form-control" type="text"> <span class="input-group-btn"> <button class="btn btn-default" type="submit" id="addresssearch"> <span class="icon-search"></span> </button> </span> </div> </form> </div> </div> when see responsive view working on mobile , ta...