Posts

sql - 42501: INSUFFICIENT PRIVILEGE ERROR while querying in Postgresql -

i trying query database table in postgresql, every time run below query gives me insufficient privilege error. possibly reason such permission denied error. also, using pgadmin tool in windows connect database in linux environment. below query running > > select appid,hash > app > appid=1; while running same query getting below error error: permission denied relation app ********** error ********** error: permission denied relation app sql state: 42501 the user running query need permissions table. can grant them user grant statement. below example grants public grant select on tablename public; also have seen selinux cause isses , places such here mention it. not sure of command turn selinux off can see if running using selinuxenabled && echo enabled || echo disabled

python - Detecting multiple sessions from same user on Google App Engine -

i writing application uses google user api , having google account can login. want prevent multiple users using same google account login simultaneously. basically, allow 1 user / account using application. running subscription service, need restrict users sharing accounts , simultaneously logging in. can accomplish somehow in app engine using users module? if not, can please suggest alternate mechanism? i using python on app engine. yes can, you'll have build session tracking functionality yourself.

django-rest custom url in a ModelViewSet -

i'm having issue adding custom url modelviewset in django-rest-framework. here's example of main urls.py router = routers.defaultrouter() router.register(r'post', postviewset) urlpatterns = patterns('', url(r'^api/', include(router.urls)), ) my modelviewset looks like class postviewset(viewsets.modelviewset): """ api endpoint allows users viewed or edited. """ queryset = post.objects.all() serializer_class = postserializer permission_classes = (permissions.isauthenticatedorreadonly, isownerorreadonly,) search_fields = ('created') def pre_save(self, obj): obj.user = self.request.user # # based on post type decide serializer use data def get_serializer_class(self): # # default text role serializer return postserializer that works great url like /api/post/ i'm looking set day like /api/post/yyyy/mm/dd/ or should ...

.net - Custom Naming Style Options in Resharper For Backing Fields -

Image
the coding standard in organization private fields lowercamelcase backing fields used properties prefixed underscore ( _ ). there way add rule backing fields in resharper naming style tool. here's naming rule editor: i'd rather error not show local variables examples in vb , c#: vb: public class employee 'should lowercamelcase private usecode string = "new" 'should _lowercamelcase private _name string public property name() string return _name end set(byval value string) _name = value end set end property end class c#: public class employee { //should lowercamelcase private string usecode = "new"; //should _lowercamelcase private string _name; public string name { { return _name; } set { _name = value; } } } whether agree or not naming convention, there way ask reshaper enforce this? there no ...

java - How to use check box listener with a dynamic JTable? -

i new using swing, why asking lot; actually, searching lot this, not found answer. have dynamic table; has filled name of sheets xml file, , there column check box clicked if sheet has validated. when create table empty. after other action filled data. i need know how use check box listener in case. this main code, button open performs filling. public class createscenarioui extends jframe { /** * */ private static final long serialversionuid = 1l; private jpanel contentpane; private jtextfield textfield; string filepath = null; string[] sheetnames = null; /** * launch application. */ public static void main(string[] args) { eventqueue.invokelater(new runnable() { public void run() { try { createscenarioui frame = new createscenarioui(); frame.setvisible(true); } catch (exception e) { e.printstacktrace(); } } }); } /** * create frame. */ public createscena...

groovy - How to make a task to call a main class -

what trying make task in build.gradle execute main class (class main method), don't know how. i made test project test how that. here file structure layout: testproject/ build.gradle src/main/groovy/hello/world/helloworld.groovy here content of build.gradle: apply plugin: 'groovy' apply plugin: 'maven' repositories { mavencentral() } dependencies { compile 'org.codehaus.groovy:groovy-all:2.0.6' } task( hello, dependson: jar, type: javaexec ) { main = 'hello.world.helloworld' } here content of helloworld.groovy: package hello.world class helloworld { public static void main(string[] args) { println "hello world!" } } here shell: testproject>$ gradle hello :compilejava up-to-date :compilegroovy up-to-date :processresources up-to-date :classes up-to-date :jar up-to-date :hello error: not find or load main class hello.world.helloworld :hello failed failure: build failed excepti...

hyperlink - I need to create a script that will check a files size, warn user, move files and link to new location -

we trying keep little end-user data on our companies thin-clients, need create script run when file saved locally. i'm new power shell apologize lack of knowledge. check file size if (file size equal or greater "x"mb) output warning "file larger allowed, moving file cloud drive (usually k: drive) i'd imaging i'd use move-item -destination "k:\my documents\" create link or shortcut new file location. i'm sure need more data @ point. take any/all can get. $directory = get-childitem "d:\download" #directory care $sizelimit = "200000" #size limit in bytes foreach ($file in $directory) { if ($file.length -ge $sizelimit) { # notify user pop-up # coding said popup # move file move-item $file.fullname k:\ mklink.exe k:\$file.name $file.fullname