Posts

Showing posts from January, 2011

java - JFrame size, resize, fullscreen -

my question have 3 parts. i know, how can set jframe window resizable, can not go under minim size user cant make smaller minimum size. i know, how can set jframe window resizable, still keep aspect ratio (16:9) if user resizing it. i know, how can make program become full screen after clicks button there no borders , runs game or (and if there specific issues how can revert safely). thanks , patient not perfect english , not perfect java knowledge. the provided answer useful , answers part of question, still of still blank me. the part of code: private void createdisplay() { graphicsdevice gd = graphicsenvironment.getlocalgraphicsenvironment().getdefaultscreendevice(); frame = new jframe(title); //setting title of window frame.setsize(width, height); //setting width , height of window frame.setdefaultcloseoperation(jframe.exit_on_close); //make ...

generating correlated summated scales from random normal variables in r -

i want generate 5 random normal variables in r each given mean , sd x1 <- rnorm(100,20,5) x2 <- rnorm(100,22,4) y1 <- rnorm(100,21,3) y2 <- rnorm(100,23,4) y3 <- rnorm(100,22,5) and summated scales x , y having predefined correlation as x <- rowsums(cbind(x1,x2)) y <- rowsums(cbind(y1,y2,y3)) cor(x,y) # must 0.6 i think using loop should inefficient solution this. y=r*x+sqrt(1-r*r)*rnorm(n) not applicable. i'm bit confused how start. suggestion appreciated.

angularjs - How to pass $index as a object key in ng-repeat? -

i facing problem angular have dynamic generated object in form below object:{ 0: [], 1: [] } this set in angular controller in html side want this <tr ng-repeat="comapny in companies"> <td ng-repeat="option in object.$index">{{option.name}}</td> </tr> $index comes tr ng-repeat wraps ng-repeat $index variable. is possible? if have object can access array option in object[$parent.$index] you need use $parent.$index because want access $index of first ng-repeat .

sql - MYSQL: create an insert with data from two subqueries -

i know can use subquery make insert after selecting rows database. insert wp_43_term_relationships (object_id, term_taxonomy_id, term_order) select id, 8363, 0 ( select distinct wp_43_posts.id wp_43_posts inner join wp_43_term_relationships on wp_43_term_relationships.object_id = wp_43_posts.id inner join wp_43_term_taxonomy on wp_43_term_taxonomy.term_taxonomy_id = wp_43_term_relationships.term_taxonomy_id (wp_43_term_taxonomy.term_id = 4613 or wp_43_term_taxonomy.term_id = 4615) , wp_43_term_taxonomy.term_id != 8363 ) posts but if, instead of hardcoding 8363, i'd need derive query?for example i'd need deriv from select wp_43_term_taxonomy.term_taxonomy_id wp_43_term_taxonomy wp_43_term_taxonomy.term_id = 8363 if replace constant second query in ()'s, should work. this: insert wp_43_term_relationships (object_id, term_taxonomy_id,term_order) select id, (select wp_43_term_taxonomy.term_taxonomy_id wp_43_term_taxonomy wp_43_term_taxonomy.term_id = 8363)...

android - Does checking the Never ask again box when asking for a runtime permission disable future dialogs? -

if user denies runtime permission never ask again checked, disable future ability ask same permission? user have go through settings enable permission? in application, when call activitycompat.requestpermissions(this, new string[]{manifest.permission.read_phone_state}, 0) and permission has been denied never ask again checked, won't show dialog box @ all. expected behavior? this expected behaviour. from the documentation : when system asks user grant permission, the user has option of telling system not ask permission again . in case, time app uses requestpermissions() ask permission again, the system denies request . system calls onrequestpermissionsresult() callback method , passes permission_denied , same way if user had explicitly rejected request again. means when call requestpermissions() , cannot assume direct interaction user has taken place.

swift - indexOf(Element) doesn't exist for [Foo.Type] arrays -

swift's collectiontype provides 2 indexof methods: 1 takes element directly, , 1 takes predicate function. if have array of type [foo.type] (for class foo ), former doesn't exist; there's predicate version of indexof . why this? the indexof method takes element requires element must conform equatable protocol. it's defined in constrained protocol extension, shows when constraint holds true. metatypes (of form sometype.type ) cannot conform protocols (current of swift 2.1). therefore though can define == operator @ global scope operates on metatypes, can't have metatype conform equatable protocol. known language limitation. in cases (e.g. when using types keys in dictionary) may able use standard library objectidentifier type work around limitation.

ios - Detect UITapGestureRecognizer on UIView with transform -

i’ve attached uitapgesturerecognizer uiview works expected, however, part of user interface view gets rotated when tapped first time. now, same tap gesture no longer fired when try tap on view. the transform attached view’s layer. how detect uitapgesturerecognizer on view layer has non catransform3didentity transform?

java - How to use something like the charAt for integers -

i trying make program uses 3 digit numbers identify items , trying use charat method integers or something. im not sure. im beginner , apologize need help. need bit of use if statement , relational operators. im trying if last digit in number less 5 {item} , if greater 5 {item}. that. thank in advance. string number; system.out.println("enter 3 digit number: "); number = in.nextline(); switch (number.charat(0)) { //stuff } if (number > 5) { //it item { else { //it other item { there @ least 2 ways can it: string number = in.nextline(); char c = number.charat(i); // position of digit want retrieve int digit = c - '0'; if want ith digit end of integer, do: int digit = 0; while(i > 0) { digit = n%10; n /= 10; --i; }

cmake - Errors after trying to compile Amazon AWS C++ SDK -

i'm trying build amazon's c++ aws sdk g++ under 64 bit cygwin running on windows 8. when call cmake build directory so: cmake c:\users\path\aws-sdk-cpp-master i following error: you have called add_library library aws-cpp-sdk-core without source files. typically indicates problem cmakelists.txt file have called add_library library testing-resources without source files. typically indicates problem cmakelists. txt file have called add_library library aws-cpp-sdk-dynamodb without source files. typically indicates problem cmakelis ts.txt file have called add_library library aws-cpp-sdk-cognito-identity without source files. typically indicates problem cmakelists.txt file have called add_library library aws-cpp-sdk-identity-management without source files. typically indicates problem yo ur cmakelists.txt file errors folders in directory cut them out. cmake error @ c:/users/path/aws-sdk-cpp-master/aws-cpp-sdk-core-tests/cmakelists.txt:59 (add_exec...

amazon web services - Move files to S3 then remove source files after completion -

i familiarising myself amazon web services , s3 aws cli. does know if it's possible remove files source exist on destination bucket? i trying below: aws s3 sync /home/recsout s3://myfakebucketname001 --delete i using rsync nas drive --remove-source-files want use s3 , aws cli instead. the aws s3 sync command in aws command-line interface (cli) used synchronize source target. it not delete files source after copying. however, --delete option remove files target if not present in source (thereby making target match source). if intent copy file , remove it , use aws s3 mv command, copies , removes source. also, it's worth mentioning aws s3 commands can work local disk amazon s3 bucket, or s3 bucket local disk, or between 2 s3 buckets.

mysql - Selecting Top 10 Employee Salaries -

i have database salaries of employees. here salaries table fields: emp_no int(11) salary int(11) from_date date to_date date i'm trying top 10 employee salaries, non-duplicate employees. code below can maximum salary emp_no, from_date , to_date defaulting earliest date values emp_no. select emp_no, max(salary) salary, from_date, to_date salaries group emp_no order salary desc limit 10 i assumed group by keep values of dates matched salary , emp_no , after thinking bit doesn't make sense so. any how correct date values appreciated. first table contain top 10 salaries. then check original table see row matches emp_no , salary dates. select s.* (select emp_no, max(salary) salary salaries group emp_no order salary desc limit 10 ) maxsal inner join salaries s on maxsal.emp_no = s.emp_no , maxsal.salary = s.salary

ReactJS - access to props child in render for props transfer -

when try access {this.props} in render, crashes page. doing wrong here? var react = require('react'); var defaultlayout = react.createfactory(require('../layouts/default')); var reactgridlayout = react.createfactory(require('react-grid-layout')); var desktopstore = require("../stores/desktopstore"); var _ = require('lodash'); // var classnames = require('classnames'); var homepage = react.createclass({ displayname: 'index.jsx', getinitialstate: function(){ return { zoomed: desktopstore.get('zoom'), layout: this.generatelayout() }; }, getdefaultprops: function() { return { layout: defaultlayout, grid: { items: 20, cols: 80, rowheight: 30, verticalcompact: false, autosize: false, isresizable: false, margin: [5,5] ...

binary - C - Return 1 if any even-numbered bit in word x is set to 1 -

i stuck on function return 1 if bit set 1 using ! ~ & ^ | + << >>. so far made mask 0x55 (0101) example, 1110 (true) masked return 0100 , 1010 (false) return 0000. how express answer true return 1 false return 0? thank edit: far code is: int anyeven(int x){ int mask = 0x55; return (x&mask); } int anyevenbit(int x) { return 0 != (x & 0x55555555); // assuming 32-bit int }

opencv3.0 - Why Python says "'int' object is not callable"? -

i'm trying execute code , interpreter says this. error? import cv2 videocapture = cv2.videocapture('opal.avi') fps = videocapture.get(cv2.cap_prop_fps) size = (int(videocapture.get(cv2.cap_prop_frame_width)), int(videocapture.get(cv2.cap_prop_frame_height))) videow = (cv2.videowriter('opal2.avi', cv2.cap_prop_fourcc('i', '4', '2', '0'), fps, size)) success, frame = videocapture.read() while success: # loop until there no more frames. videow.write(frame) success, frame = videocapture.read() the line cv2.cap_prop_fourcc('i', '4', '2', '0') generate error. cap_prop_fourcc constant, ie int. you can't call int 3("hello") => impossible "int" object not callable

c++ - C++11 accessing each variadic parameter -

this question has answer here: variadic template pack expansion 5 answers is possible split variadic parameter list of items , access them? below can see example of want achieve - first piece, standard, simple example of using variadic parameters float sum() { return 0; } template<typename ... types> float sum(float first, types ... rest) { return first + sum(rest...); } below, can see i'd do template<typename ... types> float func(int first, types ... rest) { std::cout<<first<<std::endl; for(auto item : rest) cout<<rest<<std::endl; } i know can print , things recursively, there way access params w/o recursion? #include <iostream> #include <string> template<class...t> void printall(const t&...t) { using expander = int[]; auto sep = ""; (...

Basic Java Vending Machine Program -

i making vending machine program , i'm not sure whats wrong vendingmachine.java: public class vendingmachine { int cancount; int tokencount; public vendingmachine() { cancount = 0; tokencount = 0; } public vendingmachine(int initialcans, int initialtokens) { cancount = initialcans; tokencount = initialtokens; } public void fillup(int cans) { cancount += cans; } public void inserttoken() { tokencount -= tokencount; cancount -= cancount; } public double getcancount() { return cancount; } public double gettokencount() { return tokencount; } } vendingmachinetester.java: public class vendingmachinetester { public static void main(string[] args) { vendingmachine machine = new vendingmachine(5, 5); machine.fillup(10); // fill ten cans machine.inserttoken(); machine.inserttoken(); system.out.print("token count: "); system.out.println(machine.gettokencount()); ...

javascript - How to Change Content When User Selected Different Option From DropDownList -

Image
i have dropdownlist user select item want retrieve gridview. (see below:) let's @ first when page loaded, dropdown list "item1" being displayed default option. @ first when page loaded, should retrieve item1 content based on listitem text, not value, , display item1 content on webpage. if user clicked on different option (e.g. item2), retrieve item2 content based on listitem text, , display item2 content on webpage, , on.. dropdownlist code: <asp:dropdownlist id="dropdownlist1" runat="server" width="136px" autopostback="true" onselectedindexchanged="jobrun_selectedindexchanged"> </asp:dropdownlist> dropdownlist_selectedindexchanged code: protected void dropdownlist1_selectedindexchanged(object sender, eventargs e) { if (dropdownlist1.selectedindex >= 0) { if (!string.isnullorempty(1stlistbox.selectedvalue) && !string.isnullorempty(...

java - Cannot find string -

i'm messing around code see can , can't , i'm creating simple log in program , reason can't seem find 1 of strings. here's code: import java.util.scanner; public class login { public static void main(string[] args) { scanner input = new scanner(system.in); system.out.print("username: "); string user = input.next(); system.out.print('\f'); while (true) { system.out.print("pass: "); string pass = input.next(); system.out.print('\f'); system.out.print("password again: "); string pass2 = input.next(); system.out.print('\f'); if (pass.equals(pass2)) { system.out.println("*passwords match*"); system.out.println(""); break; } else if (!pass.equals(pass2)) { system.out.println("*passw...

ruby on rails - one view two controllers -

my app got installation controller , address controller. address has_one :installation , installation belongs_to :address in installation view, got simple_form inside in other simple_form. this: <%= simple_form_for @installation, class: 'form-horizontal' |f| %> <%= f.error_notification %> <%= f.simple_fields_for @installation.address |u| %> <%= u.label :street_address, label: t('address.address_label'), required: true, class: 'col-sm-2 control-label' %> <%= u.input_field :street_address, class: 'form-control' %> so how can update 2 models ? can have 2 def params ? likes this: def installation_params params.require(:installation).permit(x) end def installation_address_params params.require(:????).permit(y) end you can use nested attributes . untested, roughly: model: class installation < activerecord::base belongs_to :addre...

javascript - How should Urls from User Options be matched in Content_Script? -

this question has answer here: optionally inject content script 1 answer i writing extension has options let users decide sites want extension run on. say user has site in options site action stackoverflow.com/* change background css blue google.com/* change background css green i store these string in options. when content_script runs should retrieve these strings options, loop through each one, parse urlparser parts, turn each part regex (escaping *), , compare document.url? read kind of user options validation urls should done through background script i'm not sure way go or if there's more obvious way it. i think extensions adblocker , vimium seem have functionality deciding sites not run on. want figure out how decide sites to run on. update question: since content_script needs run @ docume...

embedded - strange #define statements in C -

i have embedded c source code. in it's definitions, has lot of #define lines following: #define xnv_spi_tx(x) st(u1csr &= 0xfd; u1dbuf = (x);) any idea st( ) means , does? using iar compiler , toolchain. thanks comments, here found: /* (the while condition below evaluates false without generating * constant-controlling-loop type of warning on compilers.) */ #define st(x) { x } while (__line__ == -1)

validation - Using Required Expression and Required Field Validators in ASP.NET -

i having trouble validating use inputs once calculate button clicked. appreciated. text fields must validated using validation controls , should include summary show errors. error messages appear in lblmessage.text nothing showing once calculate clicked. (side note: cannot clear button reset textboxes null. great too) html <body> <form id="form1" runat="server"> <div> <img src="images/header.jpg" alt="get fit" title="getfit" width="100%"/> </div> <h1>body mass index calculator</h1> <table align="center"> <tr> <td class="auto-style4">enter first name:</td> <td class="auto-style6"> <asp:textbox id="txtname" runat="server" tabindex="1"></asp:textb...

c++ - Visual Studio stops breaking on assert() -

this started happening today visual studio 2013 project have seen , on years in other visual studio versions. running debug build , unknown reason aborts stop raising message dialog allows break , debug , instead simple message in output window , program terminates. r6010 - abort() has been called program '[9408] test_explode.exe' has exited code 3 (0x3). over many years c++ developer gremlin pops , , forget how solve , can't see cause was. i'm sure can shed more light on what's happening , correct fix , @ minimum i'll @ least add own notes. a manual call _set_error_mode(_out_to_msgbox) somewhere in program restores correct behaviour. appears default error mode being set wrong compiler option or visual studio setting? i'm not sure what. all debug->exception settings enabled.

xlwt - convert multiple csv to xls using python with number stored as integer not text -

i writing script converts multiple csv files xls file , did so, problem facing numbers stored text not numbers(integer). please me on store numbers numbers not text. please on same. import xlwt, csv, os csv_folder = "d:\data/" book = xlwt.workbook() headerstyle = xlwt.easyxf('font: bold 1; align: wrap on, vert centre, horiz center; borders: top 1, bottom 1, left 1, right 1; pattern: pattern solid, fore_color 5;') style = xlwt.easyxf('font: height 220; align: wrap on, vert centre, horiz center; borders: top 1, bottom 1, left 1, right 1;') file in os.listdir(csv_folder): sheet = book.add_sheet(file[:-4], cell_overwrite_ok=true) sheet.set_horz_split_pos(2) sheet.set_vert_split_pos(1) sheet.panes_frozen = true sheet.remove_splits = true sheet.col(0).width = 3333 #3333 = 1 inch sheet.write_merge(0, 0, 0, 0, 'date', headerstyle) sheet.write_merge(0, 0, 1, 6, 'smpp requests', headerstyle) sheet.write_...

c++ - How do I modify the following code so that I'm actually reading in the contents of the file into an array then printing out the array? -

the following code reads in text file prints screen. works want first read in contents array print out contents , i'm not sure how so. #include <fstream> #include <iostream> #include <string> using namespace std; int main() { string input; //open file std::ifstream infile; infile.open("input.txt"); while (true) { //get input infile >> input; //avoid repetition of last line: if(infile.eof() ) break; //print input on screen if (input == "a") std::cout << "variable: " << input << "\n"; if (input == "=") std::cout << "assignment: " << input << "\n"; if (input == "3") std::cout << "integer: " << input << "\n"; if (input == ";") std::cout << "semicolon: " << input << "\n"; if (input == "+") std::cout ...

cypher - Query needed for neo4j -

hey guys needed in framing query in neo4j. rank artists (music artists) unique number of listening users, display top 5. thanks graph this: (user)-[:listens_to{weight:1212}]->(artists), (user)-[:tags]->(artists), (user)-[:friends_with]->(friend) query think might work : match (m : user) - [l : listnto ] - > : aryist return count (distinct (m ) )as listncount , a.name order lostencount desc limit {5} created small graph sample here: http://console.neo4j.org/r/ujhh0x the query match (u:user)-[:listens_to]->(a:artist) return a.name,count(distinct u) count order count desc limit 5 returns artists ordered number of unique listeners.

algorithm - How can I find the upper and lower boundary for quick sort? -

i got average case complexity quick sort.now how can find upper , lower bounds quick sort? the time complexity of quick sort o(n log(n)). due fact must go through numbers of array , divide them equally. 2 sub arrays lower , higher selected pivot. each of these sub arrays must continue through same process. divide , conquer continues until there arrays of size 2 sorted correctly. compute takes n log(n). seen binary tree, leaves (the bottom rows) sorted. concatenate them. 8 4 4 2 2 2 2 quick sort runs problems when have sorted array. insertion sort have o(n) time algorithm @ situation. dealing arrays partially sorted , need time crunch (that if dealing millions of data), might want create algorithm of own design suits taste. reference: https://en.wikipedia.org/wiki/quicksort

activerecord - How to write using where and and conditions on active record rails -

how write query using , and conditions on active record rails select c.name from categories as c join categories_coaches cc on cc.category_id=c.id cc.coach_id=16 , c.parent_id=1 this should it: category.joins(:categories_coaches) .where('categories_coaches.id = ? , categories.parent_id = ?', 16, 1) .select('categories.name')

ios - How to pass data from View controller to Container? -

Image
i'm new in using swift programming , need pass data container view. i have variables passed in eyewear detail view controller vc passed container connected table. in this, have dictionary of information put in table. i've been scratching head find answer no luck on google search. perhaps guys can me. thanks! set segue identifier in storyboard, first of all. find field can set identifier after click segue link. view controller call next viewcontroller func showsomeviewcontroller() { self.performseguewithidentifier("testcontainer", sender: self); } override func prepareforsegue(segue: uistoryboardsegue, sender: anyobject?) { if (segue.identifier == "testcontainer") { let vc: testviewcontroller = segue.destinationviewcontroller as! testviewcontroller vc.tmpstring = "say ho" } } and testviewcontroller class testviewcontroller: uiviewcontroller { var tmpstring: string! override func viewd...

javascript - jquery add class on click event not working -

in project have menu , give them ids sub menu , it's in header.php <div class="top-menu"> <ul> <nav class="cl-effect-13"> <li><a href="about.php" id="about">about</a></li> <li><a href="product.php" id="product">products</a></li> <li><a class="scroll" href="#news" id="news">news</a></li> <li><a href="typography.php" id="typo">typo</a></li> <li><a href="contact.php" id="contact">contact</a></li> </nav> </ul> </div> now when click goes about.php or if click contact goes contact.php. in about.php insert jquery this. <script type="text/javascript"> $(document).ready(function() { /* var defaults = { contain...

android - Creating like button in the listview -

i working on project , wondering how can implement like button(custom) in list view. should append likes particular row whenever button pressed , unlike if pressed second time.just face book. can provide me link such tutorial?? want know how handle end part.. please suggest something. thank you. in custom adapter's getview() need add method setonclicklistener() buttons you're using. any data associated button has added mybutton.settag() in getview() , can accessed in onclicklistener via view.gettag()

I can not compare view.getBackground() == R.drawable.image ?[android] -

i need compare image loaded background imageview. this: @override public boolean ontouch(view v, motionevent event) { if(event.getaction() == motionevent.action_down) { switch (v.getid()) { case r.id.hero1: if(v.getbackground() == r.drawable.hero1){ //do } break; case r.id.hero2: //other stuff } but v.getbackground() not compare have in drawable folder. why? note v.getbackgroundresource() not available. you can this- @override public boolean ontouch(view v, motionevent event) { if(event.getaction() == motionevent.action_down) { switch (v.getid()) { case r.id.hero1: if (v.getbackground().getconstantstate().equals(getresources().getdrawable(r.drawable.hero1).getconstantstate())) { // here ...

Wagner Fischer algorithm implementation in java -

i trying implement wagner-fischer algorithm in java using wikipedia reference wagner-fischer java code: public class stringdistance { public static void main(string[] args) { int i, j, m, n, temp, tracker; int[][] d = new int[50][50]; string s = "kitten"; string t = "sitting"; char u[] = s.tochararray(); char v[] = t.tochararray(); m = u.length; n = v.length; (i = 0; <= m; i++) { d[i][0] = i; } (j = 0; j <= n; j++) { d[0][j] = j; } (j = 1; j <= m; j++) { (i = 1; <= n; i++) { if (u[i - 1] == v[j - 1]) { tracker = 0; } else { tracker = 1; } temp = math.min((d[i - 1][j] + 1), (d[i][j - 1] + 1)); d[i][j] = math.min(temp, (d[i - 1][j - 1] + tracker)); } } system.out.println("the levenstien distance" + d[n][m]); } } but above code working strings ...

Add a delay in jquery -

i add delay between apparition of circle , apparition of content. tried "delay" nothing happen. my jsfiddle $('.toggle-menu').click(function (e) { e.preventdefault(); $('h4.toggle-menu').text($(this).text() == 'menu' ? 'close' : 'menu'); $('.circle').toggleclass('opacity'); $('#overlay-menu').delay(5000).toggleclass('opacity'); $('.circle').toggleclass('open'); }); try using window.settimeout. window.settimeout(function() { $('#overlay-menu').toggleclass('opacity');} ,1000 );

c# - Entity Framework TPC: Why does BaseEntity Id need to be of type Guid? -

i have been experiencing objectcontext inconsistent state exception: the changes database committed successfully, error occurred while updating object context. objectcontext might in inconsistent state. inner exception message: acceptchanges cannot continue because object's key values conflict object in objectstatemanager. make sure key values unique before calling acceptchanges. this seems happen when base entity (abstract since using tpc) has an public int id { get; set;} which configured primary key generated database: // base entity modelbuilder.entity<baseentityobject>().haskey(t => t.id); modelbuilder.entity<baseentityobject>().property(t => t.id). hasdatabasegeneratedoption(databasegeneratedoption.identity); and derived entities inheriting , trying use primary key. when instantiate 2 different types of derived entries, add them dbcontext, try savechanges(), exception fired. however, when id field changed guid int: pub...

javascript - Debugging Method in Chrome: Identify what line of code is executed after Onload event ended -

i have function in javascript. example: function sample(){ var myid_signature_image = new image(); myid_signature_image.onload = function () { alert('two'); }; alert('one'); } i put breakpoint in each line of function. one being displayed first, , two . afer onload event, javascript function interfering code. how know line of code using google chrome developer tools ? fire developer tools ( ctrl + shift + i ) , under sources tab, put breakpoint @ alert('two'); line. carry out html actions thru browser, in case onload needs refresh, , halt on breakpoint. here, press f10 (step on next function call) , tell lines executed next after onload event.

android - WebViewClient: load web pages with no header -

Image
i'm using webviewclient open site in android application. when loads site shows this: i "cut" page header, mean page starts point. should loaded this: do know way this? (the website want load in app not mine) here webviewclient in android app code: public class mywebview extends fragment { private webview webview; public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); bundle args = getarguments(); string url = args.getstring("url"); webview = (webview) getview().findviewbyid(r.id.webview); webview.setwebviewclient(new mybrowser()); websettings websettings = webview.getsettings(); websettings.setsaveformdata(true); websettings.setusewideviewport(true); websettings.setloadwithoverviewmode(true); websettings.setsupportzoom(true); websettings.setloadsimagesautomatically(true); websettings.setjav...

php - Wordpress alongside Codeignitier? -

i have ci installed in root , wordpress inside wordpress directory. allowed wordpress use root setting site url , main .htaccess rewrite wordpress directory, because ci inside root have url conflict between ci , wordpress.. know ci using pretty links, when try run example: example.com/ci_class/ci_function it's redirects me wordpress template message not found this happens because included wordpress wp-load.php inside index.php of codeignitier... what can do? want use wordpress functions inside ci, want ci url works fine...

azure - How Many Hive Dynamic Partitions are Needed? -

i running large job consolidates 55 streams (tags) of samples (one sample per record) @ irregular times on 2 years 15-minute averages. there 1.1 billion records in 23k streams in raw dataset, , these 55 streams make 33 million of records. calculated 15-minute index , grouping average value, seem have exceeded max dynamic partitions on hive job in spite of cranking way 20k. can increase further suppose, takes awhile fail (about 6 hours, although reduced 2 reducing number of streams consider), , don’t know how calculate how many need. here code: set hive.exec.dynamic.partition = true; set hive.exec.dynamic.partition.mode = nonstrict; set hive.exec.max.dynamic.partitions=50000; set hive.exec.max.dynamic.partitions.pernode=20000; drop table if exists sensor_part_qhr; create table sensor_part_qhr ( tag string, tag0 string, tag1 string, tagn_1 string, tagn string, timestamp string, unixtime int, qqfr2013 int, quality int, count ...

TFS work item tags (To Delete / Modify ) - Team Foundation Server 2013 -

i have been informed remove obsolete tags tfs,is there option remove tags no longer needed?in other words "centralized" method manage them. pls note there user stories & bugs added tfs using these obsolete tags. you need minimum of tfs 2013 update 4 enable tag management support excel , through api.

PHP - Remove subsequent array values if key found -

$week_link_arr array ( [0] => 1-4_1*oct-2015 [1] => 5-11_2*oct-2015 [2] => 12-18_3*oct-2015 [3] => 19-25_4*oct-2015 [4] => 26-31_5*oct-2015 ) $current_week_url 1-4_1*oct-2015 tried using array_search key , remove unset if found: if (($key = array_search($current_week_url, $week_link_arr)) !== false) { unset($week_link_arr[$key]); } output array ( [1] => 5-11_2*oct-2015 [2] => 12-18_3*oct-2015 [3] => 19-25_4*oct-2015 [4] => 26-31_5*oct-2015 ) this removes key found. instead if key found need remove subsequent array elements. exepected output key 1-4_1*oct-2015 array ( [0] => 1-4_1*oct-2015 ) if key 5-11_2*oct-2015 , array ( [0] => 1-4_1*oct-2015 [1] => 5-11_2*oct-2015 ) do mean this? if (($key = array_search($current_week_url, $week_link_arr)) !== false) { $week_link_arr = array_slice($week_link_arr, 0, $key + 1); }

ios - How to Open data(saved using core data model) saved in my in pad -

Image
im new core data, created 1 model , saved data in simulator , opened .sqlite folder contain data. now done same thing in ipad different data how see .sqlite file, stored… in ipad can copy same data in ipad, mean out entering data again …. thanks … you can app's container when attach device xcode. windows->devices->your app->click small setting button->select download container. show content of appdata saved, see .sqlite file in folder. in terms of browsing data, have several choices. here discussion tool browsing core data. is there core data browsing tool out there? in case use db browser, works fine. could explain more why want that? hope helps :)

javascript - Jasmine testing runs code in illogical order when iterating over mutliple results in a div? -

i'm trying write test grab contents of div , compare them expectation. i know can expect multiple results, i've been trying iterate on results 1 @ time , concatenate them 1 string can compare against expectation. code snippets below don't seem work expected. console returns "result returned: " no results before returns "result inside while: 1" , "result inside while: 1 2" . this doesn't make sense me... i've explained enough i'm trying do. code isn't great @ moment because i've been chopping , changing bits test happening. a 'tl;dr' summary of i'm hoping can :) how can iterate on each item returned element.all line , concatenate values string function return test? can me understand why if/else appears true when has been set 0 beforehand (i'm sure items.length 2 in case) can point me place read on promises? have feeling poor understanding of promises holding me back... test: var re...

wcf - Could not find a base address that matches scheme net.msmq -

i trying create self-hosted service listens amessage queue, , sends email when message put in queue. however, getting rather known error could not find base address matches scheme net.msmq endpoint binding netmsmqbinding. registered base address schemes [http]. i have removed http stuff in config file, know fact msmq working on computer, have msmq running fine. mailnotificationagentqueue created. here config: <?xml version="1.0"?> <configuration> <appsettings> <add key="aspnet:usetaskfriendlysynchronizationcontext" value="true" /> </appsettings> <system.web> <compilation debug="true" targetframework="4.5" /> <httpruntime targetframework="4.5"/> </system.web> <system.servicemodel> <bindings> <netmsmqbinding> <binding exactlyonce="false" deadletterqueue="none" durable="true...

php - Wordpress get custom post type posts by category -

hi have problem custom post type categories, try post have category output post. can me please. thank you. my code $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => "collection-posts", 'category'=> 1, 'posts_per_page' => 12, 'paged' => $paged ); query_posts($args); but give posts. don't understand why the arguments key should cat , not category : $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; $args = array( 'post_type' => "collection-posts", 'cat' => 1, 'posts_per_page' => 12, 'paged' => $paged ); query_posts($args);

MongoDB filter an array field by period (start date, end date) using PHP -

i have mongodb documents structure: { _id: 1 dates: [ isodate ("2015-08-21t22: 00: 00z") isodate ("2015-09-27t22: 00: 00z") ], ... } in example, see document 1 accessed: 2015-08-21 2015-09-27 in application, can filter time period (start date, end date). if in application filter period "2015-09-01 - 2015-09-01": logically document 1 should not found because not consulted during period. tests, document 1 found. what conditions must use filter data correctly? i tried it's fallible: <?php $begin = new \datetime('2015-09-01'); $end = new \datetime('2015-09-01'); $expr1 = $qb->expr()->field('dates')->gte($begin); $expr2 = $qb->expr()->field('dates')->lte($end); $qb ->addand($expr1) ->addand($expr2) ; thanks help, yohann with aggregation this code snippet mongoshell can try > db.collection.aggregate([{$un...

ruby on rails - want to edit resource of confirmation mail -

i'm using devise 3.3.0 , applied confirmable function user. it work fine, when new user sign send confirmation email email id. send mail - <p>welcome <%= @email %>!</p> <p>you can confirm account email through link below:</p> <p><%= link_to 'confirm account', confirmation_url(@resource, confirmation_token: @token) %></p> when check on terminal, send link - <p><a href="http://localhost:3000/users/confirmation?confirmation_token=d1eyxrst5rk3q5fjyxsg">confirm account</a></p> but url of application ' demo.localhost.com:3000 ' and confimable send link localhost:3000, want edit resource link demo.localhost.com:3000. i think should edit @resource define , how edit it? or there better way pass url in confirmation mail? you can achieve through setting default url options action mailer in config/environments/development.rb (if app in development) below config....