Posts

Showing posts from January, 2012

php - Laravel 5.3 keep going to /home view -

kindly me solve auth redirect issue. currently i'm using laravel 5.3.22. put protected $redirectto = 'dashboard'; into logincontroller. then test redirect in browser: http://myapp.localhost/login it shows "login page" correctly. continue login, redirect me "dashboard" correctly. the issue here. after login, if tried go to http://myapp.localhost/login it redirect me "home" not available. should go "dashboard". please me. please in folder /app/http/middleware/ there should see following file redirectifauthenticated.php change from: public function handle($request, closure $next, $guard = null) { if (auth::guard($guard)->check()) { return redirect('/home'); } return $next($request); to : public function handle($request, closure $next, $guard = null) { if (auth::guard($guard)->check()) { return redirect('/dashboard...

How to handle new data addition on infinite scrolling DOM -

i had question thought needed expert advice. have infinitely scrollable div loaded list, 10 @ time. works fine if there no changes in list. i have form prepends list new item , hence disturbs sequence of infinite scroll i.e. last item in displayed content repeated. i'd thankful if advice me how handle condition. things tried do, splicing last item in displayed content. (vague way, not useful if list prepended multiple items) keeping track of how many items prepended , passing skip = <number_of_prepended_items> argument server skip these newly added items (works fine feel break) reload first 10 items upon addition of new item. any suggestions? as harry pehkonen said, could, example, give each item id value, increment 1 each new element. can request first 10 items after id server, in case lowest id on page (literally). give first 10 items not have , prevent duplicates.

android - Error login to server with volley -

i have problem login. force stop when login button click. this code : //initializing views edittextemail = (edittext) findviewbyid(r.id.edemail); edittextpassword = (edittext) findviewbyid(r.id.edpassword); btlogin = (button) findviewbyid(r.id.btlogin); btlogin.setonclicklistener(this); ((textview) findviewbyid(r.id.btdaftar)) .setonclicklistener(new onclicklistener() { public void onclick(view v) { loginactivity.this.startactivity(new intent(loginactivity.this,signupactivity.class)); } }); } @override protected void onresume() { super.onresume(); //in onresume fetching value sharedpreference sharedpreferences sharedpreferences = getsharedpreferences(config.shared_pref_name,context.mode_private); //fetching boolean value form sharedpreferences loggedin = sharedpreferences.getboolean(config.loggedin_shared_pref, false); //if true if(loggedin){ //we start profile activity in...

sql server - sql datetime converted to specific day if between certain times -

i have string of datetime records. i'd make case condition or if statement reads datetime value , assigns specific day. the day range 2:45pm next day @ 2:45pm. range considered 'next day' ex. time of post 3:42 pm 11/12/2016 , therefore read 11/13/2016 . if post made @ 2:42 pm 11/12/2016, have read 11/12/2016. so far don't believe convert(date, 'datetime') work due time range constraints. thanks use dateadd function add time date gets next day. 2:45pm you'll need add 9:15.

GAMS Inventory Model -

i looking through gams inventory modelling in gams model library , trying implement similar version according our needs. there 2 plants 3 products , 6 periods determine optimal production schedule. following part of code sets /i1*i3/ j /j1*j6/; the total inventory in every period maximum limit given ic1(j).. sum(i,x2(i,j))=l=42; ic2(j).. sum(i,y2(i,j))=l=56; code giving me optimal solution, says part being produced in plant , stored in plant b. not possible, unable model otherwise. tried using dollar operator in equation giving error of uncontrolled set constant. there way can circumvent , if part produced in plant stored in plant ? in advance.

javascript - Cannot access cookie created by js using php -

i have began learn how use cookies , i'm sorry if answer simple. attempting create mysql database name js variable. this, attempting save variable cookie: document.cookie = "test=" + variable; i try cookie , save php variable executed: <?php // define set variables $servername = "localhost"; $username = "root"; $password = ""; // input variables $test = $_cookie["test"]; // create connection $conn = mysqli_connect($servername, $username, $password); // check connection if (!$conn) { die("error: " . mysqli_connect_error()); } // sql create table $sql = "create database `$test`"; if (mysqli_query($conn, $sql)) { header("location: index.html"); exit; } else { echo "error: " . mysqli_error($conn); } mysqli_close($conn); ?> i have tried creating cookie via php testing purposes: <?php setcookie("test","variable"); ?> when ...

ios - Using viewDidAppear to present a View Controller, re-opening it when it's closed -

in app, i've created new storyboard serves basic tutorial how use features. (instructions.storyboard). storyboard has it's own class - instructionsvc.swift i want present instructionsvc when mainvc loads within viewdidappear. it works great. fires on app load it's supposed to. problem occurs when press [close] button on instructions interface. closes vc, fades main screen, , fires instructions vc up. how can prevent instructions vc loading once it's closed? func openinstructions() { let storyboard = uistoryboard(name: "instructions", bundle: nil) let instructionsview = storyboard.instantiateviewcontroller(withidentifier: "instructionsstoryboardid") instructionsview.modalpresentationstyle = .fullscreen instructionsview.modaltransitionstyle = .crossdissolve self.present(instructionsview, animated: true, completion:nil) } override func viewdidappear(_ animated: bool) { openinstructions() } and within instructions c...

how to redirect the std out immediately to a file in C++ or python? -

in c++, have code: #include <unistd.h> #include <iostream> using namespace std; int main() { cout<<"before-sleep"<<endl; sleep(5); cout<<"after-sleep"<<endl; return 1; } then compile g++ main.exe , run it. when run redirect std out file : ./main.exe > file.log however, 2 line "before-sleep" , "after-sleep" print file @ same time -- have 5s delay. how can made first line print file , second line print file 5s delay? the situation same in python: import time print 'before sleep' time.sleep(5) print 'after sleep'

EXCEL VLOOKUP to other workbook -

i keep trying , trying nothing n/a photo added. tried put e:\onedrive\ubuy still didn't work. need left workbook in cell c2 vlookup of cell a2 in right workbook d2 cell enter image description here l 2 aa cell 400. , show me in c2 value @ aa. ty :[ command did =vlookup(a2,'[מחירון פריטים - עסקית.xlsx]xl_pricelist'!$d$2:$aa$375,23,false) without changing data, can edit formula this: =vlookup(text(a2, "@"),'[מחירון פריטים - עסקית.xlsx]xl_pricelist'!$d$2:$aa$375,23,false) the text(a2, "@") converts lookup value text format (same data you're searching) on fly, don't need edit data.

itcl - tcl need a way to get Job Id from the huge string no regexp to use as case can fail -

need fetch job id huge string(1618252) , no regexp operation may fail when job id not found---------- % set invoc [[$this cget -testrun] cget -invocation] tcl profilemgr -confignetwork {} -startbefore -releaseunusedequip 0 \ -profile ptse1-bsd2 -noreserve 0 -noreplace 0 \ -comment {<a href="/testrunscheduler/schedulerjob.rvt?job_id=1618252">profile push: 1618252</a>} \ -attr {} -dur 300minutes -controlassert 0 -rolesubst {} -offline false -nodb 0 \ -image {} -layer2mode mapping -checkleaks 0 -config {} -trace 0 -debug 0 -desc 0 \ -notify 0 -forceprofileip false -clusterhashingmode simple -doconfig true \ -reservation 0 -projects pts_7_20-latest -flavor {} -platformmix {} \ -releasereservation 0 -pkgext {} -emails {} -loadbalancingmode none -enableiom false \ -checkconn 1 -platform ptsvpl-esxi-lnx -pkgview {} -offlinefailedconn 1 -noall 0 \ -ipmode ipv4 -runtype pmgr-run -enableudpprioritization false \ -params...

A questionon FOR JSON to delegate the JSON formatting to SQL Server -

the following statement retrieves data odata service in sql server 2016 when database context set adventureworks2014: select 'http://services.odata.org/v4/northwind/northwind.svc/$metadata#products(productid,productname)/$entity' '@odata.context', productid, name productname production.product productid <400 json auto when 'master' context, returns error. however, northwind not present in sql server 2016 on instance of sql server 2012 on same windows 10 machine. why did work when database context running query 'adventureworks 2014'? the above query link: https://msdn.microsoft.com/en-us/library/dn921897.aspx if master current database, query try find production.product table in master database , fail because there no such kind of table there. should switch context of query database table placed, or use 3 part name explicit database name, e.g.: select 'http://services.odata.org/v4/northwind/northwind.svc/$metadata#p...

firebase - Need help understanding this promise and handling the error -

i saving data firebase database inside polymer element. works fine. person who's new promises need understand promise.resolved() means here @ end of method. isn't promise going through before when .then used? doing? looked around can't find example of resolved() no value. and how can change have more familiar structure below: .then(function(snapshot) { // promise "fulfilled" (it succeeded). }, function(error) { // promise rejected. }); here's block , promise.resolved() taken documentation : savedata : function() { this.$.document.data = this.$.message.value; this.$.document.save("/parent", "child").then(function() { console.log('sent event!!!!!!'); this.$.document.reset(); }.bind(this)); return promise.resolve(); }, first need understand basics of promises. lets start basics - a newly created es6 promise in 1 of follo...

rest - How to start a HTTP server in android -

i new android development. want create tcp server in android can handle post or request coming client. if see node js (following program): var net = require('net'); var server = net.createserver(function(socket) { socket.write('echo server\r\n'); enter code here socket.pipe(socket); }); server.listen(1337, '127.0.0.1'); its easy start tcp server. need similar should able handle request coming rest client, post man or advance rest client or browser

machine learning - Autoencoder and Neural Network Overfitting in terms of parameter number? -

i have 1100 sequences 2 classes. of them 400 1 class 1 , 700 class 2 . have used 1 hidden layer auto-encoder of 2 neurons capture features. initial features tri-grams each sequences. so, each sequence have 6860 tri-grams. result of input vectors sparse vectors. now, if calculate parameters network, have 6860 * 2 = 13720 paramters (1st layer) 2 * 6860 = 13720 parameters (2nd layer) ----------------------------------------- 27440 parameters (in total) now, way many parameters in comparison number of data points. hence, have used dropout value of 0.98 , on layer 1->hidden layer hidden layer->output layer makes number of parameters 13720 * 0.02 = 274 on each layer , in total 548 parameters. now, after training, tried encoder on test data of 500 sequences, , extracted hidden layer of 2 dimensional data. use data on 5 neuron single hidden layer neural network classify. results in getting around 90% accuracy. my question overfitting in autoencoder? ...

swift - Query Coordinates in Firebase with iOS SDK -

i have firebase database data so: { "city name" : { "uniqueid" : { "averagerating" : 1, "createdby" : "somedood", "latitude" : 1234, "longitude" : 4321, "name" : "best buy", "ratingcount" : 1 }, "uniqueid" : { "averagerating" : 3, "createdby" : "somedood", "latitude" : 1234, "longitude" : 4321, "name" : "indigo", "ratingcount" : 1 }, "uniqueid" : { "averagerating" : 3, "createdby" : "somedood", "latitude" : 1234, "longitude" : 4321, "name" : "catholic parish", "ratingcount...

Is there customer group in virtocommerce 2? -

Image
i need have customer group on pricing module , of modules. there customer group in virtocommerce 2? if there is, admin panel? you can specify customer group using tags, tags need added customer object on storefront, custom expressions can created - https://virtocommerce.com/docs/vc2devguide/working-with-platform-manager/extending-functionality/composing-dynamic-conditions :

ruby on rails 4 - cap production deploy NoMethodError: undefined method `each' for "3w":String -

i'm trying deploy app server, keep getting error cant find solution for. when run : bundle exec cap production deploy --trace the output : ** invoke production (first_time) ** execute production ** invoke load:defaults (first_time) ** execute load:defaults ** invoke bundler:map_bins (first_time) ** execute bundler:map_bins ** invoke deploy:set_rails_env (first_time) ** execute deploy:set_rails_env ** invoke deploy:set_linked_dirs (first_time) ** execute deploy:set_linked_dirs ** invoke deploy:set_rails_env ** invoke rbenv:validate (first_time) ** execute rbenv:validate ** invoke rbenv:map_bins (first_time) ** execute rbenv:map_bins ** invoke deploy (first_time) ** execute deploy ** invoke deploy:starting (first_time) ** execute deploy:starting ** invoke deploy:check (first_time) ** execute deploy:check ** invoke git:check (first_time) ** invoke git:wrapper (first_time) ** execute git:wrapper 00:00 git:wrapper 01 mkdir -p /tmp ✔ 01 deploy@server's-ip 0...

Firebase Sorting Score from Highest to Lowest ~ Android -

inside mainactivity , have function: public void sortingdata() { mrootref = new firebase("https://fyp-1-43a27.firebaseio.com/user"); dbsortalldata = firebasedatabase.getinstance().getreference(); listview mlvscore = (listview) findviewbyid(r.id.lvscore); final list<userinformation> listscore = new linkedlist<>(); final arrayadapter<userinformation> adapter = new arrayadapter<userinformation> (this, r.layout.scoreboard_row, listscore) { @nonnull @override public view getview(int position, view view, viewgroup parent) { if (view == null) { view = getlayoutinflater().inflate(r.layout.scoreboard_row, parent, false); } userinformation item = listscore.get(position); ((textview) view.findviewbyid(r.id.tvscorename)).settext(item.getname()); ((textview) view.findviewbyid(r.id.tvscorepoint)).settext(item.get...

c# - Service Fabric with F# not working -

i tried convert default template "service fabric applicatoin" "actor service" c# f#. here github repo . i can compile when deploy local cluster system.argumentnullexception . anyoune know wrong here? here stack trace (it's in german, sorry): bei system.reflection.emit.fieldbuilder..ctor(typebuilder typebuilder, string fieldname, type type, type[] requiredcustommodifiers, type[] optionalcustommodifiers, fieldattributes attributes) bei system.reflection.emit.typebuilder.definefieldnolock(string fieldname, type type, type[] requiredcustommodifiers, type[] optionalcustommodifiers, fieldattributes attributes) bei system.reflection.emit.typebuilder.definefield(string fieldname, type type, type[] requiredcustommodifiers, type[] optionalcustommodifiers, fieldattributes attributes) bei microsoft.servicefabric.services.remoting.builder.methodbodytypesbuilder.buildrequestbodytype(icodebuildernames codebuildernames, codebuildercontext context, methoddescription ...

c# - ListView.ScrollIntoView doesn't work properly -

i have listview in page. select row , scroll listview . selecteditem goes out of visible area. when call listview.scrollintoview( selecteditem) jumps row content of row wrong , it filled last row visible when scrolled. it in xaml <listview name="lstsurahtext" selectedvaluepath="tblsuyaid" showsscrollingplaceholders="false" > <listview.itemtemplate> <datatemplate> <grid> <grid.columndefinitions> <columndefinition width="10*"/> <columndefinition width="*"/> </grid.columndefinitions> <stackpanel> <contentcontrol content="{binding rtb}" /> ...

How to get Google refresh_token on multiple devices -

i creating node based authentication server google apps can use access tokens google data apis. i basing off server side flow described here: https://developers.google.com/youtube/v3/guides/auth/server-side-web-apps i @ point trying implement refresh token logic when token expires. need refresh_token . refresh token no problem - first time access service subsequent times not. i plan keep these tokens in local storage on browser it's not problem - until access same service on mobile or additional device. how refresh token on second or third device? surely don't have revoke tokens , sign in again each time want switch new device? thanks

php - Prestashop won't work when migrating to a new domain -

i moved prestashop 1.7.0 new web hosting , error: fatal error: uncaught exception 'defuse\crypto\exception\environmentisbrokenexception' message 'your system not have secure random number generator.' in /membri/gbdns/vendor/defuse/php-encryption/src/core.php:110 stack trace: #0 /membri/gbdns/vendor/defuse/php-encryption/src/key.php(23): defuse\crypto\core::securerandom(32) #1 /membri/gbdns/classes/phpencryptionengine.php(101): defuse\crypto\key::createnewrandomkey() #2 /membri/gbdns/classes/phpencryption.php(97): phpencryptionenginecore::createnewrandomkey() #3 /membri/gbdns/config/bootstrap.php(131): phpencryptioncore::createnewrandomkey() #4 /membri/gbdns/config/config.inc.php(56): require_once('/membri/gbdns/c...') #5 /membri/gbdns/index.php(27): require('/membri/gbdns/c...') #6 {main} thrown in /membri/gbdns/vendor/defuse/php-encryption/src/core.php on line 110 i have php 5.6 , mysql running i tried disab...

how can make an application for IOS in java? -

i know can create ios application on xcode if own mac either using swift or objective-c code. how can go creating ios app java or on regular windows computer in different programming language? you can't distribute ios apps non-mac os. nevertheless, have such options xamarin creating ios apps using c#, or react native - using js, but, again, won't able distribute, or compile try, without mac update have tried react native , it's possible view how app without mac

android - why am i getting Attempt to invoke interface method 'int java.util.List.size()' on a null object reference? -

this question has answer here: what nullpointerexception, , how fix it? 12 answers enter code here` public class mainactivity extends appcompatactivity { private recyclerview recyclerview; private albumadapter adapter; public list<album> list; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); recyclerview = (recyclerview) findviewbyid(r.id.recycler_view); new movieasynctask().execute(""); adapter = new albumadapter(this, list); recyclerview.setlayoutmanager(new gridlayoutmanager(this, 2)); recyclerview.setadapter(adapter); } public class movieasynctask extends asynctask<string,void,list<album> > { public list...

git - Make unable to branch merge [Lock for merge?] -

i wondering, if it's possible make branches unable merge? example: have master , brancha , branchb . i'm working on branch branchb completetely different other branches. how make branch unable merge others? my bad, if it's duplicate question. if branches different need separate repository, or fork if you're using github , branch in question @ least similar other. a rather ugly workaround hook. there's no pre-merge hook there prepare-commit-msg hook (link answer pre-merge hooks) receives argument give you'd need write script checks name of branch. it'd ugly. i'm not 100% sure work. realistically, should go first option. if 2 branches can never merged should in separate repositories.

angular - Binding custom header element -

my problem is, have component 'action-bar' supposed have header. have freedom of being able insert h1,h2,h3 etc. binding, component can called , title set. component: import { component } '@angular/core'; @component({ selector: 'action-bar', templateurl: 'action-bar.component.html', styleurls: ['action-bar.component.styl'] }) export class actionbarcomponent { } template: <div class="action-bar"> <ng-content select="[action-bar-title]"> </ng-content> </div> thus in component using it. do <action-bar> <div action-bar-title> <h1>hi</h1> </div> </action-bar> but how make h1 bindable action-bar component? can use h2 or h3. or mindset angular 2 wrong, should there 'a' header, maybe size attribute or class switch header size. im still learning with thanks. i have component 'action-bar' supposed have...

sql - How to insert results from select (from db1) into table (in db2) -

i have 2 databases same table. have connectionstring connect both databases. how can perform select table a in db1 , insert results in table a in db2? my connectionstrings: for db1: server=12.34.56.789,12345;database=shop;user id=admin; password=1234567890; for db2: server=34.12.56.789,12345;database=shop;user id=admin; password=1234567890; try one /*do target server*/ exec sp_addlinkedserver @server='12.34.56.789,12345' exec sp_addlinkedsrvlogin '12.34.56.789,12345', 'false', null, 'admin', '1234567890' select * tablea [12.34.56.789,12345].[shop].[dbo].[tablea]

android - "Find in page" in Chrome Custom Tabs menu -

according documentation , custom tabs menu includes "find in page" , "open in chrome" menu items default. in implementation, created following implementation guide, "open in chrome" appears. how can include "find in page" menu item , functionality in custom tabs? know can add menu item customtabsintent.builder.addmenuitem , name "find in page", have program search functionality well? "find in page" menu item comes in default menu items. don't need handle intent, handled chromeactivity called contextual search inside chrome. default customtab menu resource file seems doesnt include find in page. main chromeactivity menu resource file includes it, maybe need create similar menu resource project. guess is, action on these menu items handled id.

javascript - In Angular2 NGmodule .I want to load 2 different sets of route modules based on Condition -

in angular2 .i want load 2 different sets of route modules 1 jobseekers , other employers . the urls same modules jobseekers , employers different . there fore want dynamically load route modules bases on session of login .is there way can ?? or there better way can implemented in angular2 basically want able load ngmodules based on condition below sample code . @ngmodule({ imports: [browsermodule, httpmodule,customroutes.getcustomroutes(), sharedmodule.forroot()], declarations: [appcomponent], providers: [ { provide: app_base_href, usevalue: '<%= app_base %>' }, canactivateguard,accountservice, profileservice], bootstrap: [appcomponent] }) export class appmodule { constructor(private _http:http,@inject(accountservice) authservice:accountservice) { } // custom route export class customroutes { public customroutes; constructor(@inject(accountservice) accountservice:accountservice) { } getcustomroute...

angularjs - Unknown provider NgTableParamsProvider <- NgTableParams -

i see lot of posts on stackoverflow error: error: [$injector:unpr] unknown provider: ngtableparamsprovider <- ngtableparams http://errors.angularjs.org/1.5.8/$injector/unpr?p0=ngtableparamsprovider%20%3c-%20ngtableparams @ http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:33767:12 @ http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38210:19 @ object.getservice [as get] (http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38363:39) @ http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38215:45 @ getservice (http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38363:39) @ injectionargs (http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38387:58) @ object.invoke (http://localhost:3000/packages/modules.js?hash=5b256037162d84065d102fdba9b374faa45dbd89:38409:18) @ $...

c# - Youtube API access is granted but I still have Invalid Credentials error -

Image
trying test search functions of youtubeapi, getting could because of channel(which binded gmail account, using in console.developers.google) banned? upd: created new account, situation still same well, i've have done here: created porject in console.developers.google activated youtube data api(choosed app or somth this, not js one), downloaded json, looks that first call authorize method (new page shows, asking permission, clicking allow button, , seems ok), trying use search , 401 error heres code using system; using system.collections.generic; using system.linq; using system.web; namespace webapplication3.services.serviceauthoriaztion.impl { using system.data.entity.core.metadata.edm; using system.io; using system.threading; using google.apis; using google.apis.auth.oauth2; using google.apis.services; using google.apis.util.store; using google.apis.youtube.v3; public class youtube : icustomservice { p...

MySQL Procedure Wait for loop to process before continuing -

i'm working on procedure need move stock items selected bin levelling bin , move items need in selected bin bin. empty container i'm using cursor. move instances selected container, i'm using procedure had created previously. i've noticed need sleep 1 second between these 2 part. if don't, error code: 1172. result consisted of more 1 row. can find procedure below. there better way this? create definer= current_user procedure container_emptyandupdatewithinstances ( out varresponse int unsigned, in varidcontainer int unsigned, in vardelimitedidfainstances text, in variduser varchar(100) ) begin /* procedure empty container varidcontainer putting items in it's location stock leveling (idcontainer= 286) move instances have been selected it's location response number of instances remain in container */ d...