Posts

Showing posts from March, 2015

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

css - Rotate Element Within H2 -

Image
im trying rotate <span> within <h2> 90 degrees. right if set rotate nothing happens - if add display:block span rotates. problem pushes rest of h2 on next line. is there way have h2 display on 1 line span rotated in middle of it? here's how should html: <h2>join <span class="flip-text">with</span><span class="flip-text">your</span> family</h2> css: span.flip-text{font-size:10px; -webkit-transform: rotate(-90deg); -moz-transform: rotate(-90deg); -ms-transform: rotate(-90deg); -o-transform: rotate(-90deg); filter: progid:dximagetransform.microsoft.basicimage(rotation=3); -ms-filter: progid:dximagetransform.microsoft.basicimage(rotation=3);} just christopher suggesting, display: inline-block way go: http://jsfiddle.net/x85b6/ <h2>join<span>with<br />your</span>family</h2> h2 { font-size: 60px; text-transform: uppercase; } h2 span { font-siz

python - How to make class based view accept parameters from URL or hardcoded in URLconf -

i working on class based generic view takes model name argument , processes model name more parameters. had working fine when hardcoded model name entry in urlconf: url(r'^generic/', resultcreateview.as_view(model = 'sometask')) snippets of class based view: class resultcreateview(createview): model = none #this here, expecting overwritten, because otherwise error saying can't pass in 'model' kwarg above because 'model' not attribute of class def __init__(self,*args, **kwargs): self.model = get_model_object_from_modelname(kwargs['model']) self.form_class = my_custom_function_to_generate_a_formclass(self.model) self.template_name = self.model.template #template_name attribute set on model class return super(resultcreateview,self).__init__(*args, **kwargs) when tried switch passing model parameter in via url, i.e.: url(r'^tasks/(?p<model>\w+)$', resultcreateview.as_view()) m

symfony - show iframe from database row in twig symfony2 -

i use twig symfony2 i got following text database: <iframe src="http://xxx.example.com/embedframe/123456" frameborder=0 width=510 height=400 scrolling=no></iframe> in twig try show with: {{ movie.iframe }} when insert iframe direct in twig-code, iframe shown perfect, when try view variable, view text above. what did wrong? twig escapes every output default. output html have use raw filter. have sure, database output safe. {{ movie.iframe|raw }}

webserver - Under what user does the web server run on OS X SERVER Lion (10.7.5) -

trying install owncloud on hosted os x server 10.7.5. when running "web installer", can't past first step, because "can't write current directory. please fix giving webserver user write access directory" the problem is, don't know webserver user is. can me find out? somehow screwed web directory permissions, , fix once , all. thanks can provide, cheers thanks responses, , sorry newbie question. close loop: @arkascha - yep. macminicolo.net. why not? got mini laying around, sent in @nyarlathotep - yes. going through install now. turns out documentation of owncloud has been updated address specific problem, down specific chown need use. problem solved @nyarlathotep #2 - running standard apache comes lion, apache 2

java - Curator transaction runtime construction -

the apache curator library zookeeper uses nice "fluent" syntax. example, modify several nodes in transaction, code looks like: client.intransaction(). .setdata().fornode(node1path, data1) .and() .setdata().fornode(node2path, data2) .and() .commit(); this works great and, imho, produces readable code. however, have situation have modify set of znodes in transaction. don't know until runtime how many nodes, or nodes, need modified. thus, don't think can use fluent syntax easily. looking @ docs, can manually manage proxy objects each of fluent method calls return, code requires explicit use of curatortransaction , transactionsetdatabuilder , curatortransactionbridge , etc. it's do-able, code starts ugly. i don't see non-fluent way transactions curator. know if there 1 and/or if there "nice" way build transaction @ runtime? specifically, given map<string, string> mapping znode paths data needs end in znode, how set n

PHP PDO Basics! Escaping/Unescaping Special Characters -

im starting out pdo methods , have managed create table , insert 10 test records .csv file. checked table in phpmyadmin , noticed fields containing speech marks (in csv file) enclosed double quotes "original csv value ""would"" this" - correct or have done wrong? if thats correct, how make output display without double quotes? i hope makes sense? have read loads of q&a's similar problem none of them explaining should happening in db , subsequently how pull data out , display when special characters involved. can pull out , display - quotes present. help! please! got there in end. help. correct, csv file contained escaped characters working should not how wanted to. final code below, hope others in future. removes double quotes etc csv data , stores them in table how intended :-) <?php require_once ('mysql_connect.php'); $databasefile = fopen('products.csv', 'r'); if ($databasefile === false) { die('c

ipc - android AIDL interface, parcelables and backwards compatibility -

we expose aidl service third party developers. we'd return parcelable objects service, have concerns backwards compatibility. this, mean clients compiled against version n of parcelable, , service compiled against version n+1 must work together. from tests, simple flat objects (simple type fields only), backwards compatibility possible, long new fields parceled @ end of stream ... e.g., in.writeint(field1); in.writeint(field2); // new field however, when comes complex objects, things blow up. example, class d implements parcelable { int field1; } class c implements parcelable { list<d> ds; } if second field added class d , class d implements parcelable { int field1; int field2; // new field } unmarshalling of class c s fail (i tried using parcel.writelist() , parcel.writeparcelablearray() ). this seems inconceivable case can't handled. sure, can leave old binder interface as-is, , create new binder interface returns objects of new class addit

javascript - Change input field value depending on what a link has -

i have link changing , want print text input text field depending on link points to. example link following. <a onclick="main()" id="link" href="#foo"> or same link @ times like <a id="link" href="#bar"> if link links to #foo want following like <input id="input" type="text" value="hello world" /> and if link links #bar need input have value of bye world. how can acheave this. tried following think doesn't work because url doesn't change until user clicks on it. looking isn't there yet. function main() { var url = window.location.href; if (url.search("#foo") > 0) { document.getelementbyid("link").value = "#foo"; document.getelementbyid("input").value = "hello world"; } } update here's list of of hash tags 1 link be. , input text field when links clicked. #work = can't talk i'

javascript - Scroll Spy Get Stuck on top, doesn't follow the scroll -

i copying exact same code , resources http://getbootstrap.com/components however, don't understand why in copy, whenever refresh page, entire ul list stuck in position, therefore, if scroll down, ul go off screen. this version: scroll spy stuck if not refresh, ul works should , follow wherever scroll submenu being highlighted... jquery set active class seems working submenu active class correct. have no idea @ how happen... highly appreciated! thanks! note: -. works on original site -. works on chrome -. bootstrap 2.3.2 version works fine

php - ajax loading wordpress content removes linebreaks/paragraph tag -

i'm having issue ajax loading wordpress content jquery. works great, except line returns aren't being parsed. it's being pulled in json, , stuck 2 different divs. jquery code: $('.load').on('click',function(e){ e.preventdefault(); var person_clicked = $(this).attr('id'); $.post('/load.php', { id:person_clicked, callback:'person' } ) .done(function(data) { alert(data); $('.page_tagline').html(data.title); $('.left_content').html(data.content); scrolltoelement($('#hero')); }); return false; }); load.php: <?php /* send json */ header("content-type: application/json", true); require('../../../wp-load.php'); ?> <?php query_posts('p='.$_post['id']); $post = $wp_query->post; ?> <?php if (ha

dynamic programming - 2 shot strategy and kshot strategy algorithm for selling stocks -

the classic maximize stock profit questions involves array stock prices , required return max profit can made: i understand logic maximizing profit given stock quotes. in simple way, can maintain running min , running max_so_far , check if current elem less min or current elem - running min greater max_so_far , if yes, update our max_so_far we return our max_so_far maximum profit can made. now, how solve problem 2 shot strategy? required return i0, j0, i1, j1 such sum of arr[j0]-arr[i0] , arr[j1]-arr[i1] maximum , i0<j0 < i1 <j1 i able think extent couldnt figure out later how generalize it. so, 1st single shot solution array containing max_so_far elems. similarly, similar array starting arr[n-1] 0. tells me if have sell after today, max profit can make. if add corresponding elements in array in forward iteration , array in backward iteration , max element out of it, corresponds max i0,j0,i1,j1 but can first explain logic k shot algorithm. guess i'll want un

Neo4j Java 7 Terminal Issue -

i'm having issues starting neo4j instance (2.0.0 m03). have java 7 installed indicated in code block below when trying start neo4j apparently not recognize this, gives , error , not start. terminal output below. ideas on how fix or going wrong? lot. tim-bornys-macbook-pro:neo4j community 2.0.0 m03 bornytm$ java -version java version "1.7.0_25" java(tm) se runtime environment (build 1.7.0_25-b15) java hotspot(tm) 64-bit server vm (build 23.25-b01, mixed mode) tim-bornys-macbook-pro:neo4j community 2.0.0 m03 bornytm$ bin/neo4j start warning! using unsupported version of java runtime. please use oracle(r) java(tm) runtime environment 7. starting neo4j server...warning: not changing user process [88317]... waiting server ready.... failed start within 120 seconds. neo4j server may have failed start, please check logs. the problem java_home not set correct jvm. determine have instance installed can enter following terminal: /usr/libexec/java_home -v 1.7 th

.net - EF context changes not saving -

very basic scenario. have context attached db 1 table has 1 row in it. can bind ui data , see data fine, changes, additions, etc not save. below 5 line bit not result in changes db. curious , confused. var context = new testentities(); context .dataitems.load(); // testing - 1 row in table. context .dataitems.first().data = "blah blah blah"; context .dataitems.add(new dataitem() { data = "happy birthday" }); context .savechanges(); the data in database not change. no new row. no updated row. connection: <add name="testentities" connectionstring="metadata=res:// /datamodel.csdl|res:// /datamodel.ssdl|res://*/datamodel.msl;provider=system.data.sqlserverce.4.0;provider connection string="data source=|datadirectory|\testdb.sdf"" providername="system.data.entityclient" /> i'm sure stupid, don't see it. try doing below:- context .dataitems.addobje

java - Android share a combined string -

i have button action calls share intent. construct string strings.xml below have strings: <string name="app_name">nowicons</string> <string name="market">market://details?id=com.nmiltner.nowicon</string> my string constructor here: public string share = "check out " + getresources().getstring(r.string.app_name) + getresources().getstring(r.string.market); by button click here: btn_share.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { // launching share intent intent sendintent = new intent(); sendintent.setaction(intent.action_send); sendintent.putextra(intent.extra_text, share); sendintent.settype("text/plain"); startactivity(sendintent); } }); when test app, force close, , error log has null pointer exception. i using similar method s

php - How do I echo the contents of a MySQL table field? -

i seem having trouble understanding concept of how use information in mysql database using php/mysqli. understand it, generate variable representing connection object: $connectionobject = mysqli_connect('serverstring', 'userstring', 'passstring', 'databasestring'); then, generate variable representing query string want use: $querystring = "select rowname tablename"; then, generate variable representing result object returned successful query: $resultobject = mysqli_query($connectionobject, $querystring); then, use fetch_assoc() function generate array result object , assign variable: $resultarray = myqli_fetch_assoc($resultobject); then, can use while loop (i have trouble one) sort through array , use content of row somehow: while ($resultarray) { echo $resultarray["rowname"]; } do have concept wrong way, somehow, because not working me, output text content of text-based char(10) field contents of no more than

Why is the google chromecast extension not injecting API on a whitelisted domain -

i got couple of domains whitelisted. let's a.mydomain.com , b.mydomain.com i went developer options in chromecast extension , whitelisted mydomain.com , added data-cast-api-enabled=”true” html tag at point, expecting extension inject api_script.js (like 1 seeing on youtube , netflix) what missing here? there 2 whitelisting procedures listed in developer documentation. the first device whitelisting (under "whitelisting receiver device"). during process provide 1 or 2 target urls google cast team, , generate application id you. when launching session cast api device (android, ios, or chrome browser extension installed) provide string "<applicationid>_<urlnumber>" , receiver select open receiver page located @ url associated string. the second whitelisting (under "whitelisting chrome apps" @ link above) specific developing sender app chrome extension, , configured within browser. chrome extension inject cast api specif

running average of items list in python in reverse order -

i need find average of items in 1-dimensional list: example: l = [123,678,234,256,789,-----] first need obtain running average starting last item in list.thus providing resultant list follows: reslist= [416,489.25,426.33,522.5,789---]. plz can 1 suggest simple code in python doing helpful.. here's solution uses recursion: def runningmean(seq, n=0, total=0): if not seq: return [] total = total+seq[-1] return runningmean(seq[:-1], n=n+1, total=total) + [total/float(n+1)] demo print(runningmean([123,678,234,256,789])) output: [416.0, 489.25, 426.3333333333333, 522.5, 789.0]

objective c - iOS deep linking: how to embed URL in another URL? -

i need deep link app url, if custom scheme is: myapp:// then deep linking url looks like: myapp://?type=url&url=[another url] the problem "another url" may contain separators ?, /, & etc, thought using quotation mark: myapp://?type=url&url="http://another.url" however url may have quotation mark in it, there way it? thanks you need escape of special characters in 2nd url. use utility method wrote help: + (nsstring *)encodestring:(nsstring *)string { nsstring *result = (__bridge_transfer nsstring *)cfurlcreatestringbyaddingpercentescapes(kcfallocatordefault, (__bridge cfstringref)string, null, cfstr("% '\"?=&+<>;:-#\\/~`!"), kcfstringencodingutf8); return result; } with in place (in helper class or added category), can following: nsstring *link = @"http://another.url"; nsstring *escapedlink = [someutility encodestring:link]; nsstring *myurl = [nsstring stringwithformat:@&qu

macros - Autohotkey sending multiple "push-to-talk" keydown / keyup events -

the situation is: i'm using combination of teamspeak [shared communication], arma 2 acre extension [gaming software w/ extended "radio" capabilities] , dxtory [video , audio splitting/recording software]. the problem is: dxtory records audio when single hotkey pressed. acre uses set of hotkeys allow switching between different radios. end losing audio "push-to-talk" keys aren't monitored dxtory. what i'd like: i'm thinking autohotkey should allow me take "numpad-key-1" press , produce "numpad-key-1" + "g3" (g3 being unused arma/acre, being used "push-to-talk" dxtory , "numpad-key-1" being push-to-talk arma/acre). similarly, i'd map "numpad-key-2" "numpad-key-2" + "g3" , "numpad-key-3" "numpad-key-3" + "g3". the g3 key need key-down corresponding "numpad-key" pressed , released key-up event. can done? if so, hin

node.js - How to enumerate all the sessions in nodejs + express? -

i trying write simple nodejs server sessions , user authentication. here code: var express = require('express'), app = express(), fs = require('fs'), passport = require('passport'), jade = require('jade'), basicauthstrategy = require('passport-http').basicstrategy, webrootdir = __dirname + '/web', templatesdir = __dirname + '/templates/'; passport.use(new basicauthstrategy( function (username, password, cb) { "use strict"; cb(null, username); } )); app.use(express.logger()); app.use(express.bodyparser()); app.use(express.cookieparser()); app.use(express.session({secret: 'd6151b7e-8997-4187-a95e-29ce08450094'})); app.use(passport.initialize()); app.use(passport.authenticate('basic', { session: false })); app.use(express.favicon()); app.use(app.router); app.use(express['static'](webrootdir)); app.use(express.errorhandler({ dumpexceptions: t

Forward Apache Server to Proxmox Web Gui -

so, i'm pretty new apache , i'm having issues finding solution answer. i have domain name abcdefg.com (for example) , have public facing fedora apache webserver on home network @ 192.168.10.10. have machine proxmox ve server @ 192.168.10.20. i know can forward ports , type [https://abcdefg.com:8006] proxmox server, want able go abcdefg.com/proxmox , somehow make call [https://192.168.10.20:8006] internally (https required). can point me in right direction? don't need spoonfed, i'm not sure start looking. i've figured out how use "location" tags not working this, seems bit more involved. --cheers you need run reverse proxy server, apache can few mods. listen on specific port (let's port 444 in case) , send requests whatever ip , port specify behind scenes. see following link how reverse proxy site: simple apache reverse proxy example simply change mywebsite.jamescoyle.net references point internal proxmox box on port 8006 - eg.

php - Why don't loops scale evenly? -

i not believe duplicate, i've looked it, had no clue call exactly. i want know why loop ten times larger loop doesn't take ten times longer run. i doing testing try , figure out how make website faster , more reactive, using microtime() before , after functions. on website, i'm not sure how pull lists of table rows attributes out without going through entire table, , wanted know if slowing me down. so using following loop: echo microtime(), "<br>"; echo microtime(), "<br>"; session_start(); $connection = mysqli_connect("localhost", "root", "", "") or die(mysqli_connection_error());; echo microtime(), "<br>"; echo microtime(), "<br>"; $x=1000; $messagequery = mysqli_query($connection, "select * users id='$x'"); while(!$messagequery or mysqli_num_rows($messagequery) == 0) { echo('a'); $x--; $messagequery = mysqli_query($co

c# - NuGet Package Restore Issue -

i need nuget automatically restore packages. @ moment, referenced dlls missing. i have enabled package restore on solution. the .nuget folder checked in. the packages.config file checked in each project. the packages folder (on solution level) check in. the packages folder contains folders packages solution uses nuspec , nupkg files each package. dll not checked in. in visualstudio packages installed reference dll in each project missing (ass dll not checked in). i have tried install nugetpowertools . same story. thanks, there no reason check-in underneath packages folder. optionally, can check in repositories.config file technically not required. do right have checked-in nuspec , nupkg files within packages folder? if so, delete them. these restored, , presence might causing restore failures (i don't think nuget package restore checking presence of package contents, , rather checks presence of nupkg/nuspec file in packages folder, skipping p

php - Is it possible to create custom menus in WordPress with titles without links? -

we building theme on wordpress 3.5.1 , created 2 custom menus - 1 header , 1 footer. in footer titles not linkable, therefore created custom links href "#" , changed href "". result empty links <a> . know it's possible change cursor of these empty links css: .footer-content #sitemap ul.menu > li.menu-item > { cursor: text; } and found out way remove these empty links javascript , jquery: $('.footer-content #sitemap ul.menu > li.menu-item > a').each(function() { // if href empty, remove <a> element. var href = $(this).attr('href'); var href_length = 0; if (!(typeof href === 'undefined')) { var href_length = href.length; } if (href_length === 0) { var contents = $(this).contents(); $(this).replacewith(contents); } }); (the footer menu inside .footer-content #sitemap elements: <div class="footer-content"> <div id="sitemap&qu

c++ - Using pimpl with Templated Class and explicitly instantiated templates -

how use pimpl templated class, when explicitly instantiate templates? all need example code. what have tried is: mytemplatedclass.h template< class t > class mytemplatedclass { private: class impl; impl* _pimpl; public: void publicmethod(); } here implementation goes: mytemplatedclass.cpp template< class t > class mytemplatedclass<t>::impl { public: void publicmethod(); } template <class t> void mytemplatedclass<t>::impl::publicmethod() { ... } forwarding method call implementation class: template< class t > void mytemplatedclass<t>::publicmethod() { _pimpl->publicmethod(); } explicit instantiation: example int , double: template class mytemplatedclass< int >; template class mytemplatedclass< double; but doesn't seem work. this answer question, doubt hoped achieve. suspect want declare template implementation outside scope of mytemplatedclass. might better design inherit templat

ruby on rails - simple_form month translation -

Image
i dealing rails 4 application using simple_form. want display app in spanish did i18n.locale = :es . created labels simple_form in simple_form.es.yml , works right except month dropdown in birthday field (date attribute). screen: as can see in image, labels working right, select field kindly tries 'translation missing'. don't know add translation strings. please help! i searched in simple_form documentation , couple of other posts in found nothing. newbie in translation apis. code behind just: <%= f.input :birthday, as: :date, start_year: date.today.year, end_year: date.today.year - 120, order: [:day, :month, :year] %> you must have locale configured in simple-form.[locale].yaml useful links: https://github.com/plataformatec/simple_form/issues/695#issuecomment-10495237 https://github.com/rails/rails/blob/v3.2.8/activesupport/lib/active_support/locale/en.yml#l18-l21

i want when i click on file in elfinder return a url to a textfield -

please me , have textfield in page , , want when click on textfield or button , elfinder open in popup , when choose file close , url of file return in textfield , able use filemanager if works fine <script type="text/javascript" src="../elfinder/jquery/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="../elfinder/jquery/jquery-ui-1.10.1.custom.min.js"></script> <link rel="stylesheet" type="text/css" media="screen" href="../elfinder/css/smoothness/jquery-ui-1.8.13.custom.css"> <script type="text/javascript" src="../elrte/js/elrte.min.js"></script> <script type="text/javascript" src="../elfinder/js/elfinder.min.js"></script> <script type="text/javascript" src="../elfinder/js/jquery.dialogelfinder.js"></script> <script src="../elrte/js/i18n/elrte.en.js

Spurious (?) warning about string constants using a macro in OpenCL -

i use following macro in opencl kernel: #define ided_printf(_format, ...) printf("(%u,%u,%u) " _format, get_global_id(0), get_group_id(0), get_local_id(0), __va_args__ ) and works fine. however, when compile (i use amd's app opencl library on win7), following warning on each use of macro: argument of type "const __constant char *" incompatible parameter of type "__constant char *" why getting that? after all, string literals const's. , if opencl compiler doesn't make them const, why "(%u, %u, %u)" string const'ed while other string (_format) not consted? i'm assuming compiler bug; if is, workaround appreciated. maybe sort of cast? based on amd forum's post , bug. , yes cast suggested in same post: printf((__constant char *)"%d\n", i);

http - Using Spring EL to decide which outbound gateway to use -

my application can use 1 of 2 web services, lets call them ws , ws b. both contain same interface. i want perform logic on http headers , request channel. ws b should used on request channels. decide channel used have created java class takes request channel string parameter. <http:outbound-gateway request-channel="xxxxx" url-expression="'${el exp}'" http-method="get" extract-request-payload="true" expected-response-type="java.lang.string" charset="utf-8" reply-timeout="3000" reply-channel="xxxxx"> </http:outbound-gateway> i read url-expression evaluated when context initialised. source : http://forum.springsource.org/showthread.php?113446-usage-of-expressions-in-http-namespace-element-url <int-http:outbound-gateway request-channel="requestchannel" url="dummy" http-method="get" extract-request-pay

neo4j - Coding Standards for Gremlin/Cypher -

we in process of developing review tool gremlin/cypher predominantly work neo4j graph databases in our project reduce manual review effort , deliver quality code. are there list of coding standards(formatting/performance tips etc.,) gremlin , cypher scripts can used checklist performing review of these scripts? i don't think you're going find 1 specific answer, discussing coding standards can lead subjective (and debate-laden) answers. said: i'll go more objective: first step decide on gremlin vs cypher since they're not same thing nor same style. when making decision (and maybe decision use both ), should take close @ neo4j 2.0 development (currently @ milestone 4), cypher maturing rapidly , there's lot of work being put it, both expressiveness point of view , performance point of view. assuming go cypher, i'd suggest @ samples being published neo technology, cypher learning module . don't know of published guidelines, i'd think of gu

javascript - When clicked on bold or italic tag cursor to be in middle? -

i'm using code in 1 of torrent websites. when click on 'b' tag next code shows [b][/b]. however, when done cursor's position @ beginning of these tags instead of in middle, this: [b]cursor here[/b] this code: <script type="text/javascript"> function bbtag(tag, s, text, form) { switch (tag) { case '[url]': var start = document.forms[form].elements[text].selectionstart; var end = document.forms[form].elements[text].selectionend; if (start != end) { var body = document.forms[form].elements[text].value; var left = body.substr(body, start); var middle = "[url]" + body.substring(start, end) + "[/url]"; var right = body.substr(end, body.length); document.forms[form].elements[text].value = left + middle + right; } else { document.forms[form].elements[text].value = document

c# - Select query with multiple like conditions in Sql -

all, i have view filtered data fetched sql query view structure: bridgeid int name varchar displayname varchar there search text box in user can enter 1 of values filtering. due project old framework have query c# itself. public static list<conferencebridges> getsearchlist(string search) { db db = new db(server_name, data_base_name); string searchquery = string.format("select bridgeid,name,ownerid vconferencebridgesdetails bridgeid '%' + {0} + '%' or name like'%' + {0} + '%' or displayname '%' + {0} + '%'", search); datatable table = db.getdata(searchquery); list<conferencebridges> bridgelist = new list<conferencebridges>(); if (table != null && table.rows.count > 0) { foreach (datarow item in table.rows) { bridgelist.add(new conferencebri

html - Web Loader Stress Test -

i have constructed web loader loads url , displays loading time. question is, how add virtual users in site perform multiple user testing simultaneously stress test selected url. <html> <head> <script type="text/javascript"> beforeload = (new date()).gettime(); function pageloadingtime() { afterload = (new date()).gettime(); seconds = (afterload-beforeload)/1000; document.getelementbyid("loadingtime").innerhtml = "<font color='red'>(you page load took " + seconds + " second(s).)</font>"; } </script> <title>load time</title> </head> <body> <div id="loadingtime"></div> <script type="text/javascript"> function reload() { beforeload = (new date()).gettime(); var f = document.getelementbyid('iframe');

warnings - Comodo internet security detect c++ hello world program as a viruses (trojan) -

i using dev c++ 4.9.9.2 editor running code. comodo internet security detect c++ hello world program virus. the program shown below - #include <iostream> int main() { std::cout << "hello world!\n"; return 0; } comodo internet security detect c++ file - trojware.win32.trojen.killfiles.aml0@105409181 i faced same problem. since know there no virus in programs, excluded dev c++ folder , program file folders antivirus software. steps in comodo antivirus is: 1.open cis 2.click tasks in upper right corner 3.click advanced tasks 4.select open advanced settings 5.expand security settings 6.expand antivirus 7.click exclusions 8.click on arrow or right click anywhere on screen. 9.select add->folders 10.add dev c++ folders , program files folder in list. 11.you have excluded files now run program, surely output without virus.

twitter bootstrap border title -

Image
just wanted know how give border title using bootstrap? example below. <div id="form" style="width:350px;"> <fieldset> <legend style="color:blue;font-weight:bold;">general information</legend> <table> <tr> <td><span style="text-decoration:underline">c</span>hange password to:</td> <td><input type="text" /></td> </tr> <tr> <td><span style="text-decoration:underline">c</span>onfirm password:</td> <td><input type="text" /></td> </tr> </table> </fieldset> </div> based on html, outcome in chrome: you control border on fieldset: fieldset{ border:1px solid #cccc; } please note though, positioning of legend "general information" computed style overridden. " fieldsets , legends &quo

c# - Related to url rewriting -

"i want perform 301 redirect in site. so, example.com http://example.com http://www.example.com/default.aspx it redirect www.example.com there lots of ways this. easiest use iis url rewrite module alternatively, place redirect in global.asax.cs file in application_beginrequest : void application_beginrequest(object sender, eventargs e) { if (httpcontext.current.request.url.absoluteuri.equals("http://www.example.com/foo.aspx")) { string newurl = "http://www.example.com"; response.status = "301 moved permanently"; response.statuscode = 301; response.statusdescription = "moved permanently"; response.addheader("location", newurl); response.end(); } }

c - Generating function call graph -

i using egypt tool visualize call graphs of c files. using option --include-external 1 can see calls functions defined externally (in libraries, other project .c files etc.) i wondering if there way know in file external function declared? not tool, in general feasible during stage of compilation know location of function called? you can use eclipse cdt. configure include paths , library paths . can navigate functions provides call hierarchy.

matlab - How to unhide an overriden function? -

suppose have own function named zeros on matlab path. want call built-in zeros . how can that? use builtin function: builtin(function, arg1, ..., argn) in case e.g.: builtin('zeros', 50)

javascript - jQuery Validation - Add custom callback function, check if a string has a space doesn't working -

this code, checkusername function doesn't working, how should fixit? <form id="register_form" method="post" action=""> <fieldset> <legend>info</legend> <div> <label>username</label> <input type="text" name="username" id="username"/> <input type="submit" id="btnaccess" class="button" value="submit" name="btnaccess"/> </fieldset> </form> $(document).ready(function() { var validator = $('#register_form').validate({ rules: { username: { required: true, minlength: 4, checkusername: true } }, messages: { username: { required: "no blank", minlength: "enter atleast 4 words"

Unable to save description in products with magento -

i got problems when im trying save product short , long description in backend. whenever try change description , press save, text have entered disappears , textarea field blank. not occur long , short description. problem textarea fields in product edit page. can change textarea fields in categories page , on. i have pdo mysql error debug show you.. sql: select `main_table`.`tax_calculation_rate_id`, `main_table`.`tax_calculation_rule_id`, `main_table`.`customer_tax_class_id`, `main_table`.`product_tax_class_id`, `rule`.`priority`, `rule`.`position`, `rate`.`rate` `value`, `rate`.`tax_country_id`, `rate`.`tax_region_id`, `rate`.`tax_postcode`, `rate`.`tax_calculation_rate_id`, `rate`.`code`, if(title_table.value null, rate.code, title_table.value) `title` `tax_calculation` `main_table` inner join `tax_calculation_rule` `rule` on `rule`.`tax_calculation_rule_id` = main_table.tax_calculation_rule_id inner join `tax_calculation_rate` `rate` on rate.tax_calculation_rate_

How to upload a file starting with Cleanview using net::ftp in perl? -

i'm trying upload file starting cleanview , full filename have random characters in middle "cleanview.45673.log". need find file filename starting cleanview , upload. tried code below not working. file created on server, size 0 bytes. please help. $login = 'abc'; $pass = 'xyz'; $dir = '/projects/ban/android/bx'; $ftp = net::ftp->new('10.xxx.xx.xxx' ,debug => 1) or die "cannot connect"; print("ftp session opened logs\n"); $ftp->login($login, $pass) or die "can't log $login in\n"; $ftp->pasv(); $ftp->cwd($dir); @cleanviewlog = glob "cleanview*.log"; $ftp->pasv; for(@cleanviewlog) { print "transferring cleanview log $_\n"; $ftp->put("$_") or die $ftp->message; sleep(5); } here debug message shown: transferring cleanview log cleanview.66411936.log net::ftp=glob(0x202697f0)>>> allo 1958 net::ftp=glob(0x202697f0)<<< 227 entering

r - Automatic split of character matrix according to a column values into variable number of new dataframes -

i split character matrix have according 1 of column values. if example have 3 columns , "n" rows, , want use column number 2 reference. script should in second column , group rows contain same value dataframe. so, have "a", "b", "c", "d" , "e" values in column 2 through "n" rows. want (in case) 5 new dataframes containing rows of data conditioned second column values. rows contain "a" in second column of matrix go 1 dataframe , on. my data bigger, containing around 400 different character values in column want use reference (column 2 in above example) split process needs automatic, mean, has automatically detect how many new dataframes should created according number of different values in "column 2". here shorter example of need: structure(c("hi", "med", "hi", "low", "a", "d", "a", "c", "8", &qu