Posts

Showing posts from May, 2014

c# - adding custom parameter to install-package -

c# - adding custom parameter to install-package - i building nuget bundle uses install.ps1 script in tools folder. want pass parameters install script in install-package command. so running in bundle manger within visual studio install-package mypackage -myparam param param passed install.ps1 file within tools folder. is possible? there improve way accomplish this? afaik that's not possible. install-package cmdlet exposes few options map properties on installpackagecommand in nuget sources. maybe log issue or submit pull request kind of functionality? instead of trying extend install-package cmdlet, why not create own cmdlets , expose 1 after installation (similar mvc scaffolding package)? c# visual-studio powershell nuget

infix notation - How does Haskell know which function can operate first? -

infix notation - How does Haskell know which function can operate first? - i'm writing custom language features functional elements. when stuck somewhere check how haskell it. time though, problem bit complicated me think of illustration give haskell. here's how goes. say have next line a . b in haskell. obviously, composing 2 functions, , b. if function took 2 functions parameters. what's stopping operating on . , b? can surround in brackets shouldn't create difference since look still evaluates function, prefix one, , prefix functions have precedence on infix functions. if do (+) 2 3 * 5 for example, output 25 instead of 17. basically i'm asking is, mechanism haskell utilize when want infix function operate before preceding prefix function. so. if "a" function takes 2 functions parameters. how stop haskell interpreting a . b as "apply . , b function a" , interpret "compose functions , b". i...

sendmail connectivity issue -

sendmail connectivity issue - i baffled sendmail sending emails 1 particular host. seems absolutely fine while communicating other servers, on particular host hangs @ end: 050 250 local recipient ok 050 >>> info 050 354 command info start mail service input; end <crlf>.<crlf> 050 >>> . the lastly line hanging 3-4 minutes before continues 050 250 message sent ok sendmail

javascript - Why is my :nth-child(2) selector not working in my jQuery? -

javascript - Why is my :nth-child(2) selector not working in my jQuery? - i have next jquery: $(".score-window a:first-child").click(function() { $(".score-window").hide(); $(".login-window").show(); }); $(".score-window a:nth-child(2)").click(function() { $(".score-window").hide(); $(".register-window").show(); }); which hooked next html: <div class="score-window"> <i class="icon-remove" title="close"></i> <p>in order view score, have <a href="#">log in</a>.</p><br> <p>don't have business relationship yet? <a href="#">register</a>! totally free , you'll ability save scores.</p> </div> i have 2 links in score-window class, don't see why isn't working. you hav...

python imports suddenly not working -

python imports suddenly not working - i had installed on laptop. working. today when wanted work projects 1 time again gives error on imports. it's not 1 package, multiple. thing think of windows update, uncertainty cause of problem. i have installed in 32-bit since packages 32-bit. reinstalled , restarted several times. i'm not experienced python, thats why i'm wondering if more knowledge help me this. the packages installed are: cherrypy, cython, oursql, pil, pywin32, setuptools thanks in advance!! are sure installed? in python shell, run help('modules') then can check pythonpath with import sys print sys.path hope helps. python

css - Jquery hover_caption plugin hiding transparency, Is it the z-index -

css - Jquery hover_caption plugin hiding transparency, Is it the z-index - i trying hover overlay black text on white transparencies on imgs in ul, think transparency hiding behind img. i'm using corey schires' hover_caption jquery plugin. here link code. http://blooming-citadel-2598.herokuapp.com/residential/ and jquery library https://github.com/coryschires/hover-caption (function($) { $.hover_caption = { defaults: { caption_font_size: '13px', caption_color: 'black', caption_bold: false, caption_default: "fix me" } } $.fn.extend({ hover_caption: function(config) { var config = $.extend({}, $.hover_caption.defaults, config); homecoming this.each(function() { var image = $(this); // set variable wrapper div var width = image.width(); var height = image.height(); // variables caption var caption_padding = width * .07; // dynamic margin depending on img width // ...

apache - Symfony2 : redirect localhost/app_dev.php to localhost/ -

apache - Symfony2 : redirect localhost/app_dev.php to localhost/ - i developping website/web-app locally, includes many ajax calls etc... problem everytime have include app_dev.php url - when go on prod i'll need search , replace these urls.. is there way via apache hide app_dev.php ? read many questions on 1 no solution worked me. what did adding this: <virtualhost *:80> serveradmin webmaster@dummy-host.example.com documentroot "c:/wamp/www/web" directoryindex app_dev.php servername dummy-host.example.com serveralias localhost errorlog "logs/dummy-host.example.com-error.log" customlog "logs/dummy-host.example.com-access.log" mutual <directory "c:/wamp/www/web"> allowoverride allow </directory> </virtualhost> to httpd.conf ignored... i working wamp 2.2 i changed web/.htaccess following, : <ifmodule mod_rewrite.c> options +follows...

javascript - How to reliably determine timezone -

javascript - How to reliably determine timezone - i need reliably determine user's timezone in javascript. bulk of userbase on low bandwidth & old browsers have maintain backwards compatibility , maintain info transfer minimum. ideally fetch user's timezone @ start of session (i utilize cas login there no login page), send server i'll able store in database. have looked in jstimezonedetect library various geolocation apis (to retrieve location/timezone user's ip) each has drawbacks: jstimezonedetect not big, i'd rather not include 5k of js code on pages (there no single login page!) geolocation apis (such ipinfodb) introduce dependency on external services, can slow, , not guarantee me results what simplest way reliably , efficiently determine user's timezone, , send jsf app while using minimum bandwidth , browser's resources? after reading comments ended next code: <h:panelgroup layout="block" rendered="#{!app...

javascript - MVC3 prevent navigation away from page -

javascript - MVC3 prevent navigation away from page - how prevent page not navigate away when link on page clicked. have code bellow instead shows message twice. page has info grid. message pop ups shown twice when navigate away page click record on grid. anywhere else fine. var canshowwarning = "@(model.canedit)"; var showwarning = false; window.onbeforeunload = function () { if (canshowwarning && showwarning) { homecoming 'you have made unsaved changes'; } } $(function () { $("#form").submit(function () { showwarning = false; }); $("#form").change(function () { showwarning = true; }); }); var canshowwarning = "@(model.canedit)"; var showwarning = false; var alreadyshown = false; window.onbeforeunload = function () { if (canshowwarning && showwarning && !alreadyshown) { alreadyshown = true; homecoming 'you have made unsa...

scoping - Include source code to function from external file in R -

scoping - Include source code to function from external file in R - i have standard info analysis procedure need run on various (~50 datasets). have been developing time , got point turn function takes dataset , spits out sensible table each dataset. however, procedure done spans on 4 script files , far have used source 1 run it, seems seems impossible function . i have next problem: foo <- function(data) { <- somevariable source("..somefile..") #the code in there uses a, not in workspace... .. go on .. } the code crashes when run on dataset. is there way (command) copy-paste commands other files while compiling (don't know how phone call differently, though not real compiling) function? know can copy-paste myself, rather not, because various steps include neural-networks , arfima estimations maintain in separate files sake of readability of code. anyway function after copy-paste 200 lines of code, not user friendly... thx i...

calendar - iCal re-occuring events never end on iPhone -

calendar - iCal re-occuring events never end on iPhone - i have code generates calendar entries ical file hosted on publicly accessible web-server. here trimmed downwards version: begin:vcalendar version:2.0 calscale:gregorian method:publish prodid:-//customical//me// x-wr-calname:testing : : (other calendar entries) : begin:vevent dtstart:20120723t140000 duration:pt60m rrule:freq=daily;until=20120806t2359590 location:room 1 summary:daily appointment categories:(none) class:public description:this daily appointment end:vevent : : (other calendar entries) : end:vcalendar if subscribe through google calendar, calendar entry starts on 23rd july 2012, re-occurs every day , ends 6th august 2012. brilliant. however, if subscribe straight iphone running ios 6, calendar entry starts on 23rd july 2012, re-occurs every day , never ends! before write off ios defect (and effort work around not including appointments have expired), there can alter in ical file create iphone corr...

asp.net mvc - Make URL language-specific (via routes) -

asp.net mvc - Make URL language-specific (via routes) - its hard find reply specific question, sick pop here: we want build our urls language specific, meaning www.mysite.com/en www.mysite.com/de this done in routeconfig url: "{language}/{controller}/{action}/{id}" but tricky part: www.mysite.com/en/categories www.mysite.com/de/kategorien i.e. create controllername appear in multiple languages, point same controller. possible? well, partially possible (the language part only). controller name in different language interesting point, think hard accomplish that. think bidi languages standard arabic , hebrew. thought utilize controller in different languages create havoc , believe have alter underlying mvc construction allow this. the language changing part easy , done below. what might want @ globalization. language part corresponds current threads ui culture. need following: define route, this: var lang = syste...

c# - changing custom control textblock value by code -

c# - changing custom control textblock value by code - i learning how write windows 8 app, , can't find answers problem. i created custom command adding button click with: onclick() { card currentcard = new card(); ... ... hand.children.add(currentcard); } in page.cs the current card command has generic.xaml info looks containing textblock <style targettype="local:tile"> <setter property="verticalalignment" value="center"/> <setter property="template"> <setter.value> <controltemplate targettype="local:tile"> <border background="{templatebinding background}" borderbrush="{templatebinding borderbrush}" borderthickness="{templatebinding borderthickness}"> <textblock x:name="label"/> // <----------------------- textblock </border> ...

version control - Mercurial: move changes of specific folder to another repo -

version control - Mercurial: move changes of specific folder to another repo - i have 2 mercurial repos, , 1 folder (project) in each on them (path folder differs in each repos). made many changes in 1 of repos, , want re-create changes repo other one. certainly, can re-create files modified repo folder other repo, , commit it. @ way, loose changes history, , it's bad me. what can do? (if batch, win cmd, not bash) convert mutual folder repository ( hg convert ) add subrepo (or guest-repo) both "super"-repositories have mutual shared history in subrepo version-control mercurial folder

c# - Code first Model foreign key property SocialDetails is null even when the ID's match in the DB -

c# - Code first Model foreign key property SocialDetails is null even when the ID's match in the DB - i'm trying debug dbcontext query , generated sql looks this select [extent1].[id] [id], [extent1].[name] [name], [extent1].[socialdetails_id] [socialdetails_id] [dbo].[items] [extent1] [extent1].[id] = @p__linq__0 however foreign key property socialdetails null when i've checked id's in teh db public class item { public int id { get; set; } public string name { get; set; } [required] public user user { get; set; } [required] public socialdetails socialdetails { get; set; } etc what best way find out why socialdetails null? you have lazy loading disabled. as suggested matt whetton, seek this: var items = x in dbcontext.items.include("socialdetails") x.id = id select x; where dbcontext context, , have dbset named items see link (msdn): loading rela...

How to pass the value into php from android? -

How to pass the value into php from android? - i'm facing problem passing value php script android. i want questionid pass php script url_get_ansurl can't pass value. how this? please guide me. thanks lot. seek { int success = json.getint(tag_success); if (success == 1) { system.out.println("success"); groups = json.getjsonarray(tag_group); system.out.println("result success+++"+groups); (int = 0; < groups.length();i++) { jsonobject c = groups.getjsonobject(i); string question = c.getstring(tag_ques); system.out.println("checking ::"+question); ques1.add(question); string questionid = c.getstring(tag_quesid); system.out.println("checking ::"+questionid); id=questionid; quesid.add(questionid); } } else { showalert(); ...

cordova - HTML5 how-to read a large catalog of images for offline mobile web application -

cordova - HTML5 how-to read a large catalog of images for offline mobile web application - i trying create mechanism read big catalog of products offline web aplication. currently mechanism have in place read images in loading process manifest file offline caching. has severe problems in ios 6, 50mb , there appears broken in back upwards html offline in safari ios6, more in ios5. however faced multiple problems. filesystem api not supported in mobile browsers, , file api not solve problem of reading files. thinking moving web application phonegap application, not without it's own issues... looking cross platform way of handling offline image gallery. the first thing, maintain in mind is, phonegap-app hybrid app. can perform native app, can done phonegap. to more concrete in case: you can start phonegap-example. now need service (serverside), can list of images (maybe, json-structure). can read phonegap app. with filetransfer object can download files dev...

How to find whether SQL server report services and BIDS is installed? -

How to find whether SQL server report services and BIDS is installed? - our installation should work both on sql 2008 r2 , sql 2012 , prerequisite sql server study services , bids ( in 2012 sql server info tools) should installed before initiating installation. we needed via registry keys or file folders (if creates folders on installation). if bids not installed still registry key exists, how find whether feature installed or not. even if powershell script verify , helpful. sql sql-server-2008 powershell registry prerequisites

c# - How to Dynamically create textboxes using ASP.NET and then save their values in Database? -

c# - How to Dynamically create textboxes using ASP.NET and then save their values in Database? - i creating survey site. want add together textboxes dynamically , values in database. now let's select 4 textboxes dropdown there dynamically. code on selection on dropdown : protected void numdropdown_selectedindexchanged(object sender, eventargs e) { if (dropdownlist1.selectedvalue == "textbox") { int j; = int.parse(numdropdown.selectedvalue); session["i"] = i; switch (i) { case 1: t = new textbox[i]; session["textbox"] = t; (j = 0; j < i; j++) { t[j] = new textbox(); t[j].id = "txtcheckbox" + j.tostring(); panel1.controls.add(t[j]); } bre...

Iterate through Python dictionary by Keys in order -

Iterate through Python dictionary by Keys in order - if have dictionary in python looks this: d = {1:'a',5:'b',2:'a',7:'a'} so values of keys irrelevant there way iterate through dictionary keys in numerical order. keys integers. instead of saying key in d: code.... can go through dictionary keys in order 1,2,5,7? help in advance. additionally cannot utilize sort/sorted functions. you can utilize this: for key in sorted(d.iterkeys()): .. code .. in python 3.x, utilize d.keys() (which same d.iterkeys() in python 2.x). python dictionary order loops

javascript - Japanese characters for autosuggestion field -

javascript - Japanese characters for autosuggestion field - first of all, i'm not state of japan , don't have knowledge japanese writting. i need develop autosuggest field, autocomplete widget jquery ui. the suggestion should presented user typing. know there conversion between latin characters, hiragana , kanji. until conversion happens, there should no suggestion presented. what best practice implement such functionality? also, there way in javascript distinguish between hiragana , kanji characters? javascript autocomplete

c# - Write and read hidden tags in .docx documents using .Net -

c# - Write and read hidden tags in .docx documents using .Net - what able write hidden marks in document, when user fills in information, can process each part of document according marks or sections surrounded it. i'm using .net, ideas? thanks take @ sdtelements tag, openxml sdk , word 2007 content command toolkit the essence is: create word document template in word, turn on developer tab in developer tab there controls group. click "aa" ones insert new content tag, click "properties" edit tag alias , data, turn on design mode see content tags the steps below apply if app can output xml bind document: open word content command toolkit open document created attach xml in right-side panel double-click on content tags edit xpath binding or utilize drag-drop; see wcct manual that once have template prepared, depending on actual task @ hand can many things these content tags, including: replace custom xml part in document update info...

c++ - floor of a matrix in OpenCV 2.4.3 -

c++ - floor of a matrix in OpenCV 2.4.3 - i have matrix of type mat. want calculate floor of mat. have searched operations on arrays , core functionality documentation. below sample code mat m = (mat_<double>(3,3) << 1.2, 0.3, 0.9, 2.3, 1.1, 0.7, 10.2, 10,3, 8.0, 11.6); i looking like floor(m, m) or m = floor(m) can tell me how this? platform c++ c++ opencv matrix

android - Issues with Translucent Theme -

android - Issues with Translucent Theme - i have app has 2 activities. first 1 presented single button opens sec one. here manifiest definition first one: <activity android:name="com.example.buttonexample.mainactivity"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> second activity: <activity android:name="com.example.buttonexample.mainactivity2" android:label="@string/title_activity_main_activity2" android:theme="@android:style/theme.translucent"> </activity> here how launch sec activity (via onclicklistener button on first activity): public void startsecondactivityclick(view v) { intent startactivity2 = new intent(this, mainactivity2.class); startactivity(startactivity2); } this works fine, when ba...

cpu - possible factors in slowing down a parallel program -

cpu - possible factors in slowing down a parallel program - consider programme can run in parallel , moved single core quad core. speed 4-fold? say not see expected speedup in program. can possible reasons? cache 1 reason if each core not have separate cache have problem. other issues? one possible reason not see performance boost if work you're dividing on 4 processors small. if have 4 simple add-on operations you're sending separate processors, might take more time work of delegation 4 operations on 1 processor. parallel-processing cpu

Need to speed up this loop in matlab -

Need to speed up this loop in matlab - i'm running mcmc simulation in matlab , need speed loop iterations, after profiling found next loop taking time far: for i=1 : n u=0; ii=0 : t-1 if bitget(r(i),8-ii)==1 u=bitset(u,ii+1+2*t); end if bitget(g(i),8-ii)==1 u=bitset(u,ii+1+t); end if bitget(b(i),8-ii)==1 u=bitset(u,ii+1); end end %u = tcb(i)*tcr(i); p(1+u) = p(1+u) + 1; %kernel(x(i)*x(i)+y(i)*y(i)); end it part of algorithm obtain colour distribution of image. here profile results: you can save time defining 8-ii , ii+1 variables @ origin of loop, thereby reducing repeated calculations. matlab

java - Elastic Search prefix , suffix , EdgeGram -

java - Elastic Search prefix , suffix , EdgeGram - how 1 can search word through middle or lastly english language alphabets letter. illustration corporation words , able search corporation initials cor, co, c etc using edgegram , prefix filter. not able search lastly letters or middle letters of corporation por or rati or ion. elastic search back upwards features? if yes how can resolve issue. the ngram tokenizer want. it's edge-ngram tokenizer, except moves through whole word rather beingness anchored 1 edge. $ curl localhost:9200/test/_analyze?tokenizer=ngram&pretty' -d 'corporation' | grep token "tokens" : [ { "token" : "c", "token" : "o", "token" : "r", "token" : "p", "token" : "o", "token" : "r", "token" : "a", "token" : "t", "token" : "i", "tok...

email - Saving a mail message in applescript -

email - Saving a mail message in applescript - i'm new applescript , i'm having enormous problem doing seems basic. i'm trying save selected mail service message in rtf format attachments. here errant script: tell application "mail" activate set allmessages selection set mymessage item 1 of allmessages open mymessage tell application "system events" tell process "mail" tell menu bar 1 tell menu bar item "file" tell menu "file" click menu item "save as…" delay 2 keystroke "test" click checkbox "include attachments" -- result: error end tell end tell end tell end tell end tell en...

Excel Macro to convert xlsx to xls -

Excel Macro to convert xlsx to xls - i have bunch of files in folder of them in xlsx format, need convert them xls format. going done on daily bases. i need macro loop around folder , convert file xls xlsx out changing file name.? here macro using loop sub processfiles() dim filename, pathname string dim wb workbook pathname = activeworkbook.path & "c:\users\myfolder1\desktop\myfolder\macro\" filename = dir(pathname & "*.xls") while filename <> "" set wb = workbooks.open(pathname & filename) dowork wb wb.close savechanges:=true filename = dir() loop end sub what missing instead of calling wb.close savechanges=true save file in format, need phone call wb.saveas new file format , name. you said want convert them without changing file name, suspect meant want save them same base of operations file name, .xls extension. if workbook named book1.xlsx , want save book1.xls . calculate new name can si...

java - LWJGL: Shaders fail to load when initializing with PixelFormat and ContextAttribs -

java - LWJGL: Shaders fail to load when initializing with PixelFormat and ContextAttribs - i have been trying basic shaders work day , got working version (kinda). whenever initialize display up-to-date method, shaders fail load, when old fashioned way (without pixelformat , contextattibs), shaders load dandy. here code using initialize opengl: pixelformat pf = new pixelformat(); contextattribs ca = new contextattribs(3, 3).withforwardcompatible(true).withprofilecore(true); seek { display.setdisplaymode(new displaymode(width, height)); display.settitle("shader testing"); display.setlocation((int) (utils.screen_dim.getwidth() - width) / 2, (int) (utils.screen_dim.getheight() - height) / 2); display.setresizable(false); display.create(pf, ca); } grab (lwjglexception e) { utils.printerror("failed initialize display", true); } and here how initialize shaders (a bit lengthy): shdrpid = glcreateprogram(); vsid = glcre...

algorithm - Dispersing n points uniformly on a sphere -

algorithm - Dispersing n points uniformly on a sphere - i trying disperse n points on sphere such each point has "same" area "around" it. basically, i'm trying integrate function on sphere evaluating @ n points , assuming each area element same (and equal 4pi r^2/n). my question related this one, can't seem agree code presented in "accepted" reply works desired (see attached photo, generated choosing r = 1000, nx = ny = 40). clearly, points much more concentrated @ poles , un-concentrated along equator. any suggestions? edit: reference, did find some software generates mesh such each point has equal "area" around (scroll downwards see uniform area distribution on sphere), rather implement code went less-time consuming approach: iterated on azimuthal , polar angles ([0,2pi] , [0,pi]) , computed ''infinitesimal'' area of each patch (da = r^2 sin theta dtheta dphi). need integration on sphere, hoping uniform-area...

android - How to create sectioned adapter with LoadManager -

android - How to create sectioned adapter with LoadManager - here illustration utilize of loadmanager http://developer.android.com/reference/android/app/loadermanager.html example of sectioned adapter is private class sectionadapter extends sectionedadapter { @override protected view getheaderview(string caption, int index, view convertview, viewgroup parent) { textview tv = new textview(lazysectionlistactivity.this); tv.settext(caption); homecoming tv; } } my problem loadmanager can not fetch date separate cursors :(, namely need fill listview info 2 separate cursors , should separated in listview header (just sectioned adapter) how can display info separate cursors in same listview utilize of loadmanager so far managed create workable illustration 1 cursor in oncreateloader method public loader<cursor> oncreateloader(int id, bundle args) { uri baseuri; baseuri = contacts.content_ur...

c++ - Shared library name collisions -

c++ - Shared library name collisions - i'm distributing shared library (c++) , python module uses library. build modified version of bullet physics library (as cmake subproject). utilize bullet classes , functions in 1 file--bullet_interface.cpp--and bullet stuff hidden within "namespace {...}". the problem other libraries require bullet scheme dependency , link scheme version of bullet. in fact, 1 of dependencies of library (libopenrave) exports bullet symbols. (more specifically, dynamically loads plugin exports bullet symbols). i'm wondering if there's way build library bullet_interface.cpp uses right bullet functions, library doesn't create of bullet symbols visible. can't utilize scheme bullet because had create changes source code. 1 hacky solution rename of bullet functions , classes using search , replace (almost contain string "bt"). there improve way? this bit of roundabout way accomplish want, beats search-an...

android - How to keep scrollview? -

android - How to keep scrollview? - i want set scrollview. how this? in listview have 10 items view..im can see 7items..remanining 3 items need scrollview see..any possible there maintain scrollview..please guide me.. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context=".nexttopic" > <listview android:id="@+id/list_view" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:layout_centervertical="true" > </listview> </relativelayout> layoutinflater inflater = (layoutinflater) getsystemservice(context.layout_inflater_service); viewlist = n...

java - How to add locale for Arabic -

java - How to add locale for Arabic - i trying build multi-language website using jsf 2.0 using this tutorial but facing @ line countries.put("english", locale.english); countries.put("chinese", locale.simplified_chinese); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ i want set arabic , locale.xxxxxxx not giving back upwards arab countries. countries no standard arabic country. any idea, can have standard arabic country? you have utilize this countries.put("arabic", new locale("ar", "dz")); //or language name generic standard arabic new locale("ar"); where first pair of letters means language , sec country (region) - people's democratic republic of algeria in case. can utilize this link reference list of available countries , locales (i know, roseindia sucks list seemed me useful). java internationalization multilanguage

subprocess - How to save the data coming from "sudo dpkg -l" in Ubuntu terminal by using python -

subprocess - How to save the data coming from "sudo dpkg -l" in Ubuntu terminal by using python - how save info coming "sudo dpkg -l" in ubuntu terminal using python, tried way, doesn't work import os f = open('/tmp/dpgk.txt','w') f.write(os.system('sudo dpkg -l')) use subprocess.check_output() capture output of process: import subprocess output = subprocess.check_output(['sudo', 'dpkg', '-l']) os.system() returns exit status of process. above illustration presumes sudo not going prompt password. python subprocess

delphi - Multiple Connections for a single user -

delphi - Multiple Connections for a single user - i trying figure best / "correct" place set next logic in delphi datasnap server. a user connects server, , using credentials provided validate them using centralized authorizationdatabase (oracle database). if are, in fact, valid user, want given them connection info resides based on authorization repository says (could host,database,username, password). i have authorizationdatabase in own server class, server life cycle, since noone can in without beingness validated there. create problem concurrency? 10 users login validated @ same time, work ok? i have base of operations server module, session level info modules derive from, has application connection. application connection parameters can alter based on user logging in. the problem having set authorization / validation / new db parameter assignment process. where kind of two-step database approach best fit? seems rather common, user verified...

python - Convert raw socket data into readable form -

python - Convert raw socket data into readable form - i working on network analyzer. have used code available form http://www.binarytides.com/python-packet-sniffer-code-linux/. info section output of programme follows: content-type: text/html; charset=iso-8859-1 m�ak�0 ���zo�aqz��▒�&e�� �s�эu���v:���� ����'qw�oձ.�u�up7/�~ ��}�v��*n�<���j&��w/�%mb��$7��a���i�����g���d�ryo�&�gx֗�uc▒~t�!b�7�.@ !� ��>�6��yԭ%��x9�7�i�i ��w��� �� o��?6�]��l���k�� i need convert raw info readable form , analyze data.i using using python 2.7. if @ content-encoding header, says gzip . means web-page compressed using gzip algorithm. such it's binary info can't print out, have uncompress first. you can utilize python gzip module that. python sockets

Jade ClientSide Template Inheritance -

Jade ClientSide Template Inheritance - jade inheritance in clientside give me error: error: failed require "path" any solution? or possible utilize inheritance on client side? you using path somewhere in code, this app.use(express.static(path.join(__dirname, 'public'))); so should add together path module : var express = require('express') , path = require('path'); jade

xml - Test if nodes are empty or contain NULL using template match -

xml - Test if nodes are empty or contain NULL using template match - edit xml i trying figure out how test if nodes not exist or contain word null using template matching. using <xsl:choose> test in matched template. there more efficient way test? in xml if or nodes not eixt, or contain word null want skip node , print out statement saying why node wrong (i.e. "the title not exist" or "the content null"). in xml have 3rd , 4th node should not display content , instead print statement saying why content not displayed. here illustration of xml using test: <?xml version="1.0" encoding="utf-8"?> <figures> <figure> <title>title 1</title> <desc>description 1</desc> <content>content 1</content> </figure> <figure> <title>title 2</title> <desc>description 2</desc> <content>content 2</content> ...

Pass all files in directory that match criteria to a program -

Pass all files in directory that match criteria to a program - in windows explorer when drag , drop 100 files on batch file, error saying "data area passed scheme phone call small" i generated batch file take 100 arguments so, thinking work myprog.exe %1 %2 %3 %4 %5 ... %100 myprog takes bunch of paths , things them. so solution is for %%x in (*.my_ext) ( myprog.exe %%x ) but initializing programme 1 time again , 1 time again since passing 1 file it, sort of defeats purpose of accepting arbitrary number of arguments , start-up + finish slowing things down. ideally, pass files programme , allow run. how accomplish this? edit: one thought i'm going one: how can concatenate strings in windows batch file? my solution looks this. have 2 batch files get_files.bat , main.bat get_files.bat @echo off set myvar=myprog.exe /r %%i in (*.my_ext) phone call :concat "%%i" echo %myvar% goto :eof :concat set myvar=%myvar% %1 goto ...

excel vba - Copy data from one workbook to other with special condition -

excel vba - Copy data from one workbook to other with special condition - i have 2 columns in excel sheet . first column has other cell address illustration - column has contents f1, f2, f3, f4 , f5. sec column has other cell address illustration - column b has contents x1, x13, x17, x72. now want macro can re-create contents of cells mentioned in first column (want re-create contents of f1 ...f5) cells mentioned in sec column. i have written next code working : sub transfervalues() dim rnga range dim rngb range dim srcaddress range dim destaddress range dim r long 'row iterator varw1 = "a.xlsx" sht1 = "sheet1" set rnga = range("a2", range("a2").end(xldown)) set rngb = rnga.offset(0, 1) r = 1 rnga.rows.count set srcaddress = range(rnga(r).value) set destaddress = workbooks(varw1).sheets(sht1).range(rngb(r).value) destaddress.value = srcaddress.value next end sub now problem unable above operations without o...

How to run jmeter script from eclipse -

How to run jmeter script from eclipse - please allow me know whether possible run jmeter script eclipse? if yes please allow me know process. use eclipse external tool eclipse menu: run -> external tools -> external tools configuration... the dialog external tools configuration opens from tree on left select program use left mouse button , select mouse menu new or utilize left icon (above tree) , select new launch configuration on right side of tree, opens panel, details of new lauch configuration can filled in enter name: jmeter sample enter location: the location jmeter installed (on windows c:\program files\apache\jmeter\bin\jmeter.bat ) (on linux /opt/apache/jmeter/bin/jmeter ) enter working directory: ${workspace_loc:/jmeter-project} (use button browse workspance..., select project, in workspace jmeter script located. here project jmeter-project shown) close dialog using button run, should launch jmeter. info icon stop, not work, launches script, launche...

javascript - Script isn't creating span -

javascript - Script isn't creating span - this script utilize create span under image show background image on hover $(".gallery li a.image, .portfolio li a.image").append('<span class="image_hover"></span>'); //add span images $(".gallery li a.video, .portfolio li a.video").append('<span class="video_hover"></span>'); //add span videos $('.gallery li span').css('opacity', '0').css('display', 'block') //span opacity = 0 // show / hide span on hover $(".gallery li a, .portfolio li a").hover( function () { $(this).find('.image_hover, .video_hover').stop().fadeto('slow', .7); }, function () { $('.image_hover, .video_hover').stop().fadeout('slow', 0); }); this css code: #gallery_prettyphoto.portfolio {paddin...

Creating C code from Java -

Creating C code from Java - i want create simple c code java, , wondering if there libraries help me. sadly google skills not , results way off. ("c libraries java", "creating c code in java", etc). my thought create c file , utilize method createmethod(name, argument, return, code) instead of having create document , write strings return name(argument) { code } nevertheless, little pessimistic , think have create c code creating document, , writing c lines. one can utilize jcodemodel create (java) source code. create own c targeted api mimicking jcodemodel api. maybe extend jcodemodel classes. java c code-generation libraries

jquery - Jscrollpane mousedrag not working in popup on opera 12.12 -

jquery - Jscrollpane mousedrag not working in popup on opera 12.12 - here code snippet. code working correctly in every browser in ie versions except opera 12.12 , above $(function() { jquery(".footer_right li a").click(function(event){ var pop=jquery(this).attr('href'); pop=pop.substr(pop.lastindexof('#'),pop.length); $('.popup').hide(); jquery(pop+',.popup_section').fadein('slow',function() { scrollpane = $(pop).jscrollpane({showarrows: true, scrollbarwidth : '20'}).data().jsp; }); if(event.preventdefault()) event.preventdefault(); else event.returnvalue = false; homecoming false; }); }); please utilize below url live example: http://wordpress.markupbox.com/vidit_new1/ you need scroll downwards bottom of page , cleck on privacy open pop up please help. in advance jquery jquery-plugins

g++ - linker error cannot find symbol name in library -

g++ - linker error cannot find symbol name in library - g++ (gcc) 4.7.2 3.7.6-201.fc18.x86_64 #1 smp mon feb 4 15:54:08 utc 2013 x86_64 x86_64 x86_64 gnu/linux fedora release 18 (spherical cow) hello, i compiling , having problem trying link program. the linker error is: /usr/bin/ld: point.o: undefined reference symbol '_znwj@@glibcxx_3.4' /usr/bin/ld: note: '_znwj@@glibcxx_3.4' defined in dso /lib/libstdc++.so.6 seek adding linker command line /lib/libstdc++.so.6: not read symbols: invalid operation collect2: error: ld returned 1 exit status this object file point.o trying phone call function doesn't exist in libstdc++. when seek , check if symbol name exist using readelf can't find it. readelf --all libstdc++.so.6.0.17 | grep _znwj@@glibcxx_3.4 is because point.o looking symbol in older libstdc++ have been removed in later version? many suggestions, in case using gcc not g++. used work in '12, later build on differ...

c# - How to configure multiple object sets per type in Entity Framework code first -

c# - How to configure multiple object sets per type in Entity Framework code first - i using entity framework 5 code first . in database have 2 tables, availpayperiods , availpayperiodsweekly . both same: period datetime not null because these 2 tables identical in nature decide create next class represent either 1 of 2: public class payperiod : ientity { public int id { get; set; } public datetime period { get; set; } } i'm struggling configure 2. have next in database context class: public dbset<payperiod> weeklypayperiods { get; set; } public dbset<payperiod> monthlypayperiods { get; set; } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.configurations.add(new weeklypayperiodconfiguration()); // haven't yet created configuration file monthly pay periods } my weeklypayperiodconfiguration class: class weeklypayperiodconfiguration : entitytypeconfiguration<payperiod> { ...

How to identify an Android device programmatically? -

How to identify an Android device programmatically? - this question has reply here: is there unique android device id? 32 answers currently, using mac address identifier android device. wifimanager wifimanager = (wifimanager) getsystemservice(context.wifi_service); wifiinfo winfo = wifimanager.getconnectioninfo(); string mac = winfo.getmacaddress(); however, found mac empty users' devices. little confused why empty. if figure out reason, that's best! otherwise, provide alternative identifying android device? your best bet finding unique android device access serial number. there several other posts on how this, most-viewed 1 here: how find serial number of android device? android android-wifi

How to get image matrix 2D using JavaScript / HTML5 -

How to get image matrix 2D using JavaScript / HTML5 - are there solution of converting image 2d matrix using html5/js illustration picture.jpg -------be converted -----> matrice[w][h] of pixels as others have noted, can using canvas element. i'd post jsfiddle except technique works images hosted on same domain page (unless image cross-origin enabled)... , jsfiddle doesn't seem host suitable images utilize in example. here's code used test this: // reference image want pixels of , dimensions var myimage = document.getelementbyid('theimagetoworkwith'); var w = myimage.width, h = myimage.height; // create canvas element var canvas = document.createelement('canvas'); // size canvas element canvas.width = w; canvas.height = h; // draw image onto canvas var ctx = canvas.getcontext('2d'); ctx.drawimage(myimage, 0, 0); // finally, image info // ('data' array of rgba pixel values each pixel) var info = ctx.getimageda...

r - Table placement with stargazer and knitr -

r - Table placement with stargazer and knitr - i have knitr document table of regression results output stargazer , so: \documentclass[11pt]{article} \begin{document} <<setup, echo = false, results= 'hide', message = false>>= data(mtcars) library(stargazer) @ lorem ipsum dolor sit down amet, consectetur adipiscing elit. nullam eleifend molestie nisi, id scelerisque orci venenatis imperdiet. fusce dictum congue faucibus. phasellus mollis bibendum tellus european union interdum. nam sollicitudin congue fringilla. donec rhoncus viverra lorem vel molestie. ut varius facilisis ante, pretium arcu feugiat in. maecenas sagittis accumsan massa. pellentesque sollicitudin odio non odio elementum vel tristique dui mattis. pellentesque tempus feugiat magna, pharetra ipsum posuere ac. donec fringilla ligula nec tellus egestas dictum. vestibulum sit down amet sem elit. vestibulum nibh purus, pulvinar nec hendrerit sollicitudin, posuere ac mi. cras mollis lorem ac mau...

spring - JDBC lost connection while iterating ResultSet -

spring - JDBC lost connection while iterating ResultSet - in application connect mssql database via tcp/ip using spring , jdbcdaosupport. works fine when connection stable, when unplug ethernet cable while iterating through result set application suspends. doesn't throw exceptions. jdbctemplate jdbc = getjdbctemplate(); homecoming jdbc.query(sql, mapper, someargs); where mapper own rowmapper class. have tried using connection , preparedstatement , doesn't solve problem. have solution or have similar problems? the application hangs, because tcp/ip designed bad connections in mind. when packet doesn't reach destination, sender retries exponential back-off. if behavior not desirable, configure socket blocking timeout (so_timeout). unfortunately, sql server jdbc driver not have alternative configure socket timeout, block indefinitely. as nathan hughes indicates in comment, jtds driver have alternative configure sockettimeout, seek driver instead. ...

c# - DataGridViewImageCell not showing image -

c# - DataGridViewImageCell not showing image - i have created datagridviewimage column datagridview . datagridviewimagecolumn guardar = new datagridviewimagecolumn(); { guardar.headertext = ""; guardar.name = "guardar"; guardar.autosizemode = datagridviewautosizecolumnmode.displayedcells; guardar.celltemplate = new datagridviewimagecell(); guardar.image = properties.resources.empty_grilla; guardar.tooltiptext = "guardar"; } dgv_bancos.columns.add(guardar); the problem when want alter image of specific cell, not changes. this code, please help, don´t know wrong datagridviewimagecell cell = (datagridviewimagecell)dgv_bancos.rows[e.rowindex].cells["guardar"]; cell.value = properties.resources.guardar_grilla; resolved! you can utilize instead of using datagridviewimagecell cell datagridview1["guardar", e.rowindex].value = properties.resources.guardar_grilla; c# winforms datagrid...

Android, set custom timing of AlarmManager... Please advise -

Android, set custom timing of AlarmManager... Please advise - hi need set alarmmanager run reminder me take medication. need repeat custom amount of days , custom amount of times take in day. so there efficient way set alarmmanager or commonsware's implementation of alarmmanager remind me "twice day starting @ 9am next 5 days" remind me take medication? pls advice , tnx in advance constructive help in sample code , in relevant tutorials. i haven't looked mark's alarmmanager implementation, there no way, in general, bare alarmmanager trying do. can schedule single alarm, @ specific time, or repeating alarm, repeats @ fixed intervals. if want handles complex schedules 1 describe, you'll have write or find code it. android alarmmanager

java - calling getview() method in custom listview -

java - calling getview() method in custom listview - i using custom listview text , arrow image @ right of list row. i have following 1: mainactivity extends listactivity 2: specialadapter extends arrayadapter have getview() method. 3: classes sqlite dtabase. i have edittext , add together button storing new text database list. code here . onclicklistener listeneradd = new onclicklistener() { @override public void onclick(view v) { comment comment = null; edittext edit = (edittext) findviewbyid(r.id.edit_txt); string number = edit.gettext().tostring(); if(!number.equals("")){ comment = datasource.createcomment(number); adapter.add(comment); edit.settext(""); adapter.notifydatasetchanged(); } else{ toast.maketext(getapplicationcontext(), "please come in number",toast.length_s...

c++ - CoCreateInstance of IWICImagingFactory -

c++ - CoCreateInstance of IWICImagingFactory - i running visual studio 2012 on windows 7 machine. when run simpledirect2dapplication found here : http://technet.microsoft.com/en-us/subscriptions/dd940321%28v=vs.85%29.aspx hr = cocreateinstance( clsid_wicimagingfactory, null, clsctx_inproc_server, iid_ppv_args(&m_pwicfactory) ); the cocreateinstance fails "class not registered" , ptr mill 0. any help appreciated. using this #if defined(clsid_wicimagingfactory) #undef clsid_wicimagingfactory #endif and may pass this refer: http://skia.googlecode.com/svn/trunk/src/ports/skimagedecoder_wic.cpp c++ directx direct2d

javascript - ToLowerCase if statement not working? -

javascript - ToLowerCase if statement not working? - ok got of work other tolowercase. not work not split if case sensitive. using drop downwards box select delimiter. js code has been posted help guys point out issue. double checked think needs new pair of eyes. window.onload = function() { document.getelementbyid("change").onclick = function () { var paragraph = document.getelementbyid('box').value; var x = document.getelementbyid("changecase"); var getinfo = document.getelementbyid('parawrite'); var lowercase = " "; var lowercase2 = " "; var splitat = " "; var options = document.getelementbyid("split").value; alert("above loop"); if (x.checked === true) { lowercase = paragraph.tolowercase(); } else { lowercase = paragraph; } (var = 0; < document.form1.split.options.length; i++) { if (document.form1.split.options[i].selected === true) { splitat = paragraph...