persistent

Orphaned Session Management Records in Database. How to handle the issue? DB Stability Risk

左心房为你撑大大i 提交于 2019-12-06 14:59:04
I have a webapp that uses persistent cookies to allow a user to stay logged it. I am using the Improved Persistent Login Cookie method. https://www.programering.com/a/MDO0MzMwATA.html https://www.experts-exchange.com/questions/29006560/selector-validator-cookies.html When a user is logging in through the LOGIN form and has asked to be remembered I generate a random selector and a random token and add these to a table called Session in my DB along with the userID and other values(IP,time,browser,whaterver). I also set a cookie called KeepMeLoggedIn with the value selector:token and expire in 30

C# TcpClient reading multiple messages over persistent connection

泄露秘密 提交于 2019-12-06 11:55:59
I'm trying to create a TCP Server & Client that will have a persistent connection so that the server and client at any point in time can notify each other of certain 'events'(so push instead of poll). I almost have everything working, clients can connect, connection is kept open and client and server can both write & read from the tcp stream. The problem is with the read, I've defined the message boundary by first sending 8 bytes that contain the length of the message. Once I've received it, the messages of lenght x is read and an event is raised. This all works fine but once the message has

CORBA: Java's servertool does not allow me to register a server class

99封情书 提交于 2019-12-06 08:46:14
Have been pulled down into the realm of CORBA... I am trying to quickly learn (if not master...) CORBA along side its Java mappings. I have come upon some old tutorials: Java IDL: The "Hello World" Example Naming Service orbd - The Object Request Broker Daemon I have created a project with the source from the first link above (Java IDL...) and have run both HelloServer and HelloClient after running the following command: start orbd -ORBInitialPort 1050 Not surprisingly, everything works :) I then with to register the HelloServer in the as a persistent service and fail miserably! I run the

Foreign key constraints in Yesod/Persistent?

前提是你 提交于 2019-12-06 07:32:42
问题 I am trying to use Database.Persistant to make a database for a Scotty app, and I cannot figure out the syntax for adding a foreign key constraint between tables. For example, I have a User table and a Post table, and I want the Post table to have an attribute authorId which references UserId in User . This can be accomplished quite easily in raw SQL, but I want to be able to access the data through haskell without resorting to raw sql commands. Also, the constraints would be overwritting

v8 WeakCallback never gets called

纵饮孤独 提交于 2019-12-06 05:37:43
I know that this question is old but all the answers I found doesn't work and are outdated. But here is my code: void Destroyed(const v8::WeakCallbackData<v8::Object, int>& info) { std::cout << "d: " << *info.GetParameter() << std::endl; } std::vector<v8::Persistent<v8::Object, v8::CopyablePersistentTraits<v8::Object>>> persistent; int i = 0; void Constructor(const v8::FunctionCallbackInfo<v8::Value>& info) { v8::HandleScope scope(v8::Isolate::GetCurrent()); v8::Persistent<v8::Object, v8::CopyablePersistentTraits<v8::Object>> per; per = v8::Persistent<v8::Object>(v8::Isolate::GetCurrent(),

MaybeT and Transactions in runDb

给你一囗甜甜゛ 提交于 2019-12-06 05:29:05
问题 For my previous question on chaining failures, Michael Snoyman had suggested I use MaybeT to run them so if any of them fails, it will just short-circuit to Nothing . I was under the impression runDb runs everything in a transaction. So shouldn't a failure at any point in code automatically rollback the transaction? mauth <- runDb $ runMaybeT $ do valid <- MaybeT $ return $ listToMaybe errs uid <- MaybeT $ insertUnique u vid <- MaybeT $ getBy $ UniqueField v -- this step fails but previous

Unable to Restart Service after killed despite running in foreground and with START_STICKY

☆樱花仙子☆ 提交于 2019-12-06 02:05:26
I am facing a critical issue with binded service running as foreground and with notification. I am doing everything correct as mentioned by most of the tutorials and solutions I found. I have an activity which starts a service and then bind with it. In onCreate() of service, i am using startForeground() and showing notification as well. I am also returning START_STICKY in onStartCommand() but when my application gets killed i see this in my log cat .. Force stopping package com.example.voicerecognizersp appid=10102 user=0 I/ActivityManager( 929): Killing proc 27176:com.example

Haskell Persistent: how get entity from db by key if i have key in integer variable?

狂风中的少年 提交于 2019-12-05 17:31:55
问题 I use Persistent orm with scotty web framework. I want to get value from db by id. These id are coming to me from GET request There are "get" function that takes "Key Entity" variable and returns "Maybe Entity". I use following code to get value from db k <- keyFromValues $ [(PersistInt64 myOwnIntVarFromRequest)] case k of Left _ -> {-some processing-} Right x -> do t <- liftIO . runDb $ get (x::Key Post) --Post is one of my models case t of Nothing -> {-processing-} Just x -> {-processing-}

MongoDB Example for Yesod / Persistent

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 14:39:43
问题 Haskell and Yesod newbie here. I've been trying to follow the Integration with Yesod example from the Persistent chapter in the Yesod book (http://www.yesodweb.com/book/persistent). The Sqlite compiles and runs fine it seems. However, I'm trying to use MongDB and am having a hard time getting things to work. Specifically: In the example for sqlite: share [mkPersist sqlSettings, mkMigrate "migrateAll"] [persist| The Yesod book says "Mongo code will use mongoSettings instead." But I can't find

说说Android应用的persistent属性

谁说我不能喝 提交于 2019-12-05 13:06:10
说说Android应用的persistent属性 侯 亮 1 启动persistent应用 在Android系统中,有一种永久性应用。它们对应的AndroidManifest.xml文件里,会将persistent属性设为true,比如: <application android:name="PhoneApp" android:persistent="true" android:label="@string/dialerIconLabel" android:icon="@drawable/ic_launcher_phone"> 在系统启动之时,AMS的systemReady()会加载所有persistent为true的应用。 public void systemReady(final Runnable goingCallback) { . . . . . . . . . . . . try { List apps = AppGlobals.getPackageManager(). getPersistentApplications(STOCK_PM_FLAGS); if (apps != null) { int N = apps.size(); int i; for (i=0; i<N; i++) { ApplicationInfo info = (ApplicationInfo