Posts

Showing posts from July, 2010

sql server 2008 - SQL Agent job fails to execute -

this question has answer here: running ssis package using dtexec 2 answers i run package in server, worked fine when used run in sql agent job, failed execute. microsoft (r) sql server execute package utility version 10.50.4000.0 64-bit copyright (c) microsoft corporation 2010. rights reserved. started: 2:05:54 pm error: 2014-02-05 14:06:00.54 code: 0xc0047062 source: data flow task ado net source [1] description: system.data.odbc.odbcexception: error [im002] [microsoft][odbc driver manager] data source name not found , no default driver specified @ system.data.odbc.odbcconnection.handleerror(odbchandle hrhandle, retcode retcode) @ system.data.odbc.odbcconnectionhandle..ctor(odbcconnection connection, odbcconnectionstring constr, odbcenvironmenthandle environmenthandle) @ system.data.odbc.odbcconnectionopen..ctor(odbcconnection outer

asset pipeline - heroku explain environments/production.rb -

i have staging environment application. wanted enable assets precompilation, there no clear way me this. ended copying on many lines in environments/production.rb file environments/staging.rb current staging.rb dezzmo0003::application.configure # settings specified here take precedence on in config/application.rb. # in development environment application's code reloaded on # every request. slows down response time perfect development # since don't have restart web server when make code changes. config.cache_classes = false # not eager load code on boot. config.eager_load = false # show full error reports , disable caching. config.consider_all_requests_local = true config.action_controller.perform_caching = false # don't care if mailer can't send. config.action_mailer.raise_delivery_errors = false # settings assets compiled on staging config.serve_static_assets = false config.assets.js_compressor = :uglifier config.asse

java - AndEngine: Getting a NullPointerException on UpdateThread when adding a Sprite -

getting nullpointerexception on updatethread when adding sprite i'm creating first game in andengine , trying add sprite gamescene class. i've been tinkering hours application kept crashing after splash screen, supposed load gamescene afterwards. i've narrowed down these of code in drawpanel() method: selectpanel[0] = new sprite(0, 0, resourcemanager.balltextureregionarray[0], vbom) { @override protected void predraw(glstate pglstate, camera pcamera) { super.predraw(pglstate, pcamera); pglstate.enabledither(); } }; selectpanel[0].setposition(240, 400); attachchild(selectpanel[0]); here resourcemanager class loaded ball texture: balltexture = new bitmaptextureatlas(act.gettexturemanager(), 64, 576); balltextureregionarray[0] = bitmaptextureatlastextureregionfactory .createfromasset(balltexture, act, "red_ball.png", 0, 0); balltextureregionarray[1] = bitmaptextureatlastextureregionfactory .

python - NoReverseMatch after upgrading to Django 1.6 from 1.4 -

finally upgraded project 1.6 , i'm having trouble urls , class based views. i have form starts this: <form action="{{ project.get_absolute_url }}" method="post" id="editproject" > and project model includes this: @permalink def get_absolute_url(self): return ('project_url', (), {'slug': self.slug}) on trying load page i'll error: noreversematch @ /teamslug1/projectslug1/teamid1/projectid1/ reverse 'project_url' arguments '()' , keyword arguments '{'slug': u'projectslug1'}' not found. 1 pattern(s) tried: ['(?p<teamslug>[^\\.]+)/(?p<projectslug>[^\\.]+)/(?p<teamid>[^\\.]+)/(?p<projectid>[^\\.]+)/$'] if wrap form variable in quotes: <form action="{{ "project.get_absolute_url" }}" method="post" id="editproject" > it won't error out on loading when post form it'll result in url thi

markers - Attaching rigid bodies in Motionbuilder 2014 -

i have optimal marker data imported c3d file in motionbuilder. marker data represents animation of 2 feet of character. there way attach rigid bodies these markers , export animation of rigid body out fbx file ? just clarify, have marker data feet , not entire character. many ! cheers, darkz to answer own question : 1) create primitive asset browser in resources pane expaning elements subsection under templates section. drag cube scene. 2) go constraints under templates section , drag rigid body constraint scene. 3) specify constrained object constraint newly created cube. , keep adding desired markers want drive cube sources in constraint settings. 4) repeat required rigid bodies. 5) send scene maya etc. , export/edit rigid body animation desired.

javascript - Comparing array elements to character -

i'm trying write simple javascript program check if letter vowel. problem output incorrect , should " vowel." javascript: function findvowel(letter1, vowels) { var count = vowels.length; (var = 0; < count; i++) { if (vowels[i] === letter1) { var message1 = " vowel"; document.getelementbyid('exercise3').innerhtml = letter1 + message1; } else { var message2 = " consonant"; document.getelementbyid('exercise3').innerhtml = letter1 + message2; } } } html: <script> $(document).ready(function() { findvowel("a",["a","e","i","o","u"]); }); </script> output: a consonant add break loop doesn't keep going. function findvowel(letter1, vowels) { var count = vowels.length; (var = 0; < count; i++) { if (vowels[i] === letter1) {

correct way to add js in sencha architect (ExtJS)? -

Image
this thread works well in mobile app in desktop app seem cant add reference external js in extjs desktop app. the instructions sencha somehow don't correspond or doesn't work me when try , follow them. so, selecting resources->library , can see attribute include javascript (ticked) , library base path:/ext. the js file using use in phone app , fine - added app.json in , compiling app copies file on target , defers loading. in case sa not seeing file copied target - nor can follow instructions sa 3 documented. way can add external js dropping onto filesystem ext folder manually. again, doesn't appear in target , errors when run app with uncaught referenceerror: hex_sha512 not defined this js has been used in other apps, proved , tested relates sa or wrong use of sa. the proper way add resource in sencha architect, regardless of framework, add js resource. this done hitting ctrl-t (or cmd-t on mac) , typing "js resource" (or shortened

wifi - Identifying devices of users walking into a physical store and send messages -

user has ios app in device , walks physical store. identify user programmatically within app , throw him push notifications welcome message , based on usage history or level, send him coupons etc., on entering store. has receive these messages automatically. in ways possible? , important thing needs work in states of app (foreground, background, not running, suspended). appreciate quick inputs here. since tagged question ibeacon, here's summary of what's possible technology. in general, can want, there caveats. if install ibeacon in store , make app ibeacon using [locationmanager startmonitoringforregion: ibeaconregion] , app callback whenever beacon first seen. in callback, can make send local notification user (or making web service call, can make send push notification user). can happen in all of app states mention, using this definition of these app states. the situations not work if: the phone turned off bluetooth turned off the app has never be

java - How to turn Website into Android App -

i have developed 1 website , want create android app it. app should in sync web site automatically. know there many online free tools it. want learn android programming basic. i don't want link or view webpages smartphone must able add android features. may assume newbie in andriod developing field. want any, tutorial or book this. suggestion? for e.g. suraj.com ---> suraj (android​ app) thank in advance. if want build native app, , communication server, follow step learn java , android sdk use eclipse build server , create web api (like http://localhost/index.php?data=123) in android application, call web api send or receive data ( get , post ) and can following website android user interface design: layout basics androidhive

javascript - Simple #meteor subscribe call giving an error -

server : meteor.publish('trades', function() { return trades.find(); }); client: meteor.subscribe("trades"); both: trades = new meteor.collection('trades'); when run meteor, giving me typeerror: object # has no method 'subscribe' any suggestions? you might have client code running in root directory / . execute on server , give error. (not sure if this).

html - bootstrap menu - item cut off - for smaller screen -

Image
i'm modifying existing template uses bootstrap. here's work: http://goo.gl/vbazgv my problem last item of menu - contactos - disappears smaller screens: while it's present bigger ones: i think changing point 767px. i can't life of me correct problem... have tried can't seem understand nor find code produces change. actually problem didn't appear smaller 767, appeared smaller 979px. able solve increasing margin-bottom: @media (max-width: 979px) { .navbar .container { width: 100%; margin-bottom: 2em; }

<< Operator overloading error in C++ -

i'm c++ beginner, trying learn online videos. in of operator overloading examples in lectures following code there , gives error error: no match 'operator<<' in 'std::cout << operator+(((point&)(& p1)), ((point&)(& p2)))'compilation terminated due -wfatal-errors. on line marked comment. can please tell what's wrong in code? trying professor explained in lecture can't compile. =============== #include <iostream> using namespace std; class point{ public: double x,y; }; point operator+ (point& p1, point& p2) { point sum = {p1.x + p2.x, p1.y + p2.y}; return sum; } ostream& operator<< (ostream& out, point& p) { out << "("<<p.x<<","<<p.y<<")"; return out; } int main(int argc, const char * argv[]) { point p1 = {2,3}; point p2 = {2,3}; point p3; cout << p1 << p2; cout <<

javascript - Adding Adsense to html -

i can't seem add adsense html have in div on right side of page (yellow box) nothing shown , have been patient, been waiting days now. anyway here code. html <div id="ad2"> <script type="text/javascript"><!-- google_ad_client = "ca-pub-1234567890123456"; /* oas ad */ google_ad_slot = "4238564948"; google_ad_width = 100%; google_ad_height = 100%; //--> </script> <script type="text/javascript" src="//pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> and css use organise place #ad2 { background-color:#ff0; position:absolute; top:44%; right:1%; height:50%; width:10%; z-index:1;} page here the following lines incorrect: google_ad_width = 100%; google_ad_height = 100%; these values must set actual numbers of pixels, not percentages. (as written, causing syntax error because % being interpreted modulo operator, missing right hand argument.)

flash - Generate movie with some effects on server side like Facebook lookback -

i want create system facebook lookback, have no idea. https://facebook.com/lookback/ it generate videos pictures effects. have ideas can create similar? create swf(flash) , capture screen on server side? or there useful library make movie effects? any advice appreciated. thanks. you can use stupeflix api server side video renderings, using after effects templates or built-in effects : http://developer.stupeflix.com/documentation .

javascript - How to include a division from another webpage and put it in a division? -

how can include div webpage , display on webpage? can use iframe? help! if using .php in pages can use include example you have header div let's name header.php <header> <div> //.... </div> </header> you can include on other pages example in index.php <?php include 'header.php'; ?> hope help.

ios - Disable delete but enable move cells in UITableView -

i'm aware of 2 methods - (bool)tableview:(uitableview *)tableview caneditrowatindexpath:(nsindexpath *)indexpath { return indexpath.section == 0; } - (bool)tableview:(uitableview *)tableview canmoverowatindexpath:(nsindexpath *)indexpath { return yes; } but how can disable delete enable move cells in uitableview? try adding below delegate methods code. - (uitableviewcelleditingstyle)tableview:(uitableview *)tableview editingstyleforrowatindexpath:(nsindexpath *)indexpath{ return uitableviewcelleditingstylenone; } - (bool)tableview:(uitableview *)tableview shouldindentwhileeditingrowatindexpath:(nsindexpath *)indexpath { return no; }

java - How can I randomize the iteration sequence of a Set? -

i need use set collection. each time start jvm run program, want iterate through items in set in randomly decided sequence. the iteration sequence has nothing sequence in placed them in set , right? so, do? how can randomize iteration sequence in set? here method, , not randomize. public static <t> void shuffle(set<t> set) { list<t> shuffleme = new arraylist<t>(set); collections.shuffle(shuffleme); set.clear(); set.addall(shuffleme); } what need randomizingiterator set unordered, randomizing unordered collection doesn't make logical sense. an ordered set ordered using comparator means has fixed order, can't shuffle it, has no meaning order determined comparator or compare() method. set -> list allow shuffle contents of list , use custom randomizingiterator iterate across set . example implementation : link gist on github - testrandomizingiterator.java import org.juni

C - Program which reads text from file crashes after compiling -

i'm writing code obfuscator in c. debugger doesn't show errors in code, program crashes after compiling. i'm guessing has while loops , reading text files, i'm not sure how fix it? in advance. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> // list off replaced elements typedef struct replacelist { char *from; // string char *to; // string (random) struct replacelist *next; } replacelist; // ansi c keywords can't changed typedef struct data { char *kword; struct data *next; } data; // add keyword list data* addtolist(data **head, data *d) { d->next = *head; *head = d; return d; } // delete elements list void freelist(data *head) { data *prev; while (head != null) { prev = head; head = head->next; free(prev); } } // generating random numbers int random1() { return ((rand() % 6) + 1); } // return other characters file ,

What exception is thrown while creating a file in java -

import java.io.bufferedwriter; import java.io.file; import java.io.filewriter; import java.io.ioexception; public class filewrite { public static void main(string args[]) { try{ string content="this world"; file f=new file("d:/abc.txt"); }catch(ioexception i) { i.printstacktrace(); } } } compilation of above code gives error: io exception never thrown corresponding try block. what exception may thrown while creating file? from java docs : throws: nullpointerexception - if pathname argument null when want see exceptions being thrown method (constructor in case), can search in java docs, or if using eclipse ide, put cursor on method, , press f2 .

php - Form data is submitting, but isn't going into mySQL -

my db connection correct, able select , echo out rows of table. however, form data isn't updating database. i'm trying submit form on same page, left action blank. here php: <?php if (isset($_post['submit'])) { $con=mysqli_connect("localhost","hey","password!","dbname"); $sql="insert studentlist (studentnum, lastname, firstname, address, city, state, zip, balance, firsttermattended) values('$_post[inputid]','$_post[inputlast]','$_post[inputfirst]','$_post[inputaddress]','$_post[inputcity]','$_post[inputstate]','$_post[inputzip]','$_post[inputbalance]','$_post[inputterm]')"; echo "it worked"; } ?> and here form: <form class="form-horizontal" role="form" method="post" action=""> <div class="form-group"> <d

python - Filter tags in relationship with other model in taggit -

i have 2 models: reviews , product: class review(models.model): user = models.foreignkey(user, related_name="user_blog") tag = taggablemanager() product = models.foreignkey(product) review_text = models.textfield() created = models.datetimefield(auto_now=true, auto_now_add=false) updated = models.datetimefield(auto_now=true, auto_now_add=true) hashtag = models.foreignkey(hashtag) class product(models.model): name = models.charfield(max_length=500) i want filter tags related product, i'm doing this: review = review.objects.get(product=prod.id) tag in review.tag: print tag.name but i'm getting: traceback (most recent call last): file "<console>", line 1, in <module> typeerror: '_taggablemanager' object not iterable manager not iterable. use all method iterable queryset : for tag in review.tag.all(): print tag.name

windows phone 8 - OutOfMemoryException while downloading files in WP8 -

Image
while trying download large files ( of size >170 mb ) windows mobile application getting exception an unhandled exception of type 'system.outofmemoryexception' occurred in system.windows.ni.dll additional information: insufficient memory continue execution of program. the strange thing getting exception few files. code used download file hpubdownloader = new webclient(); hpubdownloader.openreadcompleted += (s, e) => { //process response }; hpubdownloader.downloadprogresschanged += (s, e) => { int value = e.progresspercentage; //show progress percentage , , shows till 98 % after goes exception app_unhandled exception }; hpubdownloader.openreadasync(url); what might reaosn ? not getting other details exception , tried put try- catch block in webclient download code , thats not firing . might possible reasons? follow msdn article more information - app

regex - Perl: Extracting multiple numbers from string -

could me in correcting me following code. want extract 2 numbers input string. input string [7:0] xxxx i want '7' , '0' loaded 2 variables (min , max). trying achieve my ($max, $min); ($max, $min) = $_ =~ /[(\d+):(\d+)]/; print "min: $min max $max\n"; i getting result use of uninitialized value in concatenation (.) or string @ constraints.pl line 16, <ph> line 165. min: max: 1 regards [ , ] regex meta characters, have escape them ($max, $min) = $_ =~ /\[(\d+):(\d+)\]/; the brackets used denote character class: [ ... ] matches characters inside it, e.g. [abc] matches a .

python - Decoding a base64 encryption on other device -

i using python build in library encode md5 digest using base 64. library using : hashlib import md5 my code encode "email" variable: apitoken = md5(email).digest().encode('base64')[:-1] now problem "apitoken" being sent other device need decode base64 email md5. what key should send them? salt value? if requirement send encrypted data should not use one-way hashing algorithm md5 (which weak algorithm, in case). recommend using known symmetric/asymmetric algorithms aes python cryptography toolkit (pycrypto) the encrypted data can unencrypted @ client end using appropriate client library algorithm. recommend reading book on security such bruce schneier's "applied cryptography" understand how build secure system.

Determining scope / context of a method call in python -

i write decorator python class method can determine if method called public context or private context. example, given following code def public_check_decorator(f): def wrapper(self): if self.f `called publicly`: # <-- how make line work correctly? print 'called publicly' else: print 'called privately' return f(self) return wrapper class c(object): @public_check_decorator def public_method(self): pass def calls_public_method(self): self.public_method() runtime execution ideally this: >>> c = c() >>> c.public_method() called publicly >>> c.calls_public_method() called privately is there way in python? is, alter line if self.f `called publicly`: # <-- how make line work correctly? to give desired output? some of seems trying swim against current of "python". appropriate? do know double-unscore standard? makes meth

php - code on a jpg image generated dynamically -

while looking info, came across image on forum didn't understood how worked. jpg image tells ip address , browser. think maybe made modifying htacess , replacing php jpg, , php generating image dynamically i'm not sure it. would way works? here image saw: http://www.danasoft.com/sig/475388.jpg thanks it nothing etching text on image. there several options it. using php see here , java see here

Total Found Count Miss-match while doing sorting V2.1 Sphinx -

when sorting on unixtimestamp date field total_found count shows different result . here query select * ca_sac_persons,ca_kc_persons,ca_sfc_persons,ca_sj_persons match('@fullname("^john$" | "^joseph$" | "^jose$" | "^josh$" | "^robs$")') order filing_date_ts desc limit 0,1;show meta; result : +---------------+-------------+ | variable_name | value | +---------------+-------------+ | total | 1000 | | total_found | 4813 | | time | 0.019 | | docs[9] | 4603 | | hits[9] | 5312 | +---------------+-------------+ select * ca_sac_persons,ca_kc_persons,ca_sfc_persons,ca_sj_persons match('@fullname("^john$" | "^joseph$" | "^jose$" | "^josh$" | "^robs$")') order filing_date_ts asc limit 0,1;show meta; result : +---------------+-------------+ | variable_name | value | +---------------+-----------

c# - Deleting multiple rows in datagridview -

i need delete top 1000 rows in datagridview. delegate void deleterowscallback(); private static void delete1krows() { jsontest form = (jsontest)application.openforms["jsontest"]; if (form.gridtestreport.invokerequired) { deleterowscallback d = new deleterowscallback(delete1krows); form.gridtestreport.invoke(d); } else { (int = 0; < 1000; i++ ) { form.gridtestreport.rows.removeat(0); } } } this deletes rows takes lot of time. ui non-responsive when delete in progress. better way delete multiple rows. thanks as not using binding or virtual mode, everytime remove row, entire grid refreshed. painfully slow. as dealing large amount of data, use virtual mode efficietly update grid. see this msdn link more information. there walkhrough available. takes little time setup once done faster ane makes life easier.

c++ - Splitting awkward cstring's into different arrays? -

ok, here's deal. project school, , can't use #include < string >. basically, strings we'll dealing with, have use cstrings, or char arrays end null terminator. same thing right? i'm having little bit of trouble. have read in first name, last name, student id, , minimum of 5 grades maximum of 6 grades input file. see looks below, there catch. there can arbitrary amount of spaces in between each of details, maximum length of line being 250. example of input below. adam zeller 452231 78 86 91 64 90 76 barbara young 274253 88 77 91 66 82 carl wilson 112231 87 77 76 78 77 82 notice, how there random amounts of spaces in between details. basically, need names (both first name , last name can vary in length), read student id int, , read rest of grades (preferably int array). also, can have either 5 or 6 grades,the program should able handle either. how in world go sorting data? thought maybe getline() cstring char array

try catch or type conversion performance in julia - (Julia 73 seconds, Python 0.5 seconds) -

i have been playing julia because seems syntactically similar python (which like) claims faster. however, tried making similar script have in python tesing numerical values within text file uses function: function isfloat(s) try: float64(s) return true catch: return false end end for reason, takes great deal of time text file reasonable amount of rows of text (~500000). why be? there better way this? general feature of language can understand apply other languages? here 2 exact scripts ran times reference: python: ~0.5 seconds def is_number(s): try: np.float64(s) return true except valueerror: return false start = time.time() file_data = open('smw100.asc').readlines() file_data = map(lambda line: line.rstrip('\n').replace(',',' ').split(), file_data) bools = [(all(map(is_number, x)), x) x in file_data] print time.time() - start julia: ~73.5 seconds start = time() fu

extjs - Remove back button Sencha Touch 2 -

i using sencha touch 2 build application. loading navigation view in view port , pushing login view. after login takes main page. here have button, when clicked goes login page. how can prevent this? googled lot not find effective answer. appreciated. my first attempt add login view directly ext.viewport instead of pushing navigationview. then, once login process completed, have destroy login view can add navigationview viewport. this way login view wont in navigationview stack. hope helps-

How to display local folder images in Html string content in windows phone? -

i have following html content in string format formed dynamically.and navigating html string browser using following code. string html=@"<html><head>image test</head><body><img src=""/images/test01.png""/></body></html>"; phonebrowser1.navigatetostring(html); page showing,but image not displayed.please on this to display such images, need copy them isolatedstorage : how display static web content using webbrowser control windows phone .

javascript - Receive a complex object from jquery in mvc controller -

i trying submit object form mvc controller. here js: <script> function submitform() { var usersroles = new array; jquery("#dualselectroles2 option").each(function () { usersroles.push(jquery(this).val()); }); var model = new object(); model.user = jquery('#selectuser').val(); model.roleslist = usersroles; console.log('model: ' + 'user: ' + model.user + 'roles: ' + model.roleslist); console.log('json: ' + json.stringify(model)); jquery.ajax({ type: "post", url: "@url.action(" adduser ")", datatype: "json", //data: { model: json.stringify(usersroles) }, data: { model: json.stringify(model) }, success: function (data) { alert(data); }, failure: function (errmsg) { alert(errmsg); } }); } now fetches al necessary

jquery - Website Image logo Url -

i want logo image url website " http://www.ford.com/ ",i using jquery selector that,but project based on node js . think logo has background-image in css write code not run.. var $ = cheerio.load(html); $(".globalnav-header #badge a.logo .img").filter(function() { console.log( $(this).css('background-image')); }); don't use .filter . try: var $ = cheerio.load(html); console.log( $(".globalnav-header #badge a.logo .img").css('background-image')); i tested code on ford's website this: ford doesn't use jquery, needed include before running code: var jq = document.createelement('script'); jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"; document.getelementsbytagname('head')[0].appendchild(jq); then ran code , worked. > console.log( $(".globalnav-header #badge a.logo .img").css('background-image')); url(http://www.ford.com

php - how to get the value of an element in the url after #? -

this question has answer here: can read hash portion of url on server-side application (php, ruby, python, etc.)? 11 answers i write < ? php if(isset($_request['id'])){ echo $_request['id']; } ? > < href="#id=3" > click < /a > but didn't value of id.. how can it? i don't think can since string after # interpreted browser anchor name it'll not being passed server.

How to change the title of javascript alert box in asp.net? -

in asp.net using imagebutton on click of showing javascript confirm button below: <asp:imagebutton id="imagebuttondelete" imageurl="~/styles/images/delete.png" commandargument='<%#eval("regionid") %>' onclientclick="javascript:return confirm('are sure want delete?');" text="delete" commandname="delete" runat="server" width="20px" height="20px" /> however, in chrome, title of alert box shows - the page @ localhost:1150 says i don't want the page at... text. how change that? sorry, can't it's security/anti-phishing feature, refer link more information change alert title however, if want display box user can construct such box through jquery modal. here nice link shows how create jquery-modal

How to change the color of an array element in android? -

i want know , can change color of particular array index? have following array-: string [] all={"1","2","3","4","5","6","7","8","9","10"}; so , want print number 6 in red color , rest in black through arrayadapter. how can change color of array index? please me out !!! for text color create following xml in drawable folder: item_bg.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_activated="true" android:color="#777"/> <item android:state_focused="true" android:color="#000"/> <item android:color="#000"/> </selector> now create layout textview only: item_layout.xml <textview xmlns:android="http://schemas.android.com/apk/res/android"

Ace Editor Plugin for MVC Razor syntax -

Image
how can create plugin ace editor support razor syntax. ace home page: http://ace.c9.io here started implementation of razor syntax highlighting in ace. credits goes andrey shchekin member of stack overflow. download branch of ace git . in node.js command prompt go directory , following: npm install node makefile.dryice.js full then copy src folder want work , configure ace this. var editor = ace.edit("editor"); editor.settheme("ace/theme/chrome_razor"); //razor css editor.getsession().setmode("ace/mode/razor"); //razor syntax!!! a sample of how looks like thank andrey starting off boost more people can tinker it.

python - How to query for entity commited yesterday by DateTimeProperty() -

i have calendar model records number of contributions users make per day: class calmodel(db.model): user = db.referenceproperty(usermodel, collection_name = "calendar") date = db.datetimeproperty(auto_now_add = true) contrib = db.integerproperty(required = true) i want query calmodel entity date attribute yesterday. how specify datetime object day yesterday? (the strftime format default) something goes like: cal = calmodel.all().filter("date", datetimeobject).get() figured out. yesterday = datetime.today() - timedelta(1) query = calmodel.all().ancestor(calendar_key()).filter("user", user).filter("date", yesterday).get()

c++ - Extending protocol buffers -

is there way add functionality class methods, generated protocol buffers? goal able add message .proto file, , automatically generate class sent on network on each data change (e.g. network exchange can managed custom class written in advance same peer on end). achieve need @ least generate custom code in set_ methods calls predefined callback notify buffer changed. no, isn't supported. accessors inline methods, not virtual, can't override them. you consider writing custom code generator generates wrappers around each type additional setter logic. write code generator plugin if trying support new language, you'd output c++ code #includes regular c++ output , defines wrapper types. see: https://developers.google.com/protocol-buffers/docs/reference/other

c# - Mutual authentication using openssl and .Net -

i using managed openssl wrapper mutual authentication in project. have done till sent client certificate calling .net's authenticateasclient function of sslstream , getting server certificate along 3 chain certificate in callback functions server. don't know server certificate. have 2 questions: why getting error:14094412:ssl routines:ssl3_read_bytes:sslv3 alert bad certificate error when calling authenticateasclient function if have root ca installed on local machine? how add server certificate have got in callback function server key store using managed openssl or else need server certificate finish mutual authentication? can please me complete mutual authentication process using openssl.

string - Mask data in a specific postion and specific record type -

updated: i have file quite big. need mask characters in specific postions , specific record type. have searched on place cannot find solution of quite simple task. here example file name: hello.txt file: 0120140206input file 1032682842 mr simpson 20231458 742 evergreen terrace 3034560817 green 1032682842 mr griffin 20231458 spooner street 3034560817 red 3001 what mask position 12-16 of lines starting 10. this: 0120140206input file 1032682842 xxxxxmpson 20231458 742 evergreen terrace 3034560817 green 1032682842 xxxxxiffin 20231458 spooner street 3034560817 red 3001 try this: sed 's/^\(10[0-9]\+[ \t]\+\).*$/\1xxxxxxxxxxxxx/g' example: sed 's/^\(10[0-9]\+[ \t]\+\).*$/\1xxxxxxxxxxxxx/g' <<< "0120140206input file 1032682842 mr simpson 20231458 742 evergreen terrace 9001"

ios7 - UIActivityViewController progress & result -

i using uiactivityviewcontroller save bunch of video assets user's camera roll, problem there no way know whether save photo library successful or not, , error code if unsuccessful. there way override default behavior of builtin activity? see completionhandler of uiactivityviewcontroller pretty useless in regard. use completionblock do. alassetslibrary *lib = [[[alassetslibrary alloc] init] autorelease]; if ([lib videoatpathiscompatiblewithsavedphotosalbum:videourl]) { [lib writevideoatpathtosavedphotosalbum:videourl completionblock:^(nsurl *asseturl, nserror *error) { if (!error) { [self performselectoronmainthread: @selector(dismissalertview) withobject: nil, waituntildone:no]; } }]; } - (void)dismissalertview { //dismiss alertview here. }

java - correct text input to next activity -

i new programmer , looking make sort of quiz app first app. questions right answer send user next activity. figured out how edit buttons not sure add java file or xml file allow next activity (screen) opened up. this layout far. have decided password input answer question stored within app. not sure if right approach? ` <textview android:id="@+id/textview1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="question" /> <edittext android:id="@+id/edittext1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/textview1" android:layout_centerhorizontal="true" android:layout_margintop="78dp" android:ems="10" android:inputtype="textpassword" /> <button android:layout_width="wrap_content" android

c# - Process memory does not increase after creating an object? -

i trying understand how memory-properties workingset64, pagedmemorysize64 , on. have written small programm shall debug memory consumption own process. there 3 classes: a dto persist memory dump: public class processdto { public processdto(long workingset64, long privatememorysize64, long pagedsystemmemorysize64, long pagedmemorysize64) { workingset64 = workingset64; privatememorysize64 = privatememorysize64; pagedsystemmemorysize64 = pagedsystemmemorysize64; pagedmemorysize64 = pagedmemorysize64; } public long workingset64 { get; private set; } public long privatememorysize64 { get; private set; } public long pagedsystemmemorysize64 { get; private set; } public long pagedmemorysize64 { get; private set; } } a process reader, first forces gc run , creates memory dump: internal class processdumper { public processdto getprocessdump(process process) { gc.collect(); gc.waitforpendingfinalize

javascript - Jquery print preview not showing full page -

Image
i'm using tool make print preview of page. demo plugin i have table in page. when draw preview after pageload, it' not showing full page in firefox . but in chrome same page working perfectly, showing full preview. codes. <link rel="stylesheet" href="{{ asset('bundles/joy/css/print.css') }}" type="text/css" /> <link rel="stylesheet" href="{{ asset('bundles/joy/print/css/print-preview.css') }}" type="text/css" /> <link rel="stylesheet" href="{{ asset('bundles/joy/css/print.css') }}" type="text/css" media="print"/> this print.css made me.it's not plugin example. $('body').printpreview(); $.printpreview.loadprintpreview(); am missing something? how can see full preview in both firefox , chrome?? problem in iframe height . if adjust iframe height based on total page height, works correctly. the

actionscript 3 - Air mobile device orientation on initialize of the app -

i develop app phone , tablet devices. when device phone app displayed in portrait. when device tablet app displayed in landscape. this no problem , works fine. in app xml default aspectration portrait. check in runtime if device tablet , change aspectration landscape. _nativestage.autoorients = true; _nativestage.setaspectratio(stageaspectratio.landscape); working. there 1 problem: when rotate ipad example upside down(hardware menu button on left side of device ;) ) , start app, device rotates default rotatedright. application stands on head. ios action bar on bottom. i didnt find out current orientation on startup. when check stage.deviceorientation or stage.orientaion "default"or "undefined" in both orientations. (normal or upside down) maby knows solution correct rotation device on startup. can check , can make stage.setorientation(stageorientation.rotated_right); or stage.setorientation(stageorientation.rotated_left); please me :( i found

android - how can I input information data when app is in first startup? -

i want input data in internal storage of app when app installed in new device & never change(delete & update &insert). information heavy & if input information in oncreate() every time user open app information make again & don't it.how can it? create class broadcastreceiver , register in manifest receiver intent.action_package_install actions. called when application installed.

html - Bootstrap 3: How to close popup using jQuery? -

in code there 2 popup windows. first login , second reset password. link second popup inside of login popup. want automatically close login popup when click link forgot password. <a href="#" data-toggle="modal" data-target=".loginform">login</a> <!- login popup start--> <div id="login" class="modal fade loginform" tabindex="-1" role="dialog" aria-labelledby="mylargemodallabel" aria-hidden="true"> .... <label> <input type="checkbox"><span style="font-size:12px;display:block;">remember me</span> </label> </div> </div> </div> </div> <div class="modal-footer"> <a data-toggle="modal" data-target=".forgotpassword" href="#" style="float:left;font-size:14px;">forgot password</a> <button type="butto