Posts

Showing posts from January, 2014

php - Exception Catch and CallHook -

i'm using callhook execute classes , methods in mvc framework. no add error-handling php exception function. i'm wondering best place execute catch command. request can (of course) lead execution of multiple classes. throughout system exceptions made. (example mentioned below). function callhook() { global $urlarray; //define controllers if (strlen(strstr($urlarray[0],'popup_'))>0) { $controller = substr($urlarray[0], 6); } else { $controller = $urlarray[0]; } $querystring[] = $urlarray[1]; $urlaction = $urlarray[2]; if(!isset($controller) && empty($controller)){ $controller = 'home';} if(!isset($urlaction) || empty($urlaction)){$action = 'view';}else{$action = $urlaction;} $controllername = str_replace('-','', $controller); $controller = ucwords($controller); $model = rtrim($controller, 's'); $controller .= 'controller'; ...

oracle - patient table database design -

i have 2 tables patient , doctor: create table "patient" ( "patient_id" number not null enable, "patient_name" varchar2(40), "age" number, "sex" varchar2(12), "place" varchar2(40), "phone_number" number, "doctor_id" number, "registration_date" date, constraint "patient_pk" primary key ("patient_id") enable, constraint "doctor_id" foreign key ("doctor_id") references "doctor" ("doctor_id") enable ) create table "doctor" ( "doctor_id" number not null enable, "doctor_name" varchar2(40) not null enable, "place" varchar2(40), "phone_number" number, constraint "doctor_pk" primary key ("doctor_id") enable ) a patient can visit doctor several times (different doctors also), have insert values ...

datetime - Loop through file timestamps, and if it equals to today's date, copy file -

good day all i have bunch of sql files in folder. loop through each file , timestamp of file. if timestamp mathes current date, want copy file new location. here directory structure of files: c:\mfa\mfa_timestamp\mfa_timestamp.sql and example of file be: c:\mfa\mfa_20131008\mfa_20131008.sql so here code have far, not right... set currentdate=%date% /r c:\mfa\ %%g in (*.sql) set %%g=%file% %%f in (%file%) set filedatetime=%%~tf if %filedatetime:~0, 10% == %currentdate% goto same goto notsame :same copy %file% c:\newlocation goto next :notsame goto end :next any suggestions on doing wrong here? thanks @echo off setlocal enableextensions enabledelayedexpansion set "currentdate=%date:~0,10%" %%g in ("c:\mfa\*.sql") ( set "filedate=%%~tg" set "filedate=!filedate:~0,10!" if "!filedate!"=="%currentdate%" ( copy "%%~fg" "c:\newlocation" ) )...

database - INSERT vs UPDATE: MySQL, 7 million rows -

for opting is not programming question, have 1) code, 2) amount of algorithms of comparing data each row in option #1. i not asking how queries or how database should setup . i have run bit of pickle. have database follows google gtfs specs , writing automatic update program service database. the database gets overhaul once every 3 months. table least amount of rows consists of between 1-10 rows , largest table contains 7 million rows. rest have between 10 000 , 80 000. the files program download .txt files translate in table. in other words: stops.txt = database.stops. database innodb type. i have come 2 solutions. 1) every row id in several .txt documents compared in database, if nothing has changed nothing, if has changed, update. 2) insert downloaded files own tables (basically mirroring live tables) , switch table names. example: database.stop_new , database.stop switch names. another twist: overhaul done @ date defined in 1 of .txt files, means done saturday ...

python - How to fill a numpy array with a gradient with a vectorized code? -

Image
two numpy arrays have filled follow: [0 1 2] [0 1 2] [0 1 2] [0 1 2] [0 1 2]] [[0 0 0] [1 1 1] [2 2 2] [3 3 3] [4 4 4]] or a first idea was: ax=np.zeros((5,3),np.int16) ay=np.zeros((5,3),np.int16) j in range(0,3): in range(0,5): ax[i,j]=j#filling ax x=col ay[i,j]=i#filling ay y values y=li a second idea was: bx = np.zeros((5,3),np.int16) = np.zeros((5,3),np.int16) j in range(3): bx[:,j]=j in range(5): by[i,:]=i i sure there's better way, one? jp i think using numpy.tile might better: in [422]: np.tile((0,1,2), (5,1)) out[422]: array([[0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2], [0, 1, 2]]) in [473]: tile(arange(5)[:,none], 3) out[473]: array([[0, 0, 0], [1, 1, 1], [2, 2, 2], [3, 3, 3], [4, 4, 4]]) time efficiency: for small matrix of shape (5,3), for-loop faster: in [490]: timeit np.tile((0,1,2), (5,1)) 10000 loops, best of 3: 38.3 per loop in [491]...

android - How to assign wrap_content as height to dynamically loaded gridview -

i loading gridview dynamically buttons. using scrollview, if assign wrap_content height gridview buttons not displayed. dont want assign static height gridview. code using: <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:paddingleft="5dip" android:paddingright="5dip" > <gridview android:id="@+id/gridviewtable" android:layout_width="fill_parent" android:layout_height=wrap_content" android:horizo...

php - Sending serialized form to database -

i'm trying send serialized form database. i'm doing because each form can have different number of user-created input fields , wanted simple way store forms same way. question when serialize form, use jquery attach hidden input field, , send the form , other information database, rest of information reaching database still have blank in serialized form is. if point out went wrong and/or explain how should done i'd grateful! thank much! here how i'm sending data database: $orderdate = mysql_prep($_post["orderdate"]); $ordername = mysql_prep($_post["ordername"]); $formserialized = mysql_prep($_post["formserialized"]); $query = "insert test (orderdate, ordername, orderserialized) values ('{$orderdate}', '{$ordername}', '{$orderserialized}')"; $result = mysqli_query($connection, $query); here hidden field trying attach serialized form to: <input type="hi...

Need a simple answer about Queues in Java -

i'm trying use arrayblockingqueue cant seem syntax right , dont know i'm supposed import use it. tried this: blockingqueue<int> queue = new arrayblockingqueue<int>(100); for declaration says there error int "dimensions expected after token" both of ints. feel simple solve, may have not imported correct thing or syntax off, appreciated. thanks blockingqueue<int> java generics not cover primitive types. you'll have use integer instances. this artifact of type erasure approach taken java. cannot erase int object , actual bytecode needed work int entirely different. possible if c++ approach used instantiate template each type parameter separately, new class new bytecode.

c++ - Why is my TB_INSERTBUTTON message causing comctl32 to throw? -

i'm trying add additional button toolbar in internet explorer . i assumed implementation straight forward, , using code: tbbutton buttontoadd; zeromemory( &buttontoadd, sizeof( tbbutton ) ); buttontoadd.ibitmap = 1; buttontoadd.idcommand = 1; buttontoadd.fsstate = tbstate_enabled; buttontoadd.fsstyle = btns_button|btns_autosize; lresult insertbuttonresult = sendmessage( hwndtoolbar, tb_insertbutton, 0, (lparam)&buttontoadd ); when message sent, internet explorer crash 90% of time (10% of time, broken button on toolbar) following exception: unhandled exception @ 0x000007fefb97ddfa (comctl32.dll) in iexplore.exe: 0xc000041d: unhandled exception encountered during user callback. given results aren't consistent, assumed sort of memory layout issue. tried send tb_insertbuttona instead (my application defaults tb_insertbuttonw ), has no effect on issue. i tried both 32 , 64 builds of application, both have same result. i took @ callstack of iexplore.ex...

java - IntelliJ shortcut refactor object to list of objects -

Image
lets have method signature: public string get(){}; is there shortcut in intellij highlight string , surround list<> can following: public list<string> get(){}; you can make own surround live template: go settings/preferences > ide settings > live templates > surround . add new template. fill in form the abbreviation used select surround with context menu. the description appear in surround with context menu. the $selection$ variable predefined as, guessed it, selected text. you can add own variables, such $coll$ make template more generic. set applicable in... of java (or can more exact if want). to use it: select text. press ctrl + alt + t on windows or ⌥⌘t on mac the surround with context menu appear new template. press c (since that's first letter of template's abbreviation) select template. intellij blog post feature: "surround with..."

php - PHPExcel - Getting irrelevant value in MySQL -

whenever import excel file mysql using phpexcel don't values , values inserted irrespective columns. but when use echo showing excel file shows exact report. also, want few selected columns imported 10-15 columns. thanks in advance my code <?php //include following 2 files require 'c:\xampp\phpexcel_1.7.9_doc\classes\phpexcel.php'; require_once 'c:\xampp\phpexcel_1.7.9_doc\classes\phpexcel\iofactory.php'; $conn = mysql_connect("localhost","root",""); mysql_select_db("invoice",$conn); $file=$_post['file']; $srow=$_post['srow']; $objphpexcel = phpexcel_iofactory::load($file); foreach ($objphpexcel->getworksheetiterator() $worksheet) { $worksheettitle = $worksheet->gettitle(); $highestrow = $worksheet->gethighestrow(); // e.g. 10 $highestcolumn = $worksheet->gethighestcolumn(); // e.g 'f' $highestcolumnindex = phpexcel_cell:...

node.js - Index multiple MongoDB fields, make only one unique -

i've got mongodb database of metadata 300,000 photos. each has native unique id needs unique protect against duplication insertions. has time stamp. i need run aggregate queries see how many photos have each day, have date field in format yyyy-mm-dd. not unique. right have index on id property, (using node driver): collection.ensureindex( { id:1 }, { unique:true, dropdups: true }, function(err, indexname) { /* etc etc */ } ); the group query getting photos date takes quite long time, 1 can imagine: collection.group( { date: 1 }, {}, { count: 0 }, function ( curr, result ) { result.count++; }, function(err, grouped) { /* etc etc */ } ); i've read through indexing strategy, , think need index date property. don't want make unique, of course (though suppose it's fine make unique in combine unique id). should regular compound index, or can chain .ensureindex() function , specify uniq...

javascript - How to set goog.ui.Autocomplete minimum input to 0 -

i autocomplete show entire list when input box gets focused (no input given). auto complete match substrings without having fiddle private variables. at moment code is: autocomplete = goog.ui.ac.createsimpleautocomplete( gsa.game.gamedata.teams, team2, false); matcher=autocomplete.getmatcher(); matcher.usesimilar_=true autocomplete.setmatcher(matcher); similar matches work have set private variable (no getter or setter available). the other 1 have not been able find out; how show data when no input given (like smart select input). when textbox receives focus it'll show data since there no filter text given. these basic things 1 configure can't find in api documentation. you need create descendants of goog.ui.ac.autocomplete , goog.ui.ac.arraymatcher , goog.ui.ac.inputhandler . directly create instance of auto complete object instead of calling goog.ui.ac.createsimpleautocomplete . in goog.ui.ac.autocomplete descendant assign custom input handler , m...

javascript - How to remove only text from link wrapping both text and image, with jquery? -

i have webpage contains list. in each li there tag. tag contains both text , image. here html: <li class="li-one" style=""> <a href="#" onclick="return false"><img class="theimg" src="...." width="18" height="12" alt="" title="">mytext</a> </li> i tried using jquery image removed too: jquery(document).ready(function($){jquery(".li-one").text("");}); how can remove text (mytext) jquery? here's solution removes text nodes: http://jsfiddle.net/4q4tv/ $('.li-one a').contents().each(function () { if (this.nodetype == 3) $(this).remove(); });

.net - BadImageFormatException when running F# application -

using vs2013 .net 4.0 i've compiled sample code provided @ updated version of "trueskill through time" bayesian inference code . however when try run against small data set chessanalysis.exe smallchessbase.csv system.badimageformatexception when gets "running schedule". i've tried compiling application cpu, x64, x86 , anycpu prefer 32-bit, nothing helped. how solve it?

java - Object ob; and Object ob = new Object; -

please explain difference between these two: 1) object ob; 2) object ob = new object(); first declared object: object ob; note declarations not instantiate objects. when object declared, value set null. second declared , instantiated object: object ob = new object(); in case initialize new object of type object on constructor methods. quick info can here . can lot of information in various java tutorials.

sql - Order Query by Parent and Child -

Image
i'm developing query , want order via parent , subparent, have problem. isn't ordering right. heres query classification_list ( select subparent.[id], subparent.[name], subparent.[parentid], 1 levelclassification, subparent.[id] hierarchy, subparent.[isactive] {classification} subparent subparent.[parentid] null , (@showall = 1 or subparent.isactive = 1) union select child.[id], child.[name], child.[parentid], el.levelclassification+1 , el.hierarchy, child.[isactive] {classification} child inner join classification_list el on child.[parentid] = el.[id] child.[parentid] not null , (@showall = 1 or child.isactive = 1) ) select * classification_list order 5,4,1 heres query output: the correct output is: teste filho 1 filho 2 computador motherboard grafica memoria memoria what i'm doing wrong? please notice ordering 5,4,1 i.e. in case hierar...

Why is my android app "black theme"? -

this question has answer here: changing theme in android project in eclipse 2 answers i working around , when tried in emulator app looked this? know problem is? link: https://dl.dropboxusercontent.com/u/97063669/black.png in values folder create file styles.xml , create theme inside: <style name="mytheme" parent="android:theme.light"/> create folder values-v11 in create file styles.xml create theme inside looks this: <style name="mytheme" parent="android:theme.holo.light"/> finally in manifest, declare theme: android:theme="@style/mytheme"

PHP Get multiple highest values from array -

i have script puts bunch of variables (in case random letters through d) array, counts frequency of these variables, finds highest frequency , finds key matches frequency. $answerlist = array($a1, $a2, $a3, $a4,); $count = array_count_values($answerlist); $high_value = max($count); $high_key = array_search($high_value, $count); print_r ($high_key); however in case there 2 equal highest values, array_search returns first key. there way return both? this should it: $high_keys = array_keys($count, $high_value); from array_search docs : if needle found in haystack more once, first matching key returned. return keys matching values, use array_keys() optional search_value parameter instead.

SAS- PROC UNIVARIATE > histogram > x axis values -

i have single continuous variable highly skewed distribution. have log transformed normalization. while creating histogram of variable proc univariate (sas 9.3), there way can plot transformed variable, keep values of original variable on x axis ? if topic has been discussed then, appreciate if can provide link. thank you. you use sas graph template language (gtl) this. documentation contains plenty of examples should able change , modify needs. output proc univariate produced gtl should able generate similar. take output dataset proc univariate , base plot off that. need reverse transformations first. documentation gtl: http://support.sas.com/documentation/cdl/en/grstatgraph/65377/html/default/viewer.htm#p1sxw5gidyzrygn1ibkzfmc5c93m.htm

mongodb - Mongoexport get property of nested objects in CSV output -

i'm trying csv mongo-db using mongoexport. my data in format: { "_id": "99", "page_id": numberlong(1122334455), "data": { "0": { "item_id": numberlong(123456789), "item_name": "item1" }, "1": { "item_id": numberlong(987654321), "item_name": "item2" }, }, "last_updated_utc": isodate("2013-12-19t13:17:43.994z") } to i'm using following command: mongoexport -f _id,page_id,last_updated_utc --query {page_id:1122334455} -d mydatabase -c mycollection --csv this gives output: "99",1122334455,2013-12-19t13:17:43.994z exported 1 record the problem need item_name data elements in output. these dynamic array contain no items or many items. if add data fields (-f) parameter, output json string csv, each object, doesn...

javascript - Get current URL from IFRAME -

is there simple way current url iframe? the viewer going through multiple sites. i'm guessing using in javascript. for security reasons, can url long contents of iframe, , referencing javascript, served same domain. long true, work: document.getelementbyid("iframe_id").contentwindow.location.href if 2 domains mismatched, you'll run cross site reference scripting security restrictions. see answers similar question .

ios - NSArray mutableCopy creates new array but still points to old contents -

i have nsmutablearray called playersarray in singleton class holds applications main datasource. each object of playersarray nsdictionary , content : { sgfid = 1; sgfplayer = "<playercontact: 0xbf851b0>"; } playercontact nsobject subclass containing properties like: nsstring * playername, playerteam, bool playerselected , on. in 1 of viewcontrollers, in viewdidload , want take deep copy of playersarray in nsmutablearray named duplicateplayersarray . playersarray = [[sgfhelper sharedhelpers] sgfcontactsarray]; duplicateplayersarray = [playersarray mutablecopy]; now have 2 separate copies, under impression playersarray , duplicateplayersarray 2 totally different arrays in memory. found not! even if debugger shows have different memory addresses, contents have same memory addresses. when this: [((nsmutabledictionary *)[duplicateplayersarray objectatindex:0]) setobject:@"333" forkey:@"sgfid"]; playersarray's dictio...

c# - Button Not Working Without Refreshing Page -

i building website simple functions , i'm running issues. can't provided sample code because have no idea problem lies , technically site not crashing. the frontend of site html , javascript, backend i'm using asp.net , c#. there's button on page, trigger function in javascript. function make call backend aspx file (say, myfunction.aspx) , generate output file user download. everything working fine. getting expected result , able download output file no problem. i didn't notice issue until try re-run function. i hit button again wasn't doing (i using httpfox know it's not calling anything) i realize wasn't able run function again without refreshing page. after refreshing page works fine. can explain why way? how can go debugging issue? don't know if problem fontend or backend. thanks help. edit this how created button. <button dojotype="dijit.form.button" type="button" onclick ="myjsfunction('...

c++ - C++11 run templated class function with std::thread -

cannot pass function argument std::thread when class defined template. compiler: gcc 4.8.2 language: c++11 code: //---------test.h----------------------- #ifndef test_h #define test_h #include <iostream> #include <thread> using namespace std; template <class t> class test { public: test(); void thr(t n); void testthread(); }; #endif // test_h //---------test.cpp----------------------- #include "test.h" template <class t> test<t>::test() { } template <class t> void test<t>::thr(t n) { cout << n << endl; } template <class t> void test<t>::testthread() { t n = 8; thread t(thr, n); t.join(); } //---------main.cpp----------------------- #include <iostream> using namespace std; #include "test.h" #include "test.cpp" int main() { test<double> tt; tt.testthread(); return 0; } compiler error: in file included ../s...

javascript - onmouseover not working on chrome? -

i want use onmouseover replaces preview picture thumbnail picture when mouse on it.. below code works fine on firefox , ie not working on chrome.. here link applied samdesign.comli.com/gallery.html <div class="gallery" align="center"> <h1>photo gallery</h1><br/> <div class="thumbnails"> <img onmouseover="preview.src=img1.src" id="img1" src="images/salman_siddiqui.jpg" alt="image not loaded"/> <img onmouseover="preview.src=img2.src" id="img2" src="images/slide6.jpg" alt="image not loaded"/> <img onmouseover="preview.src=img3.src" id="img3" src="images/slide1.jpg" alt="image not loaded"/> <img onmouseover="preview.src=img4.src" id="img4" src="images/slide2.jpg" alt="image not loaded"/> <img onmouseover="previe...

java - The final local variable cannot be assigned, since it is defined in an enclosing type -

ratings = new jslider(1, 5, 3); ratings.setmajortickspacing(1); ratings.setpaintlabels(true); int vote; class slidermoved implements changelistener { public void statechanged(changeevent e) { vote = ratings.getvalue(); } } ratings.addchangelistener(new slidermoved()); if write above code eclipse tells me this: cannot refer non-final variable vote inside inner class defined in different method but if add final before int vote gives me error: the final local variable vote cannot assigned, since defined in enclosing type so, how solve? well, standard trick use int array of length one. make var final , write var[0] . important make sure don't create data race. using code example: final int[] vote = {0}; class slidermoved implements changelistener { public void statechanged(changeevent e) { vote[0] = ratings.getvalue(); } } since happenenig on edt, including callback invocation, should safe. should consider using anonym...

android - Open Gallery Folder By Click On Notification -

i used code send notification. public static void sendnotificationphoto(context context, class<?> activitytarget) { log.i( tag , "send photo notification"); notificationmanager mnotificationmanager = (notificationmanager) context.getsystemservice(context.notification_service); notification notifydetails = new notification(r.drawable.ic_plusone_standard_off_client, "new alert!", system.currenttimemillis()); intent intent = new intent(context, activitytarget); int id = notification_id_photo; string contenttext = "slave picture available!"; pendingintent contentintent = pendingintent.getactivity(context.getapplicationcontext(), id, intent, pendingintent.flag_one_shot); notifydetails.setlatesteventinfo(context.getapplicationcontext(), context.getstring(r.string.app_name), contenttext, contentintent); mnotificationmanager.notify(...

html - Negative margin limit with images -

see fiddle: http://jsfiddle.net/5besz/ i've discovered strange haven't seen documented anywhere else... wondering if had solution. you'll notice negative margin hits limit @ around -212% image elements. there reason this? can think of work around? why need (what i've tried): i'm making fluid layout , want display rating system. have sprite sheet of stars (similar 1 in fiddle) want reuse @ various sizes. because size changes can't use background image. decided use image inside container variable width , overflow:hidden . sprite sheet adjusts width of container , container's viewable content determined padding-top:20% . can fluid width (since every star box, total height 20% width). then try , position star image inside container margin-top. tried using position:relative , top:-x% , because container technically has no height causing issue on mobile phones (-100% of 0 0, etc). so assumed negative margin work, discovered strange issue! not...

.net - LINQ Design Time Errors Upgrading From VS2010 to VS2013 -

after upgrading visual studio 2013, seeing errors throughout 1 of wcf framework 4.0 projects. wherever there linq entity query seeing error upon using linq function such any(), single(), singleordefault(), orderby() etc: error 3 type arguments method 'system.linq.enumerable.orderby<tsource,tkey>(system.collections.generic.ienumerable<tsource>, system.func<tsource,tkey>)' cannot inferred usage. try specifying type arguments explicitly. example line of code generating error: xxxxxxxxxxstatuslist = xxxxxxxxcontainer.xxxxxxxstatus.orderby(a => a.status).tolist(); as as: error 42 delegate 'system.func<businessaccess.entities.xxxportal.xxxxxxxxinfo, int, bool>' not take 1 arguments with example: xxxxxxinfo = xxxxxxxxcontainer.xxxxxlist.where(c => c.xxxxxxid.equals(xxxxxxid)).single(); here have tried: building project. builds , hides errors temporarily until code edited. removing linq reference , re-adding. uns...

Declaring property C++ by reference or pointer -

i want declare properties of class. thinking of creating private variables properties want in class. and exposing private variables reference. have pointer can pass address of private variable. user of class can modify variable. so way better via reference or pointer shown in example below? class exampleclass { private: int age; public: //this function allows access via reference int& getagebyreference() { int& refage= age; return refage; } //this function allows access via pointer int* getagebypointer() { int* pointage= &age; return pointage; } } return reference 2 reasons: returning pointer suggest nullptr returned (but won't be). reference can't null, user knows they'll valid object (assuming behaved). returning pointer make user of function wonder ownership of object being pointed at. reference tells user can object , don't need kind of me...

android - App crash when requesting friend list -

i got strange crash. user login app correctly. i'm correctly calling uilifecyclehelper methods code. when try perfrom simple request (get user's friends list) app crash in brutal way. here function make app crash: private void fetchuserfriends() { //gather friend list session session = session.getactivesession(); if( session != null && session.isopened() ) { request.newmyfriendsrequest(session.getactivesession(), new request.graphuserlistcallback() { @override public void oncompleted(list<graphuser> users, response response) { if (response.geterror() == null) { //use friends } else { //print error } } }).executeasync(); } } i've digged little bit , seems instruction making whole app crash every time this: connection.getresponsecode() internally doing connection.getinputstream() here face...

vb.net - Visual Basic keeps reseting my variables to 0 each time I leave and re-enter a class -

i have form obtain financial information user including loan amount, rate, , term. i'm supposed call class work , return answer form. however, reason, whenever program moves out of class, form, class, variables have class reset 0. code below. awesome. this code form: 'preform calculation when button clicked private sub buttoncalc_click(sender object, e eventargs) handles buttoncalc.click dim loanamount new finclass dim rate new finclass dim term new finclass dim payment new finclass loanamount.getloanamount = textboxmortgageamount.text rate.getannualrate = comboboxannualrate.text.replace("%", "") term.getterminyears = comboboxterm.selecteditem textboxmonthlypayment.text = payment.setmonthlypayment end sub and code associated class: public class finclass private loanamt decimal private termvalue decimal private ratevalue decimal public paymentvalue decimal public writeonly property getloanamount set(value...

javascript - Can't make Youtube video in modal stop playing in IE and Chrome -

i have set of modals has different youtube video in each. i've added code reset src of video every time modal closed, work in firefox, not in ie or chrome. i've tried few different codes, can make work in firefox nomatter try. javascript: function close_modal(){ //hide mask $('#mask').fadeout(500); //hide modal window(s) $('.modal_window').fadeout(500); //enable scoll on main page $('body').removeclass('stop-scrolling') var video = $("#currentvideo").attr("src"); $("#currentvideo").attr("src",""); $("#currentvideo").attr("src",video); } function show_modal(modal_id){ //disable scroll on main page $('body').addclass('stop-scrolling') //set display block , opacity 0 can use fadeto $('#mask').css({ 'display' : 'block', opacity : 0}); //fade in mask opac...

vba - ms-access tricky situation in product entry -

i have 2 access tables access 1 make entries products whitepapter | pen | startdate | enddate 5 | 10 | 31/jan | 02/feb stock product table: whitepapter | pen 10 | 20 my goals is: when user enters data, application check against stock product , date: if end date 1st january show 5 papers , 10 pens minus main stock, if today 03 february put them main stock: what best way approach this? know relation i'm asking how apply in best way... users use db not professionals i'm looking best way give them feature.... you can calculate number of products needed select query: select sum(whitepaper) sumofwihtepapers, sum(pen) sumofpens eventtable between startdate , enddate; also in access can use afterupdate events of textboxes in order perform logic. as rest: @ stackoverflow when got stuck while trying programm something, must show effort. have tried? can show code? did not work expected? did error message? please read...

php - Scrape HTML & count children using Simple HTML DOM -

i'm trying collect data website, , want count amount of elements in element. targeting different dom elements works fine, reason $count variable in example below stays @ "0". i'm missing silly, can't seem find it. the html on website follows: <div id="list_options"> <div class="list_mtgdef_option pointer"> <div class="list_mtgdef_foildesc shadow"> </div> <div class="list_mtgdef_stock tooltip"> <div class="list_mtgdef_stock_left"> <span class="foil008469_1 block "></span> <span class="foil008469_2 block transparency_25"></span> </div> <div class="list_mtgdef_stock_right"> <span class="008469_8 block "></span> <span class="008469_7 block ">...

wolfram mathematica - How plot f(x,y) = x/(1-y) with x^2 + y^2 < 1? -

how plot: f(x,y) = x/(1-y) with x^2 + y^2 < 1 in mathematica? there way that? perhaps last example in mathematica documentation on regionplot > scope > presentation is of use you. regionplot[x^2 + y^2 < 1, {x, -1, 1}, {y, -1, 1}, colorfunction->function[{x,y},colordata["temperaturemap",x/(1-y)]], colorfunctionscaling->false, plotpoints->100]

How to get values from this JSON String in Objective C, iPhone -

i wanted parse json string looks this. there more code in json string, pasting sample here. [ { "mainhd":"select correct adjective given options.", "sub": [ { "quetn":"bill 2 years ___ wanda.", "answr":"1", "optns":"1,2", "1":"younger", "2":"smaller" }, { "quetn":"france ___ european country.", "answr":"2", "optns":"1,2", "1":"an", "2":"a" }] } ] for parsing above json, doing in objective c code. nsdata *jsondata = [jsonstring datausingencoding:nsutf8stringencoding]; nserror* error; nsdictionary* json = [nsjsonserializat...

c# - Set static variable to ssis variable - error -

Image
i have static variable - static readonly string tablename; i tried set this static readonly string tablename = dts.variables["ssisstring"].value.tostring(); i error: an object reference required non-static field, method, or property. but, works this: static string tablename = ""; main() { tablename = dts.variables["ssisstring"].value.tostring(); } why ? it's not static part, it's readonly hosing you. static readonly string tablename; static scriptmain() { // object reference required non-static field, method, or property 'microsoft.sqlserver.dts.tasks.scripttask.vstartscriptobjectmodelbase.dts.get' tablename = dts.variables["ssisstring"].value.tostring(); } public void main() { // works string local = dts.variables["ssisstring"].value.tostring(); // static read field cannot assinged (except in static constructor o...