Posts

Showing posts from March, 2012

encoding - An asp.net connection string have been encoded -

i have an .aspx file in .net 4 application cant access source code, generates following html\javascript lines of code: <script language="javascript"> function saveimage(){ app1.myname.connectionstring = 'fopwigdlgbksrgptiwpgskddgsgerqwwvdmsftapsdarqewfldszvkzlvkglkazxxcvlbmfkhpoiejkgjksdlfkldkajfakkglkdgpsggedtzxsadlklglpwriuqtjvnvkiweurqiwjfkdvbnbjeowqewptyiogxlmbxjgbortwoiqerpqiwioitowiyowiskblskogtiwotiwptqipvkvzlvkzalqpreppoypehlxbklsitpqrqprfkvzlvkpwroqproqpopazkvkzvzitwptipwtpwsop' app1.myname.connectionopen()= app1.myname.savetodb( ... </script> someone has decoded above connectionstring the: server=localhost;uid=xxxxxxxx;pwd=xxxxxxxxxx;database=xxxxxxxxxxxx;min pool size=5;maz pool size=100;connect timeout=15;;workstation id=1 i want know decoding , encoding algorithm may have been used here , tool can used encoding or decoding in above senario... thx

actionbarsherlock - Android Studio - Gradle Manifest Merging Failed -

i building demo app using actionbar sherlock in android studio , facing problem , mentioned in following link :- previous problem now after following replies posted on above link did changes , facing gradle: execution failed task ':sherlocktest:processdebugmanifest'. > manifest merging failed. see console more info. my application manifest file :- <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.sherlocktest" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="10" android:targetsdkversion="16" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > ...

python 2.7 - Aptana 3 Pydev not getting Tk() window after running -

i new aptana, , have searched net see how handles gui development. i have tried following code. shows no bugs in console. however, not give me tk() window named mygui. from tkinter import * import ttk def main(): mygui = tk() mygui.title("my gui new") mygui.geometry('400x200+200+200') l = label(mygui, text="help") l.pack() if __name__ == "__main__": main() any pointers. able functions run in console, gui development not working out well. the-it right, want add mygui.mainloop() end of main . normally when i'm working in tkinter try move of information in function main if... clause. makes larger, more complex interfaces easier handle. a start use class: from tkinter import * ttk import * class app(frame): def __init__(self, master): frame.__init__(self, master) self.pack() self.create_widgets() def create_widgets(self): self.l = label(self, text=...

android - set alarm with multiple pending intent not pass the event to broadcast -

on satat command service want ser multiple pending intents broadcast on particular time in day use multiple alarm manager correct or wrong way please suggest me. @override public int onstartcommand(intent intent, int flags, int startid) { toast.maketext(this, "traffic control bk service started", toast.length_long).show(); log.d(tag, "onstart"); calendar calnow = calendar.getinstance(); calendar1 = calendar.getinstance(); date date1 = calendar1.gettime(); calendar2 = calendar.getinstance(); date date2 = calendar2.gettime(); calendar3 = calendar.getinstance(); date date3 = calendar3.gettime(); calendar4 = calendar.getinstance(); date date4 = calendar4.gettime(); calendar5 = calendar.getinstance(); date date5 = calendar5.gettime(); calendar6 = calendar.getinstance(); ...

git - Issue with cloning repo from gitlab (fatal: The remote end hung up unexpectedly) -

when making: sudo git clone git@gitlab.mydomain.com:ws.git i error: > sudo git clone git@gitlab.mydomain.com:root/ws.git password: cloning 'ws'… authenticity of host 'gitlab.mydomain.com (x.x.x.x)' can't established. rsa key fingerprint xx:xx:xx…xx:xx. sure want continue connecting (yes/no)? yes warning: permanently added 'gitlab.mydomain.com,x.x.x.x' (rsa) list of known hosts. git@gitlab.mydomain.com's password: permission denied, please try again. git@gitlab.mydomain.com's password: fatal: 'root/ws.git' not appear git repository fatal: remote end hung unexpectedly even if change url: > sudo git clone git@gitlab.mydomain.com:ws.git password: cloning 'ws'… git@gitlab.mydomain.com's password: fatal: 'ws.git' not appear git repository fatal: remote end hung unexpectedly what problem? is problem public cloning? can clone adding personal ssh key? update: added personal ssh-key: now: ssh -tvvv...

regex - Why does my regular expression in Python not capture integers? -

i using regular expression find sequences of numbers aren't refixed 0x . eg. 0 50505 20201 0012 my regular expression (?:[^(0x)]\d+) , (in head) translates match sequence of digits not started 0x . doesn't work - assumption incorrectly making? [^(0x)] in regular expression match character not ( , 0 , x , ) . use negative lookbehind: >>> re.findall(r'(?<!0x)\d+\b', '0 0x111 50505 20201 0012') ['0', '11', '50505', '20201', '0012'] from http://docs.python.org/2/library/re.html (?<!...) matches if current position in string not preceded match .... called negative lookbehind assertion. similar positive lookbehind assertions, contained pattern must match strings of fixed length. patterns start negative lookbehind assertions may match @ beginning of string being searched. update use following regular expression: >>> re.findall(r'\b\d+\b', ...

html5 - nested Sqlite Query not working properly -

in code outer sqlite query first finish work goes inner sqlite query please explain me why happen , give solution of requirment. /*outer sqlite query*/ db.transaction(function(transaction){ transaction.executesql('select * outertable;', [], function(transaction,results){ if (results != null && results.rows != null) { (var = 0; < results.rows.length; i++) { /*my work going here*/ /*inner sqlite query inside lor loop*/ db.transaction(function(transaction){ transaction.executesql('select * myinnertable;',[], function(transaction, result){ if (result != null && result.rows != null) { (var j = 0; j < result.rows.length; j++) { /* work going here */ } } },errorhandler); } ,errorhandler,nullhandler); /*inner sqlite end here*/ } ...

android - Get an event when a ListView item is visible or not -

i wondering if there kind of onvisibilychangelistener views in listview because have method called every time listview item change visibility. i know onpredrawlistener check if view gonna visible. how can check if view gets scrolled out of visible screen area? you can implement onscrolllistener listview , override onscrollstatechanged(abslistview view, int scrollstate) , onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) , listview item visible. onscroll(abslistview view, int firstvisibleitem, int visibleitemcount, int totalitemcount) method know row of listview visible using value of firstvisibleitem , visibleitemcount .

html - How to embed MediaWiki page content into my site? -

our corporate wiki mediawiki. have no problem put iframe site refer article on wiki. but own site have lot of widgets , own style. don't want include mediawiki navigation/search/login widgets, logo image. is possible , how mediawiki page contents without widgets (only article body)? yes, is. you'll want use action=render url parameter, example: http://en.wikipedia.org/w/index.php?action=render&title=main_page . note stylesheets wiki aren't included, you'll need copy relevant rules site's css files. see this .

ssas - Result of cube query shall be null if one element is null -

i've got cube 1 measure, uses count aggregation function. result of mdx queries looks this: | germany | usa | russia | france | italy | ------------------------------------------------------ 2010 | 15 | 20 | null | null | null | 2011 | 20 | 25 | 10 | null | null | 2012 | 25 | 30 | 15 | 5 | null | 2010 - 2012| 60 | 75 | 25 | 5 | null | for me works fine, our customer wants whole aggreagtion result null if 1 of dimension elements null. result has this: | germany | usa | russia | france | italy | ------------------------------------------------------ 2010 | 15 | 20 | null | null | null | 2011 | 20 | 25 | 10 | null | null | 2012 | 25 | 30 | 15 | 5 | null | 2010 - 2012| 60 | 75 | null | null | null | and make things more complicated behavior should same, when time dimension put on slice axis. resul...

html - Is there a way to change css on hover with (style="")? -

this question has answer here: how write a:hover in inline css? 17 answers i know can import css file contains, let's say: div { color: black; } div:hover { color: red; } but there way same effect in html? so <div style="color: black;"></div> i know can js, wanted know if there hack it.. , no "duplicate" question did not contain answer looking for, keep in mind 4 years ago. pseudo classes not allowed use inline css, short answer no, cannot trying achieve. consider using <style> tags @ document level, or can use javascript if want to.. <a href="#" onmouseover = "this.style.color = '#000'" onmouseout = "this.style.color = '#f00'">hi</a> demo and commented, still answer no, using html5/css3 there's no way can use pse...

Matlab: How to boxplot sparse data with coherent spacing on x axis -

i have boxplot data matlab. and have labels: x = [1 , 2 , 3 , 5 , 10 , 50 , 100 , 110 , 150 , 200 ] and have data, say: for j=1:10 i=1:10 y(j,i) = x(i)*rand() end end now when launch boxplot(y,x) obtain fixed gap between x labels. example 1 has same distance 2 of 150 200. how can set distance proportional actual gap? assuming (from comments) you're using boxplot statistics toolbox: in boxplot(data,x), x assumed information on groups - e.g. not positions along x-axis information on how group data. in example using built in data: load carsmall boxplot(mpg,model_year) both mpg , model_year 100 x 1 doubles - model_year contains 3 unique values (70, 76, 82), e.g. number of groups in data 3. output plot 3 boxes showing mpg 3 years - position, default, of boxes 1:numgroups. you can change behaviour, need use parameters: data = randn(100,7); x = [1 , 2 , 3 , 5 , 10 , 50 , 100]; boxplot(data,'position',x) you might need play of other plotting ...

parsing - How to extract just the visualization data from the solidworks files .sldprt and .sldasm in a standalone application? -

maybe converting .sldprt stl or step file outside solidworks. dont want create using plugin solidworks.. i know visualization data public original geometry , brep data stored in proprietary format of solidworks.. varun, solidworks provides source code of project named display-lists provide functionality extract tesselation info sw files without sw software itself. check out here: https://forum.solidworks.com/docs/doc-2323

css - how to combine the logical operator NOT together with the orientation media feature -

i need target css properties device not ipad , based on device orientation. nested media queries don't work on simulator. example @media not screen , (device-width: 768px) , (device-height: 1024px) { @media screen , (orientation: portrait) { div { border: solid 1px yellow; } } @media screen , (orientation: landscape) { div { border: solid 1px red; } } } the previous gives yellow borders on both orientation. never used them read might not work expected on many devices. i cannot find way split onto separated combined queries, such as @media screen , (orientation: portrait) , not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px yellow; } } @media screen , (orientation: landscape) , not screen , (device-width: 768px) , (device-height: 1024px) { div { border: solid 1px red; } } this never matches. know comma separated queries logical or, tried @media screen , (orientation: portrait), not scre...

session - One Table to Multiple Table Mapping using Hibernate Annotation -

in case: rack , slot entities having custom id generators. using unidirectional one-to-one mapping. dimension table hold data autogenerated custom id foreign key multiple tables (rack , slot example here). , schema looks : rack ------> dimension <-----------slot dimension hold data rack , slot table generated id. here concern when saving data this:- rack rack = new rack(params); dimension dim = new dimension(params); rack.setdimension(dim); session.save(rack); data being saved same autogenerated id in rack , dimension tables. but when saving data slot table : slot slot = new slot(params); dimension dim = new dimension(params); slot.setdimension(dim); session.save(slot); it showing error message as:- attempted assign id null one-to-one property: rack can pass dynamic property name "slot" when saving data slot , dimension , "rack" when saving data rack , dimension. rack.java @entity @table(name="tablename") @genericgenerator(n...

android - Rotate ImageView and keep original size -

ok have tried many different ways rotating imageview using matrix can't find how rotate without changing size. i'm trying rotate circle, literally purple circle. happens: when on 0, 90, 180, 260 have correct size, when value 1 between image change size. like 0-45 gets smaller 45-90 gets bigger until reaches original size. know doing because image circle square bitmap. anyone can me out? what minimum api using ? 11, can use setrotationx , should rotate view without affecting image.

java - How to auto the process of "javacc -> compile with custom compiler -> compile" with maven? -

my process follow: use javacc compile *.jj files , generate own compiler. use own compiler compile source code special syntax normal java code. compile java code *.class file usual. currently these works manually. there way can these works automatically through maven when build project?

Python importerror : pyqtconfig -

i trying install , run eric4. following error message when try open eric after installation. please let me know how proceed? -------------------------------------------------------------------------------- 2013-07-31, 15:18:59 -------------------------------------------------------------------------------- <type 'exceptions.importerror'>: cannot import name pyqtconfig -------------------------------------------------------------------------------- file "c:\python27\lib\site-packages\eric4\eric4.py", line 295, in <module> main() file "c:\python27\lib\site-packages\eric4\eric4.py", line 207, in main startup.setlibrarypaths() file "c:\python27\lib\site-packages\eric4\utilities\startup.py", line 195, in setlibrarypaths pyqt4 import pyqtconfig -------------------------------------------------------------------------------- version numbers: python 2.7 qt 4.8.4 pyqt4 4.10.2 sip 4.14.7 qscintilla 2.7.2 ...

python - Executing code after construction of class object -

i hoping make list of subclasses of given class having each subclass register in list parent class holds, ie this: class monster(object): monsters = list() class lochness(monster): monster.monsters.append(lochness) class yeti(monster): monster.monsters.append(yeti) this doesn't work because classes haven't been created yet when want add them list. and, it'd nicer if done automatically (like __subclass__) i'm aware __subclass__ has functionality, wondering (for own edification) how you'd implement yourself. it seems you'd want create sort of subclass of metaclass creating register monster? or off base classes already register subclasses defined; call class.__subclasses__() method list: >>> class monster(object): ... pass ... >>> class lochness(monster): ... pass ... >>> class yeti(monster): ... pass ... >>> monster.__subclasses__() [<class '__main__.lochness'...

Set the camera focus area in Android -

following several tutorials , examples came next algorithm set camera focus on specific spot, problem camera ignores spot , performs normal overall focus instead of rect area have specified. there else missing in algorithm? has been tested on several phones android 4.0 , above, focus area api supported on these devices. note, app writing works in landscape mode only. @override public boolean ontouchevent(final motionevent event) { if (event.getaction() == motionevent.action_up) { float x = event.getx(); float y = event.gety(); float touchmajor = event.gettouchmajor(); float touchminor = event.gettouchminor(); rect touchrect = new rect((int)(x - touchmajor / 2), (int)(y - touchminor / 2), (int)(x + touchmajor / 2), (int)(y + touchminor / 2)); this.submitfocusarearect(touchrect); } } private void submitfocusarearect(final rect touchrect) { camera.parameters cameraparameters = camera.getparameters(); if (camerap...

asp.net mvc - Create and Run MVC 5 Project in VS 2012 -

for reason visual studio 2013 preview cannot create mvc 5 projects. since mvc project open source in codeplex wondering if there's simple way develop mvc 5 projects in visual studio 2012 ultimate. a new tutorial has been added asp.net website on how upgrade mvc4 project mvc5 . i migrated vs 2012 project using tutorial without problems, there no design time support razor 3 in vs2012 due changes in way vs loads razor engine . you can edit razor pages in vs2012, plain html editor.

node.js - Clean method for declaring models -

i have node project uses express, orm , sqlite3. i have multiple models. each model declared similar this: var orm = require('orm'); var db = orm.connect({database: ':memory:', protocol: 'sqlite'}); var schema = db.define('service', { uptime: number, // ... }); db.sync(function (err) { !err && console.log("db synced!"); }); module.exports = schema; no particularly pleasant across dozen models repeatedly require , connect. i tidy can connect in app.js , load in models , use them in routes. can't working. doing: first define connect , define models in app.js : var service; orm.connect(app.get('db-opt'), function(err,db){ !err && console.log("db connected!"); if (err){ throw err; } db.load('./models', function(err){ app.service = service = db.models.service; !err && console.log("models loaded!"); }); db.sy...

change the url of easyui datagrid on button click -

i'm using easyui datagrid i added new button populate datagrid set of data based on row selected. here button: a href="#" class="easyui-linkbutton" iconcls="icon-edit" plain="true" onclick="view-breakdown()">view breakdown</a> and table: <table id="dg" title="my users" class="easyui-datagrid" style="width:980px;height:370px;" url="get_users.php" toolbar="#toolbar" pagination="true" rownumbers="true" fitcolumns="true" singleselect="true" height="auto";> <thead> <tr> <th field="item_group_desc" width="50">item description</th> </tr> </thead> </table> i want function view_breakdown() value of item_group_desc , change url of table "breakdown.php" how can this? in advan...

javascript - Cannot read property 'nodeName' of undefined in SVG file -

that error caused script executed before end of loading of page explain here : cannot read property childnodes of null but don't think it's error here : <?xml version="1.0" encoding="utf-8"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd"> <svg onload="init(evt)" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"> <script xlink:href="jquery-1.10.2.min.js"/> <script xlink:href="test.js"/> <g id="id"> </g> </svg> and test.js file : function init () { $(document).mousedown(test) } function test (evt) { $('#id').append('test'); $('#id').append('<rect x=10 y=10 width=50 height=50/>'); } what curious first appending works not second one. error raise when the...

c# - Ajax call is not working on check box change function -

i trying ajax call on check box check. here code: <%@ control language="c#" inherits="system.web.mvc.viewusercontrol<emsadmin.models.user>" %> <%@ import namespace="emsadmin.models" %> <script type="text/javascript"> //<![cdata[ alert("i here"); var manuid = ('#value'); alert(manuid); $('#value:checkbox').change(function () { var taskinput; alert("i here" +'#<%: model.manufacturerid %>'); $.ajax({ url: "/reportuserverification/getcountriesformanufacturer/<%:model.manufacturerid%>", type:'get', success: function (data) { taskinput = data; var countriesarray = []; (var = 0; < data.length; i++) { var item1 = data[i]; alert(item1); if (item1 != null) { countriesarray.push(item1); } ...

sql server - Azure Mobile Service concurrency handling in SQL? -

i implementing azure mobile service , have set of objects can accessed multiple users, potentially @ same time. problem can't find lot of information on how handle potential concurrency issues might result this. i know "azure tables" implements e-tag check. there out-of-the-box solution azure mobile services 1 sql ? if not, approach should going here. should implement e-tag check hand? include guid of object generated every time object saved , checked when saving. should relatively safe way it? for conflicts between multiple clients, need add detection/resolution mechanism. use "timestamp" (typically sequentially incremented version number) in table schema , check in update script. fail update if timestamp used client reading older current timestamp. if want use etags via http headers, use custom apis. looking enabling crud scripts set headers not available today. separately, looking offline scenarios well. (prog manager, windows azure mobil...

java - Problems building latest axis2 with maven -

i checked out latest version of axis2 http://svn.apache.org/repos/asf/axis/axis2/java/core/trunk/ , installed newest maven. after execution of mvn install got following. please me, doing wrong? [info] scanning projects... [warning] [warning] problems encountered while building effective model org.apache.axis2:axis2-transport-http:bundle:1.7.0-snapshot [warning] 'dependencies.dependency.(groupid:artifactid:type:classifier)' must unique: org.apache.httpcomponents:httpclient:jar -> duplicate declaration of version (?) @ line 116, column 21 [warning] [warning] highly recommended fix these problems because threaten stability of build. [warning] [warning] reason, future maven versions might no longer support building such malformed projects. [warning] [info] ------------------------------------------------------------------------ [info] reactor build order: [info] [info] apache axis2 - parent [info] apache axis2 - resource bundle [info] apache axis2 - kernel [info] a...

Accessing an array across files in C -

i'm trying access array across files, this; int option[number_of_options]; ... addition(&option[0], num1, num2); ... printf("%d", option[0]); thats first(main) file and second this; void addition(int * option, unsigned number1, unsigned number2) { int total = number1 + number2; ... *option ++; } something that. dont worry addition method. the problem printf method allways prints 0, if *option ++; never executed/read. how fix this? by way, warning in "*option++;" file saying: warning: value computed not used. how solve problem? thank you! this: *option++; doesn't think does. means is: *(option++); which first applies increment operator option pointer , dereferences afterwards. effect is: option++; *option; // statement no effect, hence warning. you need instead: (*option)++;

javascript - Using flash plugin with inline ckeditor -

i using inline ckeditor version 4.0.2 , trying embed flash object(ooyala video) using flash plugin. after adding url see image "flash" instead of video. also, after saving code still see same image instead of video. here code of flash image <img class="cke_flash" data-cke-realelement="the real element code" data-cke-real-node-type="1" alt="flash animation" title="flash animation" align="absmiddle" src="http://localhost:3000/javascripts/lib/ckeditor_4.0.2/plugins/fakeobjects/images/spacer.gif?t=d26d" data-cke-real-element-type="flash" data-cke-resizable="true"> how can see actual video instead of image? you cannot see flash video in editor on purpose. replaced dummy image secure editor's contents , make sure clicking (or other interaction) embedded object doesn't break editor. flash can go fullscreen, load lots of data, make noise or else that, speaking, u...

java - Get simple JSON Parameter from a JSON request in JAX-RS -

the client/browser makes json request rest resource (the content-type of request application/json , corresponding rest method @consumes("application/json") annotated). @path("/process-something") @post @produces("application/json") @consumes("application/json") @handledefaultexceptions public aresponse processsomething(list<long>) { } the json body consists of simple types, list<long> or string . is there simple possibility json parameters injected annotating somehow, similar @formparam in case of application/x-www-form-urlencoded request? other easier solutions decoding json string jackson's objectmapper or jettison's jsonobject . you may create java class reflects data model of json object , annotate jaxb's @xmlrootelement. can map attributes custom json key name @xmlelement annotations, e.g.: @xmlrootelement public class myjsonoject{ @xmlelement(name="json-key-name") public...

java - Set a default value to a rich:select component which has enableManualInput set to true? -

<rich:select id="midisabled" enablemanualinput="false" value="bar"> <f:selectitem itemlabel="foo" itemvalue="foo" /> <f:selectitem itemlabel="bar" itemvalue="bar" /> </rich:select> <rich:select id="mienabled" enablemanualinput="true" value="bar"> <f:selectitem itemlabel="foo" itemvalue="foo" /> <f:selectitem itemlabel="bar" itemvalue="bar" /> </rich:select> both rich:select s have "bar" value selected default, midisabled 's dropdownlist has 2 available values "foo" , "bar" expected, while mienabled 's have "bar" : "foo" disappeared ... any other way set default value rich:select component has enablemanualinput set true ? richfaces 4.1.0 jsf 2.1.21 jdk 6u20 x32 but default value being set, isn'...

arrays - Python -- Algorithm efficiency and stability -

i have done 2 algorithms , want check 1 of them more 'efficient' , uses less memory. first 1 creates numpy array , modifies array. second 1 creates python empty array , pushes values array. who's better? first program: f = open('/users/marcortiz/documents/vlex/pylearn2/mlearning/classify/files/models/model_training.txt') lines = f.readlines() f.close() zeros = np.zeros((60343,4917)) l in lines: row = l.split(",") element in row: zeros[lines.index(l), row.index(element)] = element x = zeros[1,:] y = zeros[:,0] one_hot = np.ones((counter, 2)) the second one: f = open('/users/marcortiz/documents/vlex/pylearn2/mlearning/classify/files/models/model_training.txt') lines = f.readlines() f.close() x = [] y = [] l in lines: row = l.split(",") x.append([float(elem) elem in row...

Create Error with custom text that prevents compiling in VB.NET (#error in C#) -

Image
you can add preprocessor directive cause error @ compile time in c# this: #error cause divide 0 how can same this in vb.net? or is there way create error provides custom helpful information in errorlist. tldr: i want in vb.net: here 1 way can achieve want. not perfect. meet criteria of: prevents compiling puts custom text in error list window you first need declare variable custom text want displayed underscores in between each word. (yes underscores annoying necessary) dim this_is_as_useful_a_description_as_your_gonna_get string this creates unused variable. in conjunction ide's ability treat warnings errors give close looking for: you can turn on treat warnings errors going project properties , compile tab. so: