Posts

Showing posts from January, 2014

python - Flask SQL-Alchemy OperationalError -

i'm getting error message causing 500 error sporadically on site: operationalerror: (_mysql_exceptions.operationalerror) (2006, 'mysql server has gone away') i using flask sql-alchemy. after doing googling came across this: https://rapd.wordpress.com/2008/03/02/sqlalchemy-sqlerror-operationalerror-2006-mysql-server-has-gone-away/ i added these fixes: app.config['sqlalchemy_database_uri'] = 'myserverstuff' app.config['sqlalchemy_pool_size'] = 100 app.config['sqlalchemy_pool_recycle'] = 3600 db = sqlalchemy(app) sadly haven't had success this. suggestions? edit: newest_vendors = accounts.query.filter(accounts.acc_type=='vendor').order_by(accounts.created_at.desc()).limit(4).all() this happens through out functions sporadically there isn't specific spot :/ edit edit: this apache saying: root@server [~]# tail -f /usr/local/apache/logs/error_log app 4986 stderr: file "/home/admin/venv/lib/py...

Use UCMA to auto-answer for users using Lync client? -

is possible use ucma, or lync api, create server application can answer voice calls on behalf of lync client user (and lync client endpoint)? my use case able have server application can act on behalf of user using vanilla lync desktop client. service auto-answer calls lync user perform various call control operations (hold, mute, disconnect, transfer, etc.) on behalf of user. goal avoid customizations on desktop, if possible. thus far, i've gotten events incoming calls, when service answers them, appears service taking ownership of call, not lync client. ideas? there no way central server remotely tell lync client remotely answer call. you can use 'lync client sdk' extend lync client running on desktop take commands own server , answer call. the problems are: determining when there call answer. can use umca application example know when tell when there incoming call. way go use lync server sdk script/application, may harder ucma application. ho...

node.js - Use jade mixin inside code block -

is there way use jade mixin inside javascript code block ? i have next use case: mixin yyyymmdd(date) = date.getfullyear() + '-' = ('0' + (date.getmonth() + 1)).slice(-2) + '-' = ('0' + date.getdate()).slice(-2) so need use mixin inside input( value=yyyymmdd(date) ) update: had remake mixins js functions, looks similar next: - function yyyymmdd(date) - var fldate = date.getfullyear() + '-'; - fldate += ('0' + (date.getmonth() + 1)).slice(-2) + '-'; - fldate += ('0' + date.getdate()).slice(-2); - return fldate; the easiest way is, write code on server, can use other syntax, instance coffeescript or better in case, libraries moment when render template, add helper object locals: var moment = require('moment'); var yyyymmdd = function(date) { return moment(date).format('yyyymmdd'); } // express code app.get('/test', function(req, res, next) { ...

multithreading - Communicate between 2 google chrome processes (tabs) with javascript -

question: what best way communicate between separate google chrome rendering processes (tabs) without use of web-server? background: i writing large application , decided try , migrate whole thing browser. due work google chrome. previous application consisted of c++ based (qt) webserver / calculation engine , browser used gui. have moved calculation engine javascript , run in browser. the problem gui unstable. stay running 12 hours crash "aw snap" error. before wasn't worried because simple matter of refreshing page. when gui crashes because running in same process calculation engine, crashes also. details: the calculation engine web-page spawns number of web-workers. opens gui (a separate webpage) popup window , communicates using postmessage. the gui typically needs read ~ 500 floating point numbers / second (sent json) calculation engine , write ~ 5 numbers / second. yesterday got excited because discovered sharedworker api thought accomplish wante...

deployment - Should you check in your compiled assets to Git? -

so i've been having discussion co-workers , i'd other people weigh in on this. i'm curious see other developers doing. what ignore entire build/assets folder repo. folder contains compiled css, javascript, , compressed images. think source files should checked in. find annoying every time make change stylesheet or js file, have check in source file , new compiled version. introduces merge conflicts , other issues when have multiple people working on project. keep repo nice , light , have developer build project locally set up. or when deploy, have server build out project. this issue, because co-workers use git deploy process. when want deploy, check code git, push remote repo, , ssh server , git fetch && git pull. means of website files have live in repo. have check in assets folder. how guys handle this? i'm using bedrock-ansible wordpress site, , there's option run commands right before deploys, configured run npm install && gulp...

vbscript - Script to Install Font in Windows XP -

i trying install fonts in windows xp using vbscript. reason script works fine in windows 7 not work in windows xp. need install fonts without system reboot so, had choose approach instead of other registry change approaches need system reboot. here vbscript set objshell = createobject("shell.application") set objfolder = objshell.namespace("d:\logs\") set objfolderitem = objfolder.parsename("roboto-italic.ttf") objfolderitem.invokeverb("install") my guess invokeverb("install") command not working in windows xp. in case there alternatives? please guide me thanks... next script (a code snippet) should work on (obsolete) windows xp: const ssffonts = &h14& set objshell = createobject("shell.application") set objfolder = objshell.namespace(ssffonts) objfolder.copyhere "d:\logs\roboto-italic.ttf" if font installed prompted overwrite it. not sure whether or not reboot required using above appro...

HTML/CSS-Removing the gray edges around a pdf object -

i trying put pdf object on web page. pdf loads fine, creates gray area around document. know gray area part of pdf document , part of object, trying find out how rid of it. have adjusted margins , padding. have adjusted height , width try , go away. have tried passing zoom option pdf when opens , nothing worked. i want document load without creating sort of edges or borders on page. appreciated. markup applies below. i'm pretty sure won't never know. <article class="main_content"> <object id="resume_object" type="application/pdf" data="images/alexsresume30jan15.pdf">alex's resume</object> </article> article.main_content{ margin-top:70px; } #resume_object{ height:1190px; width: 910px; margin-left:20%; margin-right:20%; padding:-20px; background-color:white; }

swift - Is it possible to make a generic Realm Results Object? -

i trying replicate nsfetchedresults controller realm backing. problem realmswift framework, cannot make generic results object. wants specific type. var objects = results<object> = realm().objects(object) compiles, crashes when controller subclass presented. i'm not sure how code compiles there 2 assignments in statement: var objects = results<object> = realm().objects(object) calling realm().objects(object) returns generic results , specialized on object , results generic.

java - How to update a FirefoxDriver (WebDriver) object when opening, and switching between tabs? -

long time lurker; first time poster. i'm new selenium api , webdriver, , i'm having small problem. in short, attempting leverage firefox tab feature using selenium's firefoxdriver, driver instance object not returning correct url using getcurrenturl() method when switching between tabs. here brief example of trying accomplish: firefoxdriver driver = new firefoxdriver(); driver.get("http://www.google.com"); // display starting tab url system.out.println(driver.getcurrenturl()); // expected output: google.com webelement body = driver.findelement(by.cssselector("body")); // open new tab if(system.getproperty("os.name").contains("mac")) { body.sendkeys(keys.command + "t"); } else { body.sendkeys(keys.control + "t"); } //navigate in new tab driver.get("http://www.yahoo.com"); // display new tab url system.out.println(driver.getcurrenturl()); // expected output: yahoo.com //navigate previous tab...

App flickers in android task manager -

i noticed weird flickering occurs when app presented in android "task manager". it seems activity drawn on top of navigation bar short time , pushed back. when other apps opened, app appears in front of others , "flickers" back. here screencasts: https://youtu.be/tfpurqa7aww (without other apps) https://youtu.be/xehi4ninwcq (with app opened) my activity_main.xml layout file implements simple navigation drawer empty framelayout replaced current fragment: <android.support.v4.widget.drawerlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/drawer_layout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true" android:background="@color/background_material_light...

asp.net mvc - mvc 5 DateTime error -

i need save date webpage date , time, have error the field filecreatedon must date" when try save data date , time ("2015-05-29 1:28:45 pm"). in db field datetime; description in model public system.datetime filecreatedon { get; set; } in edit.cshtml file: @html.editorfor(model => model.filecreatedon , new { htmlattributes = new { @class = "form-control" } }) @html.validationmessagefor(model => model.filecreatedon , "", new { @class = "text-danger" }) i can read data db date , time ("2015-05-29 1:28:45 pm") have error if try save it. you need make sure client side validators using cultures/globalization. if using jquery validate plugin mvc, see extension modify plugin meet needs: http://blog.icanmakethiswork.io/2012/09/globalize-and-jquery-validate.html

Android ListView selecting item replaces text in top list view item -

i have listfragment shows items database. when user clicks on item in list view, details appear in second fragment. however, listview replaces text in top item text of selected item. can still click on top item , details of should there, , correct text. i'm @ loss causing this, itemclick code doesn't change in listview, reads data event args. know causing this? cardfragment cardfragment = fragmentmanager.findfragmentbyid<cardfragment>(resource.id.frgcard); if (cardfragment == null) { cardfragment = cardfragment.newcardfragment(e.id); var transaction = fragmentmanager.begintransaction(); transaction.replace(resource.id.frgcard, cardfragment); transaction.settransition(fragmenttransit.fragmentfade); transaction.commit(); } else { cardfragment.changecard(e.id); } here list adapter (a simplecursoradapter): simplecursoradapter cursoradapter = new simplecursoradapter(activity, resource.la...

wcf - Intermittent System.ServiceModel.Security.MessageSecurityException -

i have webservice hosted in azure throwing intermittent message security exceptions. have retries retries have never succeeded though proxy regenerated on every retry. know or pointers on how real exception out? exception: "exceptionmessage": "an unsecured or incorrectly secured fault received other party. see inner faultexception fault code , detail.", "exceptiontype": "system.servicemodel.security.messagesecurityexception", "innerexceptiontree": "{\"innerexceptions\":[{\"innerexceptions\":null,\"message\":\"the message not processed. because action 'http:\/\/schemas.xmlsoap.org\/ws\/2005\/02\/trust\/rst\/sct\/cancel' incorrect or because message contains invalid or expired security context token or because there mismatch between bindings. security context token invalid if service aborted channel due inactivity. prevent service aborting idle sessions prematurely increase receive ti...

resize - Javascript elements only snapping to grid from right side -

i trying resize elements snap grid , far working if resize right side , bottom reason doesn't work left side. sure it's math here code: var dimension = win.getdimension(); var neww = math.round(dimension[0] / 10) * 10; var newh = math.round(dimension[1] / 10) * 10; win.setdimension(neww, newh); any ideas? so ended doing having event called onbeforeresizestart saved current x position window , in onresizefinish event checked see if new x position matched saved x position. if did not updated x position , did same snap calculation. onbeforeresizestart: var position = getcoords(win); window.currentx = position.left; onresizefinish var position = getcoords(win); if(position.left != window.currentx) { var newx = math.round(position.left / 10) * 10; win.setposition(newx, position.top); } var dimension = win.getdimension(); var neww = math.round(dimension[0] / 10) * 10; var newh = math.round(dimension[1] / 10) * 10; win.setdimension(neww, newh); ...

javascript - try to remove the string from link but its not working -

i trying remove pagenum=2 url, value 2 can dynamic following url var urlval = $(this).attr('data-rel').replace(/[\?&]pagenum=\d*/g, ''); but above link when make alert coming contents.cfm?up=http%3a%2f%2fmypage.com.com%2fez_9.asp%3frpttype%3d298%26sortby%3d1%26sortorder%3d1%26pagenum%3d3 but include pagenum , wrong not sure not working update is: itnenever removes http://www.example.com/2.asp?na_id=aaa&password=cc&target=ez_9.asp&rpttype=298&action=submit&sortby=1&sortorder=2&pagenum=4&pagenum=-1 you need decodeuricomponent first before running replace. like: var urlval = decodeuricomponent($(this).attr('data-rel')).replace(/[\?&]pagenum=\d*/g, '');

matlab - Deblurring the image -

Image
i unable find solution problem posted in thread how can deblur image in matlab? as suggested ,the image obtained after applying unsharp filter but blurrness not removed after unsharp filter.can suggest other methods! deblurring inverse problem , , inverse problems there no easy solution. not expect magical method. having said that, there used methods deblurring. wiener deconvolution 1 of popular methods used deblurring. for wiener filtering in matlab, see http://www.mathworks.com/help/toolbox/images/bqqhk8f.html

ios - showViewController has long delay -

i using following code create segue between 2 view controllers: nsstring * storyboardname = @"main"; uistoryboard *storyboard = [uistoryboard storyboardwithname:storyboardname bundle: nil]; uiviewcontroller * vc = [storyboard instantiateviewcontrollerwithidentifier:@"secondpage"]; [self showviewcontroller:vc sender:self]; the issue i'm having there's long delay before view shown. don't have happening in viewdidload or viewwillappear , causing delay?

c - Adding Characters into Struct -

i trying read characters linked list (i made simple test code try read in characters) reason cannot read in character value. #include <stdio.h> #include <stdlib.h> #include <string.h> struct node { char name[50]; struct node *next; }*head; void add(char addname); int main() { head = null; char tempname[50]; printf("what name"); scanf(" %s", tempname); add(tempname); printf("%s",head->name); return 0; } void add(char addname) { struct node *temp; temp = (struct node*)malloc(sizeof(struct node)); strcpy(temp->name,addname); head = temp; head->next = null; } i understand not how linked list works made try able run single character name struct , print out. (i should able enter in name bob , prints bob) i think function parameter definition wrong. try this: void add(char *addname) { .... }

c# - Minify the Html for an Asp.Net application -

is there event (or filter ) triggered ( called) after rendering output html mvc5 in c #. i use event remove whitespace between tags decreasing size of html please help??? :) you haven't explained reason (first sounds a sad case of micro-optimization , not place spend time, , secondly haven't explained decreasing size of html solve aka the xy problem ). by default iis/iis express uses gzip compress html: response headers: content-encoding:gzip content-type:text/html; charset=utf-8 if you're looking minification, the results of known websites being minified have shown improve them 9-16% , remember extremely complicated , big websites. unless have extremely large website, it's not best place spend time in optimization. if you're bound determined, simple need .net/iis html minification plugin (don't rewrite whats written if can it).

algorithm - Will adding a single edge to a given graph create a new shortest path? -

assume have directed graph start node , end node c, , know shortest path c in graph of length n , uses nodes a, b 0 ,b 1 , ..., b n-2 , c. i want know whether adding given new edge graph create new shortest path c of length < n . of course, use dijkstra's algorithm check shortest path in new graph, question whether information have shortest path in graph without new edge can somehow used solve problem more efficiently? you add new edge (u,v) , need check if triangular inequality holds: d(v) < d(u) + w(u,v) if does, there no new shortest path. otherwise, have new shortest path source ( a ) v , invalidates shortest paths weight greater new d(v) .

database - how to insert same record in one column but different row in mysql? -

how can insert same records in 2 columns different row without duplicating 2 columns in same row ? i have 2 tables structure table rek rek int (primary key) name varchar (10) address varchar (15) structure table cek cek int (primary key) rek int (foreign key) date date table rek rek name address 001 jane alaska 002 amel washington 003 john virginia table cek (i output table below.) cek rek date 01 002 12-05-2015 01 003 12-05-2015 02 002 13-05-2015 03 001 12-05-2015 how can insert in table cek if want output table cek? when trying insert data shown in above table can't. when removed primary key cek, data duplicated. from second table cek remove primary key , fk both columns. , create composite primary key on column (cek,rek) in way in words can record in 2 columns different row without duplicating 2 columns in same row ... or else best thing create bridging table between these 2 columns ...

Clear file queue on Jquery file Upload plugin Angularjs Version -

i use angularjs version of blueimp file upload plugin.( website ) if upload files first time works , second time plugin upload file , first 1 ... i saw $scope.queue not reset after upload. there clear function don't know how use it. there code : candidats.controller('cvuploadcontroller', function($scope, $rootscope, $http, $modal, $window, $location, toaster, $timeout) { var indexfile = 0; $scope.options = { url: '/api/cvapi/', autoupload: false, dropzone: $('fileupload'), done: function(e, data) { $scope.filename = data.result.result; $scope.array = $scope.candidat.niveauetude.libelle.split('+'); $http.put("/api/cvapi?filename=" + $scope.filename + "&path=" + $scope.array[0] + "%2b" + $scope.array[1] + "&candidatid=" + $scope.candidat.id + "&nomcv=" + $scope.fichiers[indexfile].nom + "&cvid=0" + "&langueid=" + $...

android - How to create an activity that resembles a dialog but has some specific features like scrolling off the screen -

i'm trying create activity looks dialog. these features want achieve: doesn't take entire screen you can see previous activity in background the background should darken parts can scroll off screen it should dismissed when clicking on background (where previous activity visible) when searching using activities dialogs people seem suggest using dialog style activity, example theme.appcompat.light.dialog . <style name="activitydialog2" parent="theme.appcompat.light.dialog"> <item name="colorprimary">@color/primary</item> <item name="colorprimarydark">@color/primary_dark</item> <item name="coloraccent">@color/accent</item> <item name="android:windownotitle">true</item> </style> so tried , ended can seen in these two screenshots. so 1, 2 , 5 have been achieved enough. 3 , 4 not yet. 3 should easy enough, can't figure out ...

c# - How to recover the property TileID a SecondaryTile? -

in app, create secondarytile. arguments , tileid insert id property of object. how retrieve value in page when press on app.xaml.cs secondarytile , how navigate page want? code: secondarytile t2 = new secondarytile(); t2.tileid = muss.id.tostring(); t2.arguments = muss.id.tostring(); string nome = "open arte"; t2.displayname = nome; t2.visualelements.square150x150logo = new uri(string.format("ms-appdata:///local/{0}", filename)); t2.visualelements.shownameonsquare150x150logo = true; await t2.requestcreateasync(); createlivetilesecondary(); you retrieve launchactivatedeventargs.tileid property - see msdn

java - How to use HTML in Swing -

i have bit of unusual problem: have swing label updates "used letters" in game hangman. have declared this: used = new jlabel(" used: "); but have area in code add onto it. here: used.settext(used.gettext() + lused + " , "); now when user enters letters, updates label , letters added, if enter enough, push rest of contents of frame out of view. label expands west side of borderlayout else get's pushed , times cut off application window. is there way use html make word wraps text , not change panel (what it's contained in) size? gridlayout c = new gridlayout(rows,0); westpanel = new jpanel(c); westpanel.add(guessedpanel); westpanel.add(usedpanel); frame.getcontentpane().add(westpanel, borderlayout.west); how it's laid out ^^ for more general solution coming google, can add html swing components easily, long content being added starts , ends proper html tags. for example, may insert html text j...

c++ - Using an element of a constexpr array vs a const array to instantiate a template -

while answering a question , ran issue couldn't explain. it seems there large enough difference between constexpr size_t intarray[2] = {1, 2}; and const size_t intarray[2] = {1, 2}; that elements of first can used instantiate template not elements of second. sample program demonstrates difference. #include <cstddef> template <size_t n> struct foo {}; // works fine void test1() { constexpr size_t intarray[2] = {1, 2}; const size_t = intarray[0]; foo<i> f; (void)f; // remove unused f warning. } // not work void test2() { const size_t intarray[2] = {1, 2}; const size_t = intarray[0]; foo<i> f; (void)f; // remove unused f warning. } int main() { return 0; } i following compiler error using g++ 4.9.2. g++ -std=c++11 -wall socc.cc -o socc socc.cc: in function ‘void test2()’: socc.cc:17:8: error: value of ‘i’ not usable in constant expression foo<i> f; ^ socc.cc:16:17: note: ‘i’ not initia...

c++ - Is there any way to add an object other than CString to a CComboBox in MFC? -

i trying add object has member variable cstring ccombobox . cannot add string because trying interface tool requires me have member variable other string list item in ccombobox . below trying do. ccombobox::addstring(myownobject); i want string of myownobject display, whole object in listbox other member variable can reached other tool. the ccombobox class wraps native combo box control. basic implementation meets common use case: displaying strings selection user. if need additional functionality, can use ccomboboxex class instead. exposes full set of operations of underlying comboboxex control. in particular, items can configured retrieve string representation items @ runtime, based on arbitrary information. the following assuming, custom item data layout follows: struct customitemdata { cstringw m_name; int m_someinteger; }; the item data can arbitrarily complex, , hold information wish store. populating ccomboboxex items requires calling ccom...

php - Can't submit values to database after changing html attributes -

i trying make password changing option in 1 of works. what want is: 1. first verify current password. 2. if current password entered correct 'proceed' button shifts down , new field called 'confirm' displayed. 3. when displayed, attribute of fields , button changed. 4. want enter new password , confirm password in respective fileds , check whether both fields have same value. 5. if both have same value table updated , if not alert made. problem: step 4, facing problem. whenever give wrong values in both fields, error 'incorrect password' , not 'password , confirm password not match!'. where possibly going wrong? thanks in advance. jquery <script> $(document).ready(function() { $('#button1').click(function() { var password=$('#password').val(); var datastring = 'password='+password; $.ajax({ type:"post", data: datastring, url: ...

hadoop - Sqoop list-tables issue -

i'm using hortonworks sandbox 2.2 vm , having issues when running sqoop against oracle. i'm executing command like: sqoop list-tables --connect jdbc:oracle:thin:@mydbhost.com:1521/sid --username user --password password it executes, nothing happens: warning: /usr/hdp/2.2.4.2-2/accumulo not exist! accumulo imports fail. please set $accumulo_home root of accumulo installation. 15/05/29 15:55:58 info sqoop.sqoop: running sqoop version: 1.4.5.2.2.4.2-2 15/05/29 15:55:58 warn tool.basesqooptool: setting password on command-line insecure. consider using -p instead. 15/05/29 15:55:58 info oracle.oraoopmanagerfactory: data connector oracle , hadoop disabled. 15/05/29 15:55:58 info manager.sqlmanager: using default fetchsize of 1000 slf4j: class path contains multiple slf4j bindings. slf4j: found binding in [jar:file:/usr/hdp/2.2.4.2-2/hadoop/lib/slf4j-log4j12-1.7.5.jar!/org/slf4j/impl/staticloggerbinder.class] slf4j: found binding in [jar:file:/usr/hdp/2.2.4.2-2/zookeeper/lib...

visual studio 2013 - Local file storage during development of a Windows Store App -

so i'm getting started in windows store apps. first experience visual studio. windows 8.1 matter, :p i'm trying figure out how local file storage works during dev phase of project. understand concept of how appdata directory , application install directory interact app once published , installed on client's pc. this answer gives overview of how supposed work. however, can't figure out how, during development, supposed use these concepts if app isn't installed , doesn't have dedicated folder in of appdata directories. any appreciated! as others have pointed out, app installed locally , app's data reside in common place c:\users\yourusername\appdata\local\packages during development. check packaging tab of package.appxmanifest file determine package family name, it's going cryptic. there'll corresponding folder in packages folder. one additional thing, though. there's difference between app that's been installed .app...

python - VIM + netrw: open multiple files/buffers in the same window -

i have switched vim using nerdtree , python-mode . nerdtree seems have conflict python-mode , breaks layout if close 1 out of multiple buffers, decided switch netrw since shipped vim anyway. but having file opened, if open netrw typing :e , open file hitting <enter> vim closes old 1 , opens new 1 in same window. , if hit <o> in same situation vim adds buffer adds new window in horizontal split. how can add multiple files/buffers buffer list , show last added buffer in active window (without new splits) using netrw ? #edited# thanks in advance! hope haven't missed trivial manual.. ;-) but having file opened, if open netrw typing :e , open file hitting <enter> vim closes old 1 , opens new 1 in same window. [...] how can open multiple files/buffers in same window using netrw? buffers added list, buffer list, , facultatively displayed in 1 or more window in 1 or more tab pages. since window can display 1 buffer, wa...

java - Gradle exception while building GraniteDS project -

good day, everyone. i'm trying build graniteds project locally: https://github.com/graniteds/graniteds when try build i'm facing: org.gradle.api.gradlescriptexception: problem occurred evaluating root project 'graniteds-master'. @ org.gradle.groovy.scripts.internal.defaultscriptrunnerfactory$scriptrunnerimpl.run(defaultscriptrunnerfactory.java:76) @ org.gradle.configuration.defaultscriptpluginfactory$scriptpluginimpl$1.run(defaultscriptpluginfactory.java:148) @ org.gradle.configuration.defaultscriptpluginfactory$scriptpluginimpl.apply(defaultscriptpluginfactory.java:156) @ org.gradle.launcher.gradlemain.main(gradlemain.java:23) caused by: java.lang.noclassdeffounderror: org.gradle.internal.nativeplatform.filesystem.filesystems @ org.gradlefx.conventions.gradlefxconvention.class$(gradlefxconvention.groovy) @ org.gradlefx.conventions.gradlefxconvention.$get$$class$org$gradle$internal$nativeplatform$filesystem$filesyst...

php - is not null condition in zend framework 2 -

i new zf , i've started working zf2, don't find documentation syntax , all. issue how write is not null condition in zf2 syntax. $select->where->notequalto('pe_name', ''); i've written not equal to , need is not null . don't know how write in syntax. can familiar me. got it..!! $select->where->isnotnull('pe_name'); and $select->where('pe_name not null'); also works.

php - Regexp - How to check whether a string starts OR ends with given character? -

string start , ends character should not match. is easiest like: $string = '!test'; preg_match('/^(!?)([a-z0-9]{1,10})(!?)$/i', $string, $matches); and examine $matches? if have 1 character @ beginning or end, it's simple saying this: /^!|!$/ no need capture group. update: make sure either an exclamation mark , ten letters or ten letters , exclamation mark , build pattern this: /^!?[a-z0-9]{1,10}$|^[a-z0-9]{1,10}!?$/ it looks it's repeating itself, it's way cheaper , faster having 3 capture groups. i put a unit test in regex101 this .

python 3.x - no input fields, only submit button appearing django -

my input field isn't appearing, submit button , i'm not getting error. why isn't showing label in browser. if want use modelform class foreign key user model have import forms.py? let me know if there other information need. i'm stuck. project = cmirs app = error_tracking search_incidents.html {% extends "base.html" %} {% block content %} <br> <p>not have logged in, have made search incidents page!</p> <br><br> <form action="error_tracking.views.search_usernames" method="post">{% csrf_token %} {{ form.as_p }} <input type="submit" value="submit" /> </form> views.py import datetime django.shortcuts import render django.http import httpresponseredirect django.shortcuts import render_to_response django.contrib.auth import authenticate django.contrib.auth.models import user django.contrib.auth.decorators import login_required error_tracking.models impor...

css - jqGrid image in a column not working in firefox -

good morning all, i have show 16x40 pixel image in jqgrid column, changes when click on it; @ purpose, defined formatter follow: function dataviewlink(cellvalue, options, rowdata, action) { var chartlink = "<div style='float:left;'><img id='_addtochart" + options.rowid + "' class='ui-icon-addtochart' onclick='devtogglechartchecked(" + options.rowid + ")'></img></div>"; return chartlink; } and created 2 css classes different images: .ui-icon-addtochart { content: url(../images/addtochart.jpg) !important; } .ui-icon-removefromchart { content: url(../images/removefromchart.jpg) !important; } then, dynamically switch these classes using jquery. works fine on chrome, there no way working on firefox. images not show on firefox. i have found issue related 'content' attribute on firefox: content url not display image on firefox browser and tried suggested work...

Subtract time fields in Access -

Image
i have table in access 2013 follow daily attendance @ work. in day, people need work 8 hours. here screenshot of table: column total = time until - time , ok. column missing has = 8-format(24*int([total])+hour([total]);"0") & ":" & format([total];"nn") the problem in missing column. if in total column says person did 7 hours, in missing column need 1 hours (1 hour missing complete 8 hours daily work) notice second , last rows ... reason doesn't calculate correctly... when there 30 mins... doesnt calculate right... in last row, should 1:30 missing (to complete 8 h in day) how calculate it? date/time values double-precision float numbers. means can math directly on them. in results query, computed values may displayed double-precision float ... can use format() present them in desired time format. i tested query sample data in access 2010. returns results think want. select t.[time from], t.[time unt...

linker - gcc -fno-stack-protector for linking not work -

my gcc version : gcc version 4.8.2 (ubuntu 4.8.2-19ubuntu1) the following makefile all : main.o utility.o gcc -fno-stack-protector -wl,-z,execstack -o binary main.o utility.o -lcrypto main : main.c gcc -z execstack -fno-stack-protector main.c -c utility: utility.c gcc -z execstack -fno-stack-protector utility.c -c the file utility.o , main.o not have stack guard after linking there stack guard objdump -d binary | grep chk 080488d0 <__stack_chk_fail@plt>: 8048e30: e8 9b fa ff ff call 80488d0 <__stack_chk_fail@plt> 80494dd: e8 ee f3 ff ff call 80488d0 <__stack_chk_fail@plt> 80498e2: e8 e9 ef ff ff call 80488d0 <__stack_chk_fail@plt> 8049b92: e8 39 ed ff ff call 80488d0 <__stack_chk_fail@plt> 8049c9...

Android button shadow/margin top -

Image
i have button , imageview in 1 line. button has margin top. , use simple background drawable. part of xml code: <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginleft="20dp" android:layout_marginright="20dp" android:layout_margintop="20dp"> <textview android:layout_width="match_parent" android:layout_height="60dp" android:layout_weight="4" android:background="@color/main_green" android:text="@string/from" android:gravity="center" android:textsize="22dp" android:textcolor="@color/text_color_white"/> <button android:id="@+id/fromcitybutton" android:layout_width="match_parent" android:layout_height=...

c# - DynamicObject behaves differently for null values -

Image
here dynamicdataobject class derived dynamicobject public class dynamicdataobject : dynamicobject { private readonly dictionary<string, object> _datadictionary = new dictionary<string, object>(); public override bool trygetmember(getmemberbinder binder, out object result) { return _datadictionary.trygetvalue(binder.name, out result); } public override bool trysetmember(setmemberbinder binder, object value) { if (!_datadictionary.containskey(binder.name)) { _datadictionary.add(binder.name, value); return true; } return false; } public override ienumerable<string> getdynamicmembernames() { return _datadictionary.keys; } } and consuming dynamicdataobject below. public mainwindow() { initializecomponent(); dynamic person = new dynamicdataobject(); person...

Python urllib2 web scraping 401 error but reachable in browser -

i trying scrape , similar pages using python: url = "http://www.nature.com/nature/journal/v521/n7553/full/nature14410.html" while can navigate page browser, i'm getting 401 authentication error urllib2 , can't figure out why. to clear, understand article behind paywall i'm interested in things title, authors, volume, references, etc, freely available , don't have subscription. from urllib2 import urlopen urlopen("http://www.nature.com/nature/journal/v521/n7553/full/nature14410.html") i've tried changing user-agent thinking site somehow detecting i'm not using browser request = urllib2.request(url) opener = urllib2.build_opener() opener.add_headers = [('user-agent', 'mozilla/5.0')] as non-web developer, it's not clear how can solve or figure out obstacle. if use developer tools in chrome shows in browser particular page giving 401 unauthorized response. unfortunately, urllib2 raises exception on e...

pdi - How I will log in in pentaho data integration after instalaion on windows -

i have installed pentaho data integration. don't know take start, mean should click run application in installed folder. thanks in advance. farhan in installation folder can run spoon.bat file launch application. ask select repository, can select browsing folder wish use repository, or press cancel skip step , not use repository.

android - Determining title in business card reading -

i making business card reader app. implementing tesseract ocr getting text image. texts printed on business card in format like mark henry(name) asst professor(profession) xyz university(employer). but how decide text user name, 1 user's company , 1 job title. there algorithm or what. p.s. above sequence can changed. this ideal problem natural language processing, can train classifier presume 'professor of', 'assistant to', etc more job description, , text 'mark', 'andrew', etc name. fuzzy logic , guess @ best. example - http://textblob.readthedocs.org/en/latest/classifiers.html >>> train = [ ... ('i love sandwich.', 'pos'), ... ('this amazing place!', 'pos'), ... ('i feel these beers.', 'pos'), ... ('this best work.', 'pos'), ... ("what awesome view", 'pos'), ... ('i not restaurant', 'neg'), .....

java - What instance of the Object is this method returning? -

i have written below method need find instance of object returned.also need check if json type or other type returned method work? public class dynamicobject { public static void main(string[] args) { // todo auto-generated method stub dynamicobject obj = new dynamicobject(); if(obj.testobj() instanceof string) system.out.println("string"); else if (obj.testobj() instanceof array) system.out.println("integer array"); else if (obj.testobj() instanceof integer) system.out.println("integer"); } private object testobj(){ boolean test = false; string s= new string("test"); integer in[] = {1,2,3,4,5}; if(test){ return s; }else{ return in; } } } what shall instance of case.if run console doesn't show anything. instanceof should integer[] else if (obj.testobj() ...

JMETER a ${__RandomString function that is used for creating email addresses - - - - Questions Developer Jobs Documentation beta Tags Users current community help chat Meta your communities Sign up or log in to customize your list. more stack exchange communities company blog Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about the company Business Learn more about hiring developers or posting ads with us Log In Sign Up x Dismiss Join the Community is a community of 7.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up JMETER a ${__RandomString function that is used for creating email addresses Ask Question var ados = ados || {}; ados.run = ados.run || []; ados.run.push(function () { ados_add_placement(22,8277,"adzerk813246147",4).setZone(43); }); up vote 0 down vote favorite I have tried: ${__ RandomString (qwerty,"@",".com") } but it is not fine. I wonder how can I create this type of random email addresses? I haven't added anything in the Random Variable because I am not sure that I need to use it. jmeter share|improve this question edited May 29 '15 at 13:45 Luke 10.2k95065 asked May 29 '15 at 13:17 godRA66 712 1 i think i found it: ${__RandomString(10,qwertyuiopasra)}@mail.com – godRA66 May 29 '15 at 13:23 add a comment | 2 Answers 2 active oldest votes up vote 6 down vote accepted As per Using JMeter Functions guide __RandomString() function takes 3 parameters: Length of the desired random string Source characters If you need to store generated string into a JMeter variable you can provide variable name as 3rd argument. So to get line of 10 alphabet characters you can use __RandomString function as follows: ${__RandomString(10,abcdefghijklmnopqrstuvwxyz,)} share| improve this answer answered May 30 '15 at 10:41 Dmitri T 43.3k 2 19 40 add a comment | up vote -2 down vote ${__RandomString(${__Random(3,9,)},abcdefghijklmnopqrstuvwxyz,)}@${__RandomString(${__Random(2,3,)},abcdefghijklmnopqrstuvwxyz,)}.${__RandomString(${__Random(2,3,)},abcdefghijklmnopqrstuvwxyz,)} share| improve this answer edited Mar 11 at 20:17 Petter Friberg 12.8k 8 25 53 answered Mar 11 at 17:07 Pixi Dixi 1 2 Could you please edit in an explanation of why this code answers the question? Code-only answers are discouraged, because they don't teach the solution. – Nathan Tuggy Mar 12 at 5:50 add a comment | Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Facebook Sign up using Email and Password Post as a guest Name Email Post as a guest Name Email discard By posting your answer, you agree to the privacy policy and terms of service. Not the answer you're looking for? Browse other questions tagged jmeter or ask your own question. asked 2 years, 3 months ago viewed 6,824 times active 5 months ago Blog The Incredible Growth of Python Visit Chat Related 0Jmeter throws Could not create keystore error for HTTPS11JMeter Append Random Number to Form Field1JMeter - how to simulate an email address AND a confirm email address0How to login to an email Address using jmeter?0how to parse same data from one request to other request in jmeter, which is generated by random function?0Record function in Jmeter results in a error message0Clicking an email verification link using jmeter0JMeter - Function not evaluated in remote server1How can you send one email for all thread groups using jmeter?0How to define email address with Jmeter user defined variables? Hot Network Questions “in US English” vs "in the US English" Max power of 2 such that 2^m divides n. (The ruler sequence) Implementation of memmove Why did Sirius's outlook towards House Elves change drastically from GoF to OotP? Proving that 9 is a divisor of x Choosing between PhD students or postdocs as a lecturer does "keep somebody" mean protect? Why do e-bikes need dedicated tires? When do I get my sandwich? Results of Rotate and Translate are not the same in 2D and 3D How do I copy a file larger than 4GB to a USB flash drive? Amazon let me place an order without me ever being asked for 3-D secure password How to declare "newcommand" value as a sum of some number (with units) and another command so that it can be used in coordinate arithmetic? Is it possible to determine if you were on a Möbius strip? Is there a significance to the asymptotic probability of at least one occurrence of an event in n attempts? How to protect culturally bald people from sunburn? What is the essence of the constant factor in discriminant definition? Can I ask my admin to wipe my profile when I leave? Would the principles of Stack Exchange work in a real-world utopia? Possible groups of K-rational pts for elliptic curves over arbitrary fields Is Enumerate default? What's the name of this "circle" How can I ask a possible long-lost relative to prove his identity? Have I found a paradox, or is the universe digital? Or am I just plain wrong? more hot questions question feed Questions Jobs Developer Jobs Directory Documentation Help Mobile Business Talent Ads Enterprise Insights Company About Press Work Here Legal Privacy Policy Contact Us Stack Exchange Network Technology Life / Arts Culture / Recreation Science Other Server Fault Super User Web Applications Ask Ubuntu Webmasters Game Development TeX - LaTeX Software Engineering Unix & Linux Ask Different (Apple) WordPress Development Geographic Information Systems Electrical Engineering Android Enthusiasts Information Security Database Administrators Drupal Answers SharePoint User Experience Mathematica Salesforce ExpressionEngine® Answers Blender Network Engineering Cryptography Code Review Magento Software Recommendations Signal Processing Emacs Raspberry Pi Programming Puzzles & Code Golf Ethereum Data Science Arduino more (27) Photography Science Fiction & Fantasy Graphic Design Movies & TV Music: Practice & Theory Worldbuilding Seasoned Advice (cooking) Home Improvement Personal Finance & Money Academia Law more (17) English Language & Usage Skeptics Mi Yodeya (Judaism) Travel Christianity English Language Learners Japanese Language Arqade (gaming) Bicycles Role-playing Games Anime & Manga Puzzling Motor Vehicle Maintenance & Repair more (32) MathOverflow Mathematics Cross Validated (stats) Theoretical Computer Science Physics Chemistry Biology Computer Science Philosophy more (10) Meta Stack Exchange Stack Apps API Data Area 51 Blog Facebook Twitter LinkedIn site design / logo © 2017 Stack Exchange Inc; user contributions licensed under cc by-sa 3.0 with attribution required. rev 2017.9.6.26955 works best with JavaScript enabled

as per using jmeter functions guide __randomstring() function takes 3 parameters: length of desired random string source characters if need store generated string jmeter variable can provide variable name 3rd argument. so line of 10 alphabet characters can use __randomstring function follows: ${__randomstring(10,abcdefghijklmnopqrstuvwxyz,)} ${__randomstring(${__random(3,9,)},abcdefghijklmnopqrstuvwxyz,)}@${__randomstring(${__random(2,3,)},abcdefghijklmnopqrstuvwxyz,)}.${__randomstring(${__random(2,3,)},abcdefghijklmnopqrstuvwxyz,)}

authentication - Google Spreadsheet service Using OAuth 2.0 - C# -

i'm facing issue google spreadsheet service. used below code call spreadsheet retrieve data , save local database. spreadsheetsservice service = new spreadsheetsservice("myspreadsheet"); service.setusercredentials(username, password); string token = service.queryclientlogintoken(); // 404 error spreadsheetquery query = new spreadsheetquery(); spreadsheetfeed feed = service.query(query); foreach (spreadsheetentry spreadsheet in feed.entries){ // retrieve data , save local machng } once google disable oauth1.0 got 404 error." used this method . i have project in google console , created client id service account . how can modify code ? i have use google spreedsheet service of r task. appreciate answers/ feedback's

java - Add ShaderImageView programmatically -

i'd run lines of code shaderimageview imageview = new shapeimageview(getbasecontext(), null, r.style.hexagonstyle); newphoto.setimageresource(r.drawable.image08); layout.addview(newphoto); and error: caused by: java.lang.runtimeexception: no resource defined shape hexagone defined as <style name="hexagonstyle"> <item name="android:layout_width">wrap_content</item> <item name="android:layout_height">wrap_content</item> <item name="sibordercolor">@color/hexagoninnerborder</item> <item name="siborderwidth">1dp</item> <item name="sishape">@raw/maskcopya</item> </style> the dependencies: dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.0.0' compile 'com.github.siyamed:android-shape-imageview:0.9.2@aar' } for m...

javascript - How can define "materializecss" modal "before" (beforeload) functionality -

i have used materializecss framework stuck in modal functionality. i have made popup modal image following code: html: <div class="media-insert"> <a href="#img2" class="modal-trigger"><img src="images/slide1.jpg" class="img-responsive" /></a> <div class="modal" id="img2"> <div class="modal-content"> <img src="images/slide1.jpg" class="img-responsive" /> <a href="javascript:void(0);" class="modal-action modal-close"><span class="mdi-navigation-close"></span></a> </div> </div> </div> js: $('.modal-trigger').leanmodal(); css: .media-insert .modal { width: auto; left: 0; top: 0; bottom: 0; right: 0; max-height: 100%; overflow: visible; } but issue that, image , modal (wrapper) both not aligned in center . , modal w...