Posts

Showing posts from February, 2011

ios - Segue not executing -

i having brain block. after combing database @ loss why segue not executing. took me long enough figure out how reset nsuserdefaults. when did, figured work fine. after all, have set many segues in app. now, 1 nothing. func isappalreadylaunchedonce()->bool{ let defaults = nsuserdefaults.standarduserdefaults() if let isappalreadylaunchedonce = defaults.stringforkey("isappalreadylaunchedonce"){ println("app launched") return true }else{ defaults.setbool(true, forkey: "isappalreadylaunchedonce") println("app launched first time") performseguewithidentifier("showeula", sender: self) return false } } the log shows "app launched first time" text expect segue execute. however, noting happens. please help. thank you. try dispatch_async on main_queue. call function in viewwillappear. func segue() { dispatch_async(dispatch_get_main_queue(),{ ...

error handling - C++ Prevent CMD Commands being used -

apologies (previous?) poorly worded question i trying prevent cmd commands being used. f6 button can't work around. entering f6 closes program or loops username() function. due f6 or ctr+z being direct command enter loop. has caused program act un-predictably. on 1 machine loops infinitely, on own shuts downt window part of assessment has been driving me nuts since started it. many of peers having issues it, direct request it's immediate 'fail' if can crash our program. thats why i'm being persistent on allowing characters defined below: size_t found = user.find_first_not_of("abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890"); as requested enough of program replicate problem: #include <iostream> #include <sstream> #include <vector> #include <cmath> #include <ctime> #include <cstdlib> #include <string> #include <istream> #include <cstddef> string name = { ""...

java - Changing variables using user input -

i have write code class. these requirements: one class should controller main method. the other class should: do action pass in variables use @ least 1 if statement have private methods have getters , setters. i have done of this. ran problem want user type 'go forward' , stamina decreased 5 , have message appear in sonsole saying, "you lose 5 stamina." , i'd user able type 'rest' , stamina increase 5 (capping @ 100, , console say, "stamina increased #." i don't know how increase/decrease stamina though. whenever try something, error. if there'es have don't need, tell me , why should remove it. if there that's public , doesn't need be, tell me why shouldn't be. teacher says later on, there 5 point deduction every time public doesn't need be. here's code: controller class: import java.io.*; import java.util.scanner; public class controller { public static void main(string[] args)...

c++ - how to change Width Scale in Opencv Histogram.(640 X 480) -

Image
how change width scale in opencv histogram. my code result express width 0 ~ 255, want change width 640 use scale. , want find mistakes on code, , suggest me solution.. please me. void mainwindow::basic_histogram(iplimage* timage) { iplimage* canvas; int hist[256]; double scale=1; int i,j,max=0; qimage pimage; canvas = cvcreateimage(cvsize(640, 480), ipl_depth_8u, 3); cvset(canvas,cv_rgb(255,255,255),0); for(i=0;i<256;i++) { hist[i]=0; } for(i=0;i<timage->height;i++) { for(j=0;j<timage->width;j++) { hist[(uchar)timage->imagedata[(i * timage->widthstep) + j]]++; } } max = 256 * 10; (i = 0; < 256; i++) { max = hist[i] > max ? hist[i] : max; } scale = max > canvas->height ? (double)canvas->height/max : 1.; (i = 0; < 256; i++) { cvpoint pt1 = cvpoint(i, canvas->height - (hist[i] * scale))...

mysql - Pad Varchar with 0 in SQL Server 2005 -

i have tried following this , this need pad column zeros. so have field name_id 1 2 21 74 and want like name_id 001 002 021 074 so have tried doing this: select right('000'+ name_id,3) tblcoordinates; but result is: right('000'+name_id,3) 1 2 21 74 i using mysql server 2005. wrong select statement? thanks you need convert name_id varchar first: select right('000' + convert(varchar(3), name_id), 3) tblcoordinates; if you're using mysql, there built-in function lpad() select lpad(name_id, 3, '0') tblcoordinates;

Datasource and delegate for tableView in a tableViewCell Swift -

i need make inner tableview , tableviewcell deque identifier cell2 it's outer tableview & tableviewcell deque identifier cell. outer completed datasource , delegate, when i'm trying connect inner tableview , tableviewcell don't know connect delegate/datasource to.. make new class subclass what? please out in swift language or swift2 no objective c please! thank guys! since many people incompetent answer question found answer problem!!! not rude, down thumbs me down because don't understand clear question of concept. thanks. hope helps! i've solved it. firstly, need make iboutlet innertableview subclass mine subcell inherits uitableviewcell. in awakenib -> put self.innertableview.delegate = self, self.innertableview.datasource = self, implement requirement protocols of uitableview datasource , delegate

sql server - Accessing data from SQL table containing ID, [Value Type] and Value -

if question has been asked before, please share link question. i've done searching , not able find answer question this. possibly due difficulty i've encountered trying word query displays results i'm looking for. background: i'm designing database hold information (like databases do). particular database holds, purpose of question, 3 tables. the 3 tables store different information; 1 table defines user unique id , user name, second stores types of information can stored user , third stores information user . users table defined with: create table dbo.users ( id uniqueidentifier not null default (newid()), [user name] nvarchar(1024) not null ); the [user info data type] table defined as: create table dbo.[user info data type] ( id uniqueidentifier not null default (newid()), [data type name] nvarchar(256) not null ); last not least, [user info] table defined as: create table dbo.[user info] ( id ...

java - Threading and Progressbar in Android? -

hey guys i'm trying display gps distance between user , place on card can see. problem is, think main thread splits or 2 things @ once. @ code below, android makes toast while doing code in if(flag) statement... toasts gps difference without getting coordinates of user...how make that, if(flag) statement first goes on toast after , outside if statement? @override public void onresume() { super.onresume(); imagepath = getintent().getstringextra("imagepath"); if(imagepath == null) { toast.maketext(this,"hello everyone",toast.length_long).show(); } if(newcardadded) { flag = displaygpsstatus(); if(flag) { editlocation.settext("please!! move device to" + " see changes in coordinates." + "\nwait.."); pb.setvisibility(view.visible); locationlistener = new mylocationlistener();//locationlistener physically gets location ...

javascript - function in setTimeout doesn't work -

this question has answer here: how can pass parameter settimeout() callback? 18 answers there 2 functions hello1() , hello2(). function hello1(){ console.log('hello1'); } function hello2(){ console.log('hello2'); } settimeout(hello1, 3000); settimeout(hello2(), 3000); in settimeout(hello1, 3000); , print "hello1" after delay 3 seconds. but in settimeout(hello2(), 3000); , print "hello2" immediately. i think it's because must use function name in settimeout. what if want execute function parameters after delay 3 seconds hello(1) ? because want deliver parameters function can't use function name in settimeout settimeout(hello1, 3000); when use parenthesis function in settimeout executed immediately. to use function parameters, can use anynomous function timeout function , call function inside...

c# - Why can't I localize my WPF program? -

Image
this question has answer here: error in binding resource string view in wpf 1 answer i have wpf program, , when localize it, fails. entered created xml namespace, corresponds file location, in window element: xmlns:properties="clr-namespace:resxeditor.properties" this how localizing each element: <button content="{x:static properties:resources.filepickerbutton_addfile}" /> the designer works fine, , when choose resources. , auto-complete pulls available items, when build application, crashes error message: exception thrown: 'system.windows.markup.xamlparseexception' in presentationframework.dll additional information: 'provide value on 'system.windows.markup.staticextension' threw exception.' line number '5' , line position '9'. the line number , position correspond first x in ...

python - How to set browser preference in PhantomJS using Selenium -

is there way use browser preference "network.negotiate-auth.trusted-uris" in phantomjs. below syntax selenium firefox: p_profile = webdriver.firefoxprofile() p_profile.set_preference("network.negotiate-auth.trusted-uris", "https://xx.com") driver = webdriver.firefox(p_profile) driver.get("https://xx.com") is there similar feature available in phantomjs. you can pass desired_capabilities keyword argument when create phantomjs object. for example, change user-agent header: from selenium import webdriver cap = webdriver.desiredcapabilities.phantomjs.copy() cap['phantomjs.page.settings.useragent'] = 'asdf' driver = webdriver.phantomjs(desired_capabilities=cap) driver.get('http://httpbin.org/headers') print(driver.page_source) driver.quit() check settings - phantomjs other available settings.

asp.net web api2 - Web API 2 does not set Thread.CurrentPrincipal in certain scenarios -

while trying debug why custom authentication filter not work in our in-memory integration tests, found there difference in way different subclasses of httprequestcontext set principal. most of them ( owinhttprequestcontext , selfhosthttprequestcontext , webhosthttprequestcontext ) set thread.principal this webhosthttprequestcontext.cs: public override iprincipal principal { { return _contextbase.user; } set { _contextbase.user = value; thread.currentprincipal = value; } } but not set @ ( batchhttprequestcontext , requestbackedhttprequestcontext ). is design decision , need rewrite parts of application not use thread.principal) or bug needs be/will fixed?

differentiate the clicks between parent and child using javascript/jquery -

i have 2 elements nested called blanket , blanket-content , want recognize clicks done parent alone. <div id="blanket"> <div id="blanket-content"></div> </div> the issue i'm having when i'm clicking child triggering parent on click. i've tried different methods yet unsuccessful. have tried these play around code; $('#blanket').on('click', function(ev) { alert(ev.currenttarget.id); // }); ^ triggers click on div normal , state parent id when child clicked. $('#blanket-content').on('click', function(ev) { alert(ev.currenttarget.id); }); ^ doesn't trigger anything what want achieve when click on blanket-content nothing happen, when click on blanket want something. one easy solution stop event propagation in click handler of blanket-content , trigger parent element's click handler. you can use event.stoppropagation() that $('#blanket')....

java - How to select the best .class file from a folder? -

i have 1 application handling math operator . app has interface operator so: public interface operator { double calculate(double firstnumber,double secondnumber); string getsign(); } i have 4 class implement operator so: public class plus implements operator { public double calculate(double firstnumber,double secondnumber) { return firstnumber + secondnumber; } public string getoperator() { return "+"; } } public class minus implements operator { public double calculate(double firstnumber,double secondnumber) { return firstnumber - secondnumber; } public string getoperator() { return "-"; } } and on... i compiling classes , put .class file in folder("myfolder") . in main program(main app folder) type of operator user , according operator want choose .class file correct 1 don't know how . can me ? don't. why? using reflection c...

php - how to find all result with any keyword matched in mysql -

Image
i have table called users. table has more 10 columns. want make search program return row if keyword match in string. check attachment.. in attachment when trying search "rina" select * users first_name "%riaa%" or last_name '%rina%' in condition getting result expected. but when try search '%rina sharma%' getting no result found. query searching whole keyword in each cell. like 1st name have "rina sharma" => false 2nd name have "rina sharma" => false i want either "rina"or "sharma" if keyword matched result should appear. select * id c c.name regexp 'rina|sharma';

Environment Specific application.properties file in Spring Boot application -

in spring boot application, want create environment specific properties file. packaging type of application in war , executing in embedded tomcat. use sts , execute main sts itself. can have environment specific properties file application-${env-value}.properties? in above case, env-value have values local/devl/test/prod where set env-value file? local, can set jvm argument through sts who reads application.properties in spring boot application. how load environment specific properties file? ex - if set database uid,pwd, schema etc in environment specific property file, in case datasource able understand properties in it? can use application.properties , application-local.properties file @ same time? spring boot has support profile based properties. simply add application-[profile].properties file , specify profiles use using spring.profiles.active property. -dspring.profiles.active=local this load application.properties , application-local.properti...

how to use android material button for android 4 and above? -

i'm trying add simple button on layout, min api 14, problem when run app on android < 5.0 button doesn't have animation , how can fix that? i think animation talking ripple effect. feature of material design. , remember official material design theme supported android >= 5.0. i guess using default theme. so, when run app on android 5.0 or above using material theme (with ripple effect button). however, when run android < 5.0, theme not material theme , button doesn't have ripple effect. for solve problem, need using third party libraries apply material design app. here list of awesome ui library , can find libraries applying material design. the list of awesome ui library: https://github.com/wasabeef/awesome-android-ui

Need output in sql server -

i have input below here having 2 columns..one target , 1 reference...here target may have 1 or more references need show in 1 table table col1 col2 b c d e f expected result col1 col2 b c d b c d e f f e try this: select col1, col2 tbl union select col2, col1 tbl

java - Moving from MySQL to MS Azure SQL Database -

i have j2ee web application issues parameterized sql queries mysql back-end. need replace back-end ms azure sql database. have migrated db , data on ms azure sql database. queries app failing. example following query (shown wrapping code) runs fine in management studio fails in java code: preparedstatement statement = dbconnection.preparestatement("select * [mydb].[apps] [key] = ?;"); statement.setstring(1, appkey); resultset resultset = statement.executequery(); the error is: com.microsoft.sqlserver.jdbc.sqlserverexception: incorrect syntax near keyword 'key'. i tried various things removing [], qualifying column name table name, etc. nothing works. also 1 more question: jdbc connection using string includes database name (mydb) don't want include in each of sql statement. never did mysql i'd rather avoid doing since require me manually add db name each statement in code. if remove db name above query again fails error invalid object name 'a...

java - Storing an array so that I can access it the next time I run the program -

i have array string[][] somearrayofdata={{"there","is"},{"alot","of data here"}}; i want able save array can load , access next time run program. dont mind having use string[] well. have tried write notepad file major irritation, possible store variables externally avoid hassle of writing multiple notepad files or using delineators? there multiple possibilities. in cases called persistence. store file store file store database java db tutorial send somewhere simple rest web service , client in principle 3 not persistence, way data out of volatile memory.

mysql - Golang sessions with MysqlStore not working -

i having issues setting sessions on 1 request , getting them on page request. i using mysqlstore package recommended on gorilla sessions github page under "store implementations" section in there readme file. https://github.com/srinathgs/mysqlstore i setup simple request test out , wasn't working. here code: homecontroller func (this *homecontroller) setcookie(ctx types.appcontext) web.handlertype { return func(c web.c, w http.responsewriter, r *http.request) { w.header().set("content-type", "text/plain") fmt.printf("%v\n\n", r) ctx.setcookies(r, w) } } func (this *homecontroller) getcookie(ctx types.appcontext) web.handlertype { return func(c web.c, w http.responsewriter, r *http.request) { w.header().set("content-type", "text/plain") fmt.printf("%v\n\n", r) ctx.getcookies(r) } } types.appcontext func (this *appcontext) setco...

javascript - Output largest element on the right for each element in an Array -

consider input of arr1 = [4, 6, 3, 9, 11, 5] i want function takes array input. each element in array, should output first higher value on right. example output : 4 - 6 ; 6 - 9 ; 3 - 9 ; 9 - 11 , 11 - -1 , 5 - -1 requirement : want implement without using nested loops. for (i = 0,k = arr1.length;i< k;i ++){ var val = false; for(j=i+1;j<k;j++){ while(arr1[i] < arr1[j] ){ console.log( arr1[i] + " --" + arr1[j]); val = true; break; } if(val){break;} } if( !val){ console.log( arr1[i] + " --" +" -1"); } } here's example of how it. idea iterate through array, @ every element after 1 you're looking @ until find 1 greater. greater element (or -1 default) pushed second array storage. var arr1 = [4, 6, 3, 9, 11, 5];...

mysql - php substr function for data varchar -

i have problem, want input data invoice number, when try in phpmyadmin version 5.6.16 in computer working, im upload cpanel phpmyadmin v 5.5 not working. result in v 5.6.16 : - inv0001 - inv0002 - inv0003 result in cpanel/hosting. v 5.5 : - inv0001 - inv0001 - inv0001 it's duplicate, how fix it? before. <?php $query = "select max(invoice) invoice orders"; $hasil = mysql_query($query); $data = @mysql_fetch_array($hasil); $lastinv = $data['invoice']; $nextinv= (int) substr($lastinv, 3, 4); $nextinv++; $char = "inv"; $newinvoice = $char . sprintf("%04s", $nextinv); ?> you can try below code avoid duplicate records : $query = "select max(invoice) invoice orders"; $hasil = mysql_query($query); $data = @mysql_fetch_array($hasil); $lastinv = $data['invoice']; $nextinv= (int) substr($lastinv, 3, 4); $nextinv++; $char = "inv"; $i = 1; while(true) // eliminating duplicacy {...

swt - inconsistent look in two installations of eclipse mars -

Image
i have done fresh install of eclipse mars on both of desktop pc , laptop pc. while user interface looks clean on desktop pc, looks ugly (compared desktop) on laptop. both pc's have same configuration. both runs linux mint 17.2 operating system. both uses same gtk theme etc. in opinion problem in laptop backgrounds of swt widgets not transparent. guess. screenshot of desktop pc screen shot of laptop pc your opinion seems right. had same problem on kubuntu. in fact couldn't change in way. after few days looks right itself. (maybe fix, update or something...) by way nice interface!

xml - How to resize image of checkbox in android? -

i adding image checkbox widget (that instead of default adding own image both clicked , unclciked in .xml file using selector)its geting added image not able resize small,it stays in original size. how make image small ? the code used create checkbox <checkbox android:layout_width="match_parent" android:layout_height="wrap_content" android:background="@color/white" android:button="@drawable/check_box" android:drawablepadding="20dp" android:text="check box text" android:textcolor="@color/labelcolor" /> to set android:button field null , set checkbox states android:background field of checkbox. your code become: <checkbox android:id="@+id/cb" android:layout_width="wrap_content" android:layout_height="wrap_content" android:button="@null" android:background=...

Can't get an output while calling java web service using php -

i have create web service using java. used below code call web service using php. $client = new soapclient("http://localhost:8080/imagecom/wsdl/compareimage.wsdl"); $stock = "http://localhost/pic/bluetshirts/b10.jpg"; $parameters= array("url"=>$stock); $values = $client->checksimilarity($parameters); var_dump($values); when run code following output. doesn't display result output: object(stdclass)#2 (0) { } here wsdl <wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://simalarity.imagecom" xmlns:intf="http://simalarity.imagecom" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/xmlschema" targetnamespace="http://simalarity.imagecom"> <!-- wsdl created apache axis version: 1.4 built on apr 22, 2006 (06:55:48 pdt) --> <wsdl:typ...

How to get boot time and show it on terminal wtih kernel programming in Linux? -

what i'm thinking getting uptime , current date , time, , subtracting these. i'll convert output output resembles output of "date" command in linux. but think takes long? , think there might better solution since looks brute force. -- beginner on kernel programming try following code u64 nsec = local_clock(); unsigned long rem_nsec = do_div(nsec, 100000000000); printk("time boot %5lu.%06lu ", (unsigned long)nsec, rem_nsec / 1000);

playframework - How to create eclipse project from Play activator Template -

how create eclipse project new activator template. tried executing eclipse command root of project template not work. you must add first "eclispe.sbt" file in "project" folder : // project/eclipse.sbt : // plugin adds commands generate ide project files addsbtplugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "2.5.0") then run "./activator eclipse"

Hive bucket map join with different bucket size -

in hive, can perform bucket map join of 2 tables different bucket size (but on same key) ? can please share thoughts explanation. for example table-a bucketed col-1 48 buckets, while table-b bucketed col-1 64 buckets. note: table-a bucket size not divisible bucket size of table-b. thanks in advance..!! according hive: if tables being joined bucketized on join columns, , number of buckets in 1 table multiple of number of buckets in other table, buckets can joined each other. explanation: suppose table , table b needs joined. has 2 buckets , b has 4 buckets. select /*+ mapjoin(b) */ a.key, a.value join b on a.key = b.key for query above, mapper processing bucket 1 fetch 2 buckets b. but, if not exact multiples, not possible exact number of buckets fetched. so, in case, won't work unless number of buckets in 1 table multiple of number of buckets in other.

shell bash - return code -

is possible run command redirect output , standard error in file , know return code of command ? ./commande.sh 2>&1 | tee -a $log_directory/$log_file if [ $? = 0 ]; echo "ok" else echo "ko" exit 1 fi currently, return code of tee command, want recover of commande.sh . you want pipestatus . ./commande.sh 2>&1 | tee -a $log_directory/$log_file if [ ${pipestatus[0]} = 0 ]; echo "ok" else echo "ko" exit 1 fi the index array ( [0] ) index of command in pipe chain executed ( ./commande.sh ). ${pipestatus[1]} tee .

php - After registration using tank_auth user should get logged in for codeigniter -

what best authentication out there codeigniter, decided use tank_auth. seems best authentication codeigniter. so how can i, after registration user using tank_auth should automatically logged in without requiring him/her activate his/her account. i have 4 step of registration process in application need add user id multiple tables. logice @ first step want directly login user , session id useful other step. my logice @ first step want directly login user , session id useful other step. having never used tank_auth, i'm not sure how implement system, shouldn't difficult. here's quick example whipped up, you... $data = array( 'username' => $username, 'email' => $email, 'password' => $hashed_password ); $query = $this->db->insert('users', $data); // use each table $user_id = $this->db->insert_id(); then can whatever database, linking user id $user_id the session can set once have...

HipChat API authentication fails when initiated from Ruby script -

i'm using ruby 1.8.7 not allow me use newest hipchat gem (due httparty incompatibility) , older version not work. seems though simple script cannot accomplish task. cannot figure out wrong it require 'uri' require 'net/http' require 'net/https' require 'json' data = { 'color' => 'green', 'message' => 'yaba-daba-doo!', 'notify' => false }.to_json uri = uri.parse('https://api.hipchat.com/v2/room/room_id/notification?auth_token=my_token') https = net::http.new(uri.host, uri.port) https.use_ssl = true req = net::http::post.new(uri.path, initheader = {'content-type' =>'application/json'}) req.body = "[ #{data} ]" res = https.request(req) puts "response #{res.code} #{res.message}: #{res.body}" yields response 401 unauthorized: { "error": { "code": 401, "message": "authenticated requests onl...

Scale image to fit - iOS -

Image
i have uicollectionview displays 12 images. images not fitting in cells, being cropped, want them fit in cells without being cropped. the code should make image scale fit is: cell.imageview.contentmode = uiviewcontentmode.scaleaspectfit cell.imageview.image = uiimage(named: name) here code whole viewcontroller class , screenshot: import uikit class dressingroomviewcontroller: uiviewcontroller, uicollectionviewdelegateflowlayout, uicollectionviewdatasource { @iboutlet weak var collectionview: uicollectionview! let identifier = "cellidentifier" let datasource = datasource() override func viewdidload() { super.viewdidload() collectionview.datasource = self } override func viewdidappear(animated: bool) { // notes on equation cell size: // cells per row = 6 // cell spacing = 10 // collectionview.layout.inset = 20 (10 left, 10 right) let cellsize = (collect...

json - D3JS Map Citiy Circles -

i'm creating map of germany d3js visualize data. added cities using csv, shown circles in map. want cities have different color more data used in them. have idea how can achieve this? you can declare range of color this: var color = d3.scale.linear() .domain([d3.min(array), d3.max(array)]) .range(["#fff7f3", "#49006a"]); then style every circle: .style("fill", function(d) { return color(+d.data); }); but need compact data 1 value per city so: d.values.reduce(function(sum, d){ return sum + d.amount; },0) here's example mike's site: http://bl.ocks.org/mbostock/4060606

firemonkey - Error when double-clicking TButton in FMX form application at design-time -

Image
in delphi xe8 (update 1), choose file > new > multi-device application - delphi > blank application. then put tbutton on form. then double-click button. automatically create empty click event-handler declaration , implementation (like vcl form application projects): procedure tform1.button1click(sender: tobject); begin end; however, display error message: so why error message displayed? bug in ide? can prevent error?

javascript - Bootstrap navbar doesn't collapse when visit from mobile device, works fine when I shrink desktop browser -

i have index.html , require bootstrap.css , bootstrap.js.when shrink desktop browser on desktop, navbar collapses properly. when visit site on mobile device,everything responsive except navbar,it doesn't collapse here code in head <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>sylhet international university</title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/normalize.css"> <link rel="stylesheet" href="css/loaders.min.css" /> <link rel="stylesheet" href="css/jquery.bxslider.css" /> <link rel="stylesheet" href="css/default/default.css" type="text/css...

excel - Why do I get wrong prediction when using this polynomial forecasting formula -

Image
i forecasting on growth per period. i have formula of polynomial regression y = -5e-05x2 + 0.0348x + 0.7148 . i translated to: =exp(-5)-0.5*(b4)^2+0.0348*b4+0.7148 b4 period running number (i have 365 days, b4 first period , c4 is next period etc) i have strange results (my prediction decreases on time instead of getting increased) guess didn't interpret excel's formula well. how can resolve problem? an image of chart , excel's formula: -5e-05 isn't exp(-5)-5 it -5 * 10^(-5) for clarification: -7e-05 means: -7 * 10^(-5) = -.00007

swift - iOS 9: view is not rendered properly after I rotate device -

Image
this custom uiview : after rotate horizontal, , portrait looks this: why? after rotate device method called: override func traitcollectiondidchange(previoustraitcollection: uitraitcollection?) { tableview.reloaddata() } what doing wrong? works perfect ios8, not ios9

UpdatePanel and panel visibility asp.net c# -

i have 2 panels. each panel contains updatepanel. first panel password textbox. i set second panel's visibility on page_load false. if user enters correct password, second panel should visible , first panel shouldnd. the code: <asp:panel id="passwordpanel" runat="server"> <asp:updatepanel id="updatepanel2" updatemode="conditional" runat="server"> <contenttemplate> geben sie das passwort ein:<br /> <br /> <asp:textbox id="txtpassword" autopostback="false" runat="server" textmode="password"></asp:textbox> <br /> <br /> <asp:button id="btnconfirmpassword" runat="server" autopostback="true" text="senden" cssclass="button" onclick="btnconfirmpassword_click"/> </contenttemplate> ...

php - Best way to alert user -

i have database table called userbadges . users have badges @ level 0 "locked" (greyed out) . can unlock @ level 1 , way level 3. each level worth points. userbadges {user_id,badge_id,level,score,seen} what best way me alert user a) have unlocked new badge b) have leveled badge i have code , doesn't seem right. counts number of new badges (): function countnewbadges() { require "connect.php"; $newbadges = mysqli_query($connection,"select users.studentid, individualbadges.badgename, ub.level, count(ub.seen) total userbadges ub inner join users on users.id = ub.user_id inner join individualbadges on individualbadges.id = ub.badge_id studentid = '".$_session["studentid"]."' && seen=0 && level!=0") or die(mysqli_error($connection)); while ($data = mysqli_fetch_array($newbadges)) { echo $data['total']; } } i have code set seen field of badges table 1. i m...

angularjs - Adding templateUrl dynamically while setting $routeProvider $ angular.config -

i angular newbie.i achieve following code... $routeprovider.when('/view', {templateurl: 'viewswitcher?pageid='+$rootsope.pageid+'&userid='+$rootsope..userid+'&token='+$rootscope.token, controller: ''}); viewswitcher servelet responses me html page per pageid,userid(saved in $rootscope) ......but $rootscope not available....thanks in advance! you 1 thing here instead of store variables inside $rootscope use provider accessible inside config phase. create 1 mydata provider share data between different components of app. code //before using `mydataprovider` make sure has been injected dependency. $routeprovider.when('/view', { templateurl: 'viewswitcher?pageid='+mydataprovider.pageid+'&userid='+ mydataprovider.userid+'&token='+ mydataprovider.token, controller: 'myctrl' //<--here should controller });

azure stream analytics - Latest value in PowerBi from ASA -

is possible show latest value has arrived in powerbi stream analytics? in card diagram type example imagine having filter value measurementtime field selecting latest value or something? best can right use q&a ask question "show value in last 10 seconds". it's valid request, submit item through support.powerbi.com?

tfs - Can't have Nuget.config in source control? -

in 1 of our projects, i've converted (now broken) old-school msbuild based automatic package restore shiny new automatic package restore in nuget 3.0 (visual studio 2015 rtm default). as official guidance suggests, have created .nuget/nuget.config file in solution folder stop uploading binaries. no more clutter in source control. life good. however, doesn't work on other machines if nuget.config isn't included in source control, have done that. life bad again. visual studio can't load nuget correctly , error log indicates can't open .nuget/nuget.config read-write. fair enough, since it's under tfs source control , not checked out. so here's question: how have cake , eat it, too? upgrade nuget 3.1.1, behaves expected , doesn't open file read-write. delicious cake. the discussion (closed) issue here: https://github.com/nuget/home/issues/1103 .

java - How to solve spring mvc mapping -

i have 2 controllers first 1 was: @controller("/similarsearch") public class similarsearchcontroller { @autowired similarsearchservice similarsearchservice; @requestmapping(method = requestmethod.get,produces = "application/json; charset=utf-8") @responsebody public string loadsimilarsearchphrases(httpservletrequest request, @requestparam(value = "q", required = true, defaultvalue = "") final string query){ httpsession session = request.getsession(); list<list<similarlink>> responsemain = (list<list<similarlink>>) session.getattribute("responsemain"); map<string, list<string>> result = similarsearchservice.getsimilarsearchphrases(responsemain,query); return new jsonserializer().exclude(jsonhelper.standard_exclude).include("*").serialize(result); } } and worked perfectly, when accessed localhost:0000/similarsea...

java - Basic libGDX project runs on 47-48 fps -

i created empty(only badlogic texture) libgdx project , tested on android device "jiayu g2s" . , running on 47-48 fps instead of 60. thought device not fast enough testing, have half-finished game lot of drawings , calculations, fps still 47-48. can problem? how can increase 60? libgdx's version 1.6.4 testing on api16(android 4.1.2) i found out device's maximum display refresh rate 47.49, can't go higher. the smartest solution of problem creating seperate thread game's logic , calculate how many times should executed before calling render() method. fix problem display refresh rates.

vba - Change the default form in created contacts in Outlook -

Image
you know outlook has default form show contacts(this one) and have own form created(this one) i want see contacts own form,but can create new contacts form.i can't modify created ones,which default form. how can that? macro?any idea? thank much forms associated message class. need change messageclass property values contacts want form shown. example, when item selected, outlook uses message class locate form , expose properties.

plone - Possible to pass title-value onto edit-form via URL-parameter? -

appending /createobject?type_name=document&id=some_id_value folderish object's url works. trying same other field-names, doesn't: /createobject?type_name=document&title=some_title_value , not work, neither uppercased field-name title , instead of title . then, wanted read value of url javascript on edit-form , insert title-field, url redirected /portal_factory/document/document.2015-08-25.2537358109/edit , parameter isn't available anymore, then. so now, manipulate browser's history, able read of window.referral , that's bad practice. is possible @ all, pass title createobject -method or there other possible solution known without need, have edit-form customized, respectively create dedicated one? a dexterity-solution welcome, too. update : what know, last location of link ("add page") clicked. gets lost, due redirect. relates to : provide default value on field on edit form you customize portal_skins/plone_scripts/cre...

Exclude plugins from Django cms search -

i'm using aldryn-search on django cms site. 1 of custom plugins has manytomany field django groups, indicate user groups may see plugin (and of course child plugins). i'm considering field in render() method of plugin. this works fine on page, can't find way prevent regarding plugins being indexed search (which elastic search). idea? so exclude plugin being searched completely. can set search_fulltext = false in plugin class or plugin model. to exclude plugin users not have access bit more work not complex. you have create dedicated index class plugin , deactivate cms page search shown below. then in dedicated plugin index class, add multivaluefield hold list of user ids can see plugin, note you'll have make sure index plugins have page attached them plugins.filter(placeholder__page__isnull=false) , plugins page published , public. after finishing index class/logic, if using solr, update schema reflect new field. rebuild index. here's...

java - Proxy settings in Spring security saml -

i'm learning spring security using saml. got example https://github.com/spring-projects/spring-security-saml i'm in network have proxy. hard find solution enter proxy details. used following in securitycontext.xml <bean id="hostconfiguration" class="org.apache.commons.httpclient.hostconfiguration"/> <bean class="org.springframework.beans.factory.config.methodinvokingfactorybean"> <property name="targetobject" ref="hostconfiguration"/> <property name="targetmethod" value="setproxy"/> <property name="arguments"> <list> <value>proxyhost.com</value> <value>5555</value> </list> </property> </bean> but still i'm getting connection refused error. open connection idp.ssocircle.com:80 closing connection. i/o exception (java.net.connectexception) ca...

mysql - SQL COUNT with 2 INNER JOINS -

video table stores id , video data. tag table stores id , tag_name. video_tag table connects video_ids , tag_ids represent video belongs tag. for example in query below, can videos belong tags ids both 3 , 4 also, want know how many rows there. how should modify query? select * video inner join video_tag on video.id = video_tag.video_id inner join tag on tag.id = video_tag.tag_id video_tag.tag_id in (3,4) group video.id having count(video.id)=2 order video.id desc * table structures: -- -- table structure table `video` -- create table if not exists `video` ( `id` int(11) not null auto_increment, `original_id` varchar(20) collate utf8_turkish_ci not null comment 'alınan sitedeki id''si', `source` tinyint(2) not null, `title` varchar(160) collate utf8_turkish_ci not null, `link` varchar(250) collate utf8_turkish_ci not n...